DarkKnightML
New Member
- Reaction score
- 1
So apparently making it so you can't pick up two of the same items out of a group of specific items is a lot harder than I'd thought? Or at least I've been going about it the wrong way for the past few hours. I recently made a system so that you could have only one of four items at one time in your inventory for my hero, and you would purchase this item from the shop, however while I was testing with a friend he simply put down one of the items, bought a different one(and it could have even been the same one..) and then simply picked up the old one, thus giving him two of those items, and this could work for multiple instances as well, he could potentially fill his inventory with the item with this bug. So would anyone know how to fix this? I've tried multiple ways but I just wound up deleting the triggers I had out of frustration, however I can post what I have for the buy trigger.
And you can see that I have some of how I tried to fix the issue still in here.
Code:
Cloak of Archimonde
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Tome of Archimonde
Actions
Set ShepNumber = (Player number of (Owner of (Hero manipulating item)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Triggering unit) has an item of type Cloak of Ner'zhul) Equal to True
((Triggering unit) has an item of type Cloak of Archimonde) Equal to True
((Triggering unit) has an item of type Cloak of Sargeras) Equal to True
((Triggering unit) has an item of type Cloak of Kil'jaeden) Equal to True
Then - Actions
Set PlayerGroupArray[27] = (Player group((Owner of (Hero manipulating item))))
Game - Display to (Player group((Random player from PlayerGroupArray[27]))) for 10.00 seconds the text: Only one cloak per ...
Item - Remove (Item being manipulated)
Player - Add 100 to (Owner of (Hero manipulating item)) Current gold
Else - Actions
Set CloakAmountShep[ShepNumber] = (CloakAmountShep[ShepNumber] + 1)
Hero - Create Cloak of Archimonde and give it to (Hero manipulating item)
And you can see that I have some of how I tried to fix the issue still in here.