• 🏆 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] How to stacking lifesteal with melee attack and spell attack.

Status
Not open for further replies.
Level 6
Joined
Aug 14, 2016
Messages
174
  • DrainLife
    • Events
      • Game - GDD_Event becomes Equal to 1.00
    • Conditions
      • (GDD_DamagedUnit is A structure) Equal to False
      • (GDD_DamagedUnit is Mechanical) Equal to False
      • (Sweeping Blade Loop <gen> is on) Equal to False
      • (Last Breath Loop <gen> is on) Equal to False
      • (ShieldLoop <gen> is on) Equal to False
      • (Damage Block Event <gen> is queued) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamageSource has an item of type Bloodthirster) Equal to True
        • Then - Actions
          • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (GDD_Damage x 0.20))
        • Else - Actions
Anyone know how to stacking lifesteal, like.
Blade of the ruined king +12% lifesteal + Bloodthirster + 20% lifesteal = 32% lifesteal from spell attack and normal attack.
 
Level 9
Joined
Apr 23, 2011
Messages
527
If a unit has a specific item, add a certain amount (the lifesteal %) to a real variable. You will use this real variable to multiply the damage amount. It would probably be better to set the values in map initialization if you have a lot of lifesteal items.
  • Set itemtype[1] = The Bloodthirster
  • Set itemtype[2] = Blade of the Ruined King
  • Set itemtype[3] = Doran's Blade
  • Set lifestealitem[1] = 0.20
  • Set lifestealitem[2] = 0.12
  • Set lifestealitem[3] = 0.03
Replace the actions in your trigger with this (change the maximum loop variable to the maximum amount of lifesteal items as set in initialization):
  • Set lifesteal = 0.00
  • For (integer loop) from 1 to 3, do (Actions)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • GDD_DamageSource has an item of type itemtype[loop]
      • Then - Actions
        • Set lifesteal = (lifesteal + lifestealitem[loop])
      • Else - Actions
  • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (GDD_Damage x lifesteal))
 
Level 6
Joined
Aug 14, 2016
Messages
174
If a unit has a specific item, add a certain amount (the lifesteal %) to a real variable. You will use this real variable to multiply the damage amount. It would probably be better to set the values in map initialization if you have a lot of lifesteal items.
  • Set itemtype[1] = The Bloodthirster
  • Set itemtype[2] = Blade of the Ruined King
  • Set itemtype[3] = Doran's Blade
  • Set lifestealitem[1] = 0.20
  • Set lifestealitem[2] = 0.12
  • Set lifestealitem[3] = 0.03
Replace the actions in your trigger with this (change the maximum loop variable to the maximum amount of lifesteal items as set in initialization):
  • Set lifesteal = 0.00
  • For (integer loop) from 1 to 3, do (Actions)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • GDD_DamageSource has an item of type itemtype[loop]
      • Then - Actions
        • Set lifesteal = (lifesteal + lifestealitem[loop])
      • Else - Actions
  • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (GDD_Damage x lifesteal))
Tks, Case closed.
 
Last edited:
Level 6
Joined
Aug 14, 2016
Messages
174
Edit:Oh wait, not case closed, i just tested, i just using 4 blade of runined king and 1 doran blade, 51% lifesteal, but lifesteal so weak,
I has 700 damage, but drain life just got 15%, because it effect only one items(Doran blade and Blade of ruined kings) ._.
  • unit enters combat Copy
    • Events
      • Game - GDD_Event becomes Equal to 1.00
    • Conditions
      • (GDD_DamagedUnit is A structure) Equal to False
      • (GDD_DamagedUnit is Mechanical) Equal to False
      • (Sweeping Blade Loop <gen> is on) Equal to False
      • (Last Breath Loop <gen> is on) Equal to False
      • (ShieldLoop <gen> is on) Equal to False
      • (Damage Block Event <gen> is on) Equal to False
    • Actions
      • Set Lifesteal = 0.00
      • For each (Integer loop) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (GDD_DamageSource has an item of type Itemtypedrain[loop]) Equal to True
            • Then - Actions
              • Set Lifesteal = (Lifesteal + (Lifesteal + lifestealitems[loop]))
              • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (GDD_Damage x Lifesteal))
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamageSource has an item of type Blade of the Ruined King) Equal to True
          • (Sweeping Blade Loop <gen> is on) Equal to False
          • (Last Breath Loop <gen> is on) Equal to False
          • (ShieldLoop <gen> is on) Equal to False
          • (Damage Block Event <gen> is on) Equal to False
        • Then - Actions
          • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing ((Max life of GDD_DamagedUnit) x 0.08) damage of attack type Normal and damage type Normal
        • Else - Actions
  • Lifesteal System
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Itemtypedrain[1] = Doran Blade
      • Set Itemtypedrain[2] = Blade of the Ruined King
      • Set lifestealitems[1] = 0.03
      • Set lifestealitems[2] = 0.12
  • For each (Integer loop) from 1 to 2, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (STCaster[STLoop] has an item of type Itemtypedrain[loop]) Equal to True
        • Then - Actions
          • Set Lifesteal = (Lifesteal + (Lifesteal + lifestealitems[loop]))
        • Else - Actions
  • Unit - Set life of STCaster[STLoop] to ((Life of STCaster[STLoop]) + (STDamage[STLoop] x Lifesteal))
 
Level 9
Joined
Apr 23, 2011
Messages
527
The system I posted only checks if a unit has an item-type with lifesteal, not the quantity. It works if the lifesteal for each item does not stack (i.e. 4 BotRKs), but if they do, it's pretty tricky to track them.

Probably the simplest way I can think of for a MUI check is a system that indexes units when they acquire/remove a lifesteal item, adding/removing a specific lifesteal value for that specific unit, which is applied whenever the unit deals damage.
 
Level 6
Joined
Aug 14, 2016
Messages
174
The system I posted only checks if a unit has an item-type with lifesteal, not the quantity. It works if the lifesteal for each item does not stack (i.e. 4 BotRKs), but if they do, it's pretty tricky to track them.

Probably the simplest way I can think of for a MUI check is a system that indexes units when they acquire/remove a lifesteal item, adding/removing a specific lifesteal value for that specific unit, which is applied whenever the unit deals damage.
Ok, thanks anyway, you try :)
 
Level 9
Joined
Apr 23, 2011
Messages
527
Can you making a trigger lifesteal stacking, because i need those lifesteal stacking to working my project map Yasuo :)

  • Set lifesteal = 0.00
  • For each (Integer loop) from 1 to 6, do (Actions)
    • Loop - Actions
      • For each (Integer lifestealloop) from 1 to maxlifestealitem, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item carried by GDD_DamageSource in slot loop) Equal to itemtype[lifestealloop]
            • Then - Actions
              • Set lifesteal = (lifesteal + lifestealitem)
            • Else - Actions
  • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (GDD_Damage x lifesteal))
 
Level 6
Joined
Aug 14, 2016
Messages
174
  • Set lifesteal = 0.00
  • For each (Integer loop) from 1 to 6, do (Actions)
    • Loop - Actions
      • For each (Integer lifestealloop) from 1 to maxlifestealitem, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item carried by GDD_DamageSource in slot loop) Equal to itemtype[lifestealloop]
            • Then - Actions
              • Set lifesteal = (lifesteal + lifestealitem)
            • Else - Actions
  • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (GDD_Damage x lifesteal))
That better previous version, i will tested, thanks you :).
 
Status
Not open for further replies.
Top