• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Ideas/Requests?

Status
Not open for further replies.
Level 8
Joined
Jul 3, 2011
Messages
251
Hello hive! Recently i have a lot of spare time and want to code some more spells for the hive.

Are there any ideas and/or spell requests any of you have? Unfortunately my mind is not very imaginative, and i would appriciate ideas very much. Any idea given will of course be creditted when the spell is uploaded.

Please give as much detail as possible with ideas, every tiny detail will help me shape it the way you imagine it. For requests, it would be great if a video or picture could be supplied.

Any spell made will be very configurable for your maps.

Regards,
Zaio.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I want a spell for potions to restore hp/mana based on str/int respectively over 10 seconds. It's for an RPG.

There are 5 tiers for each potion (hp/mana)
Fixed amounts are: 60, 120, 180, 240, 300
Stat based restore: 80%, 160%, 240%, 320%, 400%

The stat % is restored based on the total duration of the potion, and not each second.
Means: If the hero uses a Potion (Level 5) and has 100 str, the potion should restore Fixed amout -> 300 + 400 <- Stat %. = 700 Hp over 10 second = 70 hp x sec. During this effect the unit has the same rejuvenation special effect the skill has.

Of course, MUI =).
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Well you can spend your free time as you want, but I think this is the "World Editor Help Zone" isn't the correct one for such requests.

But at all - you should say how good your are! You just now GUI? What's about jass and vJass? Are you able to create spells without any external libraries?

Greetings and Peace
Dr. Boom
 
Level 8
Joined
Jul 3, 2011
Messages
251
I want a spell for potions to restore hp/mana based on str/int respectively over 10 seconds. It's for an RPG.

There are 5 tiers for each potion (hp/mana)
Fixed amounts are: 60, 120, 180, 240, 300
Stat based restore: 80%, 160%, 240%, 320%, 400%

The stat % is restored based on the total duration of the potion, and not each second.
Means: If the hero uses a Potion (Level 5) and has 100 str, the potion should restore Fixed amout -> 300 + 400 <- Stat %. = 700 Hp over 10 second = 70 hp x sec. During this effect the unit has the same rejuvenation special effect the skill has.

Of course, MUI =).

Sure i'll do this for you later :) i may need to pm you later though for more information.

Moin moin =)

Well you can spend your free time as you want, but I think this is the "World Editor Help Zone" isn't the correct one for such requests.

But at all - you should say how good your are! You just now GUI? What's about jass and vJass? Are you able to create spells without any external libraries?

Greetings and Peace
Dr. Boom

Well, im not making a request so this is the place this should be i believe. No i do not code in GUI, i code in PURE JASS. Check the spells in my signature, they arent that advanced but they are nice none-the-less. I am able to create spells without external libraries, but it is generally better if i use them if needed, i would rather have a spell with no errors that a spell with 1 unlikely error.
 
Level 4
Joined
Nov 24, 2010
Messages
62
Yay! You are good!
But I prefer making spell by myself with the help of another than "All credit goes to someone" blah blah
But if you want I can send you a ton of spell idea! I'm too lazy to make all of those.
 
Last edited:
Level 8
Joined
Jul 3, 2011
Messages
251
I want a spell for potions to restore hp/mana based on str/int respectively over 10 seconds. It's for an RPG.

There are 5 tiers for each potion (hp/mana)
Fixed amounts are: 60, 120, 180, 240, 300
Stat based restore: 80%, 160%, 240%, 320%, 400%

The stat % is restored based on the total duration of the potion, and not each second.
Means: If the hero uses a Potion (Level 5) and has 100 str, the potion should restore Fixed amout -> 300 + 400 <- Stat %. = 700 Hp over 10 second = 70 hp x sec. During this effect the unit has the same rejuvenation special effect the skill has.

Of course, MUI =).

Hello there Spartipilo! I have done this request, see your private messages.
If anyone else is interested in this request of his, please send me a private message for a copy.
 
Level 4
Joined
Nov 24, 2010
Messages
62
Yay! Is now my turn :p?


The Mad Scientist using his knowledge of Anti Matter and the soul of all unit within 300 range of target point of this ability, he craft X Anti Matter where X equal to the number of soul. Each AM stored increase his damage by 1. Max 100 damage.


The Mad Scientist throw some of crafted AM in to an area, blocking sight in and out that area. Only him have the sight in that area. Deal 100/200/300 damages to anyone get in or out that area.


The Mad Scientist using 3/4/5 of crafted AM to void the dimension around him. If the damage deal to him get through one of these AM, it will be blocked and that AM will be removed. After 20/25/30s, the remaining AM explore deal 200 damage each to the Mad Scientist.


Passive
After dying, all of the crafted AM will explore, dealing Number of Remaining AM x 10/20/30 damages each and attract into center all unit within 500 ranges.

 
Level 8
Joined
Jul 3, 2011
Messages
251
Yes I want see it =)

Edit: Why you make it private at all? Just share the code with us =)

Check your mail.

Yay! Is now my turn :p?


The Mad Scientist using his knowledge of Anti Matter and the soul of all unit within 300 range of target point of this ability, he craft X Anti Matter where X equal to the number of soul. Each AM stored increase his damage by 1. Max 100 damage.


The Mad Scientist throw some of crafted AM in to an area, blocking sight in and out that area. Only him have the sight in that area. Deal 100/200/300 damages to anyone get in or out that area.


The Mad Scientist using 3/4/5 of crafted AM to void the dimension around him. If the damage deal to him get through one of these AM, it will be blocked and that AM will be removed. After 20/25/30s, the remaining AM explore deal 200 damage each to the Mad Scientist.


Passive
After dying, all of the crafted AM will explore, dealing Number of Remaining AM x 10/20/30 damages each and attract into center all unit within 500 ranges.


Well Gopinich im more making single spells and possibly systems, not making entire heros lol.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Dr. Boom, i would say: "Yes". As Zaio said, he's making 'Simple spells' Any further improvement should be allowed if the user requires it. Having a Spell with shared credits, is better than having a spell no one uses :p
 
Level 16
Joined
May 1, 2008
Messages
1,605
Well, as you allowed it, I'll post my little way, which includes a little more configure things, shorter code and also a little more speed as far as I know

