Quantcast SpellHasRange() and IsSpellInRange() sometimes not working - WoWInterface
 
Thread Tools Display Modes
08-17-14, 09:20 AM   #1
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
SpellHasRange() and IsSpellInRange() sometimes not working

I have tested SpellHasRange() and IsSpellInRange() on both the beta server (build 18716) and live servers.

Basically; if you use either SpellHasRange() or IsSpellInRange() for the spell "Ice lance" it will return nil on beta, but 0/1 as expected on live servers. I also tested this with frostbolt and frostfire bolt to compare.

I've only tested this on a lvl 100 mage on the Level 100 PvE server.
I do not know if other spells are bugged like this as well.
The spellID for "Ice Lance" is the same on live and beta servers (30455) and in it's tooltip is described as a spell with 40 yard range.


Live servers:
SpellHasRange("Frostbolt") -> 0 or 1
SpellHasRange("Frostfire Bolt") -> 0 or 1
SpellHasRange("Ice Lance") -> 0 or 1

IsSpellInRange ("Frostbolt","target") -> true or false
IsSpellInRange ("Frostfire Bolt","target") -> true or false
IsSpellInRange ("Ice Lance","target") -> true or false


Beta servers (build 18716)
SpellHasRange("Frostbolt") -> 0 or 1
SpellHasRange("Frostfire Bolt") -> 0 or 1
SpellHasRange("Ice Lance") -> nil

IsSpellInRange ("Frostbolt","target") -> true or false
IsSpellInRange ("Frostfire Bolt","target") -> true or false
IsSpellInRange ("Ice Lance","target") -> nil


and yes; the target was an hostile, attackable npc.
__________________
Author of IfThen, Links in Chat
 
08-17-14, 10:23 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
There's something wrong with the Ice Lance spell id on beta servers.

Dragging Ice Lance onto a action button with my lvl 90 mage on the beta server returns the the spell id 2136 - which according to wowhead is Fire Blast. (http://wod.wowhead.com/spell=2136)
But ... the icon texture is the Ice Lance icon (Interface\Icons\Spell_Frost_FrostBlast) and on click it casts Ice Lance.
GetSpellInfo(2136) returns the "Fire Blast" as name and "Interface\Icons\Spell_Frost_FrostBlast" as texture. oO

And IsSpellInRange(2136) does work as expected.

Strange


[e]
Where do you got the id 30455 from?

Last edited by Duugu : 08-17-14 at 10:25 AM.
 
08-17-14, 10:34 AM   #3
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,696
On the beta, more spells share the same ID, and the spell itself changes depending on specs.
This is very common for warlocks after they got revamped, they are just adding it to more spells for more classes.
 
08-17-14, 10:40 AM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Uhoh. Thanks p3lim. Was completely unaware of this.
Good to know. Has the potential to break stuff within my addon.
 
08-18-14, 03:06 PM   #5
Cybeloras
A Fallenroot Satyr
 
Cybeloras's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 28
I wrote LibSpellRange-1.0 a while back for this exact purpose - IsSpellInRange() has been broken for a while. Servers are down right now on beta so I can't test it to be sure, but it should still work correctly.

http://wow.curseforge.com/addons/libspellrange-1-0/

It doesn't implement SpellHasRange() because, frankly, I never even knew that function existed since I never had a need for it. I'll look into implementing SpellHasRange as well.

Edit: It now also implements SpellHasRange as of r11.

Last edited by Cybeloras : 08-18-14 at 08:04 PM.
 
08-21-14, 02:57 PM   #6
Cybeloras
A Fallenroot Satyr
 
Cybeloras's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 28
It's also worth noting that IsSpellInRange() still returns 1/0/nil. IsItemInRange(), on the other hand, was updated to use true/false/nil.
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » SpellHasRange() and IsSpellInRange() sometimes not working

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