Tipo do script:Spell
Protocolo (versão do Tibia):8.54
Servidor utilizado:TFS
Nível de experiência:meio ANo
isso é em afastar.lua
Quote
local mayNotMove = doCreatureSetNoMove
function doPushCreature(pos, target)
creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid
if target.y < pos.y and target.x == pos.x then
newpos = {x=target.x, y=target.y-1, z=target.z}
elseif target.y > pos.y and target.x == pos.x then
newpos = {x=target.x, y=target.y+1, z=target.z}
elseif target.y == pos.y and target.x > pos.x then
newpos = {x=target.x+1, y=target.y, z=target.z}
elseif target.y == pos.y and target.x < pos.x then
newpos = {x=target.x-1, y=target.y, z=target.z}
elseif target.y < pos.y and target.x > pos.x then
newpos = {x=target.x+1, y=target.y-1, z=target.z}
elseif target.y > pos.y and target.x < pos.x then
newpos = {x=target.x-1, y=target.y+1, z=target.z}
elseif target.y > pos.y and target.x > pos.x then
newpos = {x=target.x+1, y=target.y+1, z=target.z}
elseif target.y < pos.y and target.x < pos.x then
newpos = {x=target.x-1, y=target.y-1, z=target.z}
end
if creature > 0 then
if queryTileAddThing(creature, newpos) == TRUE then
doTeleportThing(creature, newpos, TRUE)
end
end
end
local arr = {
[1] = {
{1,1,1},
{1,2,1},
{1,1,1}
},
[2] = {
{0,1,1,1,0},
{1,1,1,1,1},
{1,1,2,1,1},
{1,1,1,1,1},
{0,1,1,1,0}
},
[3] = {
{0,0,1,1,1,0,0},
{0,1,1,1,1,1,0},
{1,1,1,1,1,1,1},
{1,1,1,2,1,1,1},
{1,1,1,1,1,1,1},
{0,1,1,1,1,1,0},
{0,0,1,1,1,0,0}
},
[4] = {
{0,0,0,1,1,1,1,1,0,0,0},
{0,0,1,1,1,1,1,1,1,0,0},
{0,1,1,1,1,1,1,1,1,1,0},
{1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,2,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,1,1,0},
{0,0,1,1,1,1,1,1,1,0,0},
{0,0,0,1,1,1,1,1,0,0,0}
}
}
function onTargetCreature(cid, target)
doPushCreature(getCreaturePosition(cid), target)
end
combat = {}
for n, v in pairs(arr) do
combat[n] = createCombatObject()
_G["callback"..n] = onTargetCreature
setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n)
setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2)
setCombatArea(combat[n], createCombatArea(v))
end
function onCastSpell(cid, var)
mayNotMove(cid, TRUE)
for i = 1, #combat do
addEvent(doCombat, i*150-150, cid, combat, var)
if i == #combat then
addEvent(mayNotMove, i*150-150, cid, FALSE)
end
end
return TRUE
end
e isto em spells.xml
Quote
<instant name="punicao divina" words="Shinra Tensei" lvl="360" mana="1500" prem="1" blockwalls="0" exhaustion="5000" needlearn="0" script="air.lua">
<vocation name="Sorcerer" />
<vocation name="Druid" />
<vocation name="Master Sorcerer" />
<vocation name="Elder Druid" />
<vocation name="Knight" />
<vocation name="Elite Knight" />
<vocation name="Paladin" />
<vocation name="Royal Paladin" />
<vocation name="Slayer Sorcerer" />
<vocation name="Slayer Druid" />
<vocation name="Slayer Paladin" />
<vocation name="Slayer Knight" />
</instant>