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

[Spell] Getting started with a "Charge" trigger/ability

Status
Not open for further replies.
Level 6
Joined
Mar 17, 2012
Messages
105
I'm trying to make an ability for my Knight so that he deals additional damage and stuns targets on initial attacks.

"Initial attacks" implies the two conditions (however, if you have your own ideas for an initial attack, that'd be fine):
- the attack wasn't preceded by another attack within the past (15) seconds
- the Knight was moving for (3) seconds prior to the attack

This would simulate the Knight doing a "shock charge" when a battle begins. However, I don't know how to go about starting this. If anyone can get me started on the right foot that'd be great! Also if someone knows of an ability or other way to simplify the "initial attack" aspect, that'd be great! Thanks!

EDIT: For clarification, the Knight is not a single unit, but a unit that can be trained and a player can own multiple
 
Level 5
Joined
Jun 13, 2015
Messages
129
You could maybe have like a Wind Walk ability as a base but remove the invisibility. Not sure whether it will work or not as I did not really poke around Wind Walk that much but it should work.
 
Level 11
Joined
Aug 24, 2012
Messages
429
The only ability that does something similar is indeed Wind Walk. However, there is no way to remove Wind Walk's invisibility part.

I tried doing the same thing you are doing with the Knight Charge for a long time. Let me know if you succeed:)
 
Level 6
Joined
Mar 17, 2012
Messages
105
The only ability that does something similar is indeed Wind Walk. However, there is no way to remove Wind Walk's invisibility part.

I tried doing the same thing you are doing with the Knight Charge for a long time. Let me know if you succeed:)

I believe the game Custom Castle Defense had an ability for the Knight where this worked? I remember the Knight having an auto-cast ability that looked to be based on Black Arrow, then perhaps there was some triggering involved with conditions for when the ability would work. I know a bot regularly hosts the game so I'll download the map and take a look at the triggers and report back.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could use a damage detection system and Is unit moving system, both can be found from the spell database.

For each knight, you would create two timers and store them into a hashtable. CreateTimer is the function to call.

Unit starts moving -> start the movement timer
Unit takes damage -> start the attack timer

Both are countdown timers.

Elapsed time for both timers needs to be 0 for the initial attack to be possible.
 
Status
Not open for further replies.
Top