Lua:
local creatureEvent = CreatureEvent("creatureEventTest2")
function creatureEvent.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not creature or not attacker or creature == attacker then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
primaryDamage = primaryDamage + (primaryDamage * 4 / 100)
secondaryDamage = secondaryDamage + (secondaryDamage * 4 / 100)
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
creatureEvent:type("healthchange")
creatureEvent:register()
the above script is increasing mob damage that's right.
I would like a script to the contract that will reduce all player damage to the monster by 4% for example