WoWInterface (
-   Lua/XML Help (
-   -   IsSpellInRange("Zeal","target") (

doofus 03-02-18 05:32 PM

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?

MunkDev 03-02-18 05:39 PM

Try this.
Lua Code:
  1. local function InMeleeRange(unit)
  2.     local guid = UnitGUID(unit)
  3.     return guid and select(2, CanLootUnit(guid))
  4. end

doofus 07-02-21 03:04 AM

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 ...

Kanegasi 07-02-21 11:33 AM

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).

All times are GMT -6. The time now is 06:30 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI