Thread Tools Display Modes
05-29-13, 01:50 AM   #1
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
UnitCastingInfo API and spellID

I am missing spell id from the UnitCastingInfo, I don't understand why they didn't included it, maybe I am missing something
  Reply With Quote
05-29-13, 02:41 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
I would refer you to use the CLEU, but then again it depends on what you try to achieve.

But you are right that UnitCastingInfo and UnitChannelInfo don't return a spellID, so you can always try match the spell name instead. Like "if text == GetSpellInfo(12345) then" you get the idea.
__________________
Profile: Curse | Wowhead
  Reply With Quote
05-29-13, 02:50 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If there's a predetermined list of spells you care about (eg. you want to know when your arena opponent is casting a crowd-control spell) then you should just generate a table at runtime mapping the localized name from GetSpellInfo(id) to whatever data you actually want (spellID, true, table of data, function to run when it's seen, etc.) and refer to that table to identify the spell based on the name you got from UnitCastingInfo.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-29-13, 02:54 AM   #4
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
I tried to match spellid by name, but there are spells with the same name and different icon (I need an icon).
I was also trying GetSpellInfo by name, it works only for spells that I can cast :/
I saved all combatlogs Spell_cast_start events to the table and then parse it to get spell id by name, and got some spells that are not present in combat logs (about 1%), and it's difficult to parse it :/
  Reply With Quote
05-29-13, 02:55 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, without more specifics about what you're actually doing, it's pretty hard to suggest a more specific solution...
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-29-13, 03:02 AM   #6
shurshik
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 31
I am tracking all UnitCastingInfo but don't want to waste memory saving all icons and spellnames, just spellid. To get than Spellname, spellid, icon.

I wondered, maybe I can get spellid from the icon url or it doesn't have an id in it, don't remember
  Reply With Quote
05-29-13, 05:01 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It doesn't, and multiple spells can use the same icon. "Tracking all UnitCastingInfo" is still pretty vague, but if you want to keep your project all Top Secret National Security, go for it.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Wish List » UnitCastingInfo API and spellID


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