ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
function onGetFormulaValuesOne(cid, level, maglevel) --One is healing
local min = doCreatureAddHealth(cid, 1)
local max = doCreatureAddHealth(cid, 2)
return -min, -max
end
function onGetFormulaValuesTwo(cid, level, maglevel) --Two is damage
local min = 1
local max = 2
return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesOne") --healing
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesTwo") --damage
return doCombat(cid, combat, var)
end
It is in my weapons/scripts folder and does work, but only for damage. It is supposed to heal you 1-2 hp every time you attack, but it doesn't heal the monster or the player, how come?