- Joined
- Aug 8, 2010
- Messages
- 1,022
Hi! I am newbie in heashtables. I have tried to create a MUI trigg. and what?! It don't work, of course. So, here is my problem - i want to make an absorbing shield by adding health equal to the damage caused to the unit with the shield. And the a variable that is set to 500 (the amount of damage absorbed) will decrease with the amount of damage taken, so when the 500 real reaches zero - the shield is gone. And here are my "perfect" triggers :

-
Init
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Hashtable - Create a hashtable
-


Set HashTblIceBarr = (Last created hashtable)
-
-
-
Trig1
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Ice Barrier
-
-

Actions
-


Hashtable - Save Handle Of(Casting unit) as 0 of (Key (Triggering unit)) in HashTblIceBarr
-


Unit Group - Add (Load 0 of (Key (Triggering unit)) in HashTblIceBarr) to (Units within 1000000000.00 of (Center of (Playable map area)) matching ((Ability being cast) Equal to Ice Barrier ))
-


Hashtable - Save Handle Of(Last created unit group) as 0 of (Key (Picked unit)) in HashTblIceBarr
-


Hashtable - Save 500.00 as 0 of (Key (Target unit of ability being cast)) in HashTblIceBarr
-


Hashtable - Save ((Load 0 of (Key (Target unit of ability being cast)) from HashTblIceBarr) - (Damage taken)) as 1 of (Key (Target unit of ability being cast)) in HashTblIceBarr
-


Game - Display to (All players) the text: Trig started!
-
-
-
Trig2
-

Events
-


Unit - A unit Is attacked
-
-

Conditions
-


(Load 0 of (Key (Triggering unit)) in HashTblIceBarr) Equal to (Attacked unit)
-
-

Actions
-


Unit Group - Pick every unit in (Load 0 of (Key (Picked unit)) in HashTblIceBarr) and do (Actions)
-



Loop - Actions
-




Hashtable - Save ((Load 0 of (Key (Target unit of ability being cast)) from HashTblIceBarr) - (Damage taken)) as 1 of (Key (Attacked unit)) in HashTblIceBarr
-




Unit - Set life of (Load 0 of (Key (Triggering unit)) in HashTblIceBarr) to ((Life of (Load 0 of (Key (Triggering unit)) in HashTblIceBarr)) + (Damage taken))
-




Trigger - Run Trig3 <gen> (checking conditions)
-




Game - Display to (All players) the text: Trig runs
-
-
-
-
-
Trig3
-

Events
-

Conditions
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Load 1 of (Key (Attacked unit)) from HashTblIceBarr) Greater than 0.00
-
-



Then - Actions
-




Do nothing
-
-



Else - Actions
-




Game - Display to (All players) the text: Trig stopped
-




Unit - Remove Frost Armor buff from (Load 0 of (Key (Casting unit)) in HashTblIceBarr)
-




Trigger - Turn off Trig2 <gen>
-
-
-
-

Last edited:







