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

Item limit

Status
Not open for further replies.
Add to your "Misc" items in the Object Editor the classification of let's say "Artifact". Then, check the classification of the item upon picking of the item:
  • Trig
  • Events
    • Unit - A unit acquires an item
  • Conditions
    • (Item classification of (Item being manipulated)) Not Equal to Artifact
  • Actions
    • Set ItemsCount = (ItemsCount + 1)
This is not MUI (the items count), but I am giving you the idea.
 
Level 2
Joined
Jan 4, 2011
Messages
22
I figured it out:
EDIT
and this time it works
  • Item limit
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Not equal to Miscellaneous
    • Actions
      • Set ItemClassCounter = 0
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Permanent
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Charged
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Powerup
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Artifact
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Purchasable
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Campaign
              • And - All (Conditions) are true
                • Conditions
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
            • Then - Actions
              • Set ItemClassCounter = (ItemClassCounter + 1)
            • Else - Actions
              • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ItemClassCounter Greater than 1) and ((Item-class of (Item being manipulated)) Not equal to Miscellaneous)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item being manipulated)) Not equal to Miscellaneous
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffffcc00You can't...
            • Else - Actions
              • Do nothing
        • Else - Actions
          • Do nothing
New improved trigger:
  • Item limit
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set ItemClassCounter = 0
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Permanent
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Charged
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Powerup
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Artifact
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Purchasable
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Campaign
              • And - All (Conditions) are true
                • Conditions
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
            • Then - Actions
              • Set ItemClassCounter = (ItemClassCounter + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemClassCounter Greater than 1
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffffcc00You can't...
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top