• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Bonus health every level problem...

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
579
:D

  • LVLup Demon Fighter
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Fighter
          • (Unit-type of (Triggering unit)) Equal to Demon Knight
    • Actions
      • Set Player_Number_int = (Player number of (Owner of (Triggering unit)))
      • -------- lvl 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_02[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 2
        • Then - Actions
          • Set DF_Bool_02[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
      • -------- lvl 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_03[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 3
        • Then - Actions
          • Set DF_Bool_03[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
      • -------- lvl 4 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_04[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 4
        • Then - Actions
          • Set DF_Bool_04[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
      • -------- lvl 5 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_05[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 5
        • Then - Actions
          • Set DF_Bool_05[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
      • -------- lvl 6 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_06[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 6
        • Then - Actions
          • Set DF_Bool_06[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This could work:

  • LVLup Demon Fighter
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Fighter
          • (Unit-type of (Triggering unit)) Equal to Demon Knight
    • Actions
      • Set Player_Number_int = (Player number of (Owner of (Triggering unit))) - 1
      • Set unit = Triggering unit
      • -------- ---- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool[Player_Number_int*74+level of unit] Equal to True
        • Then - Actions
          • Set DF_Bool[Player_Number_int*74+level of unit] = False
          • Unit - Add CON Demon Fighter +32 to unit
          • Unit - Increase level of CON Demon Fighter +32 for unit
          • Unit - Remove CON Demon Fighter +32 from unit
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to unit
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for unit
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from unit
        • Else - Actions

EDIT: I'm sorry, I edited your post accidentally instead of making a reply. Please post your trigger again.
 
Level 10
Joined
Mar 17, 2012
Messages
579
This could work:

  • LVLup Demon Fighter
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Fighter
          • (Unit-type of (Triggering unit)) Equal to Demon Knight
    • Actions
      • Set Player_Number_int = (Player number of (Owner of (Triggering unit))) - 1
      • Set unit = Triggering unit
      • -------- ---- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool[Player_Number_int*74+level of unit] Equal to True
        • Then - Actions
          • Set DF_Bool[Player_Number_int*74+level of unit] = False
          • Unit - Add CON Demon Fighter +32 to unit
          • Unit - Increase level of CON Demon Fighter +32 for unit
          • Unit - Remove CON Demon Fighter +32 from unit
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to unit
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for unit
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from unit
        • Else - Actions

EDIT: I'm sorry, I edited your post accidentally instead of making a reply. Please post your trigger again.

here you go:
  • LVLup Demon Fighter
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Fighter
          • (Unit-type of (Triggering unit)) Equal to Demon Knight
    • Actions
      • Set Player_Number_int = (Player number of (Owner of (Triggering unit)))
      • -------- lvl 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_02[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 2
        • Then - Actions
          • Set DF_Bool_02[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
      • -------- lvl 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DF_Bool_03[Player_Number_int] Equal to True
          • (Level of (Triggering unit)) Greater than or equal to 3
        • Then - Actions
          • Set DF_Bool_03[Player_Number_int] = False
          • Unit - Add CON Demon Fighter +32 to (Triggering unit)
          • Unit - Increase level of CON Demon Fighter +32 for (Triggering unit)
          • Unit - Remove CON Demon Fighter +32 from (Triggering unit)
          • Unit - Add MEN Demon/Elf/Undead Fighter +26 to (Triggering unit)
          • Unit - Increase level of MEN Demon/Elf/Undead Fighter +26 for (Triggering unit)
          • Unit - Remove MEN Demon/Elf/Undead Fighter +26 from (Triggering unit)
        • Else - Actions
...till 74-th level

You didn't point level check... or maybe I didn't notice that?

The problem is: when hero level 4 kills 19 level mob - he gains several levels at once, so I need a trigger that will give him life bonuses for every gained level...

Your trigger doesn't work correctly:
- if my hero kills low level mobs - he has 555 hp on 15-th level
- if my hero kills 2 high level mobs and gets 15-th level - he has 235 hp -_-
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240

  • Untitled Trigger 107
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set Hero = (Triggering unit)
      • Set i = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bonus[i] Equal to 0
        • Then - Actions
          • Set Bonus[i] = 1
        • Else - Actions
      • For each (Integer A) from 1 to ((Hero level of Hero) - Bonus[i]), do (Actions)
        • Loop - Actions
          • Unit - Add Max Life Gain to Hero
          • Unit - Set level of Max Life Gain for Hero to 2
          • Unit - Remove Max Life Gain from Hero
      • Set Bonus[i] = (Level of Hero)

The Bonus Equal to 0 is just to set it to 1 when the unit levels up the first time. You could set it to 1 at map initialization trigger.
 
Level 10
Joined
Mar 17, 2012
Messages
579

  • Untitled Trigger 107
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set Hero = (Triggering unit)
      • Set i = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bonus[i] Equal to 0
        • Then - Actions
          • Set Bonus[i] = 1
        • Else - Actions
      • For each (Integer A) from 1 to ((Hero level of Hero) - Bonus[i]), do (Actions)
        • Loop - Actions
          • Unit - Add Max Life Gain to Hero
          • Unit - Set level of Max Life Gain for Hero to 2
          • Unit - Remove Max Life Gain from Hero
      • Set Bonus[i] = (Level of Hero)

The Bonus Equal to 0 is just to set it to 1 when the unit levels up the first time. You could set it to 1 at map initialization trigger.


but then hero will recieve lvl 2 - +32 hp; lvl 3 - +64 hp; lvl 4 - +96... this formula is not right, hero have to get tha same +32 hp every level.
 
Status
Not open for further replies.
Top