Page 1 of 1

(Scripting) Continually atk same target increases dmg?

Posted: November 15th, 2021, 5:39 am
by undeadjh
Unit ability in Angel Arena increases the damage dealt to a single-unit target the longer said target is attacked. Here's the description... "The longer your hero attacks the same enemy unit the more damage it does to it. Increases damage dealt per attack. Resets after a short period of time without attacks."

I'm curious about implementing something as such. Along the lines of while a unit is holding a specific item and is attacking the same enemy increase damage dealt to the target continually. If that makes sense please let me know. I don't know how to handle the increase damage as the ability doesn't show any buffs on the hero who has it nor does it show a debuff on enemies attacked by it. On top of that the triggers are unrecoverable. Tried digging around them for the better part of today and came up empty.

Thanks in advance

Re: (Scripting) Continually atk same target increases dmg?

Posted: November 18th, 2021, 4:29 am
by nuzamacuxe
I took a look at Angel Arena's version and it looks like way too complicated and also not efficient at all. You need to learn about JASS to do something like that.

You can use just one global to do what you want: hashtable. Using hashtable you can handle everything.

Basically you'll need to log all units through an event player unit attack, check if the attacker has the desired item, save data into the target unit, use a MUI (Multi-Unit Instanceable) timer, etc. I made an item version, look:
  • Every attack increases the damage by 20%;
  • If you don't attack within three seconds, it resets.
Spoiler:
Image


Is that what you wanted?