• 🏆 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 unit damage increase

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a spellbook, make it unit ability. Disable the spellbook for all players.

Craete custom Trueshot Aura (Night Elf hero ability). Make it affect melee damage also, and make it unit ability, and set targets to self only. Give it more levels, each level increasing the damage. Add it to your spellbook.

When the unit kills some other unit, increase the level of the custom Trueshot Aura.

  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 16, do (Actions)
        • Loop - Actions
          • Player - Disable Spell Book Trueshot Aura for (Player((Integer A)))
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Spell Book Trueshot Aura for (Killing unit)) Less than 1
        • Then - Actions
          • Unit - Add Spell Book Trueshot Aura to (Killing unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Trueshot Aura custom for (Killing unit)) Less than 3 // this is the max level of the ability
            • Then - Actions
              • Unit - Increase level of Trueshot Aura custom for (Killing unit)
            • Else - Actions
 
  • Like
Reactions: Kam
Level 4
Joined
Jan 27, 2010
Messages
133
Permanently, btw.

Nah. If you want to apply a bonus which updates when the hero levels up (gets more damage), you'll need trueshot/command aura (which leave a buff). You also need to create as many levels of it as you want upgrades. If you want the hero to be able to get 250% damage gain, you'll need 250%/5% = 50 levels.

Much more elegant is permanently adding a flat bonus to damage. There's an item ability which works just like tomes, called Item Permanent Damage Gain. (It's under Abilities -> Special -> Items)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Nah. If you want to apply a bonus which updates when the hero levels up (gets more damage), you'll need trueshot/command aura (which leave a buff). You also need to create as many levels of it as you want upgrades. If you want the hero to be able to get 250% damage gain, you'll need 250%/5% = 50 levels.

This was already explained in post #2 of this thread.

Much more elegant is permanently adding a flat bonus to damage. There's an item ability which works just like tomes, called Item Permanent Damage Gain. (It's under Abilities -> Special -> Items)

Much more elegant? Trueshot aura also supports flat damage by the way. However percentage bonus increases the damage of a unit proportionally. Imagine a unit having 2-4 base damage, and another unit having 100-124. +5 flat damage is huge for the first unit, but almost nothing for the second unit.

Flat bonus can be the desired option in some cases, but the original poster specifically asked for % bonus.

Also I believe you can get rid of the aura buff, as Justify mentioned. I'll test it when I get back home.
 
Level 17
Joined
Mar 17, 2009
Messages
1,349
What themerion says doesn't show a buff, but you cannot add a % of the damage, but a certain defined amount of damage. So in my opinion you're better off with a buff.

There is a way to do it without the buff but would require some advanced coding and would have a minor error in the amount of damage added... thus not worth it.

EDIT @ Maker:
I think (but am not sure) that removing the buff removes the damage added...
 
Level 4
Joined
Jan 27, 2010
Messages
133
This was already explained in post #2 of this thread.

You didn't clarify that he'd need a hell lot of levels on the ability if he wants it to scale to large values (AND HE SPECIFICALLY MENTIONS THAT HE'S DOING THIS EVERY TIME THE UNIT KILLS ANOTHER UNIT =).

Much more elegant?

Yeah, because it scales to very large values without much of a problem. Your solution fails as soon as you override the max level.

Trueshot aura also supports flat damage by the way. However percentage bonus increases the damage of a unit proportionally. Imagine a unit having 2-4 base damage, and another unit having 100-124. +5 flat damage is huge for the first unit, but almost nothing for the second unit.

Look, unless this is for an item ability, he'll know the base damage of the unit-type. Even if it's a hero, he should be able to pick flat values which are approximately equal to what the percentile value would give.

Anyway, good luck removing the [traces of the] buff w/o removing the effect.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You didn't clarify that he'd need a hell lot of levels on the ability if he wants it to scale to large values (AND HE SPECIFICALLY MENTIONS THAT HE'S DOING THIS EVERY TIME THE UNIT KILLS ANOTHER UNIT =).

What's the problem here? Use auto fill levels. 5 seconds and you have as many levels created as you like. At level 201 the damage bonus begins to be capped by the editor to value 10, meaning +1000 % dmg. After that you have to manually increase the stats.

Yeah, because it scales to very large values without much of a problem. Your solution fails as soon as you override the max level.

What is a very large value? My solution doesn't override the max value, I prevent that in the trigger.

Look, unless this is for an item ability, he'll know the base damage of the unit-type. Even if it's a hero, he should be able to pick flat values which are approximately equal to what the percentile value would give.

There can be multiple unit types affected by this.

Anyway, good luck removing the [traces of the] buff w/o removing the effect.

One can make the icon not show up, but it still reserves a spot in the buff list and displays the stats when hovered on.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Nah. If you want to apply a bonus which updates when the hero levels up (gets more damage), you'll need trueshot/command aura (which leave a buff). You also need to create as many levels of it as you want upgrades. If you want the hero to be able to get 250% damage gain, you'll need 250%/5% = 50 levels.

Doesnt have to be, could be less..

If you have 50 damage, and you want 5% increase, you get 52,5 damage.
When you increase it another 5% it will become 55,125.
Meaning:
damage * 1.05x = damage * 2,5
1.05x=2,5
1.05log 2,5 = x = log1.05 2,5 (whichever way of writing you prefer)
x will be about 18.78 levels, which is effectively 19 levels..

Whichever he wants, if you want the PERCENTAGE to increase with 5 every level, or you want the damage to be multiplied by 1.05 every level again.
 
Level 4
Joined
Jan 27, 2010
Messages
133
What's the problem here? Use auto fill levels. 5 seconds and you have as many levels created as you like. At level 201 the damage bonus begins to be capped by the editor to value 10, meaning +1000 % dmg. After that you have to manually increase the stats.

In my experience, an ability with 30 levels or more will cause a considerable lag spike when WC3 loads it. 200 levels... :p That's like multiple seconds for some of us (and I certainly haven't got the worst computer on B.net). That's the problem. And, ofc, if there's supposed to be over 200 levels.

What is a very large value? My solution doesn't override the max value, I prevent that in the trigger.

I have no idea of what his map looks like, true. I can, however, imagine maps where a hero kills way more than 1000 units.

There can be multiple unit types affected by this.

Sure. Then he'll have to use your aura-buff solution... I'm just trying to give an alternative to your solution (a more scalable and discrete solution).

One can make the icon not show up, but it still reserves a spot in the buff list and displays the stats when hovered on.

You mean making the icon black? :) About as elegant as putting a dark cloth on yourself and calling it an invisibility cloak. Well, sure, might be enough for him.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
In my experience, an ability with 30 levels or more will cause a considerable lag spike when WC3 loads it. 200 levels... :p That's like multiple seconds for some of us (and I certainly haven't got the worst computer on B.net). That's the problem. And, ofc, if there's supposed to be over 200 levels.

I just mentioned 200 since that's when the autofill value gets capped :)

I have no idea of what his map looks like, true. I can, however, imagine maps where a hero kills way more than 1000 units.

I'm thinking he will cap the thingy, not needing 1000 levels :)

Sure. Then he'll have to use your aura-buff solution... I'm just trying to give an alternative to your solution (a more scalable and discrete solution).

Help me understand how it's more scalable?

You mean making the icon black? :) About as elegant as putting a dark cloth on yourself and calling it an invisibility cloak. Well, sure, might be enough for him.

Just saying that according to my knowledge, the buff can't be hidden. The icon can be set to none. So that is a flaw in that solution.
 
The way I have it set up is as Maker proposed. I ended up using the attribute bonus buff icon and creating a custom buff that simply tells you the level of the upgrade. It allows for a maximum of 50% damage increase over 10 levels (kills).

What's interesting is if you set the buff as nothing the damage bonus defaults to 10% a kill, so at 10 levels it ends up doubling the units attack damage. As soon as you add a buff again it correctly calculates the bonus.

Thanks for the help guys it's working perfectly.
 
Status
Not open for further replies.
Top