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

need help with item triggers

Status
Not open for further replies.
Level 3
Joined
Dec 2, 2008
Messages
11
How would i trigger in GUI a simple trigger to make sure a hero can only have one of some type of item. Like for example a hero has a "sword" which is a type of weapon but decides to pick up an "Axe" Which is also a type of weapon. :cry:
 
Probably something like this:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Wirt's Other Leg
          • (Item-type of (Item being manipulated)) Equal to Wirt's Leg
    • Actions
      • For each (Integer A) from 1 to (Size of inventory for (Triggering unit)), 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-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Wirt's Other Leg
                  • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Wirt's Leg
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
This is just an example, using the two "Wirt's Leg" items.
 
Status
Not open for further replies.
Back
Top