Hello, i just started to learn Hashtables, pretty interesting. Ok, so let's go straightforward, I'm working on a map, and i tried to do something, a spell, which activate shield on target which will absorb DMG, well, those hashtables are making me problems. I'm going to post here the triggers, btw, i don't want you to make the spell for me, i want you to show me what i did wrong, and how i can make them work, so i can know for the next time. Ok so my problem is, when i cast the spell on one unit, the shield works pretty good, still, idk why sometimes he's taking DMG, but low indeed, idk why the "absorb" effect isn't happening a bit faster, when i use it on two units, it's goes wrong, the value of the shield for one of them is going of like from 2 strikes, maybe this is happening because idk to use hashtables at all(for sure cause of this), and the spell have to be MUI(hashtables are MUI, but if right). I have a bit bigger basic knowledge on GUI, but SUI, not MUI.
Here are the triggers:
Here are the triggers:
-
PWS INIT
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Power Word: Shield
-
Actions
- Set PWSCaster = (Triggering unit)
- Set PWSTarget = (Target unit of ability being cast)
- Set PWSShieldValue = (100.00 x (Real((Intelligence of PWSCaster (Include bonuses)))))
- Set PWSDuration = (8.00 x (Real((Level of Power Word: Shield for PWSCaster))))
- Unit Group - Add PWSTarget to PWSGroup
- Hashtable - Save PWSShieldValue as 1 of (Key (Target unit of ability being cast)) in PWSHashtable
- Hashtable - Save PWSDuration as 2 of (Key (Target unit of ability being cast)) in PWSHashtable
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PWSTakesDamage Equal to False
-
Then - Actions
- Trigger - Add to PWS Fire <gen> the event (Unit - PWSTarget Takes damage)
- Set PWSTakesDamage = True
- Else - Actions
-
If - Conditions
-
Events
-
PWS Fire
- Events
-
Conditions
- (PWSTarget has buff Power Word: Shield ) Equal to True
-
Actions
-
Unit Group - Pick every unit in PWSGroup and do (Actions)
-
Loop - Actions
- Set PWSShieldValue = (Load 1 of (Key (Picked unit)) from PWSHashtable)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- PWSShieldValue Greater than 0.00
-
Then - Actions
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Damage taken))
- Hashtable - Save (PWSShieldValue - (Damage taken)) as 1 of (Key (Picked unit)) in PWSHashtable
-
Else - Actions
- Unit - Remove Power Word: Shield buff from (Picked unit)
- Unit Group - Remove (Picked unit) from PWSGroup
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in PWSHashtable
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in PWSGroup and do (Actions)
Last edited: