• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Check for multiple copies of an item

Status
Not open for further replies.
Level 5
Joined
Sep 1, 2010
Messages
168
Use a for loop and a variable to store the value:
set variable =0
for loop integer A from 1to 6, do:
{
if picked/triggering/whatever unit has item of type, set variable =variable +1
else (do nothing)
}
after the loop,check the variable number
if (variable >= 2)
do funky stuff
(or if you want different effects depending on number of the same item, use multiple if/else on the the else function of the other,checking for variable ==number)

Hope that helps :)
 
Level 9
Joined
Apr 23, 2011
Messages
460
So it would be something like this?
  • Mutli Item Check System
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Last created item)) Equal to Claws of Attack +15
    • Actions
      • Set temp_item = (Item-type of (Item being manipulated))
      • Set item = 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 (Triggering unit) in slot (Integer A))) Equal to temp_item
            • Then - Actions
              • Set item = (item + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • item Equal to 2
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type temp_item)
          • Item - Remove (Item carried by (Triggering unit) of type temp_item)
          • Hero - Create Claws of Attack +30 and give it to (Triggering unit)
        • Else - Actions
 
Status
Not open for further replies.
Top