diff --git a/scripts/globals/mobs.lua b/scripts/globals/mobs.lua index af29ce7b0a8..cfa31fd606a 100644 --- a/scripts/globals/mobs.lua +++ b/scripts/globals/mobs.lua @@ -538,6 +538,12 @@ xi.mob.onAddEffect = function(mob, target, damage, effect, params) dMod = 20 + (dMod - 20) / 2 end + -- This is a bad assumption, but it prevents some negative damage (healing) when there otherwise shouldn't be + -- TODO: better understand damage add effects from mobs + if dMod < 0 then + dMod = 0 + end + power = dMod + target:getMainLvl() - mob:getMainLvl() + damage / 2 end @@ -557,6 +563,7 @@ xi.mob.onAddEffect = function(mob, target, damage, effect, params) if power < 0 then if ae.negMsg then message = ae.negMsg + power = power * -1 -- outgoing action packets only support unsigned integers. The "negative message" will also handle healing automagically deep inside core somewhere. else power = 0 end