Hi, I am trying to make an ability that adds a hero stat bonus for a short duration.
Here is what I have so far:
There are two abilities" Feat of Strength +5 (unit ability), and Feat of Strength ("dummy" hero ability). The Hero ability is based on Berzerk (all data set to zero), when the hero activates the ability the FoS +5 ability, which is based off of the hero stat bonus, is added. The problem is that there are 6 levels for the hero ability and unit ability, so the max stat bonus is supposed to be +30. However, it stays at +5.
I currently have a more tedious trigger (that works as intended) that checks for the level of the Hero ability, and then adds a unique unit ability (ie +5, +10, +15 ...), but that requires 6 unit abilities and a more clumsy trigger. Is there a way to optimize this trigger? Any help would be appreciated.
Thanks
Here is what I have so far:
-
FOS 1 Copy
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Feat of Strength
-
Actions
- Custom script: local unit u = GetSpellAbilityUnit()
- Unit - Add Feat of Strength (+5 Stats) to (Casting unit)
- Unit - Set level of Feat of Strength (+5 Stats) for (Casting unit) to (Level of Feat of Strength for (Casting unit))
- Wait 20.00 seconds
- Custom script: set udg_unitVariable = u
- Unit - Remove Feat of Strength (+5 Stats from unitVariable
- Custom script: set u = null
-
Events
There are two abilities" Feat of Strength +5 (unit ability), and Feat of Strength ("dummy" hero ability). The Hero ability is based on Berzerk (all data set to zero), when the hero activates the ability the FoS +5 ability, which is based off of the hero stat bonus, is added. The problem is that there are 6 levels for the hero ability and unit ability, so the max stat bonus is supposed to be +30. However, it stays at +5.
I currently have a more tedious trigger (that works as intended) that checks for the level of the Hero ability, and then adds a unique unit ability (ie +5, +10, +15 ...), but that requires 6 unit abilities and a more clumsy trigger. Is there a way to optimize this trigger? Any help would be appreciated.
Thanks