Dota's Magic Bottle question.

DeathBound

New Member
Reaction score
0
how to trigger the magic bottle in DOTA, i tried my trigger and it works exactly but the problem is the position of the magic bottle is moved to the top when used. how i dont know how to detect in which the item being manipulated is in what position of inventory.

another question is how to auto refill the magic bottle when it is nearby the fountain.. can someone show me the triggers..

another one is how to get a rune using empty bottle? thx!! just show me the triggers :D
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
You might want to say what Magic Bottle does, not everyone has played DotA.
 

tommerbob

Minecraft. :D
Reaction score
110
It probably uses 3 different items, removing/adding an item when a charge is used or near the fountain. For the stored runes, it probably uses additional items for each type of rune, then when that rune is used, it replaces it with the other bottle item and simply adds a dummy buff.
 

Bo-Bo

New Member
Reaction score
8
It probably uses 3 different items, removing/adding an item when a charge is used or near the fountain. For the stored runes, it probably uses additional items for each type of rune, then when that rune is used, it replaces it with the other bottle item and simply adds a dummy buff.

Read and understand the original post first, then answer.

Deathbound said:
how i dont know how to detect in which the item being manipulated is in what position of inventory.

You would loop through the hero's inventory and check if the current slot contains the used item. Then store that value in a variable and order the hero to move the newly created item to this slot.

This method has the problem, that the issued order interrupts the current order of the hero. If this is a problem, you would have to fill the empty slots before you give the item to the hero and remove the filler-items afterwards.

Hope this was understandable. =)

Deathbound said:
how to auto refill the magic bottle when it is nearby the fountain

Just create a region at your fountain.
When a hero enters that region, check if he has an empty bottle and replace it.
 

Bo-Bo

New Member
Reaction score
8
Make a new rune bottle item for each rune.
Add an item-targetted spell to your empty bottle item and check, on which rune the spell is used.
Then add the corresponding rune bottle item to your hero.

For using it, add to each rune bottle item a non-targetted ability.
When one of those abilities is casted, you create that rune in front of your hero and order him to use it.
 

DeathBound

New Member
Reaction score
0
thx for that.

i still dont know the trigger for checking in what position in inventory the item being manipulated this is my code

Magic Bottle 3
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Magic Bottle 3/3
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
((Triggering unit) has (Item carried by (Triggering unit) in slot (Integer A))) Equal to True
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Magic Bottle 3/3)
Hero - Create Magic Bottle 2/3 and give it to (Triggering unit)
Else - Actions
 

Bo-Bo

New Member
Reaction score
8
As I already said, store the slot in a variable and order the hero to move the replaced bottle to the stored slot.

And stop bumping.. You could also just ask, if there's something you don't understand.
I will not make the triggers for you.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
DeathBound said:
i still dont know the trigger for checking in what position in inventory the item being manipulated this is my code

He DID ask...

I just made an ability and gave it to the item instead.

Trigger:
  • Usage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Bottle Usage
    • Actions
      • Set Counter = 0
      • Set CounterCheck = False
      • 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
              • CounterCheck Equal to False
            • Then - Actions
              • Set Counter = (Counter + 1)
            • Else - Actions
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CounterCheck Equal to False
                • Then - 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 Bottle[(Integer B)]
                    • Then - Actions
                      • Set CounterCheck = True
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Set BottleType = ((Integer B) - 1)
                    • Else - Actions
                • Else - Actions
      • For each (Integer A) from 1 to (Counter - 1), do (Actions)
        • Loop - Actions
          • Hero - Create Space Filler and give it to (Triggering unit)
          • Set TempItem[(Integer A)] = (Last created item)
      • Hero - Create Bottle[BottleType] and give it to (Triggering unit)
      • For each (Integer A) from 1 to (Counter - 1), do (Actions)
        • Loop - Actions
          • Item - Remove TempItem[(Integer A)]


I'd do something like this.

Bottle -> Item Type Array (Used to store the 1/3, 2/3, full bottle.)
BottleType -> Integer
Counter -> Integer
CounterCheck -> Boolean
Space filler -> Just an item that does nothing
 

Bo-Bo

New Member
Reaction score
8
skyblader said:
He DID ask...

Yeah, and I answered.

I just don't think posting the finished trigger helps as much as giving him hints would do, but maybe that's just me.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Yeah, and I answered.

I just don't think posting the finished trigger helps as much as giving him hints would do, but maybe that's just me.

It's okay, I guess different people have different helping methods. For me, I'd post an example and he should be able to do similar stuff. This is actually, kinda complicated.
 

DeathBound

New Member
Reaction score
0
He DID ask...

I just made an ability and gave it to the item instead.

Trigger:
  • Usage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Bottle Usage
    • Actions
      • Set Counter = 0
      • Set CounterCheck = False
      • 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
              • CounterCheck Equal to False
            • Then - Actions
              • Set Counter = (Counter + 1)
            • Else - Actions
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CounterCheck Equal to False
                • Then - 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 Bottle[(Integer B)]
                    • Then - Actions
                      • Set CounterCheck = True
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Set BottleType = ((Integer B) - 1)
                    • Else - Actions
                • Else - Actions
      • For each (Integer A) from 1 to (Counter - 1), do (Actions)
        • Loop - Actions
          • Hero - Create Space Filler and give it to (Triggering unit)
          • Set TempItem[(Integer A)] = (Last created item)
      • Hero - Create Bottle[BottleType] and give it to (Triggering unit)
      • For each (Integer A) from 1 to (Counter - 1), do (Actions)
        • Loop - Actions
          • Item - Remove TempItem[(Integer A)]


I'd do something like this.

Bottle -> Item Type Array (Used to store the 1/3, 2/3, full bottle.)
BottleType -> Integer
Counter -> Integer
CounterCheck -> Boolean
Space filler -> Just an item that does nothing

its not working this is my code..

Trigger:
  • Magic Bottle
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Generic Item-Rejuv Effect (Magic Bottle)
    • Actions
      • Set MagicBottleCounter = 0
      • Set MagicBottleCheck = False
      • Set MagicBottle[1] = Magic Bottle 2/3
      • Set MagicBottle[2] = Magic Bottle 1/3
      • Set MagicBottle[3] = Magic Bottle (Empty)
      • 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
              • MagicBottleCheck Equal to False
            • Then - Actions
              • Set MagicBottleCounter = (MagicBottleCounter + 1)
            • Else - Actions
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MagicBottleCheck Equal to False
                • Then - 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 MagicBottle[(Integer B)]
                    • Then - Actions
                      • Set MagicBottleCheck = True
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Set MagicBottleType = ((Integer B) - 1)
                    • Else - Actions
                • Else - Actions
      • For each (Integer A) from 1 to (MagicBottleCounter - 1), do (Actions)
        • Loop - Actions
          • Hero - Create Space Filler and give it to (Triggering unit)
          • Set MagicBottleTemp[(Integer A)] = (Last created item)
      • Hero - Create MagicBottle[MagicBottleType] and give it to (Triggering unit)
      • For each (Integer A) from 1 to (MagicBottleCounter - 1), do (Actions)
        • Loop - Actions
          • Item - Remove MagicBottleTemp[(Integer A)]
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Set the magic bottles as
MagicBottle[0] = Empty Bottle
MagicBottle[1] = 1/3 Bottle
MagicBottle[2] = 2/3 Bottle
MagicBottle[3] = Full Bottle
 

Aedes

Member
Reaction score
8
try to use the < item use > trigger. then do the loop to check the slot of the item being manipulated. after checking, remove item. then add item to the position of the manipulated item.
 

DeathBound

New Member
Reaction score
0
Set the magic bottles as
MagicBottle[0] = Empty Bottle
MagicBottle[1] = 1/3 Bottle
MagicBottle[2] = 2/3 Bottle
MagicBottle[3] = Full Bottle

one small problem.. when i have other items on my slot. the bottles seems to go to the last slot of my inventory..
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Ooops. Forgot to include the items that were already there. Made some edits.

Trigger:
  • Usage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Bottle Usage
    • Actions
      • Set Counter = 0
      • Set CounterCheck = False
      • Set NotBottle = 0
      • 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
              • CounterCheck Equal to False
            • Then - Actions
              • Set Counter = (Counter + 1)
            • Else - Actions
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CounterCheck Equal to False
                • Then - 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 Bottle[(Integer B)]
                    • Then - Actions
                      • Set CounterCheck = True
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Set BottleType = ((Integer B) - 1)
                    • Else - Actions
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CounterCheck Equal to False
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to No item
            • Then - Actions
              • Set NotBottle = (NotBottle + 1)
            • Else - Actions
      • For each (Integer A) from 1 to (Counter - (1 + NotBottle)), do (Actions)
        • Loop - Actions
          • Hero - Create Space Filler and give it to (Triggering unit)
          • Set TempItem[(Integer A)] = (Last created item)
      • Hero - Create Bottle[BottleType] and give it to (Triggering unit)
      • For each (Integer A) from 1 to (Counter - (NotBottle + 1)), do (Actions)
        • Loop - Actions
          • Item - Remove TempItem[(Integer A)]
 

DeathBound

New Member
Reaction score
0
Ooops. Forgot to include the items that were already there. Made some edits.

Trigger:
  • Usage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Bottle Usage
    • Actions
      • Set Counter = 0
      • Set CounterCheck = False
      • Set NotBottle = 0
      • 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
              • CounterCheck Equal to False
            • Then - Actions
              • Set Counter = (Counter + 1)
            • Else - Actions
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CounterCheck Equal to False
                • Then - 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 Bottle[(Integer B)]
                    • Then - Actions
                      • Set CounterCheck = True
                      • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                      • Set BottleType = ((Integer B) - 1)
                    • Else - Actions
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CounterCheck Equal to False
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to No item
            • Then - Actions
              • Set NotBottle = (NotBottle + 1)
            • Else - Actions
      • For each (Integer A) from 1 to (Counter - (1 + NotBottle)), do (Actions)
        • Loop - Actions
          • Hero - Create Space Filler and give it to (Triggering unit)
          • Set TempItem[(Integer A)] = (Last created item)
      • Hero - Create Bottle[BottleType] and give it to (Triggering unit)
      • For each (Integer A) from 1 to (Counter - (NotBottle + 1)), do (Actions)
        • Loop - Actions
          • Item - Remove TempItem[(Integer A)]

thx!

hey another help on how to refill the empty bottle, 1/3 and 2/3 when it is near the fountain, it also check whether it is an ally or enemy,

anyway this is my code.

Code:
Magic Bottle Bought
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Magic Bottle 3/3
    Actions
        Set MagicBottleUnit = (Triggering unit)

Code:
Magic Bottle Refill1
    Events
        Time - Every 0.50 seconds of game time
    Conditions
        And - All (Conditions) are true
            Conditions
                (MagicBottleRefillSentinel <gen> contains MagicBottleUnit) Equal to True
                (MagicBottleUnit belongs to an ally of Player 1 (Red)) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (MagicBottleUnit has an item of type Magic Bottle 2/3) Equal to True
                        (MagicBottleUnit has an item of type Magic Bottle 1/3) Equal to True
                        (MagicBottleUnit has an item of type Magic Bottle (Empty)) Equal to True
            Then - Actions
                Item - Remove (Item carried by (Triggering unit) of type Magic Bottle (Empty))
                Item - Remove (Item carried by (Triggering unit) of type Magic Bottle 1/3)
                Item - Remove (Item carried by (Triggering unit) of type Magic Bottle 2/3)
                Hero - Create Magic Bottle 3/3 and give it to (Triggering unit)
            Else - Actions
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top