Thread Tools Display Modes
03-02-18, 05:32 PM   #1
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
IsSpellInRange("Zeal","target")

I use the above code to determine if my target is in melee range. It works 99% of the time as intended. However there are situations / occasions where it returns nil and it's quite stubborn too, eg a reloadUI does not help. When I say "situations" I mean straight up one or more mobs, happily melee-ing them, but it returns nil. I am not sure what's up with it. Any ideas?
  Reply With Quote
03-02-18, 05:39 PM   #2
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Try this.
Lua Code:
  1. local function InMeleeRange(unit)
  2.     local guid = UnitGUID(unit)
  3.     return guid and select(2, CanLootUnit(guid))
  4. end
__________________
  Reply With Quote
07-02-21, 03:04 AM   #3
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
A bit late reply, I have started using this today and so far seems to work! But so did the IsSpellInRange for months/years before it decides to stop working ...
  Reply With Quote
07-02-21, 11:33 AM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
If you want to continue using IsSpellInRange on a paladin, use Crusader Strike. Zeal was a melee spell in Legion but it's now a passive talent (with a hidden 30yd range).
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » IsSpellInRange("Zeal","target")

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