- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi!
I was messing with 'Unit - Cause damage' and noticed that Negative damage is not equal to heal. Even the 'Healing' (Negative damage) amount is displayed over the unit (floating text), but the hp goes down anyway (the unit deals 1-1 wc3 nontrigger damage). If I give damage reduction over 1 (which would mean over 100%) doesn't heal either.
If it doesn't work like that, what's the next best option? 'Set unit life + Unit life + Damage' ?
This is my current damage setting:
EDIT: Improved the trigger following Ultimatony and Maker suggestions.
I was messing with 'Unit - Cause damage' and noticed that Negative damage is not equal to heal. Even the 'Healing' (Negative damage) amount is displayed over the unit (floating text), but the hp goes down anyway (the unit deals 1-1 wc3 nontrigger damage). If I give damage reduction over 1 (which would mean over 100%) doesn't heal either.
If it doesn't work like that, what's the next best option? 'Set unit life + Unit life + Damage' ?
This is my current damage setting:
-
Damage Itself
-
Events
- Game - GDD_Event becomes Equal to 0.00
- Conditions
-
Actions
- -------- DamagedUnit and DamageSource Id's --------
- Custom script: set udg_I_DS = GetUnitTypeId(udg_GDD_DamageSource)
- Custom script: set udg_I_DU = GetUnitTypeId(udg_GDD_DamagedUnit)
- -------- Damage Types (Odd) and Resistances (Even) --------
- Set PD = ((Load 1 of I_DS from DamageHash) x (1.00 - (Load 2 of I_DU from DamageHash)))
- Set FD = ((Load 3 of I_DS from DamageHash) x (1.00 - (Load 4 of I_DU from DamageHash)))
- Set WiD = ((Load 5 of I_DS from DamageHash) x (1.00 - (Load 6 of I_DU from DamageHash)))
- Set ED = ((Load 7 of I_DS from DamageHash) x (1.00 - (Load 8 of I_DU from DamageHash)))
- Set WaD = ((Load 9 of I_DS from DamageHash) x (1.00 - (Load 10 of I_DU from DamageHash)))
- Set PuD = (Load 11 of I_DS from DamageHash)
- -------- Total Damage --------
- Custom script: set udg_Dmg = udg_PD + udg_FD + udg_WiD + udg_ED + udg_WaD + udg_PuD
- -------- Display Red Damage --------
- Custom script: if (GetUnitState( udg_GDD_DamagedUnit, UNIT_STATE_LIFE) - udg_Dmg ) < GetUnitState( udg_GDD_DamagedUnit, UNIT_STATE_LIFE) then
- Floating Text - Create floating text that reads (String((Integer(Dmg)))) above GDD_DamagedUnit with Z offset 0.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- -------- Display Green Heal --------
- Custom script: elseif (GetUnitState( udg_GDD_DamagedUnit, UNIT_STATE_LIFE) - udg_Dmg ) > GetUnitState( udg_GDD_DamagedUnit, UNIT_STATE_LIFE) then
- Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) - Dmg)
- Floating Text - Create floating text that reads (String((Integer((Abs(Dmg)))))) above GDD_DamagedUnit with Z offset 0.00, using font size 8.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- Custom script: endif
- -------- Deal Damage if it's > 0 --------
- Trigger - Turn off (This trigger)
- Custom script: if udg_Dmg > 0 then
- Custom script: call UnitDamageTarget(udg_GDD_DamageSource, udg_GDD_DamagedUnit, udg_Dmg, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
- Custom script: endif
- Trigger - Turn on (This trigger)
-
Events
Last edited: