- Joined
- May 7, 2008
- Messages
- 346
EDIT: Solved, Uncle found the solution as usual 
I've been fiddling with this for about 6 hours before trying to post here, but sadly I'm not able to code this one out so I will need help with it.
Basically, I have a shop. The shop contains items, and if you gather 2 items of the same kind (eg. let's say Ring of Protection x2) then that prepares the trigger for the next step.
the above code works, however I'm not sure of the Integer Variable ''ItemAmount'' and does it apply to the hero manipulating item or does it apply in general? The map I'm working on has 6 players, so would the trigger above cause any bugs towards that end?
What I'm trying to say is that the code above needs slight tweaking in example below, unless the code I mentioned above is fine (I edited only the ''For each'' trigger:
Then, once that's settled, the player unit who has ''Item Amount'' number equal to 2 can buy the ''Legendary'' item from the other shop, and once he buys the item the ''Item Amount'' should reset back to 0, unabling him to acquire the item unless he has Item Amount equal to 2 again. So far I came up with this:
Also tried this, in hopes that it somehow would work lol
Sadly it doesn't work
Also the Legendary shop (last trigger) sells Tomes, so that I can give item to triggering units who have full 6 inventory slots.
I've been fiddling with this for about 6 hours before trying to post here, but sadly I'm not able to code this one out so I will need help with it.
Basically, I have a shop. The shop contains items, and if you gather 2 items of the same kind (eg. let's say Ring of Protection x2) then that prepares the trigger for the next step.
-
Enchanted Gaunlet Acquire
-
Events
-
Unit - A unit Sells an item (from shop)
-
-
Conditions
-
(Item-type of (Sold Item)) Equal to |cff800080Runed Gauntlets|r
-
-
Actions
-
For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Buying unit) in slot (Integer A))) Equal to |cff800080Runed Gauntlets|r) then do (Set VariableSet ItemAmount = (ItemAmount + 1)) else do (Do nothing))
-
Game - Display to (All players) the text: 1
-
-
the above code works, however I'm not sure of the Integer Variable ''ItemAmount'' and does it apply to the hero manipulating item or does it apply in general? The map I'm working on has 6 players, so would the trigger above cause any bugs towards that end?
What I'm trying to say is that the code above needs slight tweaking in example below, unless the code I mentioned above is fine (I edited only the ''For each'' trigger:
-
Enchanted Gaunlet Acquire
-
Events
-
Unit - A unit Sells an item (from shop)
-
-
Conditions
-
(Item-type of (Sold Item)) Equal to |cff800080Runed Gauntlets|r
-
-
Actions
-
For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Buying unit) in slot (Integer A))) Equal to |cff800080Runed Gauntlets|r) then do (Set VariableSet ItemAmount = (ItemAmount + 1 for [B](Owner of (Hero Manipulating Item)[/B])) else do (Do nothing))
-
Game - Display to (All players) the text: 1
-
-
Then, once that's settled, the player unit who has ''Item Amount'' number equal to 2 can buy the ''Legendary'' item from the other shop, and once he buys the item the ''Item Amount'' should reset back to 0, unabling him to acquire the item unless he has Item Amount equal to 2 again. So far I came up with this:
-
Enchanted Gaunlets Recipe
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to Enchanted Gaunlets
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ItemAmount Equal to 2
-
-
Then - Actions
-
Hero - Drop (Item carried by (Hero manipulating item) of type |cff800080Runed Gauntlets|r) from (Hero manipulating item).
-
Item - Remove (Last dropped item)
-
Hero - Drop (Item carried by (Hero manipulating item) of type |cff800080Runed Gauntlets|r) from (Hero manipulating item).
-
Item - Remove (Last dropped item)
-
Hero - Create |cffd45e19Enchanted Gaunlets|r and give it to (Hero manipulating item)
-
Set VariableSet ItemAmount = 0
-
-
Else - Actions
-
-
-
Also tried this, in hopes that it somehow would work lol
-
Enchanted Gaunlets Recipe
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
(Item-type of (Item being manipulated)) Equal to Enchanted Gaunlets
-
-
Actions
-
For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to |cff800080Runed Gauntlets|r) then do (Item - Remove (Item carried by (Hero manipulating item) of type |cff800080Runed Gauntlets|r)) else do (Item - Remove (Item carrie
-
Hero - Create |cffd45e19Enchanted Gaunlets|r and give it to (Hero manipulating item)
-
For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to |cffd45e19Enchanted Gaunlets|r) then do (Set VariableSet ItemAmount = 0) else do (Do nothing))
-
-
Sadly it doesn't work
Also the Legendary shop (last trigger) sells Tomes, so that I can give item to triggering units who have full 6 inventory slots.
Last edited by a moderator: