Nightimarez
New Member
- Joined
- Jul 24, 2008
- Messages
- 287
- Reaction score
- 2
So I have this script and it works for the old TFS, but not for the new ones. Can anyone fix it?
PHP:
local t = {
squares = 3,
effects = {CONST_ME_POFF, CONST_ME_ENERGYAREA}
}
function onCastSpell(cid, var)
local v, pos, dir = 0, getThingPos(cid), getPlayerLookDir(cid)
for i = 1, t.squares do
local cur = {x=pos.x+(dir==1 and i or dir==3 and -i or 0), y=pos.y+(dir==0 and -i or dir==2 and i or 0), z=pos.z}
if queryTileAddThing(cid, cur) == 1 then
for _, k in ipairs(t.effects) do
doSendMagicEffect(cur, k)
end
doTeleportThing(cid, cur, true)
v = v + 1
else
break
end
end
return v > 0
end