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

Actually limiting the custom heros to 1 per

Status
Not open for further replies.
Level 29
Joined
Mar 9, 2012
Messages
1,557
Level 24
Joined
Jul 9, 2009
Messages
4,097
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Create a trigger that runs on map initialization.
Then you pick all players in... all players and you limit training of <MyHero> for the picked player to 1.

This is exactly how that melee game action works... except that it only loops through all standard heroes (4 human, 4 orcs, 4 night elves, 4 undead and 9? neutral)
Custom heroes ofcourse has to be added manually.
 
  • Hero Initialize
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Player - Limit training of (Unit-type of (Sold unit)) to 1 for (Owner of (Sold unit))
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by (Owner of (Sold unit)) matching (((Matching unit) is A Hero) Equal to True))) Equal to 1
        • Then - Actions
          • Hero - Create Scroll of Town Portal and give it to (Sold unit)
        • Else - Actions
 
Status
Not open for further replies.
Top