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

Item Count

Status
Not open for further replies.
Level 6
Joined
May 1, 2009
Messages
156
I know this is simple but I can't figure out a good way to have it so when a unit has all 5 of an item in its inventory it does action. I'm not sure the "Event" for it.
 
Level 6
Joined
May 1, 2009
Messages
156
Blah, i need to know how to have it so if a unit has all 5 items on him he completes the quest. What are the conditions to check he has those all 5 items.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • 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 Orb of Frost
          • (Item-type of (Item being manipulated)) Equal to Mask of Death
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
          • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
      • ((Triggering unit) has an item of type Orb of Frost) Equal to True
      • ((Triggering unit) has an item of type Mask of Death) Equal to True
      • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
      • ((Triggering unit) has an item of type Claws of Attack +15) Equal to True
      • ((Triggering unit) has an item of type Kelen's Dagger of Escape) Equal to True
    • Actions
      • Unit - Kill (Triggering unit)
In this trigger, when the unit picks up any of those five items and he already has the other four he will die.
 
Level 6
Joined
May 1, 2009
Messages
156
Thank you, oh and does this work for the same items? ... Nvm it probably does, i'm trying it now thank, +rep.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The trigger above works only for five different items.

This trigger checks if you have five of the same item. If you have, it removes them and creates a new item:

  • Item Create
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Temp_Unit_1 = (Triggering unit)
      • Set Temp_Integer_1 = 0
      • 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-type of (Item carried by Temp_Unit_1 in slot (Integer A))) Equal to Crown of Kings +5
            • Then - Actions
              • Set Temp_Integer_1 = (Temp_Integer_1 + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Integer_1 Greater than or equal to 5
        • Then - Actions
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • Item - Remove (Item carried by Temp_Unit_1 of type Crown of Kings +5)
          • Hero - Create Mask of Death and give it to Temp_Unit_1
        • Else - Actions
 
Status
Not open for further replies.
Top