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!
(Item-class of (Item being manipulated)) Equal to Charged
Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
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 (Item-type of (Item being manipulated))
((Charges remaining in (Item being manipulated)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))) Less than or equal to 60
Then - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item being manipulated)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))))
Item - Remove (Item being manipulated)
Skip remaining actions
Else - Actions
Set boolean = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
boolean Equal to True
Then - Actions
Set boolean = False
Trigger - Turn off (This trigger)
Hero - Give (Item being manipulated) to (Triggering unit)
Trigger - Turn on (This trigger)
Else - Actions
I've never actually made a stacking trigger with a limit on max stacks, so there's probably a more optimal way to do it - but this works fine. Just change the conditions if you only want it to apply to a specific type or types of item rather than all charged items.
Edit: Oh, and if you want charged items to be purchasable with a full inventory, it's a whole different, slightly longer trigger, and would require you to remake any such items in the object editor twice.
Or, you could set up an integer variable that counts how many of the items your hero has purchased; then when the 'limit' has been reached, it just prevents you from purchasing any more.
Would you like the triggers to that?
(Item-class of (Item being manipulated)) Equal to Charged
Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
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 (Item-type of (Item being manipulated))
((Charges remaining in (Item being manipulated)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))) Less than or equal to 60
Then - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item being manipulated)) + (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))))
Item - Remove (Item being manipulated)
Skip remaining actions
Else - Actions
Set boolean = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
boolean Equal to True
Then - Actions
Set boolean = False
Trigger - Turn off (This trigger)
Hero - Give (Item being manipulated) to (Triggering unit)
Trigger - Turn on (This trigger)
Else - Actions
I've never actually made a stacking trigger with a limit on max stacks, so there's probably a more optimal way to do it - but this works fine. Just change the conditions if you only want it to apply to a specific type or types of item rather than all charged items.
Edit: Oh, and if you want charged items to be purchasable with a full inventory, it's a whole different, slightly longer trigger, and would require you to remake any such items in the object editor twice.
(Item-type of (Item being manipulated)) Equal to Your Item
Actions
Item - Set charges remaining in (Item being manipulated) to 5
I think you wanted the charges you recieve to be 5. So, set the number of charges in the object editor to 60, but change the number of charges when you aquire the item to 5 using the trigger editor. Then, you'll need another trigger to get you to the max stacks. Although, you never mentioned having the max stacks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.