• 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 do you make it so your hero can only have 1 of a certain item?

Status
Not open for further replies.
Level 7
Joined
Aug 30, 2008
Messages
347
Make a trigger like
Event - unit acquires an item
Condition - type of item being manipulated equal to [the item]
Action - order hero to drop item
or you could destroy it.
 
Level 9
Joined
Apr 28, 2009
Messages
538
i had the same problem and i remember the only trigger that worked it was the following:

  • Limit Items To 1 Per Type
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Multiple ConditionsAnd - All (Conditions) are true
                • Conditions
                  • ((Hero manipulating item) has (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (==) True
                  • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (!=) (Item being manipulated)
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (==) (Item-class of (Item being manipulated))
            • Then - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-class of (Item being manipulated)) Equal to (==) Permanent
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                  • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-class of (Item being manipulated)) Equal to (==) Artifact
                    • Then - Actions
                      • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-class of (Item being manipulated)) Equal to (==) Purchasable
                        • Then - Actions
                          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-class of (Item being manipulated)) Equal to (==) Campaign
                            • Then - Actions
                              • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                            • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top