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

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