• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Random Choice

Status
Not open for further replies.
Hello, i need a trigger for this situation:
*There are 4 circles of power:
- A circle when u enter it the hero receive a tome
- A circle when u enter it a demon is summoned to attack the hero
- A circle when u enter it a warrior is summoned to attack with u
- A circle when u enter the gate open
(This is easy , i can make but whats below is what i'm asking for)

*There is a closed gates and 4 circles of powers, every time u enter a circle an event from the 4 events that mentioned happens but not in the order i listed (in a random way). Every time i enter in a circle and an event happens, that even crossed from the list.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Create a trigger array. Then create triggers for each event. Set the triggers into the array in a Map Initialization trigger. Also create an integer named max or something and set its value to 4.



Unit Enters region
set i = randomNumber between 1 and max
Trigger - run triggerArray
set triggerArray = triggerArray[max]
set max = max - 1
 
Status
Not open for further replies.
Top