Direction and distance to enemy - WoWInterface
Thread Tools Display Modes
03-29-19, 01:46 AM   #1
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 126
Direction and distance to enemy

I have asked this some time ago and was told there is no way but I am trying my luck once more.

Blizzard have lately implemented a "/cast [@cursor] Spell" and "/cast [@player] Spell". However they have not implemented a "/cast [@target] Spell".

If you are a Mage for example you can call out Blizzard in one key press using the macro "/cast [@cursor] Blizzard", assuming you are pointing at somewhere sensible when you press the button. And if you want to play like an Arcane Mage (into the fray), you could also do "/cast [@player] Flamestrike".

But is there a (ingenious) way for an addon to determine the direction / distance of a targeted enemy ? I was thinking if you cast a slow moving spell and check the time taken from successful cast to actual hit, that might give you an indication of distance? I am all out of ideas. And how would direction be relayed in an addon, are there any functions conferring directional information?
  Reply With Quote
03-29-19, 06:44 PM   #2
Fishing Trainer
Seerah's Avatar
WoWInterface Super Mod
Join Date: Oct 2006
Posts: 10,732
You can only estimate range by checking to see if other spells/abilities with a different distance are in range.

Blizzard does not want an addon to know what direction a target is in. There used to be one addon that calculated this, but they intentionally broke it.

You cannot cast spells with a targeting ring automatically at your target because Blizzard wants you to actively choose where this spell goes. You choose where your cursor is. You choose where your character is. You do not choose where your target is.
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-04-19, 03:11 PM   #3
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 126
OK thanks!
  Reply With Quote
04-05-19, 08:56 AM   #4
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 24
The nameplates can change their alpha and scale according to the distance with the player. Retreive one of them and you get a function of the distance.
For direction, probably by the minimap.

"/cast [@target] Spell" is more convenient and would be enough in some case, so you must have 2 actions. i think they didn't implemented it because aiming is a part of the gameplay.

Last edited by Taudier : 04-06-19 at 05:14 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Direction and distance to enemy

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off