• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Changing hero skills midgame.

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
973
I want to have improved versions of my hero's skills, while he's in metamorphed state (his ultimate).
I made 2 versions of his skills, and I added the Engineering Upgrade, with the right values, but that only removed the base skills, and didn't re-add the improved ones.
How do I make this work? xP
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
So you want those improved version temporary (Metamorphed stats)?

Are you trying to replace basic skills by different ones using Engineering upgrade? If not, make you did the right stats of the spell E.g : HolyLight - HolyLight (Upgrade 1) - HolyLight (Upgrade 2)...etc.
 
Level 10
Joined
May 21, 2006
Messages
323
if these skills got 3 levels then you could simply make all these skills having 6 levels instead and then your hero does his metamorph you just add +3 levels to specific skills and after the metamorphosis he loses these 3 levels on the specific skills again. For example Manaburn

Mana Burn
1 = 50 damage
2 = 100 damage
3 = 150 damage

4 = 200 damage
5 = 250 damage
6 = 300 damage

Now he does metamorph and he has usually manaburn level 2, so you add +3 levels, Manaburn is then Level 5 and deals 250 damage. Even if the hero would gain a level and skills Manaburn +1 Level it would still work, the only problem is if he can select level 4-6 after a level up.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Ah, I figured it out :p
Metamorphosis was removing the ability.
after I added a call UnitMakeAbilityPermanent(GetTriggerUnit(), true, 'A036')
to the trigger - it started working properly :)

Just to be clear, are you saying that Metamorphosis was removing the Engineering Upgrade ability or the improved spells?
 

Ardenian

A

Ardenian

What about using Metamorphosis from Illidan ( Neutral Hostile), giving the alternate hero form the improved abilities and set the level of that ability to the ones from the previous form ? That would be one additional object data for units, but should work, in theory.
 
Level 13
Joined
Jan 2, 2016
Messages
973
I already have a system, that is working, so why bother change it? xP
JASS:
scope SpiritForm

    globals
        private unit array morphed
        private integer count = 0
    endglobals

    function SpiritFormRemove takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local integer i = LoadInteger(udg_Table, GetHandleId(t), 'indx')
        if GetUnitTypeId( morphed[i] ) == 'E00R' or IsUnitDeadBJ( morphed[i] ) then
            call UnitRemoveAbility( morphed[i], 'A036' )
            call UnitRemoveAbility( morphed[i], 'A037' )
            call RecTimer(t)
            set morphed[i] = null
        endif
        set t = null
    endfunction
    
    function Trig_Spirit_Form_Conditions takes nothing returns boolean
        local unit u
        local timer t
        local integer i
        if GetSpellAbilityId() == 'A034' then
            set u = GetTriggerUnit()
            set t = GetFreeTimer()
            set i = GetUnitAbilityLevel( u , 'A034' )
            set morphed[count] = u
            call SaveInteger(udg_Table, GetHandleId(t), 'indx', count)
            if count >= 20 then
                set count = 0
            else
                set count = count + 1
            endif
            call TimerStart( t , 0.25, true, function SpiritFormRemove )
            set t = null
            call UnitAddAbility( u, 'A036' )
            call UnitAddAbility( u, 'A037' )
            call SetUnitAbilityLevel( u , 'A037', i )
            call UnitMakeAbilityPermanent(u, true, 'A036')
            call UnitMakeAbilityPermanent(u, true, 'A037')
            set u = null
        endif
        return false
    endfunction

//===========================================================================
    function InitTrig_Spirit_Form takes nothing returns nothing
        set gg_trg_Spirit_Form = CreateTrigger(  )
        call TriggerRegisterAnyUnitEventBJ( gg_trg_Spirit_Form, EVENT_PLAYER_UNIT_SPELL_EFFECT )
        call TriggerAddCondition( gg_trg_Spirit_Form, Condition( function Trig_Spirit_Form_Conditions ) )
    endfunction

endscope
Don't fix what's working :D
 
Level 10
Joined
May 21, 2006
Messages
323
Yeah, I was thinking about that, but then I wouldn't be able to level any skills during the metamorphosis xP

You would be able to level them. Look your Mana Burn is level 2 then comes morphing and it goes up to 5, now your hero gets a level and you skill one more point on Mana Burn and it goes up to 6, now the metamorph stops and it goes down to 3.
 
Level 13
Joined
Jan 2, 2016
Messages
973
You would be able to level them. Look your Mana Burn is level 2 then comes morphing and it goes up to 5, now your hero gets a level and you skill one more point on Mana Burn and it goes up to 6, now the metamorph stops and it goes down to 3.

And what happens while I'm NOT morphed?
I'll still be able to level the skill to level 6, unless I give it max level 3.
And then when it gets to level 4 or above - I wouldn't be able to level it until the Metamorphosis is over.
 
Level 8
Joined
Jan 28, 2016
Messages
486
It was removing both. I was losing the skills I had learned so far, AND when I was re-learning them - they were their base versions (not the improved ones).
But it wasn't giving me back the spent skill points xP

I recreated what you did and got the exact same results! Or should that be problems! :p

And as you discovered, make the Upgrade permanent to fix it. Well done!!
 
Status
Not open for further replies.
Top