> Note: Care if you test it with the map of Zaio - I use a little different item rawcodes for this!!
> Other note: The main thing Zaio, why I don't like your code (nothing bad - don't mind me for this!!) is: Imagen when the map has over 10 heal and 10 mana potions - then you have to create for everything a function - I handle it in a loop^^

JASS:
library MyPotions initializer init

    globals
        private constant string SFX = "Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl"
        private constant string ATTACH = "chest"
        
        private constant real WHEN_HEAL = 1.
        private constant real WHEN_MANA = 1.
        
        private constant real DURATION = 10.
        
        private constant integer MAX_ITEMS_TYPE = 5
        
        // Don't change \\
        
        private integer array POT_MANA
        private integer array POT_HEAL
        
        private constant hashtable HASH = InitHashtable()
    endglobals
    
    private function setup takes nothing returns nothing
        set POT_MANA[1] = 'I001'
        set POT_MANA[2] = 'I002'
        set POT_MANA[3] = 'I003'
        set POT_MANA[4] = 'I004'
        set POT_MANA[5] = 'I005'
        
        set POT_HEAL[1] = 'I006'
        set POT_HEAL[2] = 'I007'
        set POT_HEAL[3] = 'I008'
        set POT_HEAL[4] = 'I009'
        set POT_HEAL[5] = 'I010'
    endfunction
    
    private function heal takes integer i returns real
        return 60. * i
    endfunction
    
    private function mana takes integer i returns real
        return 60. * i
    endfunction
    
    private function str takes integer i returns real
        return 0.8 * i
    endfunction
    
    private function int takes integer i returns real
        return 0.8 * i
    endfunction
    
    // Configuration ends here \\
    
    private struct MyPotions
        unit    user    =   null
        
        real    a       =   0.
        real    b       =   0.
        
        real    c       =   0.
        real    d       =   0.
        integer t       =   0
        
        item    i       =   null
        
        effect  e       =   null
        
        static method periodic takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = LoadInteger(HASH,GetHandleId(t),0)
            
            set .d = .d + 0.03125
            set .c = .c + 0.03125
            
            if .t == 1 and .c >= WHEN_MANA then
                set .c = 0.
                call SetUnitState(.user,UNIT_STATE_MANA,GetUnitState(.user,UNIT_STATE_MANA) + .b)
            endif
            
            if .t == 2 and .c >= WHEN_HEAL then
                set .c = 0.
                call SetWidgetLife(.user,GetWidgetLife(.user) + .b)
            endif
            
            if .d >= DURATION then
                call PauseTimer(t)
                call DestroyTimer(t)
                set t = null
                call DestroyEffect(.e)
                call .destroy()
            endif
            
            set t = null
        endmethod
        
        static method create takes unit user, item i returns thistype
            local thistype this = .allocate()
            local timer t = CreateTimer()
            local integer x = 1
            
            set .user = user
            set .i = i
            set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
            loop
                exitwhen x == MAX_ITEMS_TYPE + 1
                if GetItemTypeId(.i) == POT_MANA[x] then
                    set .a = int(x)
                    set .b = mana(x) + (GetHeroInt(.user,true) * .a) / DURATION
                    set .t = 1
                elseif GetItemTypeId(.i) == POT_HEAL[x] then
                    set .a = str(x)
                    set .b = heal(x) + (GetHeroStr(.user,true) * .a) / DURATION
                    set .t = 2
                endif
                set x = x + 1
            endloop
            
            call SaveInteger(HASH,GetHandleId(t),0,this)
            call TimerStart(t,0.03125,true,function thistype.periodic)
            set t = null
            return this
        endmethod
    endstruct
    
    private function cond takes nothing returns boolean
        call MyPotions.create(GetTriggerUnit(),GetManipulatedItem())
        return false
    endfunction
    
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
            exitwhen i == 13
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null)
            set i = i + 1
        endloop
        call TriggerAddCondition(t,function cond)
        call setup()
        
        set t = null
    endfunction
endlibrary

If you have any critic or ideas - just let me now =D
 
Level 8
Joined
Jul 3, 2011
Messages
251
JASS:
call DestroyTimer(t)
Should be using TimerUtils.
JASS:
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null)
You may as well be using EventBJ here.

As for the rest of the code, im afraid i can't comment. I do not know vJASS, i merely provide strict JASS code.
 
Level 9
Joined
Jul 27, 2010
Messages
581
damage barrier.
Projectiles are bounced off.

e.g: Dragon spell effect circling unit, damage doesn't touch unit, projectiles bounce off, and melee attackers receive damage.

quite easy except the projectiles bounce off part, I need that.
 
Level 8
Joined
Jul 3, 2011
Messages
251
If you think it is easy other than the projectile bounce part i suppose you know how to trigger? Here is the code for deflection angles used to make the bounce part
JASS:
// Returns angle in radians
function GetDeflectionAngle takes unit missile, unit target returns real
    return 2.*Atan2(GetUnitY(target)-GetUnitY(missile),GetUnitX(target)-GetUnitX(missile))+bj_PI-GetUnitFacing(missile)*bj_DEGTORAD
endfunction

// Wrapper, returns angle in degrees
function GetDeflectionAngleDeg takes unit missile, unit target returns real
    return bj_RADTODEG*GetDeflectionAngle(missile,target)
endfunction
 
Level 16
Joined
May 1, 2008
Messages
1,605
JASS:
call DestroyTimer(t)
Should be using TimerUtils.
JASS:
call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null)
You may as well be using EventBJ here.

As for the rest of the code, im afraid i can't comment. I do not know vJASS, i merely provide strict JASS code.

1) No! no TimerUtils here - I discussed it already - I can use it, when I pause the timer first before destroying =)

2) Well .. I code like "down with every red line and bj" ^^
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well, as you allowed it, I'll post my little way, which includes a little more configure things, shorter code and also a little more speed as far as I know

> Note: Care if you test it with the map of Zaio - I use a little different item rawcodes for this!!
> Other note: The main thing Zaio, why I don't like your code (nothing bad - don't mind me for this!!) is: Imagen when the map has over 10 heal and 10 mana potions - then you have to create for everything a function - I handle it in a loop^^

JASS:
library MyPotions initializer init

    globals
        private constant string SFX = "Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl"
        private constant string ATTACH = "chest"
        
        private constant real WHEN_HEAL = 1.
        private constant real WHEN_MANA = 1.
        
        private constant real DURATION = 10.
        
        private constant integer MAX_ITEMS_TYPE = 5
        
        // Don't change \\
        
        private integer array POT_MANA
        private integer array POT_HEAL
        
        private constant hashtable HASH = InitHashtable()
    endglobals
    
    private function setup takes nothing returns nothing
        set POT_MANA[1] = 'I001'
        set POT_MANA[2] = 'I002'
        set POT_MANA[3] = 'I003'
        set POT_MANA[4] = 'I004'
        set POT_MANA[5] = 'I005'
        
        set POT_HEAL[1] = 'I006'
        set POT_HEAL[2] = 'I007'
        set POT_HEAL[3] = 'I008'
        set POT_HEAL[4] = 'I009'
        set POT_HEAL[5] = 'I010'
    endfunction
    
    private function heal takes integer i returns real
        return 60. * i
    endfunction
    
    private function mana takes integer i returns real
        return 60. * i
    endfunction
    
    private function str takes integer i returns real
        return 0.8 * i
    endfunction
    
    private function int takes integer i returns real
        return 0.8 * i
    endfunction
    
    // Configuration ends here \\
    
    private struct MyPotions
        unit    user    =   null
        
        real    a       =   0.
        real    b       =   0.
        
        real    c       =   0.
        real    d       =   0.
        integer t       =   0
        
        item    i       =   null
        
        effect  e       =   null
        
        static method periodic takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = LoadInteger(HASH,GetHandleId(t),0)
            
            set .d = .d + 0.03125
            set .c = .c + 0.03125
            
            if .t == 1 and .c >= WHEN_MANA then
                set .c = 0.
                call SetUnitState(.user,UNIT_STATE_MANA,GetUnitState(.user,UNIT_STATE_MANA) + .b)
            endif
            
            if .t == 2 and .c >= WHEN_HEAL then
                set .c = 0.
                call SetWidgetLife(.user,GetWidgetLife(.user) + .b)
            endif
            
            if .d >= DURATION then
                call PauseTimer(t)
                call DestroyTimer(t)
                set t = null
                call DestroyEffect(.e)
                call .destroy()
            endif
            
            set t = null
        endmethod
        
        static method create takes unit user, item i returns thistype
            local thistype this = .allocate()
            local timer t = CreateTimer()
            local integer x = 1
            
            set .user = user
            set .i = i
            set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
            loop
                exitwhen x == MAX_ITEMS_TYPE + 1
                if GetItemTypeId(.i) == POT_MANA[x] then
                    set .a = int(x)
                    set .b = mana(x) + (GetHeroInt(.user,true) * .a) / DURATION
                    set .t = 1
                elseif GetItemTypeId(.i) == POT_HEAL[x] then
                    set .a = str(x)
                    set .b = heal(x) + (GetHeroStr(.user,true) * .a) / DURATION
                    set .t = 2
                endif
                set x = x + 1
            endloop
            
            call SaveInteger(HASH,GetHandleId(t),0,this)
            call TimerStart(t,0.03125,true,function thistype.periodic)
            set t = null
            return this
        endmethod
    endstruct
    
    private function cond takes nothing returns boolean
        call MyPotions.create(GetTriggerUnit(),GetManipulatedItem())
        return false
    endfunction
    
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
            exitwhen i == 13
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null)
            set i = i + 1
        endloop
        call TriggerAddCondition(t,function cond)
        call setup()
        
        set t = null
    endfunction
endlibrary

If you have any critic or ideas - just let me now =D

The same thing I was wondering about Zaio's system:
1) Will it crash if potion is used on a non hero unit? <- Must not.
2) Is it MUI? <- Must :D
3) Do effects stack or are override by the 2nd use? <- I don't want them to stack. Its not realistic.
4) Can the potion effect by disabled? <- I need to disable Health Potion if the unit is under the effect of aky kind of poison, and Disable Mana potions if the units is under the effect of any kind os stun.
5) Later I'll create Rejuvenation Potions which heals both, Mana and Hp at half of the rate of the original potions, and can't be disabled. <- How to add that?

------------------------------

I don't want to do something complicated just because I want to. I want to make it more realistic. Health Potions are like 'Medicine' and works better if the hero is stronger. Mana potions are like... 'Drug', and increase the focus of the hero, but the effect gets override by 'Dazyness' = 'Stun'. The 'Rejuvenation potion' is just to improve gameplay. <- Are really expensive, dropped, have half of original potions effect but can't be disabled, and works for mana/hp at the same time.
 
Last edited:
Level 8
Joined
Jul 3, 2011
Messages
251
My system

1) Im not entirely sure, in the pm i said it will but actually i dont think it will, i believe the str stats will return null so it will just times null by 4.0 resulting in just the normal potions heal.
2) Yes mine is MUI
3) Yes my effects stack and will not be overrided but can be easily changed
4) Yes it can with simple editting
5) In my code you could just do another elseif i2 == 'id' then, then in the code you could make another boolean set to true, in the loop if the boolean is set to true (both hp and MP are on) then restore hp and MP, else do the normal effects.

All the questions you asked are the exact same in his code, all hes done is remaked it in vJASS.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I know Zaio :) I already knew your answers in the PM, and I already knew your system. I'm just following Dr.Boom's idea of Improving it, since he wants to, and giving him ideas to improve, since he asked for. =)

@DR. Boom.: Something is wrong with your trigger. Having a hero with 20 Str and 140 hp, using level 1 potion having 28 hp it healed to 140 inmediatly, and kept healing over the 10 seconds. - The effect appears whenever I use any item, and not just potions...

@Zaio: Your System doesn't heals me at all :D The only thing I changed was the potion Raw codes, and 'udg_hash' for 'udg_Hash' since it's the name my Hashtable variable has: udg_Hash. :p
 
Last edited:
Level 8
Joined
Jul 3, 2011
Messages
251
If you use udg_Hash then you must replace ALL usage of udg_hash with udg_Hash, else it will not save the values for healing. The test map works just fine so it must be something you have done wrong.

Also, if udg_Hash is not initalized at the start, change the line at the bottom from set udg_hash = InitHashtable() to set udg_Hash = InitHashtable()

EDIT: Did you add TimerUtils? My timers use that. If you did not import it, it will not start a timer to loop through the effects, in fact it would leak cause it would create the things in the hashtable without clearing it. Check your mail for one of the ones i sent you earlier, the instructions have TimerUtils in somewhere.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

So now I'm back and sorry didn't look at this what you wrote - I just recode my code a little but and see what I got:

Note:
I use a dummy unit, to cast a dummy ability on the user, so he can't use the item again when he used (I understand this what you say with non stack)
I use an array for the debuffs, because you can sort them by type, but since there can be other effects that should interrupt the heal, an array is the best way I think

And no, when a unit use this item, it will not crush, just the stat math will return 0 - so it only gets the basic value.

JASS:
library MyPotions initializer init

    globals
        private constant integer DUMMY = 'u000'
        private constant integer DUMMY_SPELL = 'A000'
        private constant integer DUMMY_SPELL_DEBUFF = 'B000'
        private constant string DUMMY_SPELL_ID = "slow"

        private constant string SFX = "Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl"
        private constant string ATTACH = "chest"
        
        private constant real WHEN_HEAL = 1.
        private constant real WHEN_MANA = 1.
        private constant real WHEN_REJU = 1.
        
        private constant real DURATION = 10.
        
        private constant integer MAX_POTS = 5
        private constant integer MAX_DEBUFFS = 5
        
        // Don't change \\
        
        private integer array POT_MANA
        private integer array POT_HEAL
        private integer array POT_REJU
        
        private integer array POT_DEBUFF
        
        private constant hashtable HASH = InitHashtable()
    endglobals
    
    private function setup takes nothing returns nothing
        set POT_MANA[1] = 'i000'
        set POT_MANA[2] = 'i001'
        
        set POT_HEAL[1] = 'i002'
        set POT_HEAL[2] = 'i003'
        
        set POT_REJU[1] = 'i004'
        set POT_REJU[2] = 'i005'
        
        set POT_DEBUFF[1] = 'b001'
        set POT_DEBUFF[2] = 'b002'
    endfunction
    
    private function heal takes integer a, unit u returns real
        return 60. * a + (GetHeroStr(u,true) * (0.8 * a))
    endfunction
    
    private function mana takes integer a, unit u returns real
        return 60. * a + (GetHeroInt(u,true) * (0.8 * a))
    endfunction
    
    private function reju takes integer a, unit u returns real
        return 60. / 2 * a + (GetHeroInt(u,true) * (0.8 * a))
    endfunction
        
    
    private struct MyPotions
        unit    user    =   null
        
        real    a       =   0.
        
        effect  e       =   null
        
        real    c       =   0.
        real    t       =   0.
        
        item    i       =   null
        
        integer x       =   0
        
        static method periodic takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = LoadInteger(HASH,GetHandleId(t),0)
            local integer a = 1
            
            set .c = .c + 0.03125
            set .t = .t + 0.03125
            
            loop
                exitwhen a > MAX_DEBUFFS
                if GetUnitAbilityLevel(.user,POT_DEBUFF[a]) >= 1 then
                    call DestroyEffect(.e)
                    call PauseTimer(t)
                    call DestroyTimer(t)
                    set t = null
                    call .destroy()
                endif
                set a = a + 1
            endloop
            
            if .x == 1 and .c >= WHEN_MANA then
                set .c = 0.
                call SetUnitState(.user,UNIT_STATE_MANA,GetUnitState(.user,UNIT_STATE_MANA) + .a)
            elseif .x == 2 and .c >= WHEN_HEAL then
                set .c = 0.
                call SetWidgetLife(.user,GetWidgetLife(.user) + .a)
            elseif .x == 3 and .c >= WHEN_REJU then
                set .c = 0.
                call SetWidgetLife(.user,GetWidgetLife(.user) + .a)
                call SetUnitState(.user,UNIT_STATE_MANA,GetUnitState(.user,UNIT_STATE_MANA) + .a)
            endif
            
            if .t >= DURATION then
                call DestroyEffect(.e)
                call PauseTimer(t)
                call DestroyTimer(t)
                set t = null
                call .destroy()
            endif
            
            set t = null
        endmethod
        
        static method create takes unit user, item i returns thistype
            local thistype this = .allocate()
            local timer t = CreateTimer()
            local integer a = 1
            local unit u
            local item b
            
            set .user = user
            set .i = i
            
            if GetUnitAbilityLevel(.user,DUMMY_SPELL_DEBUFF) < 1 then
            
                set u = CreateUnit(GetOwningPlayer(.user),DUMMY,GetUnitX(.user),GetUnitY(.user),0.)
                call UnitApplyTimedLife(u,'BTFL',1.)
                call UnitAddAbility(u,DUMMY_SPELL)
                call IssueTargetOrder(u,DUMMY_SPELL_ID,.user)

                loop
                    exitwhen a > MAX_POTS
                    if GetItemTypeId(.i) == POT_MANA[a] then
                        set .a = mana(a,.user) / DURATION
                        set .x = 1
                        set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
                    elseif GetItemTypeId(.i) == POT_HEAL[a] then
                        set .a = heal(a,.user) / DURATION
                        set .x = 2
                        set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
                    elseif GetItemTypeId(.i) == POT_REJU[a] then
                        set .a = reju(a,.user) / DURATION
                        set .x = 3
                        set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
                    endif
                    set a = a + 1
                endloop
                
                call SaveInteger(HASH,GetHandleId(t),0,this)
                call TimerStart(t,0.03125,true,function thistype.periodic)
            else
                set b = CreateItem(GetItemTypeId(.i),GetUnitX(.user),GetUnitY(.user))
                call UnitAddItem(.user,b)
            endif
            
            set t = null
            set u = null
            return this
        endmethod
    endstruct
    
    private function cond takes nothing returns boolean
        call MyPotions.create(GetTriggerUnit(),GetManipulatedItem())
        return false
    endfunction
    
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
            exitwhen i == 13
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null)
            set i = i + 1
        endloop
        call TriggerAddCondition(t,function cond)
        
        call setup()
        call Preload(SFX)
        
        set t = null
    endfunction
endlibrary

Note: Just to make it clear: Why the hell you are so obsessed of TimerUtils? First of all when you want use an external library for timers use T32! (faster, better performance and better coded) but second: Why the hell you want use an external library anyway when you can do it without?
That's just senseless wasted memory =O

Greetings and Peace
Dr. Boom
 
