- Joined
- May 15, 2009
- Messages
- 192
Can anyone help me as to what is wrong with my trigger?
I have this dungeon map, where the enemy player is Player 7, and the two heroes are controlled by Player 1, and Player 2.
I'm trying to create a Debuff (called Sirens Lure) which (unless dispelled) will cause control of the Target Hero to be changed over to Player 7.
I've tried using hashtables, and the buff lasts for 25 seconds. When there are only 10 seconds left of the buff, it should force the unit to come under control of Player 7, and it should change back once the buff duration ran out.
The trigger is in two parts:
Ability cast:
Help is much appreciated.
-Battlehound/Woodenplank
I have this dungeon map, where the enemy player is Player 7, and the two heroes are controlled by Player 1, and Player 2.
I'm trying to create a Debuff (called Sirens Lure) which (unless dispelled) will cause control of the Target Hero to be changed over to Player 7.
I've tried using hashtables, and the buff lasts for 25 seconds. When there are only 10 seconds left of the buff, it should force the unit to come under control of Player 7, and it should change back once the buff duration ran out.
The trigger is in two parts:
Ability cast:
-
Siren Calling
-
Events
- Unit - A unit owned by Player 7 (Green) Starts the effect of an ability
- Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Siren's Lure
-
Actions
- Set Tempr1 = 25.10
- Set TempU1 = (Target unit of ability being cast)
- Unit Group - Add TempU1 to SirenLure_group
- Hashtable - Save Tempr1 as 1 of (Key (Target unit of ability being cast)) in SirenLure_hash
-
Events
-
Sirens Calling Loop
-
Events
- Time - Every 0.30 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in SirenLure_group and do (Actions)
-
Loop - Actions
- Set TempU1 = (Picked unit)
- Game - Display to (All players) the text: ((Name of TempU1) + is now TempUnit Loop)
- Set Tempr1 = (Load 1 of (Key (Picked unit)) from SirenLure_hash)
- -------- If there is only 10 seconds left on the Debuff, the unit will be put under control of Player 7 (Green) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Tempr1 Less than or equal to 10.00
- Tempr1 Greater than 0.00
- (TempU1 has buff Siren's Lure ) Equal to True
-
Then - Actions
- Unit - Change ownership of TempU1 to Player 7 (Green) and Change color
- Hashtable - Save (Tempr1 - 0.30) as 1 of (Key (Picked unit)) in SirenLure_hash
- Game - Display to (All players) the text: (Name of TempU1)
-
Else - Actions
- -------- Returns the Hero to the Original Player, based on the Unit-type --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of TempU1) Equal to Player 7 (Green)
- (Unit-type of TempU1) Equal to Spirit of the Flame
-
Then - Actions
- Unit - Change ownership of TempU1 to Player 1 (Red) and Change color
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of TempU1) Equal to Player 7 (Green)
- (Unit-type of TempU1) Equal to Spirit of the Sea
-
Then - Actions
- Unit - Change ownership of TempU1 to Player 2 (Blue) and Change color
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of TempU1) Equal to Player 7 (Green)
- (Unit-type of TempU1) Equal to Spirit of the Sea
-
Then - Actions
- Unit - Change ownership of TempU1 to Player 2 (Blue) and Change color
- Else - Actions
-
If - Conditions
- -------- Cleans up the Hashtable and Group --------
- Unit Group - Remove TempU1 from SirenLure_group
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in SirenLure_hash
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in SirenLure_group and do (Actions)
-
Events
-Battlehound/Woodenplank