[Solved] Random mode

Status
Not open for further replies.
Level 12
Joined
Aug 12, 2008
Messages
350
I want a trigger that when a player types "-random", it will randomly creates a hero for the player. Of course, the heroes must be within a list which I've set it up. I've tried it but it seems that my trigger cause the Warcraft III to crash. :P So, I posted it here to ask for help.
  • Heroes Initialisation
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Set hero_type[1] = Hero1
      • Set hero_type[2] = Hero2
      • and so on...
      • Trigger - Turn off (This trigger)
For sure credits and +rep will be given to those who actually help me.

EDIT: No same heroes allowed.
 
Last edited:
  • Untitled Trigger 046
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set untypes[1] = Archmage
      • Set untypes[2] = Mountain King
      • Set untypes[3] = Blood Mage
      • Set untypes[4] = Paladin
      • Set i1 = 4
  • Untitled Trigger 047
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i1 Not equal to 0
        • Then - Actions
          • Set i = (Random integer number between 1 and i1)
          • Unit - Create 1 untypes[i] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Set untypes[i] = untypes[i1]
          • Set i1 = (i1 - 1)
        • Else - Actions
 
Status
Not open for further replies.
Back
Top