- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi!
I'm trying to achieve the storage of UnitType ID damage and resistance values in a hashtable, and then transform it into actual Damage and Resistance.
This way I add the damage:
This way I do the damage:
I'm trying to achieve the storage of UnitType ID damage and resistance values in a hashtable, and then transform it into actual Damage and Resistance.
This way I add the damage:
-
Damage Set
-
Events
- Time - Elapsed game time is 0.00 seconds
- Conditions
-
Actions
- Hashtable - Create a hashtable
- Set DamageHash = (Last created hashtable)
- Custom script: set udg_i = 'hfoo'
- -------- Physical Damage --------
- Hashtable - Save 100.00 as 1 of i in DamageHash
- -------- Physical Resistance --------
- Hashtable - Save 0.85 as 2 of i in DamageHash
-
Events
This way I do the damage:
-
Damage Itself
-
Events
- Game - GDD_Event becomes Equal to 0.00
- Conditions
-
Actions
- Trigger - Turn off (This trigger)
- Custom script: set udg_i = 'hfoo'
- Set PD = (Load 1 of i from DamageHash)
- Set PR = (Load 2 of i from DamageHash)
- -------- Physycal Damage --------
- Custom script: if udg_PD > 0 then
- Custom script: call UnitDamageTarget(udg_GDD_DamageSource, udg_GDD_DamagedUnit, (udg_PD * udg_PR), true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
- Custom script: endif
- Trigger - Turn on (This trigger)
-
Events
- Custom script: set udg_Handle1 = ConvertUnitType(GetHandleId(udg_GDD_DamageSource))
- Custom script: set udg_Handle2 = ConvertUnitType(GetHandleId(udg_GDD_DamagedUnit))