zbizu
Legendary OT User
this script will change your mw to old sprite and will work same way
movements.xml
mwstep.lua
\data\spells\scripts\support\magic wall rune.lua
replace file content to this:
optional: timer on wild growth
\data\spells\scripts\support\wild growth rune.lua
replace file content to this:
movements.xml
Code:
<movevent event="StepIn" itemid="8753" script="mwstep.lua"/>
mwstep.lua
Code:
function onStepIn(creature, item, position, fromPosition)
removeMw(creature:getPosition(), 8753, 1027)
return true
end
\data\spells\scripts\support\magic wall rune.lua
replace file content to this:
Code:
local id = 8753
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, id)
function tile_timer(id, pos, delay, color)
if getTileItemById(pos, id).uid == 0 then
return true
end
if delay ~= 1 then
addEvent(tile_timer, 1000, id, pos, delay - 1, color)
end
local people = Game.getSpectators(pos, 7, 7, 5, 5, false, true)
if not people then
return true
end
for i = 1, #people do
people[i]:sendTextMessage(MESSAGE_EXPERIENCE, "Magic wall will disappear in " .. delay .. " second" .. (delay > 1 and "s" or "") .. ".", pos, delay, color)
end
end
function removeMw(pos, mw, wall)
local tile = Tile(pos)
mw = tile:getItemById(mw)
wall = tile:getItemById(wall)
if mw then mw:remove() end
if wall then wall:remove() end
end
function onCastSpell(creature, var, isHotkey)
local c = combat:execute(creature, var)
if c then
local pos = variantToPosition(var)
local wall = Game.createItem(1027, 1, pos)
addEvent(removeMw, 20000, pos, id, wall:getId())
tile_timer(id, pos, 20, TEXTCOLOR_LIGHTBLUE)
end
return c
end
optional: timer on wild growth
\data\spells\scripts\support\wild growth rune.lua
replace file content to this:
Code:
local id = ITEM_WILDGROWTH
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
combat:setParameter(COMBAT_PARAM_CREATEITEM, id)
function onCastSpell(creature, var, isHotkey)
local c = combat:execute(creature, var)
if c then
local pos = variantToPosition(var)
addEvent(removeMw, 40000, pos, id)
tile_timer(id, pos, 40, TEXTCOLOR_LIGHTGREEN)
end
return c
end