silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,480
- Solutions
- 9
- Reaction score
- 211
hello folks, I'm trying make a script just for fun, to heal the attacker with % of the damage ...
then I make it but don't work
I saw it in support board, then I'm trying make it work to help the guy, I don't remember who was D:
thanks in advice
then I make it but don't work
Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not attacker then
return true
end
if attacker:isPlayer() and attacker:getVocation():getBase():getId() == 4 then
if isInArray({ORIGIN_MELEE, ORIGIN_RANGED, ORIGIN_SPELL}, origin) and primaryType ~= COMBAT_HEALING then
local cure = primaryDamage / 100 * 50
attacker:addHealth(cure, true)
attacker:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
thanks in advice