Request a Trigger

Level 35
Joined
Mar 6, 2006
Messages
9,244
Look at the item ability Item Permanent Life Gain.

Create three copies of it, one with +100, one with +10 and one with +1 for example.

Then create three different items (use manual of health as the base item), Manual of +100 health, +10 health and +1 health and give those abilites to them.

Then you can use this trigger:

  • Untitled Trigger 003
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Set Temp_Integer_1 = 153
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_Integer_1 = (Temp_Integer_1 - 100)
          • Hero - Create Manual of Health 100 and give it to (Triggering unit)
          • Item - Remove (Last created item)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer_1 Less than 100
            • Then - Actions
              • For each (Integer B) from 1 to 10, do (Actions)
                • Loop - Actions
                  • Set Temp_Integer_1 = (Temp_Integer_1 - 10)
                  • Hero - Create Manual of Health 10 and give it to (Triggering unit)
                  • Item - Remove (Last created item)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Temp_Integer_1 Less than 10
                    • Then - Actions
                      • For each (Integer loopA) from 1 to 10, do (Actions)
                        • Loop - Actions
                          • Set Temp_Integer_1 = (Temp_Integer_1 - 1)
                          • Hero - Create Manual of Health 1 and give it to (Triggering unit)
                          • Item - Remove (Last created item)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Temp_Integer_1 Equal to 0
                            • Then - Actions
                              • Skip remaining actions
                            • Else - Actions
                    • Else - Actions
            • Else - Actions
If it's temporary bonus, just save how many of each items you created for the hero.

Create three items with -100, -10 and -1 health bonuses. Click shift + Enter when setting negative values.

Then when the health should be lost, create three loops and give the unit the negative tomes.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Using items is a bad idea, they don't get removed after use and leak.

Instead use "+HP bug". The ability that permanently increases hero HP ("Item hero health bonus" or something like that) only modifies HP on add/remove, not when it changes level. So you can make such ability that adds +11 HP on first level, +1 on second and then add it (hero gets +11HP), set it to level 2 (no change) and remove it (hero loses 1 HP).
That way you can increase HP permanently (also works for the according mana bonus ability)
 
Level 10
Joined
Jan 17, 2009
Messages
790
What I want is like: When that hero somehow kills a unit in certain conditions, his health will increase by X, and it will happen more than 10 times.

I tried using tomes, but the tome ended up spawning at the hero's legs. Any ideas?
 
Top