Monday, April 16, 2012

SpellID's and GetSpellInfo()

Is there a way to find out the default mana cost of a spell? I thought GetSpellInfo() did just that, but when I tested today I found that GetSpellInfo() returned 0 as powercost for all spells while I had the preparation buff.

Thanks and hope I get a fast reply ;)|||wrong forum mate. you need to ask in the UI Customisation forum. this is for developing addons. as to your question, I thought that the spellbook (k) showed the defult spell information without taking into account talents or buffs/debuffs.|||How is this the wrong forum?


Quote:








This forum is the DEVELOPER forum. That means it is here for questions and discussion on topics relating to the DEVELOPMENT of addons, such as:

Creating addons.

Designing addons.

Testing addons.

Modifying addons.

Lua code.

XML code.

TOC files.




And no, I've tested, GetSpellInfo() returns 0 as powerCost when I have the arena preparation buff.|||I meant on its own without the addon, the spellbook doesn't take into account talents and buffs/debuffs.|||I'm not sure you get what I mean, I'm not asking for help about an addon or locating the spellbook...

I'm asking for a lua function that returns the default mana cost of a spell (for use in an addon), since GetSpellInfo() doesn't do this.|||oh sorry got the wrong end of the stick. I would only be able to do it once talents and buffs/debuffs are accounted for. mind you I'm only a hobiest programmer so maybe someone else can help you.|||According to WoWWiki:

GetSpellInfo (spellId | spellName | spellLink) - Returns the spell's info, including name, cost, icon, cast time, and range.

http://www.wowwiki.com/API_GetSpellInfo|||Quote:








According to WoWWiki:

GetSpellInfo (spellId | spellName | spellLink) - Returns the spell's info, including name, cost, icon, cast time, and range.

http://www.wowwiki.com/API_GetSpellInfo




GAAAAAH.... sorry, but I'm getting a bit tired of this.

I said in my first post GetSpellInfo didn't work.|||Quote:








GAAAAAH.... sorry, but I'm getting a bit tired of this.

I said in my first post GetSpellInfo didn't work.




That's because GetSpellInfo IS returning the proper mana cost, with Preperation accounted for. And since Preperation reduces mana cost to 0, it will always return 0 when you have that buff.

Now, what you CAN do is do a run-through of your spells without the buff, record that information into a table, and then have that info available during times when you have the Preperation buff.

No comments:

Post a Comment