• 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.

How To Set One Hero Allowed Only ?

Status
Not open for further replies.
Level 2
Joined
Feb 3, 2005
Messages
19
Code:
Untitled Trigger 002
    Events
        Unit - A unit Finishes training a unit
    Conditions
        ((Trained unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroCount[(Player number of (Owner of (Trained unit)))] Greater than 1
            Then - Actions
                Unit - Remove (Trained unit) from the game
                -------- Here you should refund the amount that the hero would have cost to the player. Only use these functions  --------
                -------- below if you are using WEU, otherwise delete them and replace them with the numbers of the price of the unit trained. --------
                Player - Add (Gold cost of (Trained unit-type)) to (Owner of (Trained unit)) Current gold
                Player - Add (Wood cost of (Trained unit-type)) to (Owner of (Trained unit)) Current gold
            Else - Actions
                Set HeroCount[(Player number of (Owner of (Trained unit)))] = (HeroCount[(Player number of (Owner of (Trained unit)))] + 1)
 
Status
Not open for further replies.
Top