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
  • 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