- Joined
- Aug 7, 2009
- Messages
- 1,406
I've just experienced a very, very weird bug: one of my heroes' spells deals damage based on the targets maximum health, any time the hero successfully lands a basic attack and heals him for the same amount. Its done like this:
Now the problem is that
At first I thought it was because of Cargo Hold (jungle creeps are given this ability so that they won't automatically aggro on heroes), but my heroes also die from one single hit, even though they don't have Cargo Hold. So I'm clueless.
JASS:
call Heal(caster,caster,MagicDamage(caster,target,GetUnitState(target,UNIT_STATE_MAX_LIFE)*.025,DAMAGE_DIRECT))
Now the problem is that
GetUnitState
returns really odd values: even 2.5% of their maximum health is usually over 12k. Does anyone have an idea what could possible be causing this weird thing? At first I thought it was because of Cargo Hold (jungle creeps are given this ability so that they won't automatically aggro on heroes), but my heroes also die from one single hit, even though they don't have Cargo Hold. So I'm clueless.