- Joined
- May 24, 2016
- Messages
- 339
I do actually know how to check unit_state_mana, but the things is, when I try to check target unit if he has mana at all (meaning that he has no mp by default object editor value), to deal him additional damage,
There's no actual respond at it, the condition returns bl as false. You know, it's like game thinks HE HAS MP and is not shown on the game. So how can I handle it, please?..
JASS:
set tr = GetSpellTargetUnit()
set I = GetUnitAbilityLevel(c,'A032')
set r = GetUnitState(tr,UNIT_STATE_MANA)
if I == 1 then
set R = 100 // damage
set r2 = 100 // mp burn
elseif I == 2 then
set R = 200 // damage
set r2 = 200 // mp burn
elseif I == 3 then
set R = 300 // damage
set r2 = 300 // mp burn
endif
set bl = false // local boolean bl
if r <= r2 then
set r = r2-r
set bl = true
call SetUnitState(tr,UNIT_STATE_MANA,0)
else
call SetUnitState(tr,UNIT_STATE_MANA,r-r2)
endif
if bl == false then
call UnitDamageTarget(c,tr,R,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
call UnitDamageTarget(c,tr,R+r,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endif
There's no actual respond at it, the condition returns bl as false. You know, it's like game thinks HE HAS MP and is not shown on the game. So how can I handle it, please?..