Hi,
I have been playing around with spells and wanted to make a heal friend that does a little aoe of damage around the target they are healing. It works if the caster has written the name in properly but if they haven't it debugs the client. I have tried a few things but everything will debug the client if there isn't a specific name in there where the regular heal a friend will just poff.
Is it actually possible to mix the two things together?
This is the basic code which I started with before trying anything. TFS 1.3
Thanks
I have been playing around with spells and wanted to make a heal friend that does a little aoe of damage around the target they are healing. It works if the caster has written the name in properly but if they haven't it debugs the client. I have tried a few things but everything will debug the client if there isn't a specific name in there where the regular heal a friend will just poff.
Is it actually possible to mix the two things together?
This is the basic code which I started with before trying anything. TFS 1.3
Thanks
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
function onGetFormulaValues(player, level, magicLevel)
local min = ((level / 5) + (magicLevel * 6.3) + 45)*2
local max = ((level / 5) + (magicLevel * 14.4) + 90)*2
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
combat2:setArea(createCombatArea(AREA_CIRCLE2X2))
function onGetFormulaValues(player, level, magicLevel)
local min = ((level / 5) + (magicLevel * 1.2) + 7)
local max = ((level / 5) + (magicLevel * 2.85) + 16)
return -min, -max
end
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
combat:execute(creature, variant)
combat2:execute(creature, variant)
return true
end