- Joined
- Aug 12, 2008
- Messages
- 350
I just involved in hashtable spell making recently and I'm still not really sure how to use it yet as it seems quite different from indexing.
Here's my first spell using hashtable for my map. I just want to ask whether if it's the correct usage of hashtable.
Passive Ability
Nerothos becomes overheat after receiving several attacks from enemies. Due to overheat, Nerothos releases the raging flame to surroundings, dealing 100 damage to all nearby enemies.
Level 1: 8 attacks
Level 2: 7 attacks
Level 3: 6 attacks
Level 4: 5 attacks
Level 5: 4 attacks
Upgrading this ability during the half way of storing charges of overheat may reset
[trigger=Overheat learns]
Overheat learns
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Overheat
Actions
Set O_charges = 0
Set tempUnit = (Triggering unit)
Set O_level = (Level of Overheat for tempUnit)
Set O_maxCharges = (9 - O_level)
Custom script: set udg_O_key = GetHandleId (udg_tempUnit)
Hashtable - Save O_charges as 1 of O_key in Hashtable
Hashtable - Save O_maxCharges as 2 of O_key in Hashtable
[/trigger]
[trigger=Overheat]Overheat
Events
Game - GDD_Event becomes Equal to 0.00
Conditions
(GDD_DamagedUnit has buff Overheat ) Equal to True
Actions
Custom script: set udg_O_key = GetHandleId (udg_GDD_DamagedUnit)
Set O_charges = ((Load 2 of O_key from Hashtable) + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
O_charges Equal to (Load 3 of O_key from Hashtable)
Then - Actions
Set O_charges = 0
Set tempPoint = (Position of GDD_DamagedUnit)
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 325.00 of tempPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and ( and do (Actions)
Loop - Actions
Set tempPoint2 = (Position of (Picked unit))
Unit - Cause tempUnit to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at tempPoint using Abilities\Spells\Other\Doom\DoomDeath.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_tempPoint2)
Custom script: call RemoveLocation (udg_tempPoint)
Else - Actions
Hashtable - Save O_charges as 2 of O_key in Hashtable
[/trigger]
Don't mention about the part of creating hashtable. I did it in the map initialisation.
Here's my first spell using hashtable for my map. I just want to ask whether if it's the correct usage of hashtable.
Passive Ability
Nerothos becomes overheat after receiving several attacks from enemies. Due to overheat, Nerothos releases the raging flame to surroundings, dealing 100 damage to all nearby enemies.
Level 1: 8 attacks
Level 2: 7 attacks
Level 3: 6 attacks
Level 4: 5 attacks
Level 5: 4 attacks
Upgrading this ability during the half way of storing charges of overheat may reset
[trigger=Overheat learns]
Overheat learns
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Overheat
Actions
Set O_charges = 0
Set tempUnit = (Triggering unit)
Set O_level = (Level of Overheat for tempUnit)
Set O_maxCharges = (9 - O_level)
Custom script: set udg_O_key = GetHandleId (udg_tempUnit)
Hashtable - Save O_charges as 1 of O_key in Hashtable
Hashtable - Save O_maxCharges as 2 of O_key in Hashtable
[/trigger]
[trigger=Overheat]Overheat
Events
Game - GDD_Event becomes Equal to 0.00
Conditions
(GDD_DamagedUnit has buff Overheat ) Equal to True
Actions
Custom script: set udg_O_key = GetHandleId (udg_GDD_DamagedUnit)
Set O_charges = ((Load 2 of O_key from Hashtable) + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
O_charges Equal to (Load 3 of O_key from Hashtable)
Then - Actions
Set O_charges = 0
Set tempPoint = (Position of GDD_DamagedUnit)
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 325.00 of tempPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and ( and do (Actions)
Loop - Actions
Set tempPoint2 = (Position of (Picked unit))
Unit - Cause tempUnit to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at tempPoint using Abilities\Spells\Other\Doom\DoomDeath.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_tempPoint2)
Custom script: call RemoveLocation (udg_tempPoint)
Else - Actions
Hashtable - Save O_charges as 2 of O_key in Hashtable
[/trigger]
Don't mention about the part of creating hashtable. I did it in the map initialisation.
Last edited: