• 🏆 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!

AI Picking Script

Status
Not open for further replies.
Level 3
Joined
Mar 26, 2011
Messages
44
Hi I just want to know how to make a computer ai to pick random from my heroes in my tavern so my custom heroes can be tested? how to make trigger like that or can anyone post a sample trigger? Thanks!
 
Level 37
Joined
Mar 6, 2006
Messages
9,240

  • 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 max = 4
      • loop Integer A from 1 to max
      • Neutral Building - Add untypes[integer A] to Tavern 0003 <gen> with 1 in stock and a max stock of 1
  • 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
          • max Not equal to 0
        • Then - Actions
          • Set i = (Random integer number between 1 and max)
          • Unit - Create 1 untypes[i] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Neutral Building - Remove untypes[i] from Tavern 0003 <gen>
          • Set untypes[i] = untypes[max]
          • Set max = (max - 1)
        • Else - Actions

The tavern needs Sell Units ability for adding/removing unit types with triggers.
 
Status
Not open for further replies.
Top