• 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 button trigger

Status
Not open for further replies.
Level 8
Joined
Jul 11, 2008
Messages
104
I've been working on this but I guess it's safe to say I'm clueless with it

Say theres a tavern with a Footman, grunt, and ghoul. How do I make a random button to select any one of those at random?

And how do I make a game mode, -ar? (Self explanitory)
 
Create one item with no gold cost or lumber cost and a unit owned by all players nearby with Inventory ability. Now, check when the item is bought:
  • Trigger0
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Units[1] = Grunt
    • Set Units[2] = Footman
    • Set Units[3] = Ghoul
  • Trigger
  • Events
    • Unit - A unit acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Random Hero
  • Actions
    • Set Point1 = (Position of (Triggering unit))
    • Unit - Create 1 Units[(Random integer number between 1 and 3)] for (Owner of (Triggering unit)) at Point1 facing default building degrees
    • Custom script: call RemoveLocation (udg_Point1)
    • Item - Remove (Item being manipulated) //Optional
Units[] is a Unit-type variable.
 
Status
Not open for further replies.
Top