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

Ability based on normal attack

Status
Not open for further replies.
Level 4
Joined
Dec 22, 2016
Messages
67
Hello hive !
I wanted to create an ability that causes hero to attack his target once , dealing bonus damage, I mean just one attack which manually is cast and deals more damage , not his next attack , it's a target unit ability.
a similar ability to this , is the new version of tusk's ultimate , walrus punch, in DotA 2 (the old version was a no target instant cast which caused hero's Next attack deal critical , this one targets a unit and deals that attack) .

well, the bonus damage effect is not a problem , but how to make this ability cause unit to attack is the problem. I tried to make a trigger which orders the caster to attack target once every 0.01 , and turn this trigger on when ability is cast , turn it off when attack is done. it doesn't work since if the player rapidly orders the unit to do sth just when the ability is cast but attack is not done , the unit wont ignore player order and the attack is delayed.

Is there any other way to make this spell? (sorry if explanation was bad)
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
That's a tricky one, even though it seems quite simple.
If you want to do it with "order caster to attack target" you will always have the problem of the player ordering something else, unless you disable user control, which is totatlly bad.
You could say, that the spell is canceled, if the player gives the unit an order, just like channeling spells.
If you don't actually use attack order, but just play the attack animation for example, you have the problem, that it's not an attack, so attack modifying abilities won't work (orb effects, vamp aura, bash, ...) also bonus damage from items/attack speed are hard to simulate.

I would make it so the caster is ordered once to attack the target and if the player cancels it it's the player's fault and the spell won't have an effect (like channeling abilities if canceled). The difference is that when multiple units are selected normal orders (not stop or hold position) won't cancel channeling abilities, because the channeling units won't recieve the orders. In your case the spell would always be canceled.

Or just make it so that the next attack is enhanced (much easier).
 
Level 13
Joined
Jul 15, 2007
Messages
763
It's hard to "force" a unit to attack, because like you said, the player can spam another command. Is there a reason it must be forced?

I recall Blink Strike in Dota used to add attack damage to a unit for a very brief moment (like 0.3 seconds): enough to deliver the attack damage, but not too much so that the unit can get 2+ buffed attacks off.
 
Level 4
Joined
Dec 22, 2016
Messages
67
Sorry for my late replay (I had an exam).

So it seems there is no way to order a unit to attack and disable ordering that unit until the attack is done.
However , is there any way or trick to make it like the unit attacked someone? for example , playing unit's Attack animation and just at the same time , create a copy of that unit , hide that copy and order that copy to attack the target once , then remove the copy?
 
Level 11
Joined
Jun 2, 2004
Messages
849
You could pause it and play its attack animation. For the actual damage I'd suggest simulating it.

Making a copy is slightly more feasible than might first be expected, due to the existence of Wand of Illusion. Mirror images however don't inherit everything from the original though, and hiding its graphics may be quite troublesome.
 
Level 4
Joined
Dec 22, 2016
Messages
67
This will sound crazy
Fire arrow

A unit orders with no target
Order equal to "flamingarrowson"
Order unit to disable flaming arrow

Then you use Spell effect as normal

Wow ! how I didn't realized that before? By the help of a good damage engine , it really worked ! the only problem is that single attack wont have other orb effects (for example if hero has cold attack orb and uses this ability as first attack , the first attack wont slow the target) but that such a small thing that doesn't matter too much.
Tnx dude.
 
Status
Not open for further replies.
Top