• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item Trigger

Status
Not open for further replies.
Level 5
Joined
Jun 27, 2009
Messages
137
For my campaign, I wanted to make it to where if you tried to pick up a helmet when you already had one (Or something of that nature) then you wouldn't be able to. I know that this is done through triggers, so I was wondering if maybe someone could help me out with this. this is as far as I got:

  • Events
    • Unit - Ragerunner 0001 <gen> Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to |cffff8c00Crown of the Deathlord|r
If someone could please help, I'd really appreciate it.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
  • ItemClassLimitGUI
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set MyItemClass = (Item-class of (Item being manipulated))
      • 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 (Triggering unit) in slot (Integer A))) Equal to MyItemClass
              • (Item being manipulated) Not equal to (Item carried by (Triggering unit) in slot (Integer A))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Skip remaining actions
            • Else - Actions
In the
  • Or - Any (Conditions) are true
    • Conditions
add any item class that you want to limit by following the example.

Note that the item that gets dropped is the old item. If you don't want that, replace
  • Hero - Drop the item from slot (Integer A) of (Triggering unit)
with
  • Hero - Drop (Item being manipulated) from (Triggering unit)
 
Status
Not open for further replies.
Top