aqubjukr
Well-Known Member
I was wondering if can put in a spell, that a specific creature take damage with the players
Ps: The boss doesn't need to "go attack the monster", I just want the magic given to the player to also remove the monster's health
Edit:
As I think it would be correct, but it isn't working:
Ps: The boss doesn't need to "go attack the monster", I just want the magic given to the player to also remove the monster's health
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
local area = createCombatArea(AREA_SQUAREWAVE8)
combat:setArea(area)
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
Edit:
As I think it would be correct, but it isn't working:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
local area = createCombatArea(AREA_SQUAREWAVE8)
combat:setArea(area)
function onTargetCreature(creature, target)
if target:isMonster() then
target:addHealth(- 10)
end
return true
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
Last edited: