Scaling damage with damage taken?

Level 3
Joined
Mar 5, 2015
Messages
21
Hey,

I am trying to make a passive ability for hero that increases his damage by 1% for every 1% of HP lost (for exapmple at 50% HP the hero would have 150% damage), and I need it to be changing all the time (when taking damage increase, when healed decrease, both from any sources), so best if there actually was some ability doing this. If not, any ideas on triggers? :vw_wtf:

Thanks for possible help.. :vw_love:
 
Level 14
Joined
Nov 17, 2010
Messages
1,263
You could get a damage detection system. This would allow you to change the amount of damage dealt before the damage is dealt. So you would just have to set the damage to a certain amount depending on the percentage of life remaining.

Here is a good one link
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Eeeem... The DDS will definitely work but if you are not using dds and this is the only thing which may need it consider that you can just periodically or on event modify his damage with buff or stacked damage bonus ability according with his missing hp.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
If you dont want to use damage systems then this is the easiest thing to do:

Make an ability based on Searing Arrows and give it 100 levels.
Also make a spell book that has that searing arrows in it and disable that spell book for every player.

Then every <...> seconds of gametime (preferably 0.03 but in this case can be higher to avoid unnecessary operations), you set the level of that ability to 100 - (Current Percentage of HP of unit).

Be aware that you add the spell book but set the level of searing arrows.
This will indeed leave a buff on the hero that comes with searing arrows but if you dont want to use systems... then dont expect the best there is.
 
Level 19
Joined
Jul 14, 2011
Messages
872
You can use Command aura instead of Searing arrows if you want percented increase. Just set the 'Data - Attack Damage Increase' to 100 - the level.
You can easily do this by making the lvl 1 value to 99 and then going to Edit>Auto Fill Levels(Ctrl + L), making the constant factor to -1.
 
Level 3
Joined
Mar 5, 2015
Messages
21
Thanks everyone for help!

Wietlol and Gismo359:

I decided to use the solution you suggested, I used command aura with 100 levels and I periodically update its level. It works - but.
My hero keeps playing casting animation.. Is there a way to get rid of this? :vw_death:
 
Level 3
Joined
Mar 5, 2015
Messages
21
I have a feeling that this "set ability level" might do it, I can't think of anything else that would..

EDIT: Ok, nope, still casting even if "set ability level" is not there.. :/

EDIT2: I found where the problem is (besides my brain is malfunctioning), I used the item damage aura instead of command aura (I already had a damage aura, so I coppied it, and it was based on that), now that I am using classic command aura it works perfectly, so thanks and let me pimp your reputation! ;)
 
Level 3
Joined
Mar 5, 2015
Messages
21
Well mostly everything works, except this - when the hero with this ability is killed, SOMETIMES the game crashes with this error:

This application has encountered a critical error:

FATAL ERROR!

Program: c:\***\War3.exe
Exeption: 0xC0000005 (ACCESS_VIOLATION) at 0023:6F4790C1

The instruction at '0x6F4790C1' referenced memory at '0x0000000C'.
The memory could not be 'read'.

Press OK to terminate the application.

So I guess it tries to read the %hp of the dead unit and level its ability, and it can't? Is there a way to make this work without a game crashing? :vw_sad:
 
Level 6
Joined
May 20, 2014
Messages
228
Maybe try making a variable that's a boolean, which the normal trigger that updates the command aura checks if it's false (implying the hero with the ability is not dead), and if it's true, then it wouldn't run the periodic update? Then make the boolean variable become true whenever the hero dies, and make it false when the unit revives. Of course that wouldn't probably be MUI so I guess the best solution is to use a DDS.

Or, post your triggers and we can give better suggestions than mine :p
 
Level 3
Joined
Mar 5, 2015
Messages
21
I would post triggers, but I have my World Editor in my native language.. :D I will try to write them:

Every 0.03 seconds
Pick every unit on map
If unit-type of (Picked unit) equals Warlock, then Set ability level of Transfer Pain to (Integer(Percentage life of(Picked unit))) else Do nothing

Also, the unit is not a specific hero, it is a PvP map, player can choose this hero from many, so that solution with boollean won't probably work.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Add another condition, "picked unit is alive" and now the damage is maxed when the hero is on full hp. You may want to do (Integer(100 - Percentage life of(Picked unit)))
I recommend you to NOT use "Pick every unit on map", better store the "warlock" units in a group variable and enum from that group.
 
Level 3
Joined
Mar 5, 2015
Messages
21
I set the ability to be lowest damage on highest level, so I guess it's ok that way. A

nyway, the picked unit is alive works, thanks! :) And about the warlock group, will do. :)

Only one more thing - there are moments when the buff totally disappears from a hero, reappearing in a moment, but still there is time when hero simply don't have the buff on him. Is there a way to get rid of this.. 'bug'?
 
Level 3
Joined
Mar 5, 2015
Messages
21
Does the command aura has a buff set for every level in object editor?

Yes, the buff is set automatically to every single level.

I made another skill now - same in many ways. Warrior gets +5% damage for every kill (5x increase ability level on generic unit dies for killer of unit) that decays over time (every second decrease ability level for all warriors).
On hit, it gives +5% (not instantly, it takes a while, but gives), but when it comes to -1% every second, it's not like 5% > 4% > 3% ... > 0%, but it goes 5% (buff completely disappears) > 0%.. When higher it goes for example 28% (disappear) > 22% (dissapear) > 18% ... (not always 5%)

Any thoughts what could be causing that? :vw_wtf: I bet it is connected to the same Warlock issue..
 
Level 19
Joined
Jul 14, 2011
Messages
872
Well, you could just remove the buff with:
  • Custom script: call UnitRemoveAbility(GetEnumUnit(), <Buff rawcode>)
You can view the rawcode by pressing Ctrl + D in the object editor. Makes sure to use the first 4 characters, if the object is custom.

You can then add a buff via casting a spell with 0 Missile Speed on the unit if you want.
 
Level 12
Joined
Nov 3, 2013
Messages
988
Actually using the aura will give increased (base) damage, this won't take into account the bonus damage you already have (from items and such) which could be a hugle deal considering you're going to have almost double the damage while dying you'd have another 50 damage if you already have that much from bonus damage for example.

And also like people have mentioned aura updates slowly so with both these points taken into account (and you don't want to use DDS) use another ability, Elune's Grace, and change the damage multiplier (the damage dealt (%) field).

This will update instantly (though it might not change the damage of projectiles already in mid air) and it will be multiply all the damage of the character instead of just adding more bonus damage.

It won't actually modify the damage displayed on the character though and I'm not sure if it works to add a buff, if it can't then there's the option of just adding another dummy ability.
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
You want to make nice spells like this one?

Go and make your own Damage Engine and remove the Damage Engine of WC3.
I can make a template for a simple damage engine but in that one, you will have to trigger all spell damage and set the values in the object editor to 0.

But as soon as you have a Damage Engine and a good Missile System, you can make almost every spell in WC3.
 
Level 3
Joined
Mar 5, 2015
Messages
21
It's not about not wanting to use DDS, it's about being new to W3 editing and not knowing a single tiny thing about it.. :D
And also I don't want to make huge system just to make one ability work, I would rather give the ability up.. :D But thank you all for help! ;) Gr8 forum & community.. :)
 
Top