Would this be MUI? not sure how locals work...

afisakov

You can change this now in User CP.
Reaction score
37
The idea of this trigger is when you activate bankai (based off metamorph), one of your hero abilities "upgrades" temporarily to a stronger form. Thus I replace and replace back afterwards. The normal hero only has A0VA, the meta form only has A0VJ. Either should be able to up ability level and it would carry over in switch back.
Code:
function Trig_bankai_Conditions takes nothing returns boolean
    return (GetSpellAbilityId()=='A0VG')
endfunction
function Trig_bankai_Actions takes nothing returns nothing
    local integer bct=3+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    set udg_units01[bct]=GetTriggerUnit()
    call UnitAddAbility(udg_units01[bct],'A0VJ')
    call SetUnitAbilityLevel(udg_units01[bct],'A0VJ',GetUnitAbilityLevel(udg_units01[bct],'A0VA'))
    call UnitRemoveAbility(udg_units01[bct],'A0VA')
    call TriggerSleepAction(30.)
    call UnitAddAbility(udg_units01[bct],'A0VA')
    call SetUnitAbilityLevel(udg_units01[bct],'A0VA',GetUnitAbilityLevel(udg_units01[bct],'A0VJ'))
    call UnitRemoveAbility(udg_units01[bct],'A0VJ')
    set udg_units01[bct]=null
endfunction
ask if it is MUI because I heard people mention that locals stay inside the trigger, so hopefully if another player uses they would get a different bct, and only the correct hero would get abilities changed back. Not sure if this is really the case.

If it doesn't work MUI can you suggest how to fix?

Thank you
 

dracolich

TH.net Regular
Reaction score
15
add engineering upgrade with modifier of skill to morphed unit and remove it afterwards. it will keep level and cd without any code.
guess ur version is legit, but sleep is very bad
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
It can be MUI if the spell is instant (Without any timers/TriggerSleepActions).
It does not matter if you use globals in instant spells as Warcraft 3 runs on single thread.
So, replace the udg_units01[bct] with a local, then you are good to go.
 

afisakov

You can change this now in User CP.
Reaction score
37
add engineering upgrade with modifier of skill to morphed unit and remove it afterwards. it will keep level and cd without any code.
guess ur version is legit, but sleep is very bad
I tried to use engineering upgrade already. I had it assigned as a normal ability of the unit that get metamorphed into. It replaced fine during the transformation, but the ability went away upon changing back.
i.e. getsuga upgraded to getsuga2 properly, but once bankai ran out neither getsuga nor getsuga2 remained, but the skill points where still used up.
That is why I went with a trigger instead.
 
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