View Single Post
09-14-19, 09:10 AM   #13
kernighan
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 45
Originally Posted by bsmorgan View Post
I'm working on the tradeskill addon Skillet-Classic, a port of Skillet from retail, and I find it amazing that I can get the names of tradeskills and I can "DoTradeSkill(name, count)" which triggers a bunch of events which contain the spellID. I can "name = GetSpellInfo(spellID)" but given the name, I can't get the spellID because all the functions that would do so don't exist in Classic.

Skillet (the retail version) is locale agnostic because it uses numeric spellIDs. I had to bastardize Skillet-Classic to use the name as the key instead. This blew any chance of a common set of source files.


I ended up indexing on itemID

Code:
    for i = 1, GetNumTradeSkills() do
      local recipe, hdr = GetTradeSkillInfo(i)
      if (recipe and hdr ~= "header") then
        local itemLink = GetTradeSkillItemLink(i)
        local itemID = itemLink:match("item:(%d+)")
        if(itemID) then
But I still have to create a database to map those to spellIDs. Very annoying.
  Reply With Quote