Remove unit availibility trigger not working

twisterghost

New Member
Reaction score
3
Hey all. This trigger isn't working right. It is supposed to make all heroes in the array Heroes_Removaarray unavailable for purchasing by the person who bought a unit. Like how DotA works for hero selection. Removing the selected hero for all players works, but removing all heroes for the purchasing player does not work.

Code:
Manage Hero Select
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Race of (Owner of (Sold unit))) Equal to Human
            Then - Actions
                For each (Integer A) from 1 to 3, do (Actions)
                    Loop - Actions
                        Player - Make Heroes_Removearray[(Integer A)] Unavailable for training/construction by (Owner of (Sold unit))
                Unit - Move (Sold unit) instantly to (Center of StartLegends <gen>)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Race of (Owner of (Sold unit))) Equal to Undead
            Then - Actions
                For each (Integer A) from 1 to 3, do (Actions)
                    Loop - Actions
                        Player - Make Heroes_Removearray[(Integer A)] Unavailable for training/construction by (Owner of (Sold unit))
                Unit - Move (Sold unit) instantly to (Center of StartProdigies <gen>)
            Else - Actions
 

denmax

You can change this now in User CP.
Reaction score
155
Code:
Summon Hero
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Game - Display to (All players) the text: (ColorCode[(Player number of (Owner of (Buying unit)))] + ((Name of (Owner of (Buying unit))) + (EndTag + ( has bought the  + (Name of (Sold unit))))))
        Unit - Remove (Buying unit) from the game
        Set RandomPoint = (Random point in Battlefield <gen>)
        Unit - Move (Sold unit) instantly to RandomPoint
        Set Hero[(Player number of (Owner of (Buying unit)))] = (Sold unit)
        Hero - Create Replenishment Scroll x3 and give it to (Sold unit)
        Hero - Create Minor Replenishment Potion and give it to (Sold unit)
        Hero - Create Minor Replenishment Potion and give it to (Sold unit)
        Hero - Create Minor Healing Potion and give it to (Sold unit)
        Player - Limit training of Heroes to 0 for (Owner of (Buying unit))
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
        Camera - Pan camera for (Owner of (Buying unit)) to RandomPoint over 0.00 seconds
        Custom script:   call RemoveLocation(udg_RandomPoint)

This is from my map, just remove the useless triggers
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top