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

[Trigger] Stacking weapons

Status
Not open for further replies.
Level 17
Joined
Apr 24, 2005
Messages
762
I want to make a trigger like when i have 1 type of item in my inventory i cannot pick up/buy another item of the same type. Like i have a sword in my inventory so i cant buy another sword. But if i drop the sword i can get a new one.
 
Level 7
Joined
Mar 12, 2006
Messages
407
I'm actually not on my PC so i cant access my we but try something like this:

event:
Unit acquires item

action
check if unit already has an item of that classification and if so drop the new item


so you need to classify all your items
i.e weapons be artifact armor be another classification and so on
and all items you can have as much as you like go into one class
 
Level 7
Joined
Mar 12, 2006
Messages
407
  • pick up
    • Ereignisse
      • Unit - A unit acquires an item
    • Bedingungen
    • Aktionen
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Item-class of (Item being manipulated)) equals (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A)))
              • (Item being manipulated) unequal (Item carried by (Hero manipulating item) in slot (Integer A))
            • 'THEN'-Aktionen
              • Held - Drop (Item being manipulated) from (Hero manipulating item)
            • 'ELSE'-Aktionen
Translated the important parts to english

I hope I could clarify what i meant
 
Level 7
Joined
Mar 12, 2006
Messages
407
For each integer a from 1 to 6 runs a loop six times
first run Integer a is 1
second run it is 2 and so on
so it checks each item slot if there is an item of the same classification


i attached the testmap so you can look it up in your we yourself ;)
 

Attachments

  • items.w3x
    16.3 KB · Views: 63
Status
Not open for further replies.
Top