- Joined
- Feb 11, 2010
- Messages
- 199
Detecting a Melee Attack (UNSOLVED)
Alright, so basically I'm working on a spell that has proved surprisingly tricky. Essentially, I want to create a version of the Wind Walk spell where the hero deals bonus damage based on their Agility. Seems simple enough: I just need to detect when the unit finishes an attack and set the damage myself (complete with floating text, etc). However, a problem arises.
Equally problematic is using "Unit takes damage" as an event, since that damage could be from any source.
So how would I replicate Wind Walk? I've been looking high and low for a solution to this using searches, and I've had no luck at all so far. +rep for anyone who can help, of course!
Alright, so basically I'm working on a spell that has proved surprisingly tricky. Essentially, I want to create a version of the Wind Walk spell where the hero deals bonus damage based on their Agility. Seems simple enough: I just need to detect when the unit finishes an attack and set the damage myself (complete with floating text, etc). However, a problem arises.
-
Night Stalker
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
((Attacking unit) has buff Night Stalker) Equal to True
-
-
Actions
-
Set NightStalkerCaster[0] = (Attacking unit)
-
Set NightStalkerTarget[0] = (Attacked unit)
-
Set NightStalkerLevel[0] = (Level of Night Stalker for NightStalkerCaster[0])
-
Set NightStalkerDamage[0] = (((Real((Agility of NightStalkerCaster[0] (Include bonuses)))) x 3.00) + (((Real(NightStalkerLevel[0])) x 50.00) + 0.00))
-
Unit - Cause NightStalkerCaster[0] to damage NightStalkerTarget[0], dealing NightStalkerDamage[0] damage of attack type Hero and damage type Normal
-
Set NightStalkerPoint[0] = (Position of NightStalkerTarget[0])
-
Floating Text - Create floating text that reads ((String((Integer(NightStalkerDamage[0])))) + !) at NightStalkerPoint[0] with Z offset 20.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
-
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
-
Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
-
Custom script: call RemoveLocation(udg_NightStalkerPoint[0])
-
Unit - Remove Wind Walk buff from NightStalkerCaster[0]
-
-
Equally problematic is using "Unit takes damage" as an event, since that damage could be from any source.
So how would I replicate Wind Walk? I've been looking high and low for a solution to this using searches, and I've had no luck at all so far. +rep for anyone who can help, of course!

Last edited: