• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

The easiest way to collect identical items

Level 8
Joined
Apr 16, 2025
Messages
160
I swear to God, I recently saw a very basic trigger for collecting identical items in one map. It looked something like this:

  • Crown
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
      • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
      • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
      • Hero - Create Crown of Kings +5 and give it to (Triggering unit)
(in this version 3 crowns are collected)

But in that version, one crown was assembled. Everything worked, I tested it. I was also very surprised that it worked, and I thought that in reforge the editor became much more functional. However, I lost this method! Please tell me how to make such a trigger?P.S. I'm currently using a much more complex system of this kind:

  • Crown2 2 2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
    • Actions
      • 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
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Circlet of Nobility
            • Then - Actions
              • For each (Integer B) from ((Integer A) + 1) to 6, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Circlet of Nobility
                    • Then - Actions
                      • For each (Integer C) from ((Integer B) + 1) to 6, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-type of (Item carried by (Hero manipulating item) in slot C)) Equal to Circlet of Nobility
                            • Then - Actions
                              • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
                              • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
                              • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
                              • Hero - Create Crown of Kings +5 and give it to (Triggering unit)
                              • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                              • Do nothing
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
 
Last edited:
this is what i came up with
  • item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
    • Actions
      • Set VariableSet Integer_Circlets = 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
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Circlet of Nobility
            • Then - Actions
              • Set VariableSet Integer_Circlets = (Integer_Circlets + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Circlets Equal to 3
        • Then - Actions
          • Set VariableSet Integer_Circlets = 0
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Triggering unit) in slot (Integer B))) Equal to Circlet of Nobility
                • Then - Actions
                  • Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
                  • Set VariableSet Integer_Circlets = (Integer_Circlets + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer_Circlets Equal to 3
                    • Then - Actions
                      • Hero - Create Crown of Kings +5 and give it to (Triggering unit)
                      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Skip remaining actions
                    • Else - Actions
                • Else - Actions
        • Else - Actions
 
this is what i came up with
  • item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
    • Actions
      • Set VariableSet Integer_Circlets = 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
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Circlet of Nobility
            • Then - Actions
              • Set VariableSet Integer_Circlets = (Integer_Circlets + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Circlets Equal to 3
        • Then - Actions
          • Set VariableSet Integer_Circlets = 0
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Triggering unit) in slot (Integer B))) Equal to Circlet of Nobility
                • Then - Actions
                  • Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
                  • Set VariableSet Integer_Circlets = (Integer_Circlets + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer_Circlets Equal to 3
                    • Then - Actions
                      • Hero - Create Crown of Kings +5 and give it to (Triggering unit)
                      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Skip remaining actions
                    • Else - Actions
                • Else - Actions
        • Else - Actions
Not bad, one step smaller, it seems, although the volume is almost the same.
 
that is just normal Item Recipe were you different items
  • easy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has an item of type Hood of Cunning) Equal to True
          • ((Hero manipulating item) has an item of type Slippers of Agility +3) Equal to True
          • ((Hero manipulating item) has an item of type Gauntlets of Ogre Strength +3) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Hood of Cunning)
          • Item - Remove (Item carried by (Hero manipulating item) of type Slippers of Agility +3)
          • Item - Remove (Item carried by (Hero manipulating item) of type Gauntlets of Ogre Strength +3)
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Hero - Create Crown of Kings +5 and give it to (Hero manipulating item)
        • Else - Actions
 
I swear to God, I recently saw a very basic trigger for collecting identical items in one map. It looked something like this:

  • Crown
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
      • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
      • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
      • Hero - Create Crown of Kings +5 and give it to (Triggering unit)
(in this version 3 crowns are collected)

But in that version, one crown was assembled. Everything worked, I tested it. I was also very surprised that it worked, and I thought that in reforge the editor became much more functional. However, I lost this method! Please tell me how to make such a trigger?P.S. I'm currently using a much more complex system of this kind:

  • Crown2 2 2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
      • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
    • Actions
      • 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
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Circlet of Nobility
            • Then - Actions
              • For each (Integer B) from ((Integer A) + 1) to 6, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Circlet of Nobility
                    • Then - Actions
                      • For each (Integer C) from ((Integer B) + 1) to 6, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-type of (Item carried by (Hero manipulating item) in slot C)) Equal to Circlet of Nobility
                            • Then - Actions
                              • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
                              • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
                              • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
                              • Hero - Create Crown of Kings +5 and give it to (Triggering unit)
                              • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                              • Do nothing
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
I'll give you an example. I hope that'll help you.
  • All Items Recipes X
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • -------- ---------------------------------- Crystal Ball - Level 2 ---------------------------------- --------
      • Set VariableSet temp_item_count_CrystalBALL = 0
      • Set VariableSet temp_item_type_CrystallBaLL = Crystal Ball - Level 1
      • 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
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to temp_item_type_CrystallBaLL
            • Then - Actions
              • Set VariableSet temp_item_count_CrystalBALL = (temp_item_count_CrystalBALL + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • temp_item_count_CrystalBALL Greater than or equal to 3
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type temp_item_type_CrystallBaLL)
          • Item - Remove (Item carried by (Hero manipulating item) of type temp_item_type_CrystallBaLL)
          • Item - Remove (Item carried by (Hero manipulating item) of type temp_item_type_CrystallBaLL)
          • Hero - Create Crystal Ball - Level 2 and give it to (Hero manipulating item)
          • Special Effect - Create a special effect attached to the origin of (Hero manipulating item) using Abilities\Spells\Items\AIam\AIamTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
temp_item_count_CrystalBALL -> "Integer"
temp_item_type_CrystallBaLL -> "Item-Type" (not just "Item")
 
Back
Top