• 0

    posted a message on GetSpellPowerCost(spellID) returns bogus information

    Has anybody used this API function?




    First it returns a nested table, that's easy enough to deal with, but it returns 0 mana for some spells like Evoker Living Flame rather than 1000 like it should.


    I was hoping this would be better than scraping tool tips, but maybe not...

    Here's how I'm calling it.


    local function GetPowerCost(spellID)
    if not spellID then return end

    local _cost = nil
    local _type = nil
    local _cc = GetSpellPowerCost(spellID)

    if nil ~= _cc and nil ~= _cc[1] then

    if nil ~= _cc[1]["cost"] then
    _cost = _cc[1]["cost"]

    if nil ~= _cc[1]["name"] then
    _type = _cc[1]["name"]
    return _cost, _type

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.