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

[Trigger] How do i create a passive that increase damage with each attack

Status
Not open for further replies.
Level 28
Joined
Feb 18, 2014
Messages
3,578
Not sure I understand what you mean but you can try this :
  • Test
    • Events
      • Unit - Archimonde 0001 <gen> Takes Damage
    • Conditions
      • (Damage source) Equal to Paladin 0000 <gen>
    • Actions
      • Set Stack = (Stack + 1)
      • Unit - Set level of BONUS DAMAGE for (Damage source) to Stack
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Stack Equal to 8
        • Then - Actions
          • Set Stack = 0
        • Else - Actions
Don't use a unit takes damage use a DDS like Chaosy said.
 
Level 8
Joined
Jul 10, 2018
Messages
383
Not sure I understand what you mean but you can try this :
  • Test
    • Events
      • Unit - Archimonde 0001 <gen> Takes Damage
    • Conditions
      • (Damage source) Equal to Paladin 0000 <gen>
    • Actions
      • Set Stack = (Stack + 1)
      • Unit - Set level of BONUS DAMAGE for (Damage source) to Stack
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Stack Equal to 8
        • Then - Actions
          • Set Stack = 0
        • Else - Actions
Don't use a unit takes damage use a DDS like Chaosy said.
Not quite good with DDS can you tell me what i have to do with it? :D and what do you mean use A DDS instead of unit takes damage
 
Not sure I understand what you mean but you can try this :
  • Test
    • Events
      • Unit - Archimonde 0001 <gen> Takes Damage
    • Conditions
      • (Damage source) Equal to Paladin 0000 <gen>
    • Actions
      • Set Stack = (Stack + 1)
      • Unit - Set level of BONUS DAMAGE for (Damage source) to Stack
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Stack Equal to 8
        • Then - Actions
          • Set Stack = 0
        • Else - Actions
Don't use a unit takes damage use a DDS like Chaosy said.

Wouldn't it be better to just keep the stack at maximum instead of resetting the stack count?

Not quite good with DDS can you tell me what i have to do with it? :D and what do you mean use A DDS instead of unit takes damage

DDS means Damage Detection System. For GUI users, this is preferred over a simple specific unit takes damage event, since DDS usually automate the process (of event registration) for you.
 
Level 8
Joined
Jul 10, 2018
Messages
383
Wouldn't it be better to just keep the stack at maximum instead of resetting the stack count?



DDS means Damage Detection System. For GUI users, this is preferred over a simple specific unit takes damage event, since DDS usually automate the process (of event registration) for you.
I opened the DDS Thread can't seem to understand the basics.
 
Level 28
Joined
Feb 18, 2014
Messages
3,578
Not quite good with DDS can you tell me what i have to do with it? :D and what do you mean use A DDS instead of unit takes damage
Damage Detection System such as this one : Damage Engine 5.5.0.0
  • Test
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource) Equal to Some Unit
    • Actions
Wouldn't it be better to just keep the stack at maximum instead of resetting the stack count?
The OP said he wants the passive to stack up to 8 times and then it will reset to 0, unless I misunderstood something...
 
Damage Detection System such as this one : Damage Engine 5.5.0.0
  • Test
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource) Equal to Some Unit
    • Actions
The OP said he wants the passive to stack up to 8 times and then it will reset to 0, unless I misunderstood something...

I don't think GER (reset to 0) was mentioned. Anyway, it's up to OP to clear that up if needed.
 
Level 8
Joined
Jul 10, 2018
Messages
383
Damage Detection System such as this one : Damage Engine 5.5.0.0
  • Test
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource) Equal to Some Unit
    • Actions
The OP said he wants the passive to stack up to 8 times and then it will reset to 0, unless I misunderstood something...
yes i want it to stack to 8 and stay there how is that possible? until the unit is dead
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Each attack will have bonus damage. On the first attack it adds a small bonus, on second even more, third even more, etc.
So if your hero deals 50 damage without the ability, when he gets this ability he will do:
50 + damage bonus ---> 1st attack,
50 + damage bonus*2 ---> 2nd attack,
50 + damage bonus*3 ---> 3rd attack.
etc.
Well, I just forgot that ability has no limit on bonus damage...so there's actually no way to stop it at 8th stack.
 