Level 8
Joined
Jul 3, 2011
Messages
251
Well, im obsessed with TimerUtils because
JASS:
call DestroyTimer(whichtimer)
is buggy, and i dont use T32 cause according to maggy its terrible xD

Its hardly wasted memory anyway
 
Level 16
Joined
May 1, 2008
Messages
1,605
Zaio ... read the next lines carefully okay?

> Destroying the Timer isn't buggy, if you pause it first (to avoid this bug) and null the timer (to avoid this bug (other then the first))

> TimerUtils is bad coded ... well not bad but out-dated. I used this external library too, because I was to stupid to use an own timer.
I know it can be useful, but it's even worst then having an own timer.

@ Gopinich: Hope you read this, because at least I want try to code your things you want there (only see if I can handle things like this ^^)

== Anti Matter Crafting ==
1) Is this an AOE cast?
2) Should the AM stay for ever? or for a time? they are gone if the hero dies?

== Light Blending ==
1) When a unit enter (damage). When a unit leaves (damage again)? When the unit enters again (damage too)?

== General ==
1) But I just can make the AM no existing ... I can't think of letting 100 AM's flow around the hero .. this would be a little bad
 
Level 4
Joined
Nov 24, 2010
Messages
62
@ Gopinich: Hope you read this, because at least I want try to code your things you want there (only see if I can handle things like this ^^)

== Anti Matter Crafting ==
1) Is this an AOE cast?
2) Should the AM stay for ever? or for a time? they are gone if the hero dies?

== Light Blending ==
1) When a unit enter (damage). When a unit leaves (damage again)? When the unit enters again (damage too)?

== General ==
1) But I just can make the AM no existing ... I can't think of letting 100 AM's flow around the hero .. this would be a little bad

Yay! Thanks! :goblin_yeah:
== Anti Matter Crafting ==
1) Yes, it's AOE cast.
2) They are gone only if the hero dies. If hero has "Last Breath" spell, they'll cause effect.

== Light Blending ==
1) I'm thinking about it. Maybe only one time when enter and one time when leave.

== General ==
1) Of course it isn't existing. But Material Vacuum calls 5 of these to fly around the caster.

I'm coding these spell in GUI, but I get mess with Hashtable when coding Material Vacuum. :ogre_rage:
 
Level 4
Joined
Aug 17, 2011
Messages
119
I have one. I don't particularly need it for anything at the moment, but I have always thought that a 'force move', with multiple unit knock-back should be made. So, its like a ripple that blasts out from the hero/mage in a widening wave, knocking back all enemies it touches. (its as if a Jedi did it with The Force! XD)
 
Level 4
Joined
Aug 17, 2011
Messages
119
Imagine something like Crushing Wave or Shock Wave, but combine that with the "knock-back" ability that someone like DotA's Barathrum has. So, it can be used as a means of crowd control.

Could be useful in a number of other ways. My personal favourite is for a mage unit as a means of crowd control. Just blast 'em away with force. (low damage, larger area, with option of getting stronger) Or, you could 'zero it in' a bit and make it a narrow and powerful wave that knocks enemies (like heroes) further away (or closer to someone/something).

need more??
 
Level 4
Joined
Aug 17, 2011
Messages
119
yeah, pretty much.

in a line is cool, but preferably in an expanding wedge if possible... starts narrow at caster feet, widens as it moves further away from caster. (so the area of effect is like a triangle in front of the caster)
 
Level 4
Joined
Aug 17, 2011
Messages
119
yup, pretty much... ; )

Sweet thanks!

Also, I have a few more ideas if you want me to keep 'em coming...
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Kno Mad! That spell already exists in the Spell Sstem. I can't find it right now, but there's the system to bash specific unit, group of units around target point, or units around the caster, in all directions.

EDIT: Btw, I'll check again the Rmk of Dr.Boom system, and check if i Imported Zaios System again. Also, there's no probem if this turns into a discussion forum, since it is always related to the creation of spells for other users :)
 
Level 4
Joined
Aug 17, 2011
Messages
119
really? thanks for the heads-up. couldn't find anything when I searched last... If you do find it please post a link!


so here is another thing I'm struggling with a.t.m, made a thread already, but if anyone wants to have a look.... trying to make it in GUI, should be possible just struggling.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
@Dr. Boom.

Moin moin =)

JASS:
library MyPotions initializer init

    globals
        private constant integer DUMMY = 'u000'
        private constant integer DUMMY_SPELL = 'A000'
        private constant integer DUMMY_SPELL_DEBUFF = 'B000'
        private constant string DUMMY_SPELL_ID = "slow"

        private constant string SFX = "Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl"
        private constant string ATTACH = "chest"
        
        private constant real WHEN_HEAL = 1.
        private constant real WHEN_MANA = 1.
        private constant real WHEN_REJU = 1.
        
        private constant real DURATION = 10.
        
        private constant integer MAX_POTS = 5
        private constant integer MAX_DEBUFFS = 5
        
        // Don't change \\
        
        private integer array POT_MANA
        private integer array POT_HEAL
        private integer array POT_REJU
        
        private integer array POT_DEBUFF
        
        private constant hashtable HASH = InitHashtable()
    endglobals
    
    private function setup takes nothing returns nothing
        set POT_MANA[1] = 'i000'
        set POT_MANA[2] = 'i001'
        
        set POT_HEAL[1] = 'i002'
        set POT_HEAL[2] = 'i003'
        
        set POT_REJU[1] = 'i004'
        set POT_REJU[2] = 'i005'
        
        set POT_DEBUFF[1] = 'b001'
        set POT_DEBUFF[2] = 'b002'
    endfunction
    
    private function heal takes integer a, unit u returns real
        return 60. * a + (GetHeroStr(u,true) * (0.8 * a))
    endfunction
    
    private function mana takes integer a, unit u returns real
        return 60. * a + (GetHeroInt(u,true) * (0.8 * a))
    endfunction
    
    private function reju takes integer a, unit u returns real
        return 60. / 2 * a + (GetHeroInt(u,true) * (0.8 * a))
    endfunction
        
    
    private struct MyPotions
        unit    user    =   null
        
        real    a       =   0.
        
        effect  e       =   null
        
        real    c       =   0.
        real    t       =   0.
        
        item    i       =   null
        
        integer x       =   0
        
        static method periodic takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = LoadInteger(HASH,GetHandleId(t),0)
            local integer a = 1
            
            set .c = .c + 0.03125
            set .t = .t + 0.03125
            
            loop
                exitwhen a > MAX_DEBUFFS
                if GetUnitAbilityLevel(.user,POT_DEBUFF[a]) >= 1 then
                    call DestroyEffect(.e)
                    call PauseTimer(t)
                    call DestroyTimer(t)
                    set t = null
                    call .destroy()
                endif
                set a = a + 1
            endloop
            
            if .x == 1 and .c >= WHEN_MANA then
                set .c = 0.
                call SetUnitState(.user,UNIT_STATE_MANA,GetUnitState(.user,UNIT_STATE_MANA) + .a)
            elseif .x == 2 and .c >= WHEN_HEAL then
                set .c = 0.
                call SetWidgetLife(.user,GetWidgetLife(.user) + .a)
            elseif .x == 3 and .c >= WHEN_REJU then
                set .c = 0.
                call SetWidgetLife(.user,GetWidgetLife(.user) + .a)
                call SetUnitState(.user,UNIT_STATE_MANA,GetUnitState(.user,UNIT_STATE_MANA) + .a)
            endif
            
            if .t >= DURATION then
                call DestroyEffect(.e)
                call PauseTimer(t)
                call DestroyTimer(t)
                set t = null
                call .destroy()
            endif
            
            set t = null
        endmethod
        
        static method create takes unit user, item i returns thistype
            local thistype this = .allocate()
            local timer t = CreateTimer()
            local integer a = 1
            local unit u
            local item b
            
            set .user = user
            set .i = i
            
            if GetUnitAbilityLevel(.user,DUMMY_SPELL_DEBUFF) < 1 then
            
                set u = CreateUnit(GetOwningPlayer(.user),DUMMY,GetUnitX(.user),GetUnitY(.user),0.)
                call UnitApplyTimedLife(u,'BTFL',1.)
                call UnitAddAbility(u,DUMMY_SPELL)
                call IssueTargetOrder(u,DUMMY_SPELL_ID,.user)

                loop
                    exitwhen a > MAX_POTS
                    if GetItemTypeId(.i) == POT_MANA[a] then
                        set .a = mana(a,.user) / DURATION
                        set .x = 1
                        set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
                    elseif GetItemTypeId(.i) == POT_HEAL[a] then
                        set .a = heal(a,.user) / DURATION
                        set .x = 2
                        set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
                    elseif GetItemTypeId(.i) == POT_REJU[a] then
                        set .a = reju(a,.user) / DURATION
                        set .x = 3
                        set .e = AddSpecialEffectTarget(SFX,.user,ATTACH)
                    endif
                    set a = a + 1
                endloop
                
                call SaveInteger(HASH,GetHandleId(t),0,this)
                call TimerStart(t,0.03125,true,function thistype.periodic)
            else
                set b = CreateItem(GetItemTypeId(.i),GetUnitX(.user),GetUnitY(.user))
                call UnitAddItem(.user,b)
            endif
            
            set t = null
            set u = null
            return this
        endmethod
    endstruct
    
    private function cond takes nothing returns boolean
        call MyPotions.create(GetTriggerUnit(),GetManipulatedItem())
        return false
    endfunction
    
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
            exitwhen i == 13
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null)
            set i = i + 1
        endloop
        call TriggerAddCondition(t,function cond)
        
        call setup()
        call Preload(SFX)
        
        set t = null
    endfunction
endlibrary

I don't know what i am supposed to place in 'Debuff'...I don't get how this works or where to put my custom data... I tested and saw that it heals though the effect remains even when I die. But i'm not sure about how it works. Also, there's no buff on the unit. How to know if i'm under Healing, Mana or Rejuv potion if there's no Buff?...

What I meant with 'No stacking' is: If the hero is under Healing Potion Effect, and uses a Mana Potion, the First potion effect is override by the second potion effect = The unit stops healing, and begins regenerating mana. Same with using potions of the same type.


@Zaio

This is the code i'm using.
JASS:
//Potion stats system by Zaio for Spartipilo
//===============================================================
//======================== CONFIGURABLES ========================
//===============================================================

function PH1 takes nothing returns integer
    return 'I007' // Level 1 heal potion ID
endfunction

function PH2 takes nothing returns integer
    return 'I00B' // Level 2 heal potion ID
endfunction

function PH3 takes nothing returns integer
    return 'I008' // Level 3 heal potion ID
endfunction

function PH4 takes nothing returns integer
    return 'I009' // Level 4 heal potion ID
endfunction

function PH5 takes nothing returns integer
    return 'I00A' // Level 5 heal potion ID
endfunction

function PM1 takes nothing returns integer
    return 'I00C' // Level 1 mana potion ID
endfunction

function PM2 takes nothing returns integer
    return 'I00G' // Level 2 mana potion ID
endfunction

function PM3 takes nothing returns integer
    return 'I00E' // Level 3 mana potion ID
endfunction

function PM4 takes nothing returns integer
    return 'I00D' // Level 4 mana potion ID
endfunction

function PM5 takes nothing returns integer
    return 'I00F' // Level 5 mana potion ID
endfunction

function PR1 takes nothing returns real
    return 60.00 // Level 1 heal/mana
endfunction

function PR2 takes nothing returns real
    return 120.00 // Level 2 heal/mana
endfunction

function PR3 takes nothing returns real
    return 180.00 // Level 3 heal/mana
endfunction

function PR4 takes nothing returns real
    return 240.00 // Level 4 heal/mana
endfunction

function PR5 takes nothing returns real
    return 300.00 // Level 5 heal/mana
endfunction

function PRS1 takes nothing returns real
    return 0.8 // Percentage of stats heal/mana increment // 0.8 = 80%
endfunction

function PRS2 takes nothing returns real
    return 1.6 // Percentage of stats heal/mana increment // 1.6 = 160%
endfunction

function PRS3 takes nothing returns real
    return 2.4 // Percentage of stats heal/mana increment // 2.4 = 240%
endfunction

function PRS4 takes nothing returns real
    return 3.2 // Percentage of stats heal/mana increment // 3.2 = 320%
endfunction

function PRS5 takes nothing returns real
    return 4.0 // Percentage of stats heal/mana increment // 4.0 = 400%
endfunction

