Quantcast Is Spell Usable in Current Form - WoWInterface
Thread Tools Display Modes
11-11-19, 12:50 PM   #1
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 56
Is Spell Usable in Current Form

The function(s) I wish were in the UI:

IsUsableInForm(spellID, [x])

spellID = spellID of Spell being checked
x = Index based on class's available forms (Use GetShapeshiftFormInfo index). Optional, if omitted then uses current form.

usable = boolean
true = Spell can be cast in selected form, disregarding other reasons why it can't be cast
false = Spell can't be cast in selected form, (can return false if not learned)

Parallel to "IsUsable", this function takes in a spellID and optionally a form and returns true if the spell can be cast in current form or false if it can't be cast in form.

My intention for function:
I want to highlight spells in the Spellbook based on if the spell is usable in the form. Some basic research shows the only real test if a spell can be cast in the current form is by casting the spell and looking for the UI_ERROR_MESSAGE event. Even then, target and range errors take priority before stance/form errors.

My current alternative is parsing tooltip data for the "Requires" lines, which I have an idea of a workaround for language localization.
  Reply With Quote

WoWInterface » Developer Discussions » Wish List » Is Spell Usable in Current Form

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