Quantcast Druid Swipe at low levels - WoWInterface
Thread Tools Display Modes
06-21-19, 03:40 AM   #1
doofus
A Warpwood Thunder Caller
Join Date: Feb 2018
Posts: 97
Druid Swipe at low levels

I am levelling some Horde toons, and noticed that Swipe appears to LUA as being always available, even though it is not until level 32:

local playerSpellSwipeUseable = IsUsableSpell("Swipe");
or
local playerSpellSwipeUseable = IsUsableSpell(213771);

Always returns true!!! I am level 20 and it is not available until level 32.

Other spells, eg Barkskin, return false (correctly):

local playerSpellBarkskinUseable = IsUsableSpell("Barkskin");


Is this a bug associated with "Swipe" and is there a way around it other than manually checking the player's level ?
  Reply With Quote
06-21-19, 11:47 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,691
Try IsSpellKnown or IsPlayerSpell.

We use the latter in oUF to check if Shred is known, thus showing combo points for druids in cat form.
  Reply With Quote
06-21-19, 06:37 PM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,013
Quick differences (not comprehensive):
Lua Code:
  1. IsUsableSpell() -- you can use it because it is available to your class and spec, and is not on cooldown
  2. IsPlayerSpell() -- a spell player characters can cast, unlike a spell is that is NPC exclusive (check spellID, not spell name because there are spells with the same name that aren't the same)
  3. IsSpellKnown() -- your character knows the spell because of class and spec; it is in your spellbook. Could also be a pet spell (I'm not 100% on that) that your combat pet can cast
  Reply With Quote
06-25-19, 09:52 AM   #4
doofus
A Warpwood Thunder Caller
Join Date: Feb 2018
Posts: 97
Guys thanks, I did not know about these two API calls.

However both IsSpellKnown(213771) and IsPlayerSpell(213771) (Swipe) return false, even when I know the spell and have just casted it!

I have also noticed that the API call IsUsableSpell() works fine for other spells, eg:

local playerSpellBarkskinUseable = IsUsableSpell("Barkskin");

which correctly returns "true" on my 120 druid and "false" on my level 23 druid.

I have not tried those two functions on "Barkskin" to see how they perform since the "IsUsableSpell" works as intended.
  Reply With Quote
06-25-19, 12:09 PM   #5
Kanegasi
An Onyxian Warder
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 357
Itís possible you may have the wrong spell ID. Pick up Swipe from your spellbook (you can use the one on your bars, but it has to be the spell itself, not a macro) and while itís on your cursor, type /dump GetCursorInfo() into chat. The number next to [3]= in your chat window is the spell ID.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Druid Swipe at low levels

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