• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Item Trigger

Status
Not open for further replies.
Level 17
Joined
Jun 17, 2010
Messages
2,275
  • Life Essence
    • 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
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Potion of Regeneration
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Holy Water
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Potion of Healing
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Life Steal Potion
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Potion of Rejuvenation
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated)))
              • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
              • Hero - Create Life Essence and give it to (Triggering unit)
            • Else - Actions
Yeah ive tried multiple times, i think i know what the problem is but i dont know how to fix it.
 
Do something like this.
  • Life Essence
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Potion of Restoration
        • Then - Actions
          • Set Item1[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Potion of Invulnerability
        • Then - Actions
          • Set Item2[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Potion of Healing
        • Then - Actions
          • Set Item3[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Vampiric Potion
        • Then - Actions
          • Set Item4[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Replenishment Potion
        • Then - Actions
          • Set Item5[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Item1[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Item2[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Item3[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Item4[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Item5[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
          • Hero - Create Essence of Aszune and give it to (Triggering unit)
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
What are you trying to do?

You can't use AND like that, what it says now is that you would have to have all those five item types in the same slot, which is not possible.

@GhostThruster

(Item-type of (Item being manipulated)) I/T/E comparisons should be inside each other, like this:


  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Then - Actions
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 030
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Claws of Attack +15) Equal to True
      • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
      • ((Triggering unit) has an item of type Kelen's Dagger of Escape) Equal to True
      • ((Triggering unit) has an item of type Mask of Death) Equal to True
      • ((Triggering unit) has an item of type Orb of Frost) Equal to True
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +15)
      • Item - Remove (Item carried by (Triggering unit) of type Crown of Kings +5)
      • Item - Remove (Item carried by (Triggering unit) of type Kelen's Dagger of Escape)
      • Item - Remove (Item carried by (Triggering unit) of type Mask of Death)
      • Item - Remove (Item carried by (Triggering unit) of type Orb of Frost)
      • Hero - Create Ring of Protection +5 and give it to (Triggering unit)
 
Status
Not open for further replies.
Top