Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Melee Initialization

Events


Unit - A unit Gains a level

Conditions

Actions


Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 50.00)
Melee Initialization

Events


Unit - A unit Gains a level

Conditions

Actions


Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (0.10 x (Max life of (Triggering unit))))%
Are you talking about the "default" HP/MP "healed" by Warcraft III Games when your Hero levels up ?
What do you meant by this ?but the tricky part is to detect every strength bonus
What you really meant was;
400/1000
Hero levels up
400/1051
Is this what you meant ?
To retain the HP ?
My heroes don't have integers (whole numbers) as Strength per level. For example, if your strength per level is 1.5, it will alternate between gaining 1 str and 2 str.What do you meant by this ?
The Strength per level, and X bonus HP per Strength are all set in Gameplay Constants, so there would be no problem as you define them yourselves, you have the power.
Why the need of periodic trigger by the way ?
Untitled Trigger 029

Events


Map initialization

Conditions

Actions


Hashtable - Create a hashtable


Set hash = (Last created hashtable)


-------- -------------------- --------


-------- HP per STR --------


-------- -------------------- --------


Custom script: call SaveReal(udg_hash, StringHash("STRHP"), 0, 25)


-------- -------------------- --------


-------- STR per level for Paladin (Hpal) --------


-------- -------------------- --------


Custom script: call SaveReal(udg_hash, 'Hpal', 0, 2.7)


-------- -------------------- --------
Untitled Trigger 016

Events


Unit - A unit Gains a level

Conditions

Actions


Set u = (Triggering unit)


Custom script: set udg_r1 = LoadReal(udg_hash, GetUnitTypeId(udg_u), 0)


Custom script: set udg_r2 = LoadReal(udg_hash, StringHash("STRHP"), 0)


Set r3 = (Real(((Hero level of u) - 1)))


Set r3 = (Real(((Integer((r3 x r1))) - (Integer(((r3 - 1.00) x r1))))))


Set r3 = (r3 x r2)


Unit - Set life of u to (((Max life of u) x ((Life of u) - r3)) / ((Max life of u) - r3))
Events

Map initialization
Actions

Hashtable - Create a hashtable

Set H = (Last created hashtable)

Custom script: call SaveReal(udg_H, StringHash("STRHP"), 0, 4)

Custom script: call SaveReal(udg_H, StringHash("INTMP"), 1, 8)

Custom script: call SaveReal(udg_H, 'O002', 0, 0.6)

Custom script: call SaveReal(udg_H, 'O002', 1, 0.65)
HeroHP fix

Events


Unit - A unit Gains a level

Conditions

Actions


Set U[1] = (Triggering unit)


-------- LIFE --------


Custom script: set udg_R[1] = LoadReal(udg_H, GetUnitTypeId(udg_U[1]), 0)


Custom script: set udg_R[2] = LoadReal(udg_H, StringHash("STRHP"), 0)


Set R[3] = (Real(((Hero level of U[1]) - 1)))


Set R[3] = (Real(((Integer((R[3] x R[1]))) - (Integer(((R[3] - 1.00) x R[1]))))))


Set R[3] = (R[2] x R[3])


Unit - Set life of U[1] to (((Max life of U[1]) x ((Life of U[1]) - R[3])) / ((Max life of U[1]) - R[3]))


-------- MANA --------


Custom script: set udg_R[1] = LoadReal(udg_H, GetUnitTypeId(udg_U[1]), 1)


Custom script: set udg_R[2] = LoadReal(udg_H, StringHash("INTMP"), 1)


Set R[3] = (Real(((Hero level of U[1]) - 1)))


Set R[3] = (Real(((Integer((R[3] x R[1]))) - (Integer(((R[3] - 1.00) x R[1]))))))


Set R[3] = (R[2] x R[3])


Custom script: call SetUnitManaBJ( udg_U[1], ( ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, udg_U[1]) * ( GetUnitStateSwap(UNIT_STATE_MANA, udg_U[1]) - udg_R[3] ) ) / ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, udg_U[1]) - udg_R[3] ) ) )