Beware: The following needs some understanding of triggering overall and some maths
The trigger came from the following thoughts:
You can divive a number into the digits multuiplied with 10 power a number:
an Example: 3210 would be: 3*10
3+2*10
2+4*10
1+5*10
0
To reduce laggs by creating a mass of tomes, i used this.
So, you need the following to increase the HP:
N abilitys and N items (where N is a variable of your choise):
N abilitys: N times a changed version of the ability of the health tome (Permanent Life increasement (+50), each one with the values +1, +10, +100, +1000.... (depending on how high your numbers will be, for +5000, you will need to set N equal to 4, else you will create too many tomes. (like said above)
N items: Custom versions of the tomes, which inhibits the single abilitys and which will be added to the hero
Then you need 5 global variables:
-An Integervariable, which represents N (In the following, i named it "HPitemsamount")
-2 Integervariables, which is required for the Loop (I named it "Loopinteger" and "Loopinteger2", you can recycle it in other triggers theoretically)
-An Integervariable, which represents the amount of HP which should be added to the hero (I named it "Hpaddition")
-An Array of Itemtypevariable of the Arrayamount of N, representing the tomes which increases the health (I named it "HPItems", maybe with "Hpitemsamount" the only variables which cannot by recycled)
-A Unitvariable, which represents the unit, whose Hp should be increased (I named it "Changedunit")
The triggers are rather small:
The INI, to determinate the tomes:
-
HP Table
-
Events
-
Conditions
-
Actions
-
-------- Required Variables: HPitemsamount (In fact, the variable N); HPitems[1....N] (The items, which increased the hp) --------
-
Set HPitemsamount = 4
-
Set HPitems[1] = HP+1
-
Set HPitems[2] = HP+10
-
Set HPitems[3] = HP+100
-
Set HPitems[4] = HP+1000
The main trigger, in your triggers, you need just to set
ChangedUnit to the unit, whose HP should be increased and
Increasedamount to the amount of max HP which should be added and then just run this trigger, checking the conditions:
-
HP Addition
-
Events
-
Conditions
-
(Changedunit is alive) Equal True
-
HPaddition Greater than 0
-
Actions
-
-------- Required Variables: HPaddition (The amount you want to increase the max HP); ChangedUnit (The unit, whose Max Hp should be increased), Loopinteger and Loopinteger2 (For the Loop) --------
-
For each (Integer Loopinteger) from 1 to HPitemsamount, do (Actions)
-
Schleifen - Aktionen
-
-------- HP+(10 power N) Tomes: --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(HPaddition mod (Integer((Power(10.00, (Real(Loopinteger))))))) Greater than 0
-
((HPaddition mod (Integer((Power(10.00, (Real(Loopinteger))))))) / (Integer((Power(10.00, ((Real(Loopinteger)) - 1.00)))))) Greater than als 0
-
'THEN'-Actions
-
For each (Integer Loopinteger2) from 1 to ((HPaddition mod (Integer((Power((Real(Loopinteger)), 10.00))))) / (Integer((Power((Real((Loopinteger - 1))), 10.00))))), do (Actions)
-
Loop - Actions
-
Hero - Create HPitems[Loopinteger] and give it to Changedunit
-
'ELSE'-Actions
(Unfortunately, the power function just exists for Real variables in GUI
)