• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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:
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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.
Top