I am trying to get an Orb Item to change the Hero's attack type to magic by saving it's orginal attack type using Hashtables.
Below is what I have so far...
The problem I have is that it does not seem to save the attack type correctly. For my Heroes with Pierce damage, it works correctly. However, Heroes with Normal damage, once the Orb Item is dropped (after being picked up) it completely removes the Hero's ability to attack until it picks the Orb Item back up. It should obviously return that Hero's attack type back to Normal.
Please help!
Below is what I have so far...
-
Acquires
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to Orb of Frost
-
-
Actions
-
-------- Store units original Attack Type in Hashtable --------
-
Hashtable - Save (Unit: (Triggering unit)'s Weapon Integer Field: Attack Attack Type ('ua1t') at Index:0) as (Key OT_AttackType.) of (Key OT_Handle.) in OT_HastTable.
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit: (Triggering unit)'s Weapon Integer Field: Attack Attack Type ('ua1t') at Index:0) Not equal to 4
-
-
Then - Actions
-
-------- Set units Attack Type to Magic --------
-
Unit - Set Unit: (Triggering unit)'s Weapon Integer Field: Attack Attack Type ('ua1t')at Index:0 to Value: 4
-
-
Else - Actions
-
-
-
-
Drops
-
Events
-
Unit - A unit Loses an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to Orb of Frost
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load (Key OT_AttackType.) of (Key OT_Handle.) from OT_HastTable.) Not equal to 4
-
-
Then - Actions
-
Unit - Set Unit: (Triggering unit)'s Weapon Integer Field: Attack Attack Type ('ua1t')at Index:0 to Value: (Load (Key OT_AttackType.) of (Key OT_Handle.) from OT_HastTable.)
-
-
Else - Actions
-
-
-
The problem I have is that it does not seem to save the attack type correctly. For my Heroes with Pierce damage, it works correctly. However, Heroes with Normal damage, once the Orb Item is dropped (after being picked up) it completely removes the Hero's ability to attack until it picks the Orb Item back up. It should obviously return that Hero's attack type back to Normal.
Please help!