Greetings,
I have a castle defense map, where heroes that die are respawned after hero level + 30 seconds, and I'm trying to make an item that revives a random hero that are currently dead. I tried using hashtables, but chose to use unit arrays instead. Here is what I got so far:
Turn On: this is where I set a boolean to make the system know someone has the item and therefore turning all other triggers on.
If someone drops the item or sells it, turns all other triggers off:
Here I define which and whom hero dies and store them:
I'm almost sure that these ones are correct, unless someone tells me it isn't. But this one I feel like there is something missing:
Or if someone would have a hashtable solution, I'm open to suggetions. Any help would be much appreciated still.
I have a castle defense map, where heroes that die are respawned after hero level + 30 seconds, and I'm trying to make an item that revives a random hero that are currently dead. I tried using hashtables, but chose to use unit arrays instead. Here is what I got so far:
Turn On: this is where I set a boolean to make the system know someone has the item and therefore turning all other triggers on.
-
Eye of Horus Activate
-

Events
-


Unit - A unit Acquires an item
-
-

Conditions
-


(Item-type of (Item being manipulated)) Equal to Eye of Horus
-
-

Actions
-


Set Eye_Boolean = True
-


Trigger - Turn on Eye of Horus Array <gen>
-
-
If someone drops the item or sells it, turns all other triggers off:
-
Eye of Horus Lose
-

Events
-


Unit - A unit Loses an item
-
-

Conditions
-


(Item-type of (Item being manipulated)) Equal to Eye of Horus
-
-

Actions
-


Set Eye_Boolean = False
-


Trigger - Turn off Eye of Horus Array <gen>
-
-
Here I define which and whom hero dies and store them:
-
Eye of Horus Array
-

Events
-


Unit - A unit Dies
-
-

Conditions
-


Eye_Boolean Equal to True
-


((Dying unit) is A Hero) Equal to True
-


((Owner of (Dying unit)) Equal to Player 1 (Red)) or (((Owner of (Dying unit)) Equal to Player 2 (Blue)) or (((Owner of (Dying unit)) Equal to Player 3 (Teal)) or (((Owner of (Dying unit)) Equal to Player 4 (Purple)) or ((Owner of (Dying unit)) Equal to Player 6 (Orange)))))
-
-

Actions
-


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



If - Conditions
-




(Owner of (Dying unit)) Equal to Player 1 (Red)
-
-



Then - Actions
-




Set Revival_Boolean[1] = True
-




Set Revival_Array[1] = (Dying unit)
-
-



Else - Actions
-




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





If - Conditions
-






(Owner of (Dying unit)) Equal to Player 2 (Blue)
-
-





Then - Actions
-






Set Revival_Boolean[2] = True
-






Set Revival_Array[2] = (Dying unit)
-
-





Else - Actions
-






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







If - Conditions
-








(Owner of (Dying unit)) Equal to Player 3 (Teal)
-
-







Then - Actions
-








Set Revival_Boolean[3] = True
-








Set Revival_Array[3] = (Dying unit)
-
-







Else - Actions
-








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









If - Conditions
-










(Owner of (Dying unit)) Equal to Player 4 (Purple)
-
-









Then - Actions
-










Set Revival_Boolean[4] = True
-










Set Revival_Array[4] = (Dying unit)
-
-









Else - Actions
-










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











If - Conditions
-












(Owner of (Dying unit)) Equal to Player 6 (Orange)
-
-











Then - Actions
-












Set Revival_Boolean[5] = True
-












Set Revival_Array[5] = (Dying unit)
-
-











Else - Actions
-
-
-
-
-
-
-
-
-
-
-
I'm almost sure that these ones are correct, unless someone tells me it isn't. But this one I feel like there is something missing:
-
Eye of Horus Use
-

Events
-


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

Conditions
-


(Ability being cast) Equal to Eye of Horus
-
-

Actions
-


Game - Display to (All players) for 10.00 seconds the text: ((|cffffcc00 + ((Proper name of (Triggering unit)) + |r)) + has used the |c006969FFEye of Horus|r!)
-


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



If - Conditions
-




(Random integer number between 1 and 5) Equal to 1
-
-



Then - Actions
-




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





If - Conditions
-






Revival_Boolean[1] Equal to True
-
-





Then - Actions
-






Hero - Instantly revive Revival_Array[1] at Pos[150], Show revival graphics
-
-





Else - Actions
-
-
-



Else - Actions
-




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





If - Conditions
-






(Random integer number between 1 and 5) Equal to 2
-
-





Then - Actions
-






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







If - Conditions
-








Revival_Boolean[2] Equal to True
-
-







Then - Actions
-








Hero - Instantly revive Revival_Array[2] at Pos[150], Show revival graphics
-
-







Else - Actions
-
-
-





Else - Actions
-






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







If - Conditions
-








(Random integer number between 1 and 5) Equal to 3
-
-







Then - Actions
-








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









If - Conditions
-










Revival_Boolean[3] Equal to True
-
-









Then - Actions
-










Hero - Instantly revive Revival_Array[3] at Pos[150], Show revival graphics
-
-









Else - Actions
-
-
-







Else - Actions
-








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









If - Conditions
-










(Random integer number between 1 and 5) Equal to 4
-
-









Then - Actions
-










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











If - Conditions
-












Revival_Boolean[4] Equal to True
-
-











Then - Actions
-












Hero - Instantly revive Revival_Array[4] at Pos[150], Show revival graphics
-
-











Else - Actions
-
-
-









Else - Actions
-










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











If - Conditions
-












(Random integer number between 1 and 5) Equal to 5
-
-











Then - Actions
-












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













If - Conditions
-














Revival_Boolean[5] Equal to True
-
-













Then - Actions
-














Hero - Instantly revive Revival_Array[5] at Pos[150], Show revival graphics
-
-













Else - Actions
-
-
-











Else - Actions
-
-
-
-
-
-
-
-
-
-
-
Or if someone would have a hashtable solution, I'm open to suggetions. Any help would be much appreciated still.



