[Spell] Make ability permanent

Level 15
Joined
Jul 19, 2007
Messages
855
How do I make an added ability with triggers permanent?
I want to add ability when this hero got the special buff and removed when the buff is gone.
  • Speed of the Wolf lvl1
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Grishnákh 0258 <gen> has buff Speed of the Wolf ) Equal to True
        • Then - Actions
          • Unit - Add Damage Bonus (Speed of the Wolf lvl1) to Grishnákh 0258 <gen>
        • Else - Actions
          • Unit - Remove Damage Bonus (Speed of the Wolf lvl1) from Grishnákh 0258 <gen>
 
Level 5
Joined
Jan 19, 2023
Messages
35
What gives the buff? It's best to detect whatever that is and add the ability then. After that you can either do a periodic check if buff is dropped, but something much shorter than a whole second. Or if there is no way to dispel the buff in your map you can just start a timer to remove the ability once the buff expires.
Can you give more info on what the buff and the ability are?
 
It is permanent until you do a morph or some weird spell interactions like Impale gets involved.

There's a function called MakeUnitAbilityPermanent (or something along that line) to make sure the spell sticks through transformation.

As for the trigger involved, it depends on your spell. Best describe what the spell does in detail (think of spell description).
 
Level 21
Joined
Mar 16, 2008
Messages
955
Maybe a better way to do this might just be make the ability have 2 ranks, then when they get the buff just increase the ability to rank 2. That way you don't need to worry about the whole permanent thing. Not sure if this applies to your map but just thought I would share the idea. Also might make it less intense and not need to run the trigger every 1 second?
 
Top