So I have this spell based on immolation and if their life is above 50% they are stronger and in under 50% they get regeneration bonuses.
So it works well and good for giving them the bonuses, but the problem is that setting the upgrade level to 0 via triggers doesn't unlearn the upgrade.
Anyone know how to unlearn/nulify an upgrade or have another idea of how to do this spell without using dummy units to cast buffs every second?
Code:
Mana Empowered Group
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Mana Empowerment
Actions
Game - Display to (All players) the text: added to group
Unit Group - Add (Triggering unit) to ManaEmpowered
Code:
Mana Empowerment
Events
Time - Every 1.00 seconds of game time
Conditions
(Number of units in ManaEmpowered) Greater than 0
Actions
Unit Group - Pick every unit in ManaEmpowered and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Mana Empowerment ) Equal to False
Then - Actions
Game - Display to (All players) the text: not in group
Player - Set the current research level of Mana Empowerment Offensive to 0 for (Owner of (Picked unit))
Player - Set the current research level of Mana Empowerment Defense to 0 for (Owner of (Picked unit))
Unit Group - Remove (Picked unit) from ManaEmpowered
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Picked unit)) Greater than or equal to 50.00
Then - Actions
Game - Display to (All players) the text: offensive buff
Player - Set the current research level of Mana Empowerment Offensive to (Level of Mana Empowerment for (Picked unit)) for (Owner of (Picked unit))
Player - Set the current research level of Mana Empowerment Defense to 0 for (Owner of (Picked unit))
Else - Actions
Game - Display to (All players) the text: defensive buff
Player - Set the current research level of Mana Empowerment Defense to (Level of Mana Empowerment for (Picked unit)) for (Owner of (Picked unit))
Player - Set the current research level of Mana Empowerment Offensive to 0 for (Owner of (Picked unit))
So it works well and good for giving them the bonuses, but the problem is that setting the upgrade level to 0 via triggers doesn't unlearn the upgrade.
Anyone know how to unlearn/nulify an upgrade or have another idea of how to do this spell without using dummy units to cast buffs every second?