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

Only 1 of the type of item

Status
Not open for further replies.
Level 1
Joined
Jun 21, 2009
Messages
282
So guys, atm im needing a trigger that makes it so you can only have 1 pair of gloves, 1 chest piece, 1 pairs of boots, and a 1 head piece.

So it would be like, put a restriction that you cannot pick up Gloves because you already have "Item of Type: Gloves" for example.

You can only have 1 type of armor piece, 4 armor types total.

Please and thanks! :thumbs_up:
 
Have each item type have a different "Level" then use this trigger

  • Only one item type of each item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item level of (Item being manipulated)) Less than 8
    • Actions
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item level of (Item carried by (Triggering unit) in slot (Integer B))) Equal to (Item level of (Item being manipulated))
            • Then - Actions
              • Hero - Drop (Item carried by (Triggering unit) in slot (Integer B)) from (Triggering unit)
            • Else - Actions
Should work, that'll be if you have 8 different item types, starting at 0.
 
Level 1
Joined
Jun 21, 2009
Messages
282
Yeah, tryed it out and it drops every item,

I dont think i was clear, what i ment was you can only have 1 feet type item, 1 chest type item, 1 head type item, and 1 glove type item for each hero.

Sorry if i wasnt clear
 
Level 7
Joined
Jul 20, 2009
Messages
295
Tigger No.1:
  • InitializeWeaponSystem
    • Events
      • Map initialization
    • Conditions
    • Actions
      • =These are Integers=
      • Set ____Boots = 1
      • Set ____Chest = 2
      • Set ____Head = 3
      • Set ____Gloves = 4
      • Set ____Sword = 5
      • =These are Booleans=
      • Set zz_bBoots = False
      • Set zz_bChest = False
      • Set zz_bHead = False
      • Set zz_bGloves = False
      • Set zz_bSword = False
      • =This is Integer=
      • Set zz_IntegerItemClassCheck = 0
      • =You have to create all these variables above in your map=
      • Etc...


Trigger No.2:
  • GetAWeapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Boots
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bBoots[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Else - Actions
                • Set zz_bBoots[(Player number of (Owner of (Triggering unit)))] = True
                • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You equiped:|r |cff00FFFF + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
          • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Chest
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bChest[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Else - Actions
                • Set zz_bChest[(Player number of (Owner of (Triggering unit)))] = True
                • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You equiped:|r |cff00FFFF + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
          • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Head
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bHead[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Else - Actions
                • Set zz_bHead[(Player number of (Owner of (Triggering unit)))] = True
                • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You equiped:|r |cff00FFFF + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
          • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Gloves
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bGloves[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Else - Actions
                • Set zz_bGloves[(Player number of (Owner of (Triggering unit)))] = True
                • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You equiped:|r |cff00FFFF + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
          • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Sword
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bSword[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: |cffc3dbffYou alrea...
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Else - Actions
                • Set zz_bSword[(Player number of (Owner of (Triggering unit)))] = True
                • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You equiped:|r |cff00FFFF + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
          • Else - Actions
      • Etc...


Last Trigger:
  • LoseAWeapon
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set zz_IntegerItemClassCheck = 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 being manipulated) Not equal to (Item carried by (Triggering unit) in slot (Integer A))
              • (Item level of (Item being manipulated)) Equal to (Item level of (Item carried by (Hero manipulating item) in slot (Integer A)))
            • Then - Actions
              • Set zz_IntegerItemClassCheck = (zz_IntegerItemClassCheck + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • zz_IntegerItemClassCheck Less than 1
        • Then - Actions
        • Else - Actions
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Boots
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bBoots[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bBoots[(Player number of (Owner of (Triggering unit)))] = False
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You dropped:|r |cffff0000 + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Chest
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bChest[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bChest[(Player number of (Owner of (Triggering unit)))] = False
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You dropped:|r |cffff0000 + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Head
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bHead[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bHead[(Player number of (Owner of (Triggering unit)))] = False
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You dropped:|r |cffff0000 + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Gloves
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bGloves[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bGloves[(Player number of (Owner of (Triggering unit)))] = False
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You dropped:|r |cffff0000 + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to ____Sword
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zz_bSword[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set zz_bSword[(Player number of (Owner of (Triggering unit)))] = False
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) for 3.50 seconds the text: (|cffffcc00You dropped:|r |cffff0000 + ((Name of (Item being manipulated)) + |r|cffffcc00.|r))
            • Else - Actions
        • Else - Actions
      • Etc...
 
Status
Not open for further replies.
Top