Sendo x e y as dimensões da área e cid, logicamente, a criatura sob a qual a função será executada:
function getMonstersTargetingCid(cid, x, y)
if not isCreature(cid) then
return false
end
local spec, uid = getSpectators(getThingPos(cid), tonumber(x) or 1, tonumber(y) or 1), {}
for _, pid in pairs(spec) do
if pid ~= cid and isMonster(pid) and getCreatureTarget(pid) == cid then
table.insert(uid, pid)
end
end
return uid
end
local targeting = getMonstersTargetingCid(getCreatureSummons(cid)[1], 5, 5) --Área de dimensão 5x5 SQMs.
if targeting and #targeting > 0 then
for _, pid in pairs(targeting) do
print(getCreatureName(pid).." is targeting your summon.")
end
else
print("There's no monsters targeting your summon.")
end




info
Grupo: Conde
Registrado: 04/02/13
Posts: 541
Reputação: +90
Gênero: Masculino
Existe alguma funçao pra pegar todos os monstro que estão com target no meu monstro em uma area sem estar com target neles e claro?Por quero fazer uma magia aonde vai ir um efeito ate eles e ai vai trazer eles pra cima de min.