Level 8
Joined
Jul 10, 2018
Messages
383
Each attack will have bonus damage. On the first attack it adds a small bonus, on second even more, third even more, etc.
So if your hero deals 50 damage without the ability, when he gets this ability he will do:
50 + damage bonus ---> 1st attack,
50 + damage bonus*2 ---> 2nd attack,
50 + damage bonus*3 ---> 3rd attack.
etc.
Well, I just forgot that ability has no limit on bonus damage...so there's actually no way to stop it at 8th stack.
no way to stop? so what then?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
Pretty sure he just wants something like Troll Warlord's Fervor in dota, but instead of attack speed it's attack damage.

Each attack on the same target adds a stack for X seconds (or forever?). Each stack adds damage.

Switching targets sets the stacks to 0 and removes the bonus damage.

Correct?
 
Level 14
Joined
Feb 7, 2020
Messages
386
You sure do post a lot, Veldris :) You should try searching and experimenting, would help build your skillset.

I currently have an ability in my project that does this. It increases attack damage by 10%, up to a maximum of 100%. Resets on target switch or if 3.0 sec elapses without refreshing. Uses Bribe's damage engine and timer utils (event = udg_DamageEventModifier) but you could reference the code for rebuilding in GUI:

Lua:
furbolgFrenzyHits = 0
furbolgFrenzyTarget = 0
furbolgFrenzyTimer = NewTimer()
furbolgFrenzyBonusDmg = 0
furbolgFrenzyBonusMultiplier = 0.10

local Furbolg_Frenzy_f = function()

    furbolgFrenzyHits = furbolgFrenzyHits + 1
    ReleaseTimer(furbolgFrenzyTimer)
    furbolgFrenzyTimer = NewTimer()
    TimerStart(furbolgFrenzyTimer,3.0,false,function()
        furbolgFrenzyTarget = 0
        furbolgFrenzyHits = 0
        furbolgFrenzyBonusDmg = 0
        ReleaseTimer()
    end)

    -- additional hits checking stored target:
    if (furbolgFrenzyHits > 1 and furbolgFrenzyTarget == udg_DamageEventTarget) then
        -- only allow up to 100% bonus damage:
        if (furbolgFrenzyBonusDmg < 1.0) then
            -- starts on 2nd attack, so subtract first (furbolgFrenzyBonusMultiplier):
            furbolgFrenzyBonusDmg = furbolgFrenzyHits*furbolgFrenzyBonusMultiplier - furbolgFrenzyBonusMultiplier
        end
        UnitDamageTargetBJ(udg_DamageEventSource,udg_DamageEventTarget,udg_DamageEventAmount*furbolgFrenzyBonusDmg,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
    -- if first hit, start timer and set target:
    else
        furbolgFrenzyTarget = udg_DamageEventTarget
        furbolgFrenzyHits = 1
        furbolgFrenzyBonusDmg = 0
    end
end
 
Level 8
Joined
Jul 10, 2018
Messages
383
You sure do post a lot, Veldris :) You should try searching and experimenting, would help build your skillset.

I currently have an ability in my project that does this. It increases attack damage by 10%, up to a maximum of 100%. Resets on target switch or if 3.0 sec elapses without refreshing. Uses Bribe's damage engine and timer utils (event = udg_DamageEventModifier) but you could reference the code for rebuilding in GUI:

Lua:
furbolgFrenzyHits = 0
furbolgFrenzyTarget = 0
furbolgFrenzyTimer = NewTimer()
furbolgFrenzyBonusDmg = 0
furbolgFrenzyBonusMultiplier = 0.10

local Furbolg_Frenzy_f = function()

    furbolgFrenzyHits = furbolgFrenzyHits + 1
    ReleaseTimer(furbolgFrenzyTimer)
    furbolgFrenzyTimer = NewTimer()
    TimerStart(furbolgFrenzyTimer,3.0,false,function()
        furbolgFrenzyTarget = 0
        furbolgFrenzyHits = 0
        furbolgFrenzyBonusDmg = 0
        ReleaseTimer()
    end)

    -- additional hits checking stored target:
    if (furbolgFrenzyHits > 1 and furbolgFrenzyTarget == udg_DamageEventTarget) then
        -- only allow up to 100% bonus damage:
        if (furbolgFrenzyBonusDmg < 1.0) then
            -- starts on 2nd attack, so subtract first (furbolgFrenzyBonusMultiplier):
            furbolgFrenzyBonusDmg = furbolgFrenzyHits*furbolgFrenzyBonusMultiplier - furbolgFrenzyBonusMultiplier
        end
        UnitDamageTargetBJ(udg_DamageEventSource,udg_DamageEventTarget,udg_DamageEventAmount*furbolgFrenzyBonusDmg,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
    -- if first hit, start timer and set target:
    else
        furbolgFrenzyTarget = udg_DamageEventTarget
        furbolgFrenzyHits = 1
        furbolgFrenzyBonusDmg = 0
    end
end
yeah... i don't know jass or lua :D
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
Here you go. It's not MUI, so it's designed to work for ONE unit and one unit only. You'll need to adjust the variables in the Stacking Damage Setup trigger, it has instructions. You also need to copy and paste the Stacking Attack Damage ability to your map.

You'll have to adjust the system if your unit with the stacking damage ability isn't pre-placed on the map. That's because I set StackHero in the Setup trigger and it requires you to choose a Unit on the map. I also add the StackAttackAbility to the pre-placed unit as well. Note that you can add the StackAttackAbility ability to the unit in the Object Editor instead of adding it with triggers.

  • Stacking Damage Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setup Hero/Ability --------
      • Set VariableSet StackLearnAbility = Stacking Damage
      • Set VariableSet StackAttackAbility = Stacking Attack Damage
      • Set VariableSet StackHero = Paladin 0000 <gen>
      • Unit - Add StackAttackAbility to StackHero
      • -------- --------
      • -------- The duration of the stacks. Increases per level. --------
      • Set VariableSet MaxDuration[1] = 5.00
      • Set VariableSet MaxDuration[2] = 6.00
      • Set VariableSet MaxDuration[3] = 7.00
      • -------- --------
      • -------- How many stacks you can get. --------
      • Set VariableSet MaxStacks[1] = 8
      • Set VariableSet MaxStacks[2] = 8
      • Set VariableSet MaxStacks[3] = 8
      • -------- --------
      • -------- How much damage each stack adds. Increases per level. --------
      • Set VariableSet StackDamage[1] = 1
      • Set VariableSet StackDamage[2] = 2
      • Set VariableSet StackDamage[3] = 3
  • Stacking Damage Event
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of StackLearnAbility for DamageEventSource) Greater than 0
    • Actions
      • Set VariableSet Level = (Level of StackLearnAbility for DamageEventSource)
      • -------- --------
      • -------- Reset Stacks --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StackTarget Not equal to DamageEventTarget
        • Then - Actions
          • Set VariableSet Stacks = 0
        • Else - Actions
      • Set VariableSet StackTarget = DamageEventTarget
      • -------- --------
      • -------- Increase Stacks --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Stacks Less than MaxStacks[Level]
        • Then - Actions
          • Set VariableSet Stacks = (Stacks + 1)
        • Else - Actions
      • -------- --------
      • -------- Change the Attack Bonus of the ability to increase our unit's Attack Damage. --------
      • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: StackAttackAbility)'s Integer Level Field: Attack Bonus ('Iatt') of Level: 0 to (Stacks x StackDamage[Level])
      • -------- --------
      • -------- The Ability Field is currently buggy so we need to increase then decrease the ability level in order for the damage to update. --------
      • Unit - Set level of StackAttackAbility for DamageEventSource to 2
      • Unit - Set level of StackAttackAbility for DamageEventSource to 1
      • Countdown Timer - Start StackTimer as a One-shot timer that will expire in MaxDuration[Level] seconds
  • Stacking Damage Timer
    • Events
      • Time - StackTimer expires
    • Conditions
    • Actions
      • Set VariableSet Stacks = 0
      • -------- Change the Attack Bonus of the ability to increase our unit's Attack Damage. --------
      • Ability - Set Ability: (Unit: DamageEventSource's Ability with Ability Code: StackAttackAbility)'s Integer Level Field: Attack Bonus ('Iatt') of Level: 0 to 0
      • -------- --------
      • -------- The Ability Field is currently buggy so we need to increase then decrease the ability level in order for the damage to update. --------
      • Unit - Set level of StackAttackAbility for DamageEventSource to 2
      • Unit - Set level of StackAttackAbility for DamageEventSource to 1
 

Attachments

  • Stacking Damage.w3m
    47.6 KB · Views: 18
Last edited:
Status
Not open for further replies.
Top