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

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