1. #1
    Deleted

    Get spell description via spell ID ?

    Hi,

    is there a way to get the description of a spell from its ID ?

    Example : 120 is the spell ID of Cone of cold. I would like to make a function like this :

    Code:
    function spellDescFromID(id)
        -- code
    end
    
    spellDescFromID(120) -- returns "Targets in a cone in front of the caster take 752 to 822 Frost damage and are slowed by 60% for 8 sec."
    I feel like the solution is within the GameTooltip methods but I don't see it. Can you help me ?

  2. #2
    There is function: GetSpellDescription but it is undocumented sadly.


    Quote Originally Posted by Lich King
    "You speak of justice? Of cowardice? I will show you the justice of the grave... and the true meaning of fear."

  3. #3
    Deleted


    That was just the thing I needed, thanks a lot. I did not see that in wowpedia.org, maybe I should check more often what's in wowprogramming. Or maybe I had some brain latency and misread it earlier... Thank you

  4. #4
    Deleted
    Yeah, you have to tooltip parse. I did it a few times.
    Let me dig out my code.

    ---------- Post added 2011-07-04 at 04:06 PM ----------

    Code:
    local scanTip = CreateFrame("GameTooltip", "CBMTSpellLoggerSpellScanTooltip", UIParent, "GameTooltipTemplate")
    local scanLine
    local function GetSpellTooltipText(spellID)
    	scanTip:SetOwner(UIParent, "ANCHOR_NONE")
    	scanTip:SetSpellByID(spellID)
    	scanLine = CBMTSpellLoggerSpellScanTooltipTextLeft3
    	local t = scanLine:GetText()
    	if (not t) then return end
    	if (t == SPELL_CAST_TIME_INSTANT_NO_MANA) or (t:find(SPELL_CAST_TIME_SEC:gsub("%%%.3g", "%d+"))) then
    		scanLine = CBMTSpellLoggerSpellScanTooltipTextLeft4
    	end
    	local r=scanLine:GetText():match("[ ]*(.+)")
    	scanTip:Hide()
    	return r
    end
    You can adapt it easily I guess.

  5. #5
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040
    Apparently, GetSpellDescription() doesn't return the numerical values - or at least, it returned variables in your screenshot, Iphi.

  6. #6
    Deleted
    Quote Originally Posted by Taryble View Post
    Apparently, GetSpellDescription() doesn't return the numerical values - or at least, it returned variables in your screenshot, Iphi.
    yes :/

    I'm Glad you posted this Treeston ! Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •