# Mathematical Formula for Ability

Status
Not open for further replies.

#### HungryHusky

Level 11
Hi. Im trying to make a version of League of Legend's Olaf's Berserker Rage ability.
Berserker Rage increases his attack speed by 1% for each 1% health he is missing.

However, my ability has 5 levels, and does NOT need to be MUI.
Level 1: Increases attack speed by 1% for each 5% of health missing.
Level 2: Increases attack speed by 1% for each 4% of health missing.
Level 3: Increases attack speed by 1% for each 3% of health missing.
Level 4: Increases attack speed by 1% for each 2% of health missing.
Level 5: Increases attack speed by 1% for each 1% of health missing.

The unit has 2 abilities. The first ability that has 5 levels with tooltips etc. The other ability (dummy, not visible) has 101 levels and is based on the Item Attack Speed Bonus ability, with level 1 giving 0% attack speed, level 2 giving 1% attack speed, level 51 giving 50%, and level 101 giving 100%. You get the idea.
I do NOT need help with the events that triggers the effect, only the formula to adjust the level of the Item Attack Speed ability based on the unit's missing health.

My current formula is like this:
But it does not give logical results.

• BerserkerRageAbilityTrigger
• Actions
• Set TempRealA = ((((Max Life of "Unit") - (Life of "Unit")) / (Max life of "Unit")) x (0.20 x (Real((Level of "Olaf" - "Berserker Rage" for "Unit")))))
• Unit - Set level of "Olaf" - "Berserker Rage" (Attack Speed Bonus) for "Unit" to ((Integer(TempRealA)) + 1)

#### Xonok

Level 21
Attackspeed = Health percentage lost / (5/4/3/2/1)

So basically you make an ability with 101 levels. Each level giving 1% attackspeed more than previous and first giving 0%.

Health percentage lost = (1-Current health/max health) * 100 + 1

Attackspeed = percentage lost / (6-ability level)

I didn't write about how to make the trigger, as I assume you are experienced enough to make them yourself once you know the maths.

#### DD_legionTN

Level 11
(100-((CurrentHp / MaxHp) X 100)) - For calculate Unit's Current lost Hp percentage

(((6-AbilityLv) / 100) X MaxHp) - For calculate Unit's Ability Level Hp percentage

So will be (100-((CurrentHP / MaxHp) X 100)) / (((6-AbilityLv) / 100) X MaxHp)

Example a unit has 100 hp max with current hp 87, ability level with 2.

So will be (100-((87 / 100) X 100)) / (((6-2) / 100) X 100)
= 3.25
So attack speed bonus will add 3%

Last edited:

#### HungryHusky

Level 11
Attackspeed = Health percentage lost / (5/4/3/2/1)

So basically you make an ability with 101 levels. Each level giving 1% attackspeed more than previous and first giving 0%.

Health percentage lost = (1-Current health/max health) * 100 + 1

Attackspeed = percentage lost / (6-ability level)

I didn't write about how to make the trigger, as I assume you are experienced enough to make them yourself once you know the maths.

This seems to make sense. Did some testing and applied the formula to some instances and it gives correct results. Thanks, + rep

Status
Not open for further replies.

Replies
9
Views
755
[Trigger] Problem with skill
Replies
6
Views
610
Replies
1
Views
736
Replies
6
Views
902
Replies
6
Views
839