No meu server está assim, tenta:
elseif spell == "Mega Drain" then
local life = getCreatureHealth(getMasterTarget(cid))
doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 14)
local newlife = (life - getCreatureHealth(getMasterTarget(cid)))
doSendMagicEffect(getThingPositionWithDebug(cid), 239)
if newlife >= 1 then
doCreatureAddHealth(cid, newlife)
doSendAnimatedText(getThingPositionWithDebug(cid), "+"..newlife.."", 32)
end








info
Grupo: Campones
Registrado: 10/10/06
Posts: 78
Reputação: 0
Boa tarde colegas, gostaria de saber como colocar para o megadrain só 'sugar' o TARGET,
No modo atual ele da dragin em todos que estão em sua volta.
Obrigado, segue script:
elseif spell == "Mega Drain" then
local uid = checkAreaUid(getThingPos(cid), check, 1, 1)
for _,pid in pairs(uid) do
if isCreature(cid) and isCreature(pid) and pid ~= cid then
if isPlayer(pid) and #getCreatureSummons(pid) >= 1 then return false end
local life = getCreatureHealth(pid)
doAreaCombatHealth(cid, GRASSDAMAGE, getThingPos(pid), 0, -min, -max, 14)
local newlife = life - getCreatureHealth(pid)
doSendMagicEffect(getThingPos(cid), 14)
if newlife >= 1 then
doCreatureAddHealth(cid, newlife)
doSendAnimatedText(getThingPos(cid), "+"..newlife.."", 32)
end
end
end