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

Spell damage based on normal attack damage

Status
Not open for further replies.
Level 10
Joined
Jun 17, 2014
Messages
236
hello, i want to create a spell that gives damage based on normal attack damage.
example, hero shoot target enemy deals 50 +(50% normal attack damage)

how do i do that?,
if i record normal attack damage with GDD, unit must attacking enemy firstly.
and if they not attacking and cast the spell, the spell will not gives bonus damage.

thank you
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Only way to do it without knowing all unit damage beforehand (ie. everyone starts with the same damage and you can add value from items) is with a physical DDS, then either keep track of the last physical damage dealt or average it over the course of time.

What you're trying to do is a mess, to say the least. Most people would do something easier like amplify spell damage based on the hero's intelligence or another retrievable attribute.

Edit: also, please don't double post. If you want to subscribe to a thread you can set tour user preferences to do so or click the "thread tools" option at the top right and click "subscribe".
 
Level 10
Joined
Jun 17, 2014
Messages
236
so we have to set the attack damage variable at the beginning of the game in accordance with a hero that is used by player?, after that we record non-spell damage that given.

yes, i do that with my other spell. but this spell is different, so i need bonus damage based on normal attack damage.

and also thank you for deleting my last post, and thank you for inform me how to subscribing
 
Level 15
Joined
Aug 14, 2007
Messages
936
Record all the hard coded buffs that your map has, Example: roar buff (whatever value), command aura buff (any value). . etc: Note that when you cast the spell you check for these buff, if the caster have it, increase the damage of that spell via trigger. If it's not clear I will do a more detailed explanation.
 
Level 15
Joined
Aug 14, 2007
Messages
936
There are only a few elements that will alter attack damage, namely for hero, the startin damage and dice, primary attribute, damage from items, damage from buffs, damage from modifiers such as critical strike etc or bash.

From that you can detect the actual attack damage from if else checks in the trigger editor, for more details about triggering you can check the forums on hiveworkshop!
 
Level 11
Joined
Jun 2, 2013
Messages
613
A damage detection system is needed for this?

Can't you just base a target spell like firebolt and set to 50 damage and then run a trigger that uses "Start's the effect of an Ability"?

Then just use the Unit - Damage Unit Target action (maybe not called that exactly) to deal (math - arithmetic) Casting Unit's Damage x 0.5 to target unit of ability being cast? I can't remember if attack damage can be used or not though...
 
Level 12
Joined
May 22, 2015
Messages
1,051
No, attack damage can't be measured hence the need for a DDS.

I think a DDS would still mess up, though. It would factor in armour and things like hardened skin. It might also do weird things with mana shield lol. You'd also need on to detect the attack damage only - but then it might also pull in crit bonuses and stuff (though I'm sure you could handle that fairly easily by making your own crit with triggers). There's still the issue of armour - which you could also trigger, but then you may as well just store the damage values as well since you are also storing all the armour values for everything.

It's basically not worth it to try to use attack damage lol (at least imo). It's just so much work and doesn't add a ton compared to just using an attribute or some other value (like hero level).

Anyway, you can do this without DDS by just storing all the damage modifications for the hero. It may be useful for other things, anyway, and detecting number changes and stuff at the time they happen (instead of each time they are needed for use) is usually the most efficient way to do it.
 
Status
Not open for further replies.
Top