AN

Ajuda Aki Preciso De Uma

Por Antiemoxml, 17 de jul. de 2010 em Archived

4
683
AntiemoxmlA
17 de julho de 2010 às 02:15

Precisa de uma spell tipo "exori vis, mort, flam, etc... mas q empurra o player alvo "monstro" se tiver como me ajuda eu agradeço

 

 

Meu msn: Morus.darf@hotmail.com

 

versão 8.40

 

Spell q taca uns 4 sqms longe

Editado Julho 17 por Antiemoxml

VodkartV
17 de julho de 2010 às 15:49

nem é minha mais ta ai:

obs: precisar usar com target

 

 

function getRepelTiles(cid)
local tile = {
{1, 4}
}
table.sort(tile, function(a, b) return a[1] > b[1] end)
for _, t in ipairs(tile) do 
if(getPlayerLevel(cid) >= t[1]) then
return t[2]
end
end
return tile[1][2]
end

function getNextPos(cid, tiles)
p = getCreaturePosition(cid)
x,y,z = p.x,p.y,p.z
local places = {
[0] = {x=x, y=(y-tiles), z=z, stackpos = 253},
[1] = {x=(x+tiles), y=y, z=z, stackpos = 253},
[2] = {x=x, y=(y+tiles), z=z, stackpos = 253},
[3] = {x=(x-tiles), y=y, z=z, stackpos = 253}}
return places[getPlayerLookDir(cid)]
end

function doRepel(cid, target, tiles)
if queryTileAddThing(cid, getNextPos(cid, 2)) == RETURNVALUE_NOERROR then
doCreatureSetLookDirection(target, getCreatureLookDirection(cid))
repeat
doTeleportThing(target, getNextPos(target, 1), true)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_GROUNDSHAKER)
tiles = tiles-1
until tiles == 0 or queryTileAddThing(target, getNextPos(target, 1)) ~= RETURNVALUE_NOERROR
end
end

function onCastSpell(cid, var)
targ = getThingfromPos(getNextPos(cid, 1))
if (isPlayer(targ.uid)) or (isMonster(targ.uid)) then
if queryTileAddThing(cid, getNextPos(cid, 2)) == RETURNVALUE_NOERROR then
if (isPlayer(targ.uid)) or (isMonster(targ.uid)) and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doRepel(cid, targ.uid, getRepelTiles(cid))
doCreatureAddHealth(targ.uid, -getPlayerLevel(cid))
doCreatureAddMana(cid, -10)
end
else
doPlayerSendCancel(cid, "Something is in the way to repel the target.")
end
else
doPlayerSendCancel(cid, "There is no target to repel.")
end
end

AntiemoxmlA
19 de julho de 2010 às 19:28

Nao tem como fazer elaco distance ? :whistle:

Editado Julho 21 por Antiemoxml

11 meses depois...
mysticChemM
05 de junho de 2011 às 22:36

Joguem meu serve!!!