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

[Trigger] One type of item system

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Any idea why this one-type item system doesn't work ?

It just automaticly throws items, even if you don't have any in your inventory.

  • One type equipment
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • 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-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot (Integer A)))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
              • Skip remaining actions
      • If (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 (Triggering unit)))) the text: ...
        • Else - Actions
          • If (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 (Triggering unit)))) the text: ...
            • Else - Actions
              • If (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 (Triggering unit)))) the text: ...
                • Else - Actions
                  • If (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 (Triggering unit)))) the text: ...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-class of (Item being manipulated)) Equal to Miscellaneous
                        • Then - Actions
                          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-class of (Item being manipulated)) Equal to Powerup
                            • Then - Actions
                              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ...
                            • Else - Actions
 
It's simple. Your firs action (For each (Integer A) from 1 to 6, do (Actions)) is to drop item of the same class that Item being manipulated. This part of trigger will allways find item that hero just acquired and drop it.
 
try this, im not sure if it will work but it might

  • Actions
    • Item - Set the custom value of (Item being manipulated) to 1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot (Integer A)))) and ((Custom value of (Item carried by (Triggering unit) in slot (Integer A))) Equal to 0)
      • Then - Actions
        • Hero - Drop (Item being manipulated) from (Triggering unit)
      • Else - Actions
        • Skip remaining actions
    • Item - Set the custom value of (Item being manipulated) to 0

EDIT i don't know why my first post posted so late. i posted it like 30 min before the other dudes so sorry about the double post.
 
Last edited:
u don't need to set a custom value and check it. You just need to use the second condition that's like this:
  • ((Item Being Manipulated) not equal to (Item Carried By (Hero Manipulating Item) in slot (Integer A))
 
The Trigger fires after the item is in the inventory, so the condition is always true, because the hero has the item of that class. This loop should work. hf.

  • 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-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Artifact
          • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You can carry only ...
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
 
Status
Not open for further replies.
Back
Top