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
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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