• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] I want to change heal amount in Inner Vitality ability.

Level 15
Joined
Jul 19, 2007
Messages
857
I have an ability in my map that is working like Huskar's "Inner Vitality" ability in dota but I want to change the healing amount it does but I don't really get how because it seems messed up in the triggers and math is also not my strongest side. Can anyone please explain how this calculation in the jass-triggers works?
heallvls.png
jass.png
 
The way it calculates is as following:
1. Check if life/max_life is below 0.4 or above 0.4
2. If above, then block runs [Math 1]
3. If below, else block runs [Math 2]

[Math 1]
R = ability level/4*0.2*attribute + 2*level
Translate to description:
Level 1: 1/4*0.2*attribute + 2*1 = 0.25*0.2*attribute + 2 = 0.05*attribute + 2
Level 2: 2/4*0.2*attribute + 2*2 = 0.5*0.2*attribute + 4 = 0.10*attribute + 4

[Math 2]
Works exactly like math 1, but the times 3 the original (0.2 changed into 0.6). So, for level 1 it is 0.05*3*attribute + 2 = 0.15*attribute + 2 and so on.

If you want to simplify the math for the current values, I recommend the following:
For then block: I2R(d.lvl)*0.05*stat + 2*d.lvl
For else block: I2R(d.lvl)*0.15*stat + 2*d.lvl

(I personally think I2R is not needed either, but just to be safe)

Easier to read for you that way.
 
Level 15
Joined
Jul 19, 2007
Messages
857
The way it calculates is as following:
1. Check if life/max_life is below 0.4 or above 0.4
2. If above, then block runs [Math 1]
3. If below, else block runs [Math 2]

[Math 1]
R = ability level/4*0.2*attribute + 2*level
Translate to description:
Level 1: 1/4*0.2*attribute + 2*1 = 0.25*0.2*attribute + 2 = 0.05*attribute + 2
Level 2: 2/4*0.2*attribute + 2*2 = 0.5*0.2*attribute + 4 = 0.10*attribute + 4

[Math 2]
Works exactly like math 1, but the times 3 the original (0.2 changed into 0.6). So, for level 1 it is 0.05*3*attribute + 2 = 0.15*attribute + 2 and so on.

If you want to simplify the math for the current values, I recommend the following:
For then block: I2R(d.lvl)*0.05*stat + 2*d.lvl
For else block: I2R(d.lvl)*0.15*stat + 2*d.lvl

(I personally think I2R is not needed either, but just to be safe)

Easier to read for you that way.
Thank you! I used Math 2 and it seems to be working perfect now :thumbs_up:
 
Top