• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,240
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