Siegh
Thronar Developer
Hello!!
I made a simple spell where a static enemy will heal other monsters inside its area, but I'm not being able to make it identify the proper creatures in the area and add health to them.
What am I doing wrong? Thanks in advance!
I made a simple spell where a static enemy will heal other monsters inside its area, but I'm not being able to make it identify the proper creatures in the area and add health to them.
What am I doing wrong? Thanks in advance!
LUA:
local combat = Combat()
local area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
--=======================================
setCombatArea(combat, createCombatArea(area))
function onCastSpell(creature, variant)
function onTargetCreature(creature, target)
if not target:isPlayer() then
local rand = math.random(1500,4500)
target:addHealth(rand)
end
return true
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
creature:getPosition():sendMagicEffect(46)
doCreatureSay(creature, "HEALING", TALKTYPE_ORANGE_1)
combat:execute(creature, variant)
return true
end
Last edited: