• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Attack bonus at longer ranges

Status
Not open for further replies.
Level 4
Joined
Aug 13, 2013
Messages
22
Is it possible to give a ranged unit an attack bonus at longer ranges (e.g. an attack bonus at more than half the maximum range)?

Things I tried that didn't work:
- Giving the unit two attacks, one with a maximum range of half the total range I want, another with higher damage and a minimum range of half the total range I want - doesn't work because minimum range field applies to both attacks.
- Using Critical Strike - it doesn't have a minimum range field.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Is it possible to give a ranged unit an attack bonus at longer ranges (e.g. an attack bonus at more than half the maximum range)?

Things I tried that didn't work:
- Giving the unit two attacks, one with a maximum range of half the total range I want, another with higher damage and a minimum range of half the total range I want - doesn't work because minimum range field applies to both attacks.
- Using Critical Strike - it doesn't have a minimum range field.

It might be possible to make an ability that reduces damage instead. Maybe even based on critical strike.
 
Level 5
Joined
Oct 10, 2012
Messages
109
maybe you can search for impetus skill in dota?

its like create the temporary location for the attacker and the attacked and check if attacker have specific buff then use some mathematic damage from the temporary distance < u must use DDS for this i guess

if you want to make it easy use instant missile shot like riflemen missile so you dont need the DDS

can only explain it in general though
 
Level 17
Joined
Jan 18, 2010
Messages
1,122
if you want to make it easy use instant missile shot like riflemen missile so you dont need the DDS
You would still need DDS, you would need entirely instant animations as well IIRC. The "attacking" unit event fires whenever the unit starts attacking so if you clicked elsewhere a moment before the unit actually fires the projectile it would still trigger.

You need to detect the unit taking damage and the damage source, create temporary locations there and check the distance in between them and if it is above your threshold then deal extra damage to the unit who took damage.
That could be done in GUI with little knowledge, the problem is detecting the unit taking damage and you also have to exclude the extra damage dealt to the unit because that could also fire another "damage taking" event and result in an infinite loop.
 
Level 4
Joined
Aug 13, 2013
Messages
22
Thanks to everyone for their help! I couldn't get it to work with Critical Strike (reducing damage at short-range instead), and I'm not very experienced with triggers, so this could take a while...
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Thanks to everyone for their help! I couldn't get it to work with Critical Strike (reducing damage at short-range instead), and I'm not very experienced with triggers, so this could take a while...

Well, with a damage detection system you can just detect when a unit takes damage.
Then, when that happens you get the distance between damager and victim and use whatever formula you wish to modify the damage.

Fancy approach:
Store the range of all relevant units in variables(or retrieve it through acquisition range).
Then modify damage compared to how much of their range the units are using, so that at 0 range damage is 0, while at 100% range they have full or maybe double damage.
 
Status
Not open for further replies.
Top