Bottle item from dota

djb4cc1o94

TH.net Regular
Reaction score
5
How do i make an item like the "Magical Bottle" in DotA? i already made runes.
What do i need to make ? Trigger it i guess,but any explain ?

Please dont say "Not all players play dota explain better" coz i cant explain better.
 

johnnymra

New Member
Reaction score
14
That is actually what you should do, explain better. But because thank god i played dota... i will sacrifice and do your work. I will explain what i think you want.
You want an item (a bottle) that regenerates hp and mana and dispels on combat.
Still, the item has 3 charges... but when all the charges are used, it still does not dissapear... and it can be recharged from a fountain. (when you get near the fountain you get back the 3 charges)
Also when a hero acquires a rune (an instant used on acquiring item) the bottle item shall be transformed into an item with the ability of the rune, and when it is used it transforms back into the 3 charged bottle.

Hope this clarifies it so that some people may be able to help you, i don't... but at least i have the brains to form a description for what you want, something you should have done...
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Play DotA said:
Refills to 3/3 full when you are near the fountain

Regenerate
Restores 135 HP and 70 Mana over 3 seconds
Effect ends if you take damage
When used, 3/3 full Bottle changes to 2/3 full, 2/3 Bottle changes to 1/3 full, and 1/3 full Bottle changes to Empty Bottle
Cannot be used when Bottle is empty
Has a 0.5 second cooldown

Rune Capture
Stores the target rune in the Bottle, the rune can be used by using the Bottle
When a rune is used from the Bottle, the Bottle is refilled to 3/3 full
Stored runes are automatically used after 120 seconds
Can only be used when Bottle is empty
Bottle is not drop-able when it has a rune stored
You should at least try to post a better description of what you want.
If you don't, we can't help you at all.
Don't say you 'can't'.
I got the above description directly from the Official DotA Website.

johnnymra didn't have to be so roud about it though.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
All you have to do is to make several items and link them with triggers. You have Bottle_Full, Bottle_2/3, Bottle_1/3, Bottle_Empty, Bottle_MS, Bottle_DD, Bottle_REG, Bottle_ILL, Bottle_WW.
Add to all items an ability based on channel and at targets/cast you choose instant, so when you press an ability is done.
Now check what items do you have when you press the ability from item, if you have Bottle_Full then create a dummy and order it to cast healing on you and then remove the item and place Bottle_2/3, continue until you replace Bottle_1/3 with Bottle_Empty, on Bottle empty add the channel ability but at its options add target type "unit target" and check if target is one of your runes when you cast ability, then you will be able from runes to replace your item with the according one that has the special abilities.
Even on "special" Bottles add the same channel ability as I said and then check what the item and order your dummy to cast the ability the item describes.
When you get a special bottle start a 2 minute timer, when it stops check if he has now the same special item and force him to use it.
If he pressed the special item before the 2 minutes pass, just stop the timer and destroy it.
Also add a region near the fountains and add an event when someone enters that region to replace if he has Bottle_2/3 or Bottle_1/3 or Bottle_Empty to replace it with Bottle_Full.

"Nha im too lazy also i didnt ask you to"

This won't save you. We are not your slaves to tell us DO IT and expect you to do, this is thehelper.net not findyourbitch.net
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You're the one asking for help.
We're here to help you, but we're not the ones who should have to run around and look for the description of what you want.

If you didn't want to post that big quote, you could've at least linked to some sort of website with the description of the bottle.
If you knew it was on the DotA page, why not link it?

I'm not trying to be mean, or rude, but just take some time and type out a clear, concise description of what you want before you post.
 

djb4cc1o94

TH.net Regular
Reaction score
5
Only people wich plays dota can understand description very well and have a demostration of the item working so thats why....
 

WolfieeifloW

WEHZ Helper
Reaction score
372
With the description I posted, I believe anyone could understand what a 'bottle' in DotA is.
Maybe, you might, have to explain what a rune is, but I don't really think you would have to.
 

Carnerox

The one and only.
Reaction score
84
Try this.

Not sure if it works or not, but if you use it, and something doesn't work, just tell me, and I'll fix it.
JASS:
scope MagicalBottle initializer init
    globals
        private trigger refill = CreateTrigger()
        private constant integer BOTTLE_ID = 'I000' //The bottle that you buy
        private constant integer FOUNTAIN_ID = 'nfoh' //Fountain where the bottle refills
        private constant integer BOTTLE_3_ID = 'I001' // Magical Bottle 3/3
        private constant integer BOTTLE_2_ID = 'I002' // Magical Bottle 2/3
        private constant integer BOTTLE_1_ID = 'I003' // Magical Bottle 1/3
        private constant integer BOTTLE_0_ID = 'I004' // Magical Bottle 0/3
        private constant real PERIODIC = 2.50
        private constant real AreaOfEffect = 500.00 // Refill range.
    endglobals
    
    private function ReplaceItem takes unit whichUnit,item whichItem,integer newItem returns nothing
        call RemoveItem(whichItem)
        call UnitAddItemById(whichUnit,newItem)
    endfunction
    
    private function Actions takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local item i = GetManipulatedItem()
        if (GetItemTypeId(i)==BOTTLE_3_ID) then
            call ReplaceItem(u,i,BOTTLE_2_ID)
        elseif (GetItemTypeId(i)==BOTTLE_2_ID) then
            call ReplaceItem(u,i,BOTTLE_1_ID)
        elseif (GetItemTypeId(i)==BOTTLE_1_ID) then
            call ReplaceItem(u,i,BOTTLE_0_ID)
        endif
        set u=null
        set i=null
        return false
    endfunction
    
    private function PickUpBottle takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local item i = GetManipulatedItem()
        if (GetItemTypeId(i)==BOTTLE_ID) then
            call ReplaceItem(u,i,BOTTLE_3_ID)
        endif
        set u=null
        set i=null
        return false
    endfunction
    
    private function Refill takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local item i
        local integer index = 0
        loop
            exitwhen index>=bj_MAX_INVENTORY
            set i=UnitItemInSlot(u,index)
            if (i!=null) and (GetItemTypeId(i)==BOTTLE_2_ID) or (GetItemTypeId(i)==BOTTLE_1_ID) or (GetItemTypeId(i)==BOTTLE_0_ID) then
                call ReplaceItem(u,i,BOTTLE_3_ID)
            endif
            set index=index+1
        endloop
        set u=null
        set i=null
        return false
    endfunction
    
    private function AddFountain takes nothing returns boolean
        local unit t = GetFilterUnit()
        call TriggerRegisterUnitInRange(refill,t,AreaOfEffect,null)
        set t=null
        return false
    endfunction
    
    private function InitRefill takes nothing returns nothing
        local group g = CreateGroup()
        local boolexpr b = Filter(function AddFountain)
        call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,b)
        call DestroyBoolExpr(b)
        call DestroyGroup(g)
        set g=null
        set b=null
    endfunction
        

    //===========================================================================
    private function init takes nothing returns nothing
        local trigger use = CreateTrigger()
        local trigger get = CreateTrigger()
        local integer index = 0
        loop
            exitwhen index>bj_MAX_PLAYER_SLOTS
            call TriggerRegisterPlayerUnitEvent(use,Player(index),EVENT_PLAYER_UNIT_USE_ITEM,null)
            call TriggerRegisterPlayerUnitEvent(get,Player(index),EVENT_PLAYER_UNIT_PICKUP_ITEM,null)
            set index=index+1
        endloop
        call TimerStart(CreateTimer(),PERIODIC,true,function InitRefill)
        call TriggerAddCondition(use,Condition(function Actions))
        call TriggerAddCondition(get,Condition(function PickUpBottle))
        call TriggerAddCondition(refill,Condition(function Refill))
    endfunction
endscope
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
also this jass function "ReplaceItem" must save inventory position, else it will be a little unprofessional
 

djb4cc1o94

TH.net Regular
Reaction score
5
Sorry i never used vJass :s how do i copy this on my map & Wich base item should i use for the bottle?
scope MagicalBottle initializer init
globals
private trigger refill = CreateTrigger()
private constant integer BOTTLE_ID = 'I000' //The bottle that you buy
private constant integer FOUNTAIN_ID = 'nfoh' //Fountain where the bottle refills
private constant integer BOTTLE_3_ID = 'I001' // Magical Bottle 3/3
private constant integer BOTTLE_2_ID = 'I002' // Magical Bottle 2/3
private constant integer BOTTLE_1_ID = 'I003' // Magical Bottle 1/3
private constant integer BOTTLE_0_ID = 'I004' // Magical Bottle 0/3
private constant real PERIODIC = 2.50
private constant real AreaOfEffect = 500.00 // Refill range.
endglobals

private function ReplaceItem takes unit whichUnit,item whichItem,integer newItem returns nothing
call RemoveItem(whichItem)
call UnitAddItemById(whichUnit,newItem)
endfunction

private function Actions takes nothing returns boolean
local unit u = GetTriggerUnit()
local item i = GetManipulatedItem()
if (GetItemTypeId(i)==BOTTLE_3_ID) then
call ReplaceItem(u,i,BOTTLE_2_ID)
elseif (GetItemTypeId(i)==BOTTLE_2_ID) then
call ReplaceItem(u,i,BOTTLE_1_ID)
elseif (GetItemTypeId(i)==BOTTLE_1_ID) then
call ReplaceItem(u,i,BOTTLE_0_ID)
endif
set u=null
set i=null
return false
endfunction

private function PickUpBottle takes nothing returns boolean
local unit u = GetTriggerUnit()
local item i = GetManipulatedItem()
if (GetItemTypeId(i)==BOTTLE_ID) then
call ReplaceItem(u,i,BOTTLE_3_ID)
endif
set u=null
set i=null
return false
endfunction

private function Refill takes nothing returns boolean
local unit u = GetTriggerUnit()
local item i
local integer index = 0
loop
exitwhen index>=bj_MAX_INVENTORY
set i=UnitItemInSlot(u,index)
if (i!=null) and (GetItemTypeId(i)==BOTTLE_2_ID) or (GetItemTypeId(i)==BOTTLE_1_ID) or (GetItemTypeId(i)==BOTTLE_0_ID) then
call ReplaceItem(u,i,BOTTLE_3_ID)
endif
set index=index+1
endloop
set u=null
set i=null
return false
endfunction

private function AddFountain takes nothing returns boolean
local unit t = GetFilterUnit()
call TriggerRegisterUnitInRange(refill,t,AreaOfEffect,null)
set t=null
return false
endfunction

private function InitRefill takes nothing returns nothing
local group g = CreateGroup()
local boolexpr b = Filter(function AddFountain)
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,b)
call DestroyBoolExpr(b)
call DestroyGroup(g)
set g=null
set b=null
endfunction


//===========================================================================
private function init takes nothing returns nothing
local trigger use = CreateTrigger()
local trigger get = CreateTrigger()
local integer index = 0
loop
exitwhen index>bj_MAX_PLAYER_SLOTS
call TriggerRegisterPlayerUnitEvent(use,Player(index),EVENT_PLAYER_UNIT_USE_ITEM,null)
call TriggerRegisterPlayerUnitEvent(get,Player(index),EVENT_PLAYER_UNIT_PICKUP_ITEM,null)
set index=index+1
endloop
call TimerStart(CreateTimer(),PERIODIC,true,function InitRefill)
call TriggerAddCondition(use,Condition(function Actions))
call TriggerAddCondition(get,Condition(function PickUpBottle))
call TriggerAddCondition(refill,Condition(function Refill))
endfunction
endscope
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You can use any old item. It doesn't matter. Make an ability that targets items, but does nothing (probably based off Channel), and add it to the item. If you don't know how to fill in the item fields, copy the values from (or even base the item off) an existing item with a targetable ability.

As for the code, create a new trigger, and Edit > Convert to Custom Text. Make sure that the trigger is blank, then copy and paste the code into the trigger.
 
General chit-chat
Help Users
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs
  • Monovertex Monovertex:
    @The Helper I'm really not seeing the "Signature" link in the sidebar on that page. Here's a screenshot:
  • The Helper The Helper:
    I have reported it - I was wondering why nobody I have given sigs to over the last few years have used them
  • The Helper The Helper:
    Ghan has said he has fixed this. Monovertex please confirm this fix. This was only a problem with people that had signatures in the upper levels like not the special members but the respected members.
  • The Helper The Helper:
    Here is a better place to manage this stuff https://www.thehelper.net/account/account-details which I think should be way more visible
  • The Helper The Helper:
    I am hoping that online user count drop is finally that TikTok bot banned

      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