Thread Tools Display Modes
09-12-14, 02:17 PM   #1
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Shared spellIDs and specs

[e]
Nevermind. Solved the problem with using spellnames instead of spellIDs.

Still would love to hear whats wrong with using spellIDs. But that would be 'nice to have' only.

------------------------------------------------------------------------------------------------------------------------------------


I'm trying to fix a problem with my secure action buttons and spells on different specs.

Problem:

Take a priest with first spec Disc and second spec Shadow. Let the spec Shadow be enabled and the Shadowform be enabled.

If I drag the spell Mindflay from the spellbook onto a Bizzard button, and then cast Mindflay via this button, everything is ok.
If I drag Mindflay from the spellbook onto one of my secure buttons, and then cast Mindflay via my secure button, then Mindflay IS casted, BUT the Shadowform is cancelled. oO

Cause:

After some tests I figured out, that dragging Mindflay from the spellbook onto my secure button actually passes somewhat unexpected arguments.

The secure button receives the following data with "OnReceiveDrag": kind, value, subtype, extra = "spell", 27, "spell", 585

I can manually verify that Mindflay is indeed shown at index number 27 in the spellbook.
But, the spellID of Mindflay is not 585. The spellID of Mindflay is 15407. 585 is the spellID of Smite.

GetSpellBookItemName(27, BOOKTYPE) returns "Mindflay", ""
GetSpellBookItemInfo(27, BOOKTYPE_SPELL) returns "SPELL", 585

I'm guessing that the cancelled Shadowform is somehow related to the spellID 585 Smite - which is a holy spell and should indeed cancle the Shadowform on use.

Question:

I know that Blizzard replaces spells/ids based on the current spec. So, receiving 585 is probably ok and intended – but if 585 with Shadow spec is actually Mindflay, why does casting it via my button (with action="spell" and value=585) breaks the Shadowform???
Am I doing something wrong? Or is this just a bug?

On a side note: setting the secure action button manually to action="spell" and value=15407 (the original spellID of Mindfay) does not work at all - which is no real surprise as Mindflay seems to be 585 in this scenario.

Last edited by Duugu : 09-12-14 at 02:36 PM.
  Reply With Quote
09-12-14, 05:23 PM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Well, I'm just realizing that this is one not fully done yet.

I only get the spellID and can't query the spell name in combat without tainting my secure buttons code. :/
The only solution I can think of is to query all spell names and ids pre-combat and pushing them via an attribute to my secure code - which sounds more like a bad hack than a good practice.

If I ever get my time machine working, then my very first trip will be the meeting where the Blizzard guys did decide that swapping spellIDs and names with specs would be a great idea. Even before the visit in 1963 to see who shot Kennedy in real.
From my point of view that's a design decision that really messes things up without any need.
  Reply With Quote
09-16-14, 03:41 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
You can either use button:HookScript("OnClick",func) or button:SetScript("PostClick",func) to test the spell data without risking the button's secure state.



button:HookScript() acts in a similar way to how hooksecurefunc() works on regular functions (post hook that doesn't taint the original function).

The button's PostClick handler is one of the 3 handlers run when clicked. The order being PreClick, OnClick, PostClick. The SecureActionButtonTemplate operates only on the OnClick handler, leaving the other two open for use by insecure code.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 09-16-14 at 03:49 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Shared spellIDs and specs

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