Potion Stack

Whoareyou.

New Member
Reaction score
24
I searched the forums and didn't see a thread for this so.. Here goes
Is making potions stack together triggered? :eek:

Solved,
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
You mean like potions that would be in a hero's inventory? Some things can be done with the object editor, but mostly stacking would be done with triggers. It depends on what you're trying to do.
 

Whoareyou.

New Member
Reaction score
24
Yes like the inventory; You buy a lot of potions and they're all one item and have multiple charges.
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
Trigger:
  • trigger
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Replenishment Potion
    • 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-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Replenishment Potion
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Sold Item)
            • Then - Actions
              • Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to ((Charges remaining in (Item carried by (Triggering unit) in slot (Integer A))) + 1)
              • Item - Remove (Sold Item)
            • Else - Actions

I think something like that would achieve what you want.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
That works. But lets say Hero 1 has 6 items, one of them being Health Potion. If he tries to buy more health potions, then it would say "Inventory is full" and thus, not allow him to buy more Health Potions. Workaround is a dummy item. Which is actually a unit. Hero 1 buys "Health Potion" (which is really a unit). If Hero 1 has Health Potion, set charges +1. If Hero 1 does not have Health Potion, and has at least 1 slot left, then create Health Potion, and give to Hero 1.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
That works. But lets say Hero 1 has 6 items, one of them being Health Potion. If he tries to buy more health potions, then it would say "Inventory is full" and thus, not allow him to buy more Health Potions. Workaround is a dummy item. Which is actually a unit. Hero 1 buys "Health Potion" (which is really a unit). If Hero 1 has Health Potion, set charges +1. If Hero 1 does not have Health Potion, and has at least 1 slot left, then create Health Potion, and give to Hero 1.

Oh and then they remove the bought unit. So that's how they do it.... ahaha.
 

vypur85

Hibernate
Reaction score
803
To elaborate on esb's post. It'd be better if a powerup is used instead of unit. I believe that's what is used in DotA. The triggering is more complicated than normal though. Then again, that's not what the poster wants. So, I'll just skip that. Also, try using a unit acquire an item event instead. It would work better because it accounts for items that are 'picked'.


> didn't see a thread for this so..

Here's one in our resources.
 

eric92

New Member
Reaction score
3
Trigger:
  • Stacking
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Charges remaining in (Item being manipulated)) Greater than 0
    • 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-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A)))
              • (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
            • Then - Actions
              • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
              • Item - Remove (Item being manipulated)
            • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top