• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

bone wall script?

p41nwithoutlove

New Member
Joined
Aug 12, 2008
Messages
216
Reaction score
0
i was wondering if some 1 could make a script for a spell that when casted it would create a bone wall around the player with 2-3 spaces between center and edge and only lasts 5-10 seconds?
would appreciate it much and rep++
 
easiest way to make it disappear will be coping walls in items.otb and adding decay in xml to the new ones, but 0.3 will not load modified otb without source edit...
and creating is easy: use mwall script and change itemid to walls id
you need to play a bit with it

or to make it disappear you can make second wave deleting bone walls in area of spell, or sth like that
ill try making it

sorry, i dont get it...
too many different items to make, and I dont know how to place them, because spells area is flipped at least in one dimension,

Code:
local WALLS = {}

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_CREATEITEM, 6396)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 6395)
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_CREATEITEM, 6399)
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_CREATEITEM, 6400)
local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_CREATEITEM, 6397)
local combat6 = createCombatObject()
setCombatParam(combat6, COMBAT_PARAM_CREATEITEM, )
local combat7 = createCombatObject()
local function onTargetTile(cid, pos)
	local position = pos
	position.stackpos = 0
	repeat
		position.stackpos = position.stackpos+1
		local item = getThingfromPos(position)
		if item.itemid > 0 then
			if isInArray(WALLS, item.itemid) == TRUE then
				doRemoveItem(item.uid,1)
		end
	until position.stackpos >= 5
end
arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0,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{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}



local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
local area6 = createCombatArea(arr6)
local area7 = createCombatArea(AREA_CIRCLE5x5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)
setCombatArea(combat6, area6)
setCombatArea(combat7, area7)

local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
end
 
local function onCastSpell2(parameters)
    doCombat(parameters.cid, combat2, parameters.var)
end
 
local function onCastSpell3(parameters)
    doCombat(parameters.cid, combat3, parameters.var)
end
 
local function onCastSpell4(parameters)
    doCombat(parameters.cid, combat4, parameters.var)
end
 
local function onCastSpell5(parameters)
    doCombat(parameters.cid, combat5, parameters.var)
end

local function onCastSpell6(parameters)
    doCombat(parameters.cid, combat6, parameters.var)
end

setCombatCallback(combat7, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 0, parameters)
addEvent(onCastSpell3, 0, parameters)
addEvent(onCastSpell4, 0, parameters)
addEvent(onCastSpell5, 0, parameters)
addEvent(onCastSpell6, 0, parameters)
addEvent(onCastSpell7, 5000, parameters)
return TRUE
end

needs a lot of work, and probably can be made easier
todo: write correct walls id and add them to WALLS array, make this spell not delete bone walls placed in map editor.
I recommend using decaying magic walls
 
Last edited:
Back
Top