function PROT takes nothing returns integer
    return 10 // The time it will do the restore in (it will still do the full amount, but this value is the time it takes)
endfunction

function RAP takes nothing returns string
    return "chest" // attachment point for the rejuvenation sfx
endfunction

//=============================================================================================================
//================================ END CONFIGURABLES =====================================================
//===================================================================================================

function Loop takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer id = GetHandleId(t)
    local real r = LoadReal(udg_Hash, id, 0)
    local unit u = LoadUnitHandle(udg_Hash, id, 1)
    local integer i = LoadInteger(udg_Hash, id, 2)
    local boolean b = LoadBoolean(udg_Hash, id, 3)
    local effect e
    if IsUnitType(u, UNIT_TYPE_DEAD) or 0 >= i then
      set e = LoadEffectHandle(udg_Hash, id, 4)
      call DestroyEffect(e)
      call ReleaseTimer(t)
      call FlushChildHashtable(udg_Hash, id)
      set e = null
    else
    if b == true then
      call SetUnitState(u, UNIT_STATE_LIFE, (GetUnitState(u, UNIT_STATE_LIFE) + r))
    elseif b == false then
      call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u, UNIT_STATE_MANA) + r))
    endif
    set i = (i - 1)
    call SaveInteger(udg_Hash, id, 2, i)
    endif
    set t = null
    set u = null
endfunction

function Start takes nothing returns boolean
    local unit u
    local timer t
    local real r
    local real r2
    local real r3
    local integer i
    local integer id
    local integer i2 = GetItemTypeId(GetManipulatedItem())
    local boolean b
    local effect e
    if i2 == PH1() or i2 == PH2() or i2 == PH3() or i2 == PH4() or i2 == PH5() or i2 == PM1() or i2 == PM2() or i2 == PM3() or i2 == PM4() or i2 == PM5() then
      set u = GetTriggerUnit()
      set t = NewTimer()
      set id = GetHandleId(t)
      set e = AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Rejuvenation\\RejuvenationTarget.mdl", u, RAP())
      if i2 == PH1() then
        set r = PR1()
        set i = GetHeroStr(u, true)
        set r2 = r + (PRS1() * i)
        set b = true
      elseif i2 == PH2() then
        set r = PR2()
        set i = GetHeroStr(u, true)
        set r2 = r + (PRS2() * i)
        set b = true
      elseif i2 == PH3() then
        set r = PR3()
        set i = GetHeroStr(u, true)
        set r2 = r + (PRS3() * i)
        set b = true
      elseif i2 == PH4() then
        set r = PR4()
        set i = GetHeroStr(u, true)
        set r2 = r + (PRS4() * i)
        set b = true
      elseif i2 == PH5() then
        set r = PR5()
        set i = GetHeroStr(u, true)
        set r2 = r + (PRS5() * i)
        set b = true
      elseif i2 == PM1() then
        set r = PR1()
        set i = GetHeroInt(u, true)
        set r2 = r + (PRS1() * i)
        set b = false
      elseif i2 == PM2() then
        set r = PR2()
        set i = GetHeroInt(u, true)
        set r2 = r + (PRS2() * i)
        set b = false
      elseif i2 == PM3() then
        set r = PR3()
        set i = GetHeroInt(u, true)
        set r2 = r + (PRS3() * i)
        set b = false
      elseif i2 == PM4() then
        set r = PR4()
        set i = GetHeroInt(u, true)
        set r2 = r + (PRS4() * i)
        set b = false
      elseif i2 == PM5() then
        set r = PR5()
        set i = GetHeroInt(u, true)
        set r2 = r + (PRS5() * i)
        set b = false
      endif
      set r3 = (r2 / PROT())
      call SaveReal(udg_Hash, id, 0, r3)
      call SaveUnitHandle(udg_Hash, id, 1, u)
      call SaveInteger(udg_Hash, id, 2, PROT())
      call SaveBoolean(udg_Hash, id, 3, b)
      call SaveEffectHandle(udg_Hash, id, 4, e)
      call TimerStart(t, 1., true, function Loop)
      set u = null
      set e = null
      set t = null
    endif
    return false
endfunction

function InitTrig_Potions takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_USE_ITEM )
    call TriggerAddCondition( t, Condition( function Start ) )
    set udg_Hash = InitHashtable()
    set t = null
endfunction
 
Level 4
Joined
Nov 24, 2010
Messages
62
rank4.gif
Dr.Boom

Gone from Hive
avatar147921_25.gif
Omg =.=
Are my idea too hard for you?
 
Level 8
Joined
Jul 3, 2011
Messages
251
Well Spartipilo that code looks absoloutely fine, it should be working. Double check your item IDs again to make sure they are definately correct, and that you are using the correct item in-game. Also, if you are using it on a normal unit try using it on a hero and see if that makes a difference. Make sure you created the globals required by TimerUtils. If you are saving specific values in the hashtable every here and there (e.g. 1 of 1, except not those particular numbers) its possible, but unlikely that that might be the cause of the problem, but you should and probably are using handleids.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
@Zaio: This is all the information. As you can see, everything is all right: codes, names, variables, etc.

The Timer Utils
JASS:
//*************************************************
//*
//*   TimerUtils (Jass Version)
//*   v1.3.2.0
//*   By Magtheridon96
//*
//*   Original version by Vexorian.
//*   All the functions have O(1) complexity.
//*
//*   API:
//*       - function NewTimer takes nothing returns timer
//*           - Returns a new timer from the stack
//*       - function ReleaseTimer takes timer t returns nothing
//*           - Throws a timer back into the stack
//*       - function SetTimerData takes timer t, integer value returns nothing
//*           - Attaches a value to a timer
//*       - function GetTimerData takes timer t returns integer
//*           - Returns the attached value
//*
//*************************************************

    function SetTimerData takes timer t, integer value returns nothing
        call SaveInteger(udg_TimerUtils_hash,GetHandleId(t),0,value)
    endfunction

    function GetTimerData takes timer t returns integer
        return LoadInteger(udg_TimerUtils_hash,GetHandleId(t),0)
    endfunction

    function NewTimer takes nothing returns timer
        if 0==udg_TimerUtils_int then
            return CreateTimer()
        endif
        set udg_TimerUtils_int = udg_TimerUtils_int - 1
        return udg_TimerUtils_timer[udg_TimerUtils_int]
    endfunction

    function ReleaseTimer takes timer t returns nothing
        call PauseTimer(t)
        set udg_TimerUtils_timer[udg_TimerUtils_int] = t
        set udg_TimerUtils_int = udg_TimerUtils_int + 1
    endfunction

    function InitTrig_TimerUtils takes nothing returns nothing
        set udg_TimerUtils_hash = InitHashtable()
    endfunction

The variables
attachment.php


The Potions IDs
attachment.php


The Original code i posted before
JASS:
//Potion stats system by Zaio for Spartipilo
//===============================================================
//======================== CONFIGURABLES ========================
//===============================================================

function PH1 takes nothing returns integer
    return 'I007' // Level 1 heal potion ID
endfunction

function PH2 takes nothing returns integer
    return 'I00B' // Level 2 heal potion ID
endfunction

function PH3 takes nothing returns integer
    return 'I008' // Level 3 heal potion ID
endfunction

function PH4 takes nothing returns integer
    return 'I009' // Level 4 heal potion ID
endfunction

function PH5 takes nothing returns integer
    return 'I00A' // Level 5 heal potion ID
endfunction

function PM1 takes nothing returns integer
    return 'I00C' // Level 1 mana potion ID
endfunction

function PM2 takes nothing returns integer
    return 'I00G' // Level 2 mana potion ID
endfunction

function PM3 takes nothing returns integer
    return 'I00E' // Level 3 mana potion ID
endfunction

function PM4 takes nothing returns integer
    return 'I00D' // Level 4 mana potion ID
endfunction

function PM5 takes nothing returns integer
    return 'I00F' // Level 5 mana potion ID
endfunction

function PR1 takes nothing returns real
    return 60.00 // Level 1 heal/mana
endfunction

function PR2 takes nothing returns real
    return 120.00 // Level 2 heal/mana
endfunction

function PR3 takes nothing returns real
    return 180.00 // Level 3 heal/mana
endfunction

function PR4 takes nothing returns real
    return 240.00 // Level 4 heal/mana
endfunction

function PR5 takes nothing returns real
    return 300.00 // Level 5 heal/mana
endfunction

function PRS1 takes nothing returns real
    return 0.8 // Percentage of stats heal/mana increment // 0.8 = 80%
endfunction

function PRS2 takes nothing returns real
    return 1.6 // Percentage of stats heal/mana increment // 1.6 = 160%
endfunction

function PRS3 takes nothing returns real
    return 2.4 // Percentage of stats heal/mana increment // 2.4 = 240%
endfunction

function PRS4 takes nothing returns real
    return 3.2 // Percentage of stats heal/mana increment // 3.2 = 320%
endfunction

function PRS5 takes nothing returns real
    return 4.0 // Percentage of stats heal/mana increment // 4.0 = 400%
endfunction

function PROT takes nothing returns integer
    return 10 // The time it will do the restore in (it will still do the full amount, but this value is the time it takes)
endfunction

function RAP takes nothing returns string
    return "chest" // attachment point for the rejuvenation sfx
endfunction

An obvious question: Do I have to create a Hashtable, and then set the TimerUtils_hash variable? :p because I didn't.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set TimerUtils_hash = (Last created hashtable)
      • Custom script: set udg_Hash = InitHashtable() <- This is the Hashtable I use for the quest.
Doesn't work anyway.
 

Attachments

  • Variables.jpg
    Variables.jpg
    9.1 KB · Views: 91
  • Potions.jpg
    Potions.jpg
    26 KB · Views: 97
Level 8
Joined
Jul 3, 2011
Messages
251
No you do not, it is declared within TimerUtils
JASS:
function InitTrig_TimerUtils takes nothing returns nothing
        set udg_TimerUtils_hash = InitHashtable()
    endfunction
I'm not entirely sure why you can't get it to work im afraid, it should be working as it seems from my point of view. However, the system works perfectly in the test map i sent so there has to be something you're doing wrong.

EDIT: Theese are the ITEMS ID you added right? Not the ability ID the items use, because otherwise that is the reason it is erroring. Also, are you using it on a non-hero unit?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
In your map the Heal Over Time works... but the hero having 46 str, the potion heals 10 x sec.ç

EDIT; Oh yeah, that's what it's supossed to heal xD

EDIT: Your system has this
JASS:
function InitTrig_Potions takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_USE_ITEM )
    call TriggerAddCondition( t, Condition( function Start ) )
    set udg_Hash = InitHashtable() // <------------
    set t = null
endfunction

but I already have on map init:
  • set udg_Hash = InitHashtable()
Could that cause a problem? (Shouldn't, I guess)
 
Level 8
Joined
Jul 3, 2011
Messages
251
That won't matter, you should remove one of them because they both init the hashtable at map start, but it won't cause the error, all its doing is starting the hashtable 2 times at the exact same time.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Shouldn't the formula be.. 'easier'? I can set the potion HP same than the potion level.

And use formula: (I don't know jass, but you'll know what I mean)

set Heal == ((60 x (GetPotionHp)) + ((0.8 x (GetPotionHp) x (GetRealStr(GetTriggerUnit))) / 10)

And heal that amount every 1 sec per 10 secs?

And make some kind of:

- GDD_Event becomes equal to 0.00
- GDD_Damaged Unit has buff A, or, B, or, C, or, D
- Stop Trigger?
 
Level 8
Joined
Jul 3, 2011
Messages
251
Using potion hp using a very good idea due to how units can damage items and leave leaks when they destroy them (unless you use Bribe's item cleanup)

Im afraid unless you're willing to send me the map, you're going to have to figure this one out on your own. I can not help you further unless i have all the details and can see how your map works.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Items are untargetable, and i'm using Bribes Item Cleanup :)

Having that formula makes it a lot easier for me (and the system) to customize than creating a variable for each potion, and else.

The thing is... your system is ok. It works in your map, should work in mine since it's the same thing. only changed 'h' for 'H'. Maybe
 
Level 8
Joined
Jul 3, 2011
Messages
251
The way i have done it will be the easiest way mate, you just need to copy what i have done in the code to add your own stuff, there is a pattern which you should see, which is easy to follow. The only other way i can do what you say is to use a loop, and even then you will have to alter a lot of other stuff.
 
Status
Not open for further replies.
Top