• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

need trigger that does so the hero dont can buy/have two of the same item

Status
Not open for further replies.
Level 3
Joined
Apr 21, 2009
Messages
27
ehh, I cant get the condition (how do I get it to be eqal to 1?)
 
Level 11
Joined
Feb 23, 2009
Messages
577
Hey! I am not on my comp so I can't take screenshots, but heres how you can do it using GUI's only:

Event:
Unit - A unit acquires an item

----------------------------------------------

Condition:
Item class of (Item being manipulated) equal to Miscellaneous

----------------------------------------------

Action 1:
If (All conditions are True) then do (Then Actions) else do (Else Actions)

If Condition 1:
Item class of (Item carried by (Hero Manipulating Item) in slot 1) equal to Miscellaneous

If Condition 2:
Item class of (Item carried by (Hero Manipulating Item) in slot 2) equal to Miscellaneous

Then Actions:
Item - Move (Item being Manipulated) to position of (Hero manipulating item))

Else Actions:
Do nothing

----------------------------------------------

Action 2:
If (All conditions are True) then do (Then Actions) else do (Else Actions)

If Condition 1:
Item class of (Item carried by (Hero Manipulating Item) in slot 1) equal to Miscellaneous

If Condition 2:
Item class of (Item carried by (Hero Manipulating Item) in slot 3) equal to Miscellaneous

Then Actions:
Item - Move (Item being Manipulated) to position of (Hero manipulating item))

Else Actions:
Do nothing

----------------------------------------------

Action 3:
If (All conditions are True) then do (Then Actions) else do (Else Actions)

If Condition 1:
Item class of (Item carried by (Hero Manipulating Item) in slot 1) equal to Miscellaneous

If Condition 2:
Item class of (Item carried by (Hero Manipulating Item) in slot 4) equal to Miscellaneous

Then Actions:
Item - Move (Item being Manipulated) to position of (Hero manipulating item))

Else Actions:
Do nothing

----------------------------------------------

And so on, doing every 2 slots possible at once in the inventory (1-2 , 1-3 , 1-4 , 1-5 , 1-6 , 2-3 , 2-4 , 2-5 , 2-6 , 3-4 , 3-5 , 3-6 , 4-5 , 4-6 , 5-6 (15 possible combination's, since 1-6 = 6-1, etc.)

It doesn't take very long if you copy paste the: If (All conditions are True) then do (Then Actions) else do (Else Actions)

Then you can do it with every "Item Class" (Permanent, Miscellaneous, Charged, etc.) allowing you to have 7 different types of item where you can only have 1 of each.

Hope this helps!

PS: Jon is crazy
 
Level 12
Joined
May 4, 2008
Messages
1,111
Lol i made like 3 of those in the past :p i should still have it somewhere in my posts :D
naw, i sent them in P.M XD searched posts for nothing :p
no clue if this is the right one, but yeah it should work
BLN = a Boolean Variable
  • antiduplicate
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Artifact
    • 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
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Set BLN = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Value Equal to True
                • Then - Actions
                  • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                  • Set BLN = False
                • Else - Actions
 
Status
Not open for further replies.
Top