• 🏆 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!

How can I adapt this max hp (item life bonus) trigger to use Life Drain instead ?

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
This trigger seems to use an accumulative system, on which it adds the life bonus on each action until it fits the proposed "max hp", however I need a similar approach to use with life drain instead, can anyone help me?

  • Test Set Max Hp and Mana Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing test as A substring
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Set Max_Hp = 1000
          • Set Some_Unit = (Picked unit)
          • Trigger - Run Set Max Hp <gen> (ignoring conditions)
  • Set Max Hp
    • Events
    • Conditions
    • Actions
      • Set Max_Hp = (Max_Hp - (Integer((Max life of Some_Unit))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Max_Hp Greater than 0
        • Then - Actions
          • Set Loop_Integer = ((Max_Hp - (Max_Hp mod 100)) / 100)
          • For each (Integer A) from 1 to Loop_Integer, do (Actions)
            • Loop - Actions
              • Unit - Add Max Life Modifier to Some_Unit
              • Unit - Set level of Max Life Modifier for Some_Unit to 4
              • Unit - Remove Max Life Modifier from Some_Unit
          • Set Max_Hp = (Max_Hp mod 100)
          • Set Loop_Integer = ((Max_Hp - (Max_Hp mod 10)) / 10)
          • For each (Integer A) from 1 to Loop_Integer, do (Actions)
            • Loop - Actions
              • Unit - Add Max Life Modifier to Some_Unit
              • Unit - Set level of Max Life Modifier for Some_Unit to 3
              • Unit - Remove Max Life Modifier from Some_Unit
          • Set Max_Hp = (Max_Hp mod 10)
          • For each (Integer A) from 1 to Max_Hp, do (Actions)
            • Loop - Actions
              • Unit - Add Max Life Modifier to Some_Unit
              • Unit - Set level of Max Life Modifier for Some_Unit to 2
              • Unit - Remove Max Life Modifier from Some_Unit
        • Else - Actions
          • Set Max_Hp = (0 - Max_Hp)
          • Set Loop_Integer = ((Max_Hp - (Max_Hp mod 100)) / 100)
          • For each (Integer A) from 1 to Loop_Integer, do (Actions)
            • Loop - Actions
              • Unit - Add Max Life Modifier to Some_Unit
              • Unit - Set level of Max Life Modifier for Some_Unit to 7
              • Unit - Remove Max Life Modifier from Some_Unit
          • Set Max_Hp = (Max_Hp mod 100)
          • Set Loop_Integer = ((Max_Hp - (Max_Hp mod 10)) / 10)
          • For each (Integer A) from 1 to Loop_Integer, do (Actions)
            • Loop - Actions
              • Unit - Add Max Life Modifier to Some_Unit
              • Unit - Set level of Max Life Modifier for Some_Unit to 6
              • Unit - Remove Max Life Modifier from Some_Unit
          • Set Max_Hp = (Max_Hp mod 10)
          • For each (Integer A) from 1 to Max_Hp, do (Actions)
            • Loop - Actions
              • Unit - Add Max Life Modifier to Some_Unit
              • Unit - Set level of Max Life Modifier for Some_Unit to 5
              • Unit - Remove Max Life Modifier from Some_Unit
Just replacing the ability didn't work at all, as I think it needs to be set into variables for it is not cumulative like Max Life Modifier.

Thanks in advance for the help!
 
Level 11
Joined
Oct 9, 2015
Messages
721
I need to increase current hp over the maximum, but I need to detect how much current hp the unit have so I can set to a desired value with life drain, this ability (Max Life Modifier) has 7 levels on which modifies the number of the max hp increased
lvl 1 = 0
lvl 2 = -1
lvl 3 = -10
lvl 4 = -100
lvl 5 = 1
lvl 6 = 10
lvl 7 = 100
 
Status
Not open for further replies.
Top