• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Random button trigger

Status
Not open for further replies.
Level 7
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