From ef9c4eb49534272f1c42d0dd6be62b6a3a1b2426 Mon Sep 17 00:00:00 2001 From: Ackis Date: Wed, 9 Dec 2009 22:56:22 +0000 Subject: [PATCH] Rename a bunch of files, making them shorter. --- ARL.lua | 1737 ++++++++++++++++++++++++++++++++++++++ ARLColour.lua | 320 ------- ARLConfig.lua | 701 --------------- ARLDatamine.lua | 2346 --------------------------------------------------- AckisRecipeList.lua | 1737 -------------------------------------- AckisRecipeList.toc | 8 +- Colour.lua | 320 +++++++ Config.lua | 701 +++++++++++++++ Datamine.lua | 2346 +++++++++++++++++++++++++++++++++++++++++++++++++++ Frame.lua | 3 +- 10 files changed, 5109 insertions(+), 5110 deletions(-) create mode 100644 ARL.lua delete mode 100644 ARLColour.lua delete mode 100644 ARLConfig.lua delete mode 100644 ARLDatamine.lua delete mode 100644 AckisRecipeList.lua create mode 100644 Colour.lua create mode 100644 Config.lua create mode 100644 Datamine.lua diff --git a/ARL.lua b/ARL.lua new file mode 100644 index 0000000..5521324 --- /dev/null +++ b/ARL.lua @@ -0,0 +1,1737 @@ +------------------------------------------------------------------------------- +-- AckisRecipeList.lua +------------------------------------------------------------------------------- +-- File date: @file-date-iso@ +-- File revision: @file-revision@ +-- Project revision: @project-revision@ +-- Project version: @project-version@ +------------------------------------------------------------------------------- +-- Authors: Ackis, Zhinjio, Jim-Bim, Torhal, Pompy +------------------------------------------------------------------------------- +-- Please see http://www.wowace.com/projects/arl/for more information. +------------------------------------------------------------------------------- +-- License: +-- Please see LICENSE.txt + +-- This source code is released under All Rights Reserved. +------------------------------------------------------------------------------- +--- **AckisRecipeList** provides an interface for scanning professions for missing recipes. +-- There are a set of functions which allow you make use of the ARL database outside of ARL. +-- ARL supports all professions currently in World of Warcraft 3.2 +-- @class file +-- @name AckisRecipeList.lua +-- @release 1.0 + +------------------------------------------------------------------------------- +-- Localized Lua globals. +------------------------------------------------------------------------------- +local _G = getfenv(0) + +local tostring = _G.tostring +local tonumber = _G.tonumber + +local pairs, ipairs = _G.pairs, _G.ipairs +local select = _G.select + +local table = _G.table +local twipe = table.wipe +local tconcat = table.concat +local tinsert = table.insert + +local string = _G.string +local strformat = string.format +local strfind = string.find +local strmatch = string.match +local strlower = string.lower + +------------------------------------------------------------------------------- +-- Localized Blizzard API. +------------------------------------------------------------------------------- +local GetNumTradeSkills = _G.GetNumTradeSkills +local GetSpellInfo = _G.GetSpellInfo + +------------------------------------------------------------------------------- +-- AddOn namespace. +------------------------------------------------------------------------------- +local LibStub = _G.LibStub +local MODNAME = "Ackis Recipe List" +local addon = LibStub("AceAddon-3.0"):NewAddon(MODNAME, "AceConsole-3.0", "AceEvent-3.0") +_G.AckisRecipeList = addon + +--@alpha@ +_G.ARL = addon +--@end-alpha@ + +local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME) + +local BFAC = LibStub("LibBabble-Faction-3.0"):GetLookupTable() + +-------------------------------------------------------------------------------------------------------------------- +-- Acquire types +-------------------------------------------------------------------------------------------------------------------- +local A_TRAINER, A_VENDOR, A_MOB, A_QUEST, A_SEASONAL, A_REPUTATION, A_WORLD_DROP, A_CUSTOM = 1, 2, 3, 4, 5, 6, 7, 8 + +------------------------------------------------------------------------------ +-- Constants. +------------------------------------------------------------------------------ +local NUM_FILTER_FLAGS = 128 +local PROFESSION_INITS = {} -- Professions initialization functions. + +------------------------------------------------------------------------------ +-- Database tables +------------------------------------------------------------------------------ +local RecipeList = {} +local CustomList = {} +local MobList = {} +local QuestList = {} +local ReputationList = {} +local TrainerList = {} +local SeasonalList = {} +local VendorList = {} +local AllSpecialtiesTable = {} +local SpecialtyTable + +addon.custom_list = CustomList +addon.mob_list = MobList +addon.quest_list = QuestList +addon.recipe_list = RecipeList +addon.reputation_list = ReputationList +addon.trainer_list = TrainerList +addon.seasonal_list = SeasonalList +addon.vendor_list = VendorList + + +------------------------------------------------------------------------------ +-- Data which is stored regarding a players statistics (luadoc copied from Collectinator, needs updating) +------------------------------------------------------------------------------ +-- @class table +-- @name Player +-- @field known_filtered Total number of items known filtered during the scan. +-- @field Faction Player's faction +-- @field Class Player's class +-- @field ["Reputation"] Listing of players reputation levels +local Player = {} +addon.Player = Player + +-- Global Frame Variables +addon.optionsFrame = {} + +------------------------------------------------------------------------------- +-- Check to see if we have mandatory libraries loaded. If not, notify the user +-- which are missing and return. +------------------------------------------------------------------------------- +local MissingLibraries +do + local REQUIRED_LIBS = { + "AceLocale-3.0", + "LibBabble-Boss-3.0", + "LibBabble-Faction-3.0", + "LibBabble-Zone-3.0", + } + function MissingLibraries() + local missing = false + + for idx, lib in ipairs(REQUIRED_LIBS) do + if not LibStub:GetLibrary(lib, true) then + missing = true + addon:Print(strformat(L["MISSING_LIBRARY"], lib)) + end + end + return missing + end +end -- do + +if MissingLibraries() then + --@debug@ + addon:Print("You are using an SVN version of ARL. As per WowAce/Curseforge standards, SVN externals are not set up. You will have to install Ace3, Babble-Faction-3.0, Babble-Zone-3.0, Babble-Boss-3.0, LibAboutPanel, and LibSharedMedia-3.0 in order for the addon to function correctly.") + --@end-debug@ + _G.AckisRecipeList = nil + return +end + +function addon:DEBUG(str, ...) + print(string.format(addon:Red("DEBUG: ") .. tostring(str), ...)) +end + +do + local output = {} + + function addon:DumpMembers(match) + twipe(output) + tinsert(output, "Addon Object members.\n") + + local count = 0 + + for key, value in pairs(self) do + local val_type = type(value) + + if not match or val_type == match then + tinsert(output, key.. " ("..val_type..")") + count = count + 1 + end + end + tinsert(output, string.format("\n%d found\n", count)) + self:DisplayTextDump(nil, nil, tconcat(output, "\n")) + end +end -- do + +------------------------------------------------------------------------------- +-- Initialization functions +------------------------------------------------------------------------------- +function addon:OnInitialize() + -- Set default options, which are to include everything in the scan + local defaults = { + global = { + -- Saving alts tradeskills (needs to be global so all profiles can access it) + tradeskill = {}, + }, + profile = { + ------------------------------------------------------------------------------- + -- Frame options + ------------------------------------------------------------------------------- + frameopts = { + offsetx = 0, + offsety = 0, + anchorTo = "", + anchorFrom = "", + uiscale = 1, + tooltipscale = .9, + fontsize = 11, + }, + + ------------------------------------------------------------------------------- + -- Sorting Options + ------------------------------------------------------------------------------- + sorting = "SkillAsc", + + ------------------------------------------------------------------------------- + -- Display Options + ------------------------------------------------------------------------------- + includefiltered = false, + includeexcluded = false, + closeguionskillclose = false, + ignoreexclusionlist = false, + scanbuttonlocation = "TR", + spelltooltiplocation = "Right", + acquiretooltiplocation = "Right", + hidepopup = false, + minimap = true, + worldmap = true, + autoscanmap = false, + scantrainers = false, + scanvendors = false, + autoloaddb = false, + maptrainer = false, + mapvendor = true, + mapmob = true, + mapquest = true, + + ------------------------------------------------------------------------------- + -- Recipe Exclusion + ------------------------------------------------------------------------------- + exclusionlist = {}, + + ------------------------------------------------------------------------------- + -- Filter Options + ------------------------------------------------------------------------------- + filters = { + ------------------------------------------------------------------------------- + -- General Filters + ------------------------------------------------------------------------------- + general = { + faction = true, + specialty = false, + skill = true, + known = false, + unknown = true, + }, + ------------------------------------------------------------------------------- + -- Obtain Filters + ------------------------------------------------------------------------------- + obtain = { + trainer = true, + vendor = true, + instance = true, + raid = true, + seasonal = true, + quest = true, + pvp = true, + discovery = true, + worlddrop = true, + mobdrop = true, + originalwow = true, + bc = true, + wrath = true, + }, + ------------------------------------------------------------------------------- + -- Item Filters (Armor/Weapon) + ------------------------------------------------------------------------------- + item = { + armor = { + cloth = true, + leather = true, + mail = true, + plate = true, + trinket = true, + cloak = true, + ring = true, + necklace = true, + shield = true, + }, + weapon = { + onehand = true, + twohand = true, + axe = true, + sword = true, + mace = true, + polearm = true, + dagger = true, + fist = true, + staff = true, + wand = true, + thrown = true, + bow = true, + crossbow = true, + ammo = true, + gun = true, + }, + }, + ------------------------------------------------------------------------------- + -- Binding Filters + ------------------------------------------------------------------------------- + binding = { + itemboe = true, + itembop = true, + recipebop = true, + recipeboe = true, + }, + ------------------------------------------------------------------------------- + -- Player Role Filters + ------------------------------------------------------------------------------- + player = { + melee = true, + tank = true, + healer = true, + caster = true, + }, + ------------------------------------------------------------------------------- + -- Reputation Filters + ------------------------------------------------------------------------------- + rep = { + aldor = true, + scryer = true, + argentdawn = true, + ashtonguedeathsworn = true, + cenarioncircle = true, + cenarionexpedition = true, + consortium = true, + hellfire = true, + keepersoftime = true, + nagrand = true, + lowercity = true, + scaleofthesands = true, + shatar = true, + shatteredsun = true, + sporeggar = true, + thoriumbrotherhood = true, + timbermaw = true, + violeteye = true, + zandalar = true, + argentcrusade = true, + frenzyheart = true, + ebonblade = true, + kirintor = true, + sonsofhodir = true, + kaluak = true, + oracles = true, + wyrmrest = true, + wrathcommon1 = true, + wrathcommon2 = true, + wrathcommon3 = true, + wrathcommon4 = true, + wrathcommon5 = true, + ashenverdict = true, + }, + ------------------------------------------------------------------------------- + -- Class Filters + ------------------------------------------------------------------------------- + classes = { + deathknight = true, + druid = true, + hunter = true, + mage = true, + paladin = true, + priest = true, + rogue = true, + shaman = true, + warlock = true, + warrior = true, + }, + } + } + } + self.db = LibStub("AceDB-3.0"):New("ARLDB2", defaults) + + if not self.db then + self:Print("Error: Database not loaded correctly. Please exit out of WoW and delete the ARL database file (AckisRecipeList.lua) found in: \\World of Warcraft\\WTF\\Account\\>\\SavedVariables\\") + return + end + local version = GetAddOnMetadata("AckisRecipeList", "Version") + version = string.gsub(version, "@project.revision@", "SVN") + self.version = version + + self:SetupOptions() + + -- Register slash commands + self:RegisterChatCommand("arl", "ChatCommand") + self:RegisterChatCommand("ackisrecipelist", "ChatCommand") + + ------------------------------------------------------------------------------- + -- Create the scan button + ------------------------------------------------------------------------------- + local scan_button = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate") + scan_button:SetHeight(20) + + scan_button:RegisterForClicks("LeftButtonUp") + scan_button:SetScript("OnClick", + function(self, button, down) + local cprof = GetTradeSkillLine() + local current_prof = Player["Profession"] + + if addon.Frame:IsVisible() then + if IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then + -- Shift only (Text dump) + addon:Scan(true) + elseif not IsShiftKeyDown() and IsAltKeyDown() and not IsControlKeyDown() then + -- Alt only (Wipe icons from map) + addon:ClearMap() + elseif not IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() and current_prof == cprof then + -- If we have the same profession open, then we close the scanned window + addon.Frame:Hide() + elseif not IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then + -- If we have a different profession open we do a scan + addon:Scan(false) + addon:SetupMap() + end + else + if IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then + -- Shift only (Text dump) + addon:Scan(true) + elseif not IsShiftKeyDown() and IsAltKeyDown() and not IsControlKeyDown() then + -- Alt only (Wipe icons from map) + addon:ClearMap() + elseif not IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then + -- No modification + addon:Scan(false) + addon:SetupMap() + end + end + end) + + scan_button:SetScript("OnEnter", + function(this) + GameTooltip_SetDefaultAnchor(GameTooltip, this) + GameTooltip:SetText(L["SCAN_RECIPES_DESC"]) + GameTooltip:Show() + end) + scan_button:SetScript("OnLeave", function() GameTooltip:Hide() end) + scan_button:SetText(L["Scan"]) + + self.scan_button = scan_button + + ------------------------------------------------------------------------------- + -- Populate the profession initialization functions. + ------------------------------------------------------------------------------- + PROFESSION_INITS[GetSpellInfo(51304)] = addon.InitAlchemy + PROFESSION_INITS[GetSpellInfo(51300)] = addon.InitBlacksmithing + PROFESSION_INITS[GetSpellInfo(51296)] = addon.InitCooking + PROFESSION_INITS[GetSpellInfo(51313)] = addon.InitEnchanting + PROFESSION_INITS[GetSpellInfo(51306)] = addon.InitEngineering + PROFESSION_INITS[GetSpellInfo(45542)] = addon.InitFirstAid + PROFESSION_INITS[GetSpellInfo(51302)] = addon.InitLeatherworking + PROFESSION_INITS[GetSpellInfo(32606)] = addon.InitSmelting + PROFESSION_INITS[GetSpellInfo(51309)] = addon.InitTailoring + PROFESSION_INITS[GetSpellInfo(51311)] = addon.InitJewelcrafting + PROFESSION_INITS[GetSpellInfo(45363)] = addon.InitInscription + PROFESSION_INITS[GetSpellInfo(53428)] = addon.InitRuneforging + + ------------------------------------------------------------------------------- + -- Initialize the databases + ------------------------------------------------------------------------------- + self:InitCustom(CustomList) + self:InitMob(MobList) + self:InitQuest(QuestList) + self:InitReputation(ReputationList) + self:InitTrainer(TrainerList) + self:InitSeasons(SeasonalList) + self:InitVendor(VendorList) + + ------------------------------------------------------------------------------- + -- Hook GameTooltip so we can show information on mobs that drop/sell/train + ------------------------------------------------------------------------------- + GameTooltip:HookScript("OnTooltipSetUnit", + function(self) + local name, unit = self:GetUnit() + + if not unit then + return + end + local guid = UnitGUID(unit) + + if not guid then + return + end + local GUID = tonumber(string.sub(guid, 8, 12), 16) + local mob = MobList[GUID] + local shifted = IsShiftKeyDown() + + if mob and mob["DropList"] then + for spell_id in pairs(mob["DropList"]) do + local recipe = RecipeList[spell_id] + + if not recipe["Known"] or shifted then + local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) + + self:AddLine("Drops: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") + end + end + return + end + local vendor = VendorList[GUID] + + if vendor and vendor["SellList"] then + for spell_id in pairs(vendor["SellList"]) do + local recipe = RecipeList[spell_id] + local skill_level = Player["Professions"][GetSpellInfo(recipe["Profession"])] + local has_skill = skill_level and skill_level >= recipe["Level"] + + if ((not recipe["Known"] and has_skill) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then + local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) + + self:AddLine("Sells: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") + end + end + return + end + local trainer = TrainerList[GUID] + + if trainer and trainer["TrainList"] then + for spell_id in pairs(trainer["TrainList"]) do + local recipe = RecipeList[spell_id] + local skill_level = Player["Professions"][GetSpellInfo(recipe["Profession"])] + local has_skill = skill_level and skill_level >= recipe["Level"] + + if ((not recipe["Known"] and has_skill) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then + local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) + + self:AddLine("Trains: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") + end + end + return + end + end) +end + +---Function run when the addon is enabled. Registers events and pre-loads certain variables. +function addon:OnEnable() + self:RegisterEvent("TRADE_SKILL_SHOW") -- Make addon respond to the tradeskill windows being shown + self:RegisterEvent("TRADE_SKILL_CLOSE") -- Addon responds to tradeskill windows being closed. + + if addon.db.profile.scantrainers then + self:RegisterEvent("TRAINER_SHOW") + end + + if addon.db.profile.scanvendors then + self:RegisterEvent("MERCHANT_SHOW") + end + + ------------------------------------------------------------------------------- + -- Set the parent and scripts for addon.scan_button. + ------------------------------------------------------------------------------- + local scan_button = self.scan_button + + if Skillet and Skillet:IsActive() then + scan_button:SetParent(SkilletFrame) + Skillet:AddButtonToTradeskillWindow(scan_button) + scan_button:SetWidth(80) + elseif MRTUIUtils_RegisterWindowOnShow then + MRTUIUtils_RegisterWindowOnShow(function() + scan_button:SetParent(MRTSkillFrame) + scan_button:ClearAllPoints() + scan_button:SetPoint("RIGHT", MRTSkillFrameCloseButton, "LEFT", 4, 0) + scan_button:SetWidth(scan_button:GetTextWidth() + 10) + scan_button:Show() + end) + elseif ATSWFrame then + scan_button:SetParent(ATSWFrame) + scan_button:ClearAllPoints() + + if TradeJunkieMain and TJ_OpenButtonATSW then + scan_button:SetPoint("RIGHT", TJ_OpenButtonATSW, "LEFT", 0, 0) + else + scan_button:SetPoint("RIGHT", ATSWOptionsButton, "LEFT", 0, 0) + end + scan_button:SetHeight(ATSWOptionsButton:GetHeight()) + scan_button:SetWidth(ATSWOptionsButton:GetWidth()) + elseif CauldronFrame then + scan_button:SetParent(CauldronFrame) + scan_button:ClearAllPoints() + scan_button:SetPoint("TOP", CauldronFrame, "TOPRIGHT", -58, -52) + scan_button:SetWidth(90) + end + + local buttonparent = scan_button:GetParent() + local framelevel = buttonparent:GetFrameLevel() + local framestrata = buttonparent:GetFrameStrata() + + -- Set the frame level of the button to be 1 deeper than its parent + scan_button:SetFrameLevel(framelevel + 1) + scan_button:SetFrameStrata(framestrata) + scan_button:Enable() + + -- Add an option so that ARL will work with Manufac + if Manufac then + Manufac.options.args.ARLScan = { + type = 'execute', + name = L["Scan"], + desc = L["SCAN_RECIPES_DESC"], + func = function() addon:Scan(false) end, + order = 550, + } + end + +--[[ + -- If we're using Skillet, use Skillet's API to work with getting tradeskills + if (Skillet) and (Skillet.GetNumTradeSkills) and + (Skillet.GetTradeSkillLine) and (Skillet.GetTradeSkillInfo) and + (Skillet.GetTradeSkillRecipeLink) and (Skillet.ExpandTradeSkillSubClass) then + self:Print("Enabling Skillet advanced features.") + GetNumTradeSkills = function(...) return Skillet:GetNumTradeSkills(...) end + GetTradeSkillLine = function(...) return Skillet:GetTradeSkillLine(...) end + GetTradeSkillInfo = function(...) return Skillet:GetTradeSkillInfo(...) end + GetTradeSkillRecipeLink = function(...) return Skillet:GetTradeSkillRecipeLink(...) end + ExpandTradeSkillSubClass = function(...) return Skillet:ExpandTradeSkillSubClass(...) end + end +]]-- + ------------------------------------------------------------------------------- + -- Initialize the main panel frame. + ------------------------------------------------------------------------------- + self:InitializeFrame() + self.InitializeFrame = nil + + ------------------------------------------------------------------------------- + -- Initialize the player's data. + ------------------------------------------------------------------------------- + do + Player["Faction"] = UnitFactionGroup("player") + Player["Class"] = select(2, UnitClass("player")) + + ------------------------------------------------------------------------------- + -- Get the player's reputation levels. + ------------------------------------------------------------------------------- + Player["Reputation"] = {} + Player:SetReputationLevels() + + ------------------------------------------------------------------------------- + -- Get the player's professions. + ------------------------------------------------------------------------------- + Player["Professions"] = { + [GetSpellInfo(51304)] = false, -- Alchemy + [GetSpellInfo(51300)] = false, -- Blacksmithing + [GetSpellInfo(51296)] = false, -- Cooking + [GetSpellInfo(51313)] = false, -- Enchanting + [GetSpellInfo(51306)] = false, -- Engineering + [GetSpellInfo(45542)] = false, -- First Aid + [GetSpellInfo(51302)] = false, -- Leatherworking + [GetSpellInfo(32606)] = false, -- Mining + [GetSpellInfo(51309)] = false, -- Tailoring + [GetSpellInfo(51311)] = false, -- Jewelcrafting + [GetSpellInfo(45363)] = false, -- Inscription + [GetSpellInfo(53428)] = false, -- Runeforging + } + Player:SetProfessions() + end -- do + + ------------------------------------------------------------------------------- + -- Initialize the SpecialtyTable and AllSpecialtiesTable. + ------------------------------------------------------------------------------- + do + local AlchemySpec = { + [GetSpellInfo(28674)] = 28674, + [GetSpellInfo(28678)] = 28678, + [GetSpellInfo(28676)] = 28676, + } + + local BlacksmithSpec = { + [GetSpellInfo(9788)] = 9788, -- Armorsmith + [GetSpellInfo(17041)] = 17041, -- Master Axesmith + [GetSpellInfo(17040)] = 17040, -- Master Hammersmith + [GetSpellInfo(17039)] = 17039, -- Master Swordsmith + [GetSpellInfo(9787)] = 9787, -- Weaponsmith + } + + local EngineeringSpec = { + [GetSpellInfo(20219)] = 20219, -- Gnomish + [GetSpellInfo(20222)] = 20222, -- Goblin + } + + local LeatherworkSpec = { + [GetSpellInfo(10657)] = 10657, -- Dragonscale + [GetSpellInfo(10659)] = 10659, -- Elemental + [GetSpellInfo(10661)] = 10661, -- Tribal + } + + local TailorSpec = { + [GetSpellInfo(26797)] = 26797, -- Spellfire + [GetSpellInfo(26801)] = 26801, -- Shadoweave + [GetSpellInfo(26798)] = 26798, -- Primal Mooncloth + } + + SpecialtyTable = { + [GetSpellInfo(51304)] = AlchemySpec, + [GetSpellInfo(51300)] = BlacksmithSpec, + [GetSpellInfo(51306)] = EngineeringSpec, + [GetSpellInfo(51302)] = LeatherworkSpec, + [GetSpellInfo(51309)] = TailorSpec, + } + + -- Populate the Specialty table with all Specialties, adding alchemy even though no recipes have alchemy filters + for i in pairs(AlchemySpec) do AllSpecialtiesTable[i] = true end + for i in pairs(BlacksmithSpec) do AllSpecialtiesTable[i] = true end + for i in pairs(EngineeringSpec) do AllSpecialtiesTable[i] = true end + for i in pairs(LeatherworkSpec) do AllSpecialtiesTable[i] = true end + for i in pairs(TailorSpec) do AllSpecialtiesTable[i] = true end + end -- do +end + +---Run when the addon is disabled. Ace3 takes care of unregistering events, etc. +function addon:OnDisable() + addon.Frame:Hide() + + -- Remove the option from Manufac + if Manufac then + Manufac.options.args.ARLScan = nil + end +end + +------------------------------------------------------------------------------- +-- Event handling functions +------------------------------------------------------------------------------- + +---Event used for datamining when a trainer is shown. +function addon:TRAINER_SHOW() + self:ScanSkillLevelData(true) + self:ScanTrainerData(true) +end + +function addon:MERCHANT_SHOW() + addon:ScanVendor() +end + +do + local GetTradeSkillListLink = _G.GetTradeSkillListLink + local UnitName = _G.UnitName + local GetRealmName = _G.GetRealmName + local IsTradeSkillLinked = _G.IsTradeSkillLinked + + function addon:TRADE_SKILL_SHOW() + -- If this is our own skill, save it, if not don't save it + if not IsTradeSkillLinked() then + local tradelink = GetTradeSkillListLink() + + if tradelink then + local pname = UnitName("player") + local prealm = GetRealmName() + local tradename = GetTradeSkillLine() + + -- Actual alt information saved here. -Torhal + addon.db.global.tradeskill = addon.db.global.tradeskill or {} + addon.db.global.tradeskill[prealm] = addon.db.global.tradeskill[prealm] or {} + addon.db.global.tradeskill[prealm][pname] = addon.db.global.tradeskill[prealm][pname] or {} + + addon.db.global.tradeskill[prealm][pname][tradename] = tradelink + end + end + local scan_button = self.scan_button + local scan_parent = self.scan_button:GetParent() + + if not scan_parent or scan_parent == UIParent then + scan_button:SetParent(TradeSkillFrame) + scan_button:ClearAllPoints() + + local loc = addon.db.profile.scanbuttonlocation + + if loc == "TR" then + scan_button:SetPoint("RIGHT", TradeSkillFrameCloseButton, "LEFT",4,0) + elseif loc == "TL" then + scan_button:SetPoint("LEFT", TradeSkillFramePortrait, "RIGHT",2,12) + elseif loc == "BR" then + scan_button:SetPoint("TOP", TradeSkillCancelButton, "BOTTOM",0,-5) + elseif loc == "BL" then + scan_button:SetPoint("TOP", TradeSkillCreateAllButton, "BOTTOM",0,-5) + end + scan_button:SetWidth(scan_button:GetTextWidth() + 10) + end + self.scan_button:Show() + end +end + +function addon:TRADE_SKILL_CLOSE() + if addon.db.profile.closeguionskillclose then + self.Frame:Hide() + end + + if not Skillet then + addon.scan_button:Hide() + end +end + +------------------------------------------------------------------------------- +-- Tradeskill functions +-- Recipe DB Structures are defined in Documentation.lua +------------------------------------------------------------------------------- + +--- Adds a tradeskill recipe into the specified recipe database. +-- @name AckisRecipeList:addTradeSkill +-- @usage AckisRecipeList:addTradeSkill(RecipeDB,2329,1,2454,1,2259,0,1,55,75,95) +-- @param RecipeDB The database (array) which you wish to add data too. +-- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe being added to the database. +-- @param SkillLevel The skill level at which the recipe may be learned. +-- @param ItemID The [[http://www.wowwiki.com/ItemLink | Item ID]] that is created by the recipe, or nil +-- @param Rarity The rarity of the recipe. +-- @param Profession The profession ID that uses the recipe. See [[database-documentation]] for a listing of profession IDs. +-- @param Specialty The specialty that uses the recipe (ie: goblin engineering) or nil or blank +-- @param Game Game version recipe was found in, for example, Original, BC, or Wrath. +-- @param Orange Level at which recipe is considered orange. +-- @param Yellow Level at which recipe is considered yellow. +-- @param Green Level at which recipe is considered green. +-- @param Grey Level at which recipe is considered grey. +-- @return None, array is passed as a reference. +function addon:addTradeSkill(RecipeDB, SpellID, SkillLevel, ItemID, Rarity, Profession, Specialty, Game, Orange, Yellow, Green, Grey) + local spellLink = GetSpellLink(SpellID) + local profession_id = GetSpellInfo(Profession) + local recipe_name = GetSpellInfo(SpellID) + + if RecipeDB[SpellID] then + --@alpha@ + self:Print("Duplicate recipe: "..profession_id.." "..tostring(SpellID).." "..recipe_name) + --@end-alpha@ + return + end + + ------------------------------------------------------------------------------- + -- Create a table inside the RecipeListing table which stores all information + -- about a recipe + ------------------------------------------------------------------------------- + RecipeDB[SpellID] = { + ["Level"] = SkillLevel, + ["ItemID"] = ItemID, + ["Rarity"] = Rarity, + ["Profession"] = profession_id, + ["Locations"] = nil, + ["RecipeLink"] = spellLink, + ["Name"] = recipe_name, + ["Display"] = true, -- Set to be displayed until the filtering occurs + ["Search"] = true, -- Set to be showing in the search results + ["Flags"] = {}, -- Create the flag space in the RecipeDB + ["Acquire"] = {}, -- Create the Acquire space in the RecipeDB + ["Specialty"] = Specialty, -- Assumption: there will only be 1 speciality for a trade skill + ["Game"] = Game, + ["Orange"] = Orange or SkillLevel, -- If we don't have an orange value in the db, just assume the skill level + ["Yellow"] = Yellow or SkillLevel + 10, -- If we don't have a yellow value in the db, just assume the skill level + ["Green"] = Green or SkillLevel + 15, -- If we don't have a green value in the db, just assume the skill level + ["Grey"] = Grey or SkillLevel + 20, -- If we don't have a grey value in the db, just assume the skill level + } + local recipe = RecipeDB[SpellID] + + if not recipe["Name"] then + self:Print(strformat(L["SpellIDCache"], SpellID)) + end + + -- Set all the flags to be false, will also set the padding spaces to false as well. + for i = 1, NUM_FILTER_FLAGS, 1 do + recipe["Flags"][i] = false + end +end + +--- Adds filtering flags to a specific tradeskill. +-- @name AckisRecipeList:addTradeFlags +-- @usage AckisRecipeList:addTradeFlags(RecipeDB,2329,1,2,3,21,22,23,24,25,26,27,28,29,30,36,41,51,52) +-- @param RecipeDB The database (array) which you wish to add flags too. +-- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe which flags are being added to. +-- @param ... A listing of filtering flags. See [[database-documentation]] for a listing of filtering flags. +-- @return None, array is passed as a reference. +function addon:addTradeFlags(RecipeDB, SpellID, ...) + -- flags are defined in Documentation.lua + local numvars = select('#',...) + local flags = RecipeDB[SpellID]["Flags"] + + -- Find out how many flags we're adding + for i = 1, numvars, 1 do + -- Get the value of the current flag + local flag = select(i, ...) + flags[flag] = true + end +end + +--- Adds acquire methods to a specific tradeskill. +-- @name AckisRecipeList:addTradeAcquire +-- @usage AckisRecipeList:addTradeAcquire:(RecipeDB,2329,8,8) +-- @param RecipeDB The database (array) which you wish to add acquire methods too. +-- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe which acquire methods are being added to. +-- @param ... A listing of acquire methods. See [[database-documentation]] for a listing of acquire methods and how they behave. +-- @return None, array is passed as a reference. +do + -- Tables for getting the locations + local location_list = {} + local location_checklist = {} + + local function LocationSort(a, b) + return a < b + end + + function addon:addTradeAcquire(DB, SpellID, ...) + local numvars = select('#', ...) -- Find out how many flags we're adding + local index = 1 -- Index for the number of Acquire entries we have + local i = 1 -- Index for which variables we're parsing through + local acquire = DB[SpellID]["Acquire"] + + twipe(location_list) + twipe(location_checklist) + + while i < numvars do + local acquire_type, acquire_id = select(i, ...) + i = i + 2 + + --@alpha@ + if acquire[index] then + self:Print("addTradeAcquire called more than once for SpellID "..SpellID) + end + --@end-alpha@ + + acquire[index] = { + ["Type"] = acquire_type, + ["ID"] = acquire_id + } + local location + + if not acquire_type then + self:Print("SpellID: "..SpellID.." has no acquire type.") + elseif acquire_type == A_TRAINER then + if not acquire_id then + --@alpha@ + self:Print("SpellID "..SpellID..": TrainerID is nil.") + --@end-alpha@ + elseif not TrainerList[acquire_id] then + --@alpha@ + self:Print("SpellID "..SpellID..": TrainerID "..acquire_id.." does not exist in the database.") + --@end-alpha@ + else + location = TrainerList[acquire_id]["Location"] + + if not location_checklist[location] then + tinsert(location_list, location) + location_checklist[location] = true + end + TrainerList[acquire_id]["TrainList"] = TrainerList[acquire_id]["TrainList"] or {} + TrainerList[acquire_id]["TrainList"][SpellID] = true + end + elseif acquire_type == A_VENDOR then + if not acquire_id then + --@alpha@ + self:Print("SpellID "..SpellID..": VendorID is nil.") + --@end-alpha@ + elseif not VendorList[acquire_id] then + --@alpha@ + self:Print("SpellID "..SpellID..": VendorID "..acquire_id.." does not exist in the database.") + --@end-alpha@ + else + location = VendorList[acquire_id]["Location"] + + if not location_checklist[location] then + tinsert(location_list, location) + location_checklist[location] = true + end + VendorList[acquire_id]["SellList"] = VendorList[acquire_id]["SellList"] or {} + VendorList[acquire_id]["SellList"][SpellID] = true + end + elseif acquire_type == A_MOB then + if not acquire_id then + --@alpha@ + self:Print("SpellID "..SpellID..": MobID is nil.") + --@end-alpha@ + elseif not MobList[acquire_id] then + --@alpha@ + self:Print("SpellID "..SpellID..": Mob ID "..acquire_id.." does not exist in the database.") + --@end-alpha@ + else + location = MobList[acquire_id]["Location"] + + if not location_checklist[location] then + tinsert(location_list, location) + location_checklist[location] = true + end + MobList[acquire_id]["DropList"] = MobList[acquire_id]["DropList"] or {} + MobList[acquire_id]["DropList"][SpellID] = true + end + elseif acquire_type == A_QUEST then + if not acquire_id then + --@alpha@ + self:Print("SpellID "..SpellID..": QuestID is nil.") + --@end-alpha@ + elseif not QuestList[acquire_id] then + --@alpha@ + self:Print("SpellID "..SpellID..": Quest ID "..acquire_id.." does not exist in the database.") + --@end-alpha@ + else + location = QuestList[acquire_id]["Location"] + + if not location_checklist[location] then + tinsert(location_list, location) + location_checklist[location] = true + end + end + --@alpha@ + elseif acquire_type == A_SEASONAL then + if not acquire_id then + self:Print("SpellID "..SpellID..": SeasonalID is nil.") + end + --@end-alpha@ + elseif acquire_type == A_REPUTATION then + local RepLevel, RepVendor = select(i, ...) + i = i + 2 + + acquire[index]["RepLevel"] = RepLevel + acquire[index]["RepVendor"] = RepVendor + VendorList[RepVendor]["SellList"] = VendorList[RepVendor]["SellList"] or {} + VendorList[RepVendor]["SellList"][SpellID] = true + + location = VendorList[RepVendor]["Location"] + + if not location_checklist[location] then + tinsert(location_list, location) + location_checklist[location] = true + end + + --@alpha@ + if not acquire_id then + self:Print("SpellID "..SpellID..": ReputationID is nil.") + elseif not ReputationList[acquire_id] then + self:Print("SpellID "..SpellID..": ReputationID "..acquire_id.." does not exist in the database.") + end + + if not RepVendor then + self:Print("SpellID "..SpellID..": Reputation VendorID is nil.") + elseif not VendorList[RepVendor] then + self:Print("SpellID "..SpellID..": Reputation VendorID "..RepVendor.." does not exist in the database.") + end + --@end-alpha@ + elseif acquire_type == A_WORLD_DROP then + local location = L["World Drop"] + + if not location_checklist[location] then + tinsert(location_list, location) + location_checklist[location] = true + end + end + index = index + 1 + end + -- Populate the location field with all the data + table.sort(location_list, LocationSort) + DB[SpellID]["Locations"] = (#location_list == 0 and "" or tconcat(location_list, ", ")) + end +end -- do block + +--- Adds an item to a specific database listing (ie: vendor, mob, etc) +-- @name AckisRecipeList:addLookupList +-- @usage AckisRecipeList:addLookupList:(VendorDB,NPC ID, NPC Name, NPC Location, X Coord, Y Coord, Faction) +-- @param DB Database which the entry will be stored. +-- @param ID Unique identified for the entry. +-- @param Name Name of the entry. +-- @param Loc Location of the entry in the world. +-- @param Coordx X coordinate of where the entry is found. +-- @param Coordy Y coordinate of where the entry is found. +-- @param Faction Faction identifier for the entry. +-- @return None, array is passed as a reference. +--For individual database structures, see Documentation.lua +do + local FACTION_NAMES = { + [1] = BFAC["Neutral"], + [2] = BFAC["Alliance"], + [3] = BFAC["Horde"] + } + function addon:addLookupList(DB, ID, Name, Loc, Coordx, Coordy, Faction) + if DB[ID] then + --@alpha@ + self:Print("Duplicate lookup: "..tostring(ID).." "..Name) + --@end-alpha@ + return + end + + DB[ID] = { + ["Name"] = Name, + ["Location"] = Loc or L["Unknown Zone"], + ["Faction"] = Faction and FACTION_NAMES[Faction + 1] or nil + } + if Coordx and Coordy then + DB[ID]["Coordx"] = Coordx + DB[ID]["Coordy"] = Coordy + end + + --@alpha@ + if not Loc then + self:Print("Spell ID: " .. ID .. " (" .. DB[ID]["Name"] .. ") has an unknown location.") + end + --@end-alpha@ + end +end -- do + +------------------------------------------------------------------------------- +-- Filter flag functions +------------------------------------------------------------------------------- +do + local F_ALLIANCE, F_HORDE = 1, 2 + + ------------------------------------------------------------------------------- + -- Item "rarity" + ------------------------------------------------------------------------------- + local R_COMMON, R_UNCOMMON, R_RARE, R_EPIC, R_LEGENDARY, R_ARTIFACT = 1, 2, 3, 4, 5, 6 + + -- HardFilterFlags and SoftFilterFlags are used to determine if a recipe should be shown based on the value of the key compared to the value of its saved_var. + -- Its keys and values are populated the first time CanDisplayRecipe() is called. + local HardFilterFlags, SoftFilterFlags, RepFilterFlags + + local F_DK, F_DRUID, F_HUNTER, F_MAGE, F_PALADIN, F_PRIEST, F_SHAMAN, F_ROGUE, F_WARLOCK, F_WARRIOR = 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 + local ClassFilterFlags = { + ["deathknight"] = F_DK, ["druid"] = F_DRUID, ["hunter"] = F_HUNTER, + ["mage"] = F_MAGE, ["paladin"] = F_PALADIN, ["priest"] = F_PRIEST, + ["shaman"] = F_SHAMAN, ["rogue"] = F_ROGUE, ["warlock"] = F_WARLOCK, + ["warrior"] = F_WARRIOR, + } + + ---Scans a specific recipe to determine if it is to be displayed or not. + local function CanDisplayRecipe(recipe) + ------------------------------------------------------------------------------- + -- Origin + ------------------------------------------------------------------------------- + local GAME_ORIG, GAME_TBC, GAME_WOTLK = 0, 1, 2 + + -- For flag info see comments at start of file in comments + local filter_db = addon.db.profile.filters + local general_filters = filter_db.general + local recipe_flags = recipe["Flags"] + + -- See Documentation file for logic explanation + ------------------------------------------------------------------------------- + -- Stage 1 + -- Loop through exclusive flags (hard filters) + -- If one of these does not pass we do not display the recipe + -- So to be more efficient we'll just leave this function if there's a false + ------------------------------------------------------------------------------- + + -- Display both horde and alliance factions? + if not general_filters.faction and not Player:IsCorrectFaction(recipe_flags) then + return false + end + + -- Display all skill levels? + if not general_filters.skill and recipe["Level"] > Player["ProfessionLevel"] then + return false + end + + -- Display all specialities? + if not general_filters.specialty then + local specialty = recipe["Specialty"] + + if specialty and specialty ~= Player["Specialty"] then + return false + end + end + local obtain_filters = filter_db.obtain + local game_version = recipe["Game"] + + -- Filter out game recipes + if not obtain_filters.originalwow and game_version == GAME_ORIG then + return false + end + + if not obtain_filters.bc and game_version == GAME_TBC then + return false + end + + if not obtain_filters.wrath and game_version == GAME_WOTLK then + return false + end + + ------------------------------------------------------------------------------- + -- Check the hard filter flags + ------------------------------------------------------------------------------- + if not HardFilterFlags then + local F_IBOE, F_IBOP, F_IBOA, F_RBOE, F_RBOP, F_RBOA = 36, 37, 38, 40, 41, 42 + local F_DPS, F_TANK, F_HEALER, F_CASTER = 51, 52, 53, 54 + local F_CLOTH, F_LEATHER, F_MAIL, F_PLATE, F_CLOAK, F_TRINKET, F_RING, F_NECK, F_SHIELD = 56, 57, 58, 59, 60, 61, 62, 63, 64 + local F_1H, F_2H, F_AXE, F_SWORD, F_MACE, F_POLEARM, F_DAGGER = 66, 67, 68, 69, 70, 71, 72 + local F_STAFF, F_WAND, F_THROWN, F_BOW, F_XBOW, F_AMMO, F_FIST, F_GUN = 73, 74, 75, 76, 77, 78, 79, 80 + + local binding_filters = filter_db.binding + local player_filters = filter_db.player + local armor_filters = filter_db.item.armor + local weapon_filters = filter_db.item.weapon + + HardFilterFlags = { + ------------------------------------------------------------------------------------------------ + -- Binding flags. + ------------------------------------------------------------------------------------------------ + ["itemboe"] = { flag = F_IBOE, sv_root = binding_filters }, + ["itembop"] = { flag = F_IBOP, sv_root = binding_filters }, + ["itemboa"] = { flag = F_IBOA, sv_root = binding_filters }, + ["recipeboe"] = { flag = F_RBOE, sv_root = binding_filters }, + ["recipebop"] = { flag = F_RBOP, sv_root = binding_filters }, + ["recipeboa"] = { flag = F_RBOA, sv_root = binding_filters }, + ------------------------------------------------------------------------------------------------ + -- Player Type flags. + ------------------------------------------------------------------------------------------------ + ["melee"] = { flag = F_DPS, sv_root = player_filters }, + ["tank"] = { flag = F_TANK, sv_root = player_filters }, + ["healer"] = { flag = F_HEALER, sv_root = player_filters }, + ["caster"] = { flag = F_CASTER, sv_root = player_filters }, + ------------------------------------------------------------------------------------------------ + -- Armor flags. + ------------------------------------------------------------------------------------------------ + ["cloth"] = { flag = F_CLOTH, sv_root = armor_filters }, + ["leather"] = { flag = F_LEATHER, sv_root = armor_filters }, + ["mail"] = { flag = F_MAIL, sv_root = armor_filters }, + ["plate"] = { flag = F_PLATE, sv_root = armor_filters }, + ["trinket"] = { flag = F_TRINKET, sv_root = armor_filters }, + ["cloak"] = { flag = F_CLOAK, sv_root = armor_filters }, + ["ring"] = { flag = F_RING, sv_root = armor_filters }, + ["necklace"] = { flag = F_NECK, sv_root = armor_filters }, + ["shield"] = { flag = F_SHIELD, sv_root = armor_filters }, + ------------------------------------------------------------------------------------------------ + -- Weapon flags. + ------------------------------------------------------------------------------------------------ + ["onehand"] = { flag = F_1H, sv_root = weapon_filters }, + ["twohand"] = { flag = F_2H, sv_root = weapon_filters }, + ["axe"] = { flag = F_AXE, sv_root = weapon_filters }, + ["sword"] = { flag = F_SWORD, sv_root = weapon_filters }, + ["mace"] = { flag = F_MACE, sv_root = weapon_filters }, + ["polearm"] = { flag = F_POLEARM, sv_root = weapon_filters }, + ["dagger"] = { flag = F_DAGGER, sv_root = weapon_filters }, + ["fist"] = { flag = F_FIST, sv_root = weapon_filters }, + ["gun"] = { flag = F_GUN, sv_root = weapon_filters }, + ["staff"] = { flag = F_STAFF, sv_root = weapon_filters }, + ["wand"] = { flag = F_WAND, sv_root = weapon_filters }, + ["thrown"] = { flag = F_THROWN, sv_root = weapon_filters }, + ["bow"] = { flag = F_BOW, sv_root = weapon_filters }, + ["crossbow"] = { flag = F_XBOW, sv_root = weapon_filters }, + ["ammo"] = { flag = F_AMMO, sv_root = weapon_filters }, + } + end + + for filter, data in pairs(HardFilterFlags) do + if recipe_flags[data.flag] and not data.sv_root[filter] then + return false + end + end + + ------------------------------------------------------------------------------- + -- Check the reputation filter flags + ------------------------------------------------------------------------------- + if not RepFilterFlags then + local rep_filters = filter_db.rep + + local F_ARGENTDAWN, F_CENARION_CIRCLE, F_THORIUM_BROTHERHOOD, F_TIMBERMAW_HOLD, F_ZANDALAR = 96, 97, 98, 99, 100 + local F_ALDOR, F_ASHTONGUE, F_CENARION_EXPEDITION, F_HELLFIRE, F_CONSORTIUM = 101, 102, 103, 104, 105 + local F_KOT, F_LOWERCITY, F_NAGRAND, F_SCALE_SANDS, F_SCRYER, F_SHATAR = 106, 107, 108, 109, 110, 111 + local F_SHATTEREDSUN, F_SPOREGGAR, F_VIOLETEYE = 112, 113, 114 + local F_ARGENTCRUSADE, F_FRENZYHEART, F_EBONBLADE, F_KIRINTOR, F_HODIR = 115, 116, 117, 118, 119 + local F_KALUAK, F_ORACLES, F_WYRMREST, F_WRATHCOMMON1, F_WRATHCOMMON2 = 120, 121, 122, 123, 124 + local F_WRATHCOMMON3, F_WRATHCOMMON4, F_WRATHCOMMON5, F_ASHEN_VERDICT = 125, 126, 127, 128 + + RepFilterFlags = { + [F_ARGENTDAWN] = rep_filters.argentdawn, + [F_CENARION_CIRCLE] = rep_filters.cenarioncircle, + [F_THORIUM_BROTHERHOOD] = rep_filters.thoriumbrotherhood, + [F_TIMBERMAW_HOLD] = rep_filters.timbermaw, + [F_ZANDALAR] = rep_filters.zandalar, + [F_ALDOR] = rep_filters.aldor, + [F_ASHTONGUE] = rep_filters.ashtonguedeathsworn, + [F_CENARION_EXPEDITION] = rep_filters.cenarionexpedition, + [F_HELLFIRE] = rep_filters.hellfire, + [F_CONSORTIUM] = rep_filters.consortium, + [F_KOT] = rep_filters.keepersoftime, + [F_LOWERCITY] = rep_filters.lowercity, + [F_NAGRAND] = rep_filters.nagrand, + [F_SCALE_SANDS] = rep_filters.scaleofthesands, + [F_SCRYER] = rep_filters.scryer, + [F_SHATAR] = rep_filters.shatar, + [F_SHATTEREDSUN] = rep_filters.shatteredsun, + [F_SPOREGGAR] = rep_filters.sporeggar, + [F_VIOLETEYE] = rep_filters.violeteye, + [F_ARGENTCRUSADE] = rep_filters.argentcrusade, + [F_FRENZYHEART] = rep_filters.frenzyheart, + [F_EBONBLADE] = rep_filters.ebonblade, + [F_KIRINTOR] = rep_filters.kirintor, + [F_HODIR] = rep_filters.sonsofhodir, + [F_KALUAK] = rep_filters.kaluak, + [F_ORACLES] = rep_filters.oracles, + [F_WYRMREST] = rep_filters.wyrmrest, + [F_WRATHCOMMON1] = rep_filters.wrathcommon1, + [F_WRATHCOMMON2] = rep_filters.wrathcommon2, + [F_WRATHCOMMON3] = rep_filters.wrathcommon3, + [F_WRATHCOMMON4] = rep_filters.wrathcommon4, + [F_WRATHCOMMON5] = rep_filters.wrathcommon5, + [F_ASHEN_VERDICT] = rep_filters.ashenverdict, + } + end + local rep_display = true + + for flag in pairs(RepFilterFlags) do + if recipe_flags[flag] then + rep_display = RepFilterFlags[flag] and true or false + end + end + + if not rep_display then + return false + end + + ------------------------------------------------------------------------------- + -- Check the class filter flags + ------------------------------------------------------------------------------- + local toggled_off, toggled_on = 0, 0 + local class_filters = filter_db.classes + + -- Now we check to see if _all_ of the pertinent class flags are toggled off. If even one is toggled on, we still show the recipe. + for class, flag in pairs(ClassFilterFlags) do + if recipe_flags[flag] then + if class_filters[class] then + toggled_on = toggled_on + 1 + elseif not class_filters[class] then + toggled_off = toggled_off + 1 + end + end + end + + if toggled_off > 0 and toggled_on == 0 then + return false + end + + ------------------------------------------------------------------------------------------------ + -- Stage 2 + -- loop through nonexclusive (soft filters) flags until one is true + -- If one of these is true (ie: we want to see trainers and there is a trainer flag) we display the recipe + ------------------------------------------------------------------------------------------------ + if not SoftFilterFlags then + local F_TRAINER, F_VENDOR, F_INSTANCE, F_RAID, F_SEASONAL, F_QUEST, F_PVP, F_WORLD_DROP, F_MOB_DROP, F_DISC = 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 + + SoftFilterFlags = { + ["trainer"] = { flag = F_TRAINER, sv_root = obtain_filters }, + ["vendor"] = { flag = F_VENDOR, sv_root = obtain_filters }, + ["instance"] = { flag = F_INSTANCE, sv_root = obtain_filters }, + ["raid"] = { flag = F_RAID, sv_root = obtain_filters }, + ["seasonal"] = { flag = F_SEASONAL, sv_root = obtain_filters }, + ["quest"] = { flag = F_QUEST, sv_root = obtain_filters }, + ["pvp"] = { flag = F_PVP, sv_root = obtain_filters }, + ["worlddrop"] = { flag = F_WORLD_DROP, sv_root = obtain_filters }, + ["mobdrop"] = { flag = F_MOB_DROP, sv_root = obtain_filters }, + ["discovery"] = { flag = F_DISC, sv_root = obtain_filters }, + } + end + + for filter, data in pairs(SoftFilterFlags) do + if recipe_flags[data.flag] and data.sv_root[filter] then + return true + end + end + + -- If we get here it means that no flags matched our values + return false + end + + ---Scans the recipe listing and updates the filters according to user preferences + function addon:UpdateFilters() + local general_filters = addon.db.profile.filters.general + local recipes_total = 0 + local recipes_known = 0 + local recipes_total_filtered = 0 + local recipes_known_filtered = 0 + local can_display = false + local current_profession = Player["Profession"] + + for recipe_id, recipe in pairs(RecipeList) do + if recipe["Profession"] == current_profession then + local is_known = recipe["Known"] + + can_display = CanDisplayRecipe(recipe) + recipes_total = recipes_total + 1 + recipes_known = recipes_known + (is_known and 1 or 0) + + if can_display then + recipes_total_filtered = recipes_total_filtered + 1 + recipes_known_filtered = recipes_known_filtered + (is_known and 1 or 0) + + if not general_filters.known and is_known then + can_display = false + end + + if not general_filters.unknown and not is_known then + can_display = false + end + end + else + can_display = false + end + RecipeList[recipe_id]["Display"] = can_display + end + Player.recipes_total = recipes_total + Player.recipes_known = recipes_known + Player.recipes_total_filtered = recipes_total_filtered + Player.recipes_known_filtered = recipes_known_filtered + end + +end -- do + +------------------------------------------------------------------------------- +-- ARL Logic Functions +------------------------------------------------------------------------------- + +---Determines which profession we are dealing with and loads up the recipe information for it. +local function InitializeRecipe(profession) + if not profession then + --@alpha@ + addon:Print("nil profession passed to InitializeRecipe()") + --@end-alpha@ + return + end + local func = PROFESSION_INITS[profession] + + if func then + return func(addon, RecipeList) + else + addon:Print(L["UnknownTradeSkill"]:format(profession)) + return 0 + end +end + +---Determines what to do when the slash command is called. +function addon:ChatCommand(input) + + -- Open About panel if there's no parameters or if we do /arl about + if not input or (input and input:trim() == "") or input == strlower(L["Sorting"]) or input == strlower(L["Sort"]) or input == strlower(_G.DISPLAY) then + InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) + elseif (input == strlower(L["About"])) then + if (self.optionsFrame["About"]) then + InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["About"]) + else + InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) + end + elseif (input == strlower(L["Profile"])) then + InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["Profiles"]) + elseif (input == strlower(_G.FILTER)) then + InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["Filters"]) + elseif (input == strlower(L["Documentation"])) then + InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["Documentation"]) + elseif (input == strlower(L["Scan"])) then + self:Scan(false) + elseif (input == strlower("scandata")) then + self:ScanSkillLevelData() + elseif (input == strlower("scanprof")) then + self:ScanProfession("all") + else + -- What happens when we get here? + LibStub("AceConfigCmd-3.0"):HandleCommand("arl", "Ackis Recipe List", input) + end + +end + +------------------------------------------------------------------------------- +-- Recipe Scanning Functions +------------------------------------------------------------------------------- +do + -- List of tradeskill headers, used in addon:Scan() + local header_list = {} + + --- Causes a scan of the tradeskill to be conducted. Function called when the scan button is clicked. Parses recipes and displays output + -- @name AckisRecipeList:Scan + -- @usage AckisRecipeList:Scan(true) + -- @param textdump Boolean indicating if we want the output to be a text dump, or if we want to use the ARL GUI. + -- @return A frame with either the text dump, or the ARL frame. + function addon:Scan(textdump) + local scan_parent = self.scan_button:GetParent() + + -- The scan button is re-parented to whichever interface it's anchored to, whether it's TradeSkillFrame or a replacement AddOn, + -- so we make sure its parent exists and is visible before proceeding. + if not scan_parent or scan_parent == UIParent or not scan_parent:IsVisible() then + self:Print(L["OpenTradeSkillWindow"]) + return + end + local current_prof, prof_level = GetTradeSkillLine() + + -- Set the current profession and its level, and update the cached data. + Player["Profession"] = current_prof + Player["ProfessionLevel"] = prof_level + + -- Make sure we're only updating a profession the character actually knows - this could be a scan from a tradeskill link. + if not IsTradeSkillLinked() and Player["Professions"][current_prof] then + Player["Professions"][current_prof] = prof_level + end + + -- Get the current profession Specialty + local specialty = SpecialtyTable[Player["Profession"]] + + for index = 1, 25, 1 do + local spellName = GetSpellName(index, BOOKTYPE_SPELL) + + if not spellName or index == 25 then + Player["Specialty"] = nil + break + elseif specialty and specialty[spellName] then + Player["Specialty"] = specialty[spellName] + break + end + end + + -- Add the recipes to the database + -- TODO: Figure out what this variable was supposed to be for - it isn't used anywhere. -Torhal + Player.totalRecipes = InitializeRecipe(Player["Profession"]) + + --- Set the known flag to false for every recipe in the database. + for SpellID in pairs(RecipeList) do + RecipeList[SpellID]["Known"] = false + end + + ------------------------------------------------------------------------------- + -- Scan all recipes and mark the ones we know + ------------------------------------------------------------------------------- + twipe(header_list) + + if MRTUIUtils_PushFilterSelection then + MRTUIUtils_PushFilterSelection() + else + if not Skillet and TradeSkillFrameAvailableFilterCheckButton:GetChecked() then + TradeSkillFrameAvailableFilterCheckButton:SetChecked(false) + TradeSkillOnlyShowMakeable(false) + end + + -- Clear the inventory slot filter + UIDropDownMenu_Initialize(TradeSkillInvSlotDropDown, TradeSkillInvSlotDropDown_Initialize) + UIDropDownMenu_SetSelectedID(TradeSkillInvSlotDropDown, 1) + SetTradeSkillInvSlotFilter(0, 1, 1) + + -- Clear the sub-classes filters + UIDropDownMenu_Initialize(TradeSkillSubClassDropDown, TradeSkillSubClassDropDown_Initialize) + UIDropDownMenu_SetSelectedID(TradeSkillSubClassDropDown, 1) + SetTradeSkillSubClassFilter(0, 1, 1) + + -- Expand all headers so we can see all the recipes there are + for i = GetNumTradeSkills(), 1, -1 do + local name, tradeType, _, isExpanded = GetTradeSkillInfo(i) + + if tradeType == "header" and not isExpanded then + header_list[name] = true + ExpandTradeSkillSubClass(i) + end + end + end + local recipes_found = 0 + + for i = 1, GetNumTradeSkills() do + local tradeName, tradeType = GetTradeSkillInfo(i) + + if tradeType ~= "header" then + -- Get the trade skill link for the specified recipe + local SpellLink = GetTradeSkillRecipeLink(i) + local SpellString = strmatch(SpellLink, "^|c%x%x%x%x%x%x%x%x|H%w+:(%d+)") + local recipe = RecipeList[tonumber(SpellString)] + + if recipe then + recipe["Known"] = true + recipes_found = recipes_found + 1 + else + self:Print(self:Red(tradeName .. " " .. SpellString) .. self:White(L["MissingFromDB"])) + end + end + end + + -- Close all the headers we've opened + -- If Mr Trader is installed use that API + if MRTUIUtils_PopFilterSelection then + MRTUIUtils_PopFilterSelection() + else + -- Collapse all headers that were collapsed before + for i = GetNumTradeSkills(), 1, -1 do + local name, tradeType, _, isExpanded = GetTradeSkillInfo(i) + + if header_list[name] then + CollapseTradeSkillSubClass(i) + end + end + end + -- TODO: Figure out what this variable was supposed to be for - it isn't used anywhere. -Torhal + Player.foundRecipes = recipes_found + + self:UpdateFilters() + Player:MarkExclusions() + + if textdump then + self:DisplayTextDump(RecipeList, Player["Profession"]) + else + self:DisplayFrame() + end + end +end + +------------------------------------------------------------------------------- +-- Recipe Exclusion Functions +------------------------------------------------------------------------------- +---Removes or adds a recipe to the exclusion list. +function addon:ToggleExcludeRecipe(SpellID) + local exclusion_list = addon.db.profile.exclusionlist + + exclusion_list[SpellID] = (not exclusion_list[SpellID] and true or nil) +end + +---Prints all the ID's in the exclusion list out into chat. +function addon:ViewExclusionList() + local exclusion_list = addon.db.profile.exclusionlist + + -- Parse all items in the exclusion list + for i in pairs(exclusion_list) do + self:Print(i .. ": " .. GetSpellInfo(i)) + end +end + +function addon:ClearExclusionList() + local exclusion_list = addon.db.profile.exclusionlist + + exclusion_list = twipe(exclusion_list) +end + +------------------------------------------------------------------------------- +-- Text dumping functions +------------------------------------------------------------------------------- +do + ------------------------------------------------------------------------------- + -- Provides a string of comma separated values for all recipe information + ------------------------------------------------------------------------------- + local text_table = {} + local acquire_list = {} + + local ACQUIRE_NAMES = { + [A_TRAINER] = "Trainer", + [A_VENDOR] = "Vendor", + [A_MOB] = "Mob Drop", + [A_QUEST] = "Quest", + [A_SEASONAL] = "Seasonal", + [A_REPUTATION] = "Reputation", + [A_WORLD_DROP] = "World Drop", + [A_CUSTOM] = "Custom", + } + + function addon:GetTextDump(RecipeDB, profession) + twipe(text_table) + + tinsert(text_table, strformat("Ackis Recipe List Text Dump for %s. ", profession)) + tinsert(text_table, "Text output of all recipes and acquire information. Output is in the form of comma separated values.\n") + tinsert(text_table, "Spell ID,Recipe Name,Skill Level,ARL Filter Flags,Acquire Methods,Known\n") + + for SpellID in pairs(RecipeDB) do + local recipe_prof = GetSpellInfo(RecipeDB[SpellID]["Profession"]) + + if recipe_prof == profession then + -- Add Spell ID, Name and Skill Level to the list + tinsert(text_table, SpellID) + tinsert(text_table, ",") + tinsert(text_table, RecipeDB[SpellID]["Name"]) + tinsert(text_table, ",") + tinsert(text_table, RecipeDB[SpellID]["Level"]) + tinsert(text_table, ",\"") + + -- Add in all the filter flags + local recipe_flags = RecipeDB[SpellID]["Flags"] + local prev + + -- Find out which flags are marked as "true" + for i = 1, NUM_FILTER_FLAGS, 1 do + if recipe_flags[i] then + if prev then + tinsert(text_table, ",") + end + tinsert(text_table, i) + prev = true + end + end + tinsert(text_table, "\",\"") + + -- Find out which unique acquire methods we have + local acquire = RecipeDB[SpellID]["Acquire"] + twipe(acquire_list) + + for i in pairs(acquire) do + local acquire_type = acquire[i]["Type"] + + acquire_list[ACQUIRE_NAMES[acquire_type]] = true + end + + -- Add all the acquire methods in + prev = false + + for i in pairs(acquire_list) do + if prev then + tinsert(text_table, ",") + end + tinsert(text_table, i) + prev = true + end + + if (RecipeDB[SpellID]["Known"]) then + tinsert(text_table, "\",true\n") + else + tinsert(text_table, "\",false\n") + end + end + end + return tconcat(text_table, "") + end + +end + +---Clears all saved tradeskills +function addon:ClearSavedSkills() + twipe(addon.db.global.tradeskill) + + if addon.db.profile.tradeskill then + addon.db.profile.tradeskill = nil + end + +end + +------------------------------------------------------------------------------- +-- API to interface with external AddOns. +------------------------------------------------------------------------------- +--- Initialize the recipe database with a specific profession +-- @name AckisRecipeList:AddRecipeData +-- @usage AckisRecipeList:AddRecipeData(GetSpellInfo(51304)) +-- @param profession Spell ID of the profession which you want to populate the database with. +-- @return Boolean indicating if the operation was successful. The recipe database will be populated with appropriate data. +function addon:AddRecipeData(profession) + return InitializeRecipe(profession) +end + +--- Initialize the recipe database +-- @name AckisRecipeList:InitRecipeData +-- @usage AckisRecipeList:InitRecipeData() +-- @return Boolean indicating if the operation was successful. The recipe database will be populated with appropriate data. +-- @return Arrays containing the RecipeList, MobList, TrainerList, VendorList, QuestList, ReputationList, SeasonalList. +function addon:InitRecipeData() + return false, RecipeList, MobList, TrainerList, VendorList, QuestList, ReputationList, SeasonalList +end + +--- Get recipe information from ARL +-- @name AckisRecipeList:GetRecipeData +-- @param spellID The spell ID of the recipe you want information about. +-- @return Table containing all spell ID information or nil if it's not found. +function addon:GetRecipeData(spellID) + return RecipeList[spellID] +end diff --git a/ARLColour.lua b/ARLColour.lua deleted file mode 100644 index 0b9c7d0..0000000 --- a/ARLColour.lua +++ /dev/null @@ -1,320 +0,0 @@ ---[[ - -**************************************************************************************** - -ARLColour.lua - -Colouring functions for ARL - -File date: @file-date-iso@ -File revision: @file-revision@ -Project revision: @project-revision@ -Project version: @project-version@ - -Code adopted from Crayon library - -**************************************************************************************** - -Please see http://www.wowace.com/projects/arl/for more information. - -License: - Please see LICENSE.txt - -This source code is released under All Rights Reserved. - -************************************************************************ - -]]-- - - -local MODNAME = "Ackis Recipe List" -local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME) - ---[[ - - Colour constants - -]]-- - -local RED = "ff0000" -local ORANGE = "ff7f00" -local YELLOW = "ffff00" -local GREEN = "00ff00" -local WHITE = "ffffff" -local COPPER = "eda55f" -local SILVER = "c7c7cf" -local GOLD = "ffd700" -local PURPLE = "9980CC" -local BLUE = "0000ff" -local CYAN = "00ffff" -local BLACK = "000000" -local GREY = "666666" -local MIDGREY = "858585" -local NEUTRAL = "bfbfbf" -local FRIENDLY = WHITE -local HONORED = "00ff00" -local REVERED = "3f66e5" -local EXALTED = "9933cc" - -local TRAINER = "d9cb9e" -local VENDOR = "aad372" -local QUEST = "2359ff" -local REP = "ff7c0a" -local SEASON = "80590e" -local MOBDROP = "ffffc0" - -local POOR = "919191" -local COMMON = WHITE -local UNCOMMON = "00A900" -local RARE = "0062C3" -local EPIC = "B343FF" -local LEGENDARY = "FA9900" -local ARTIFACT = "e5cc80" - -local HIGH = WHITE -local NORMAL = "ffd100" - -local HORDE = RED -local ALLIANCE = "00ffff" - ---[[ - - Text colourization functions - -]]-- - -function addon:RGBtoHEX(r,g,b) - return string.format("%2x%2x%2x", r*255, g*255, b*255) -end - - --- Changes any string of text to the specified hex colour -function addon:Colourize(hexColour, text) - - return "|cff" .. tostring(hexColour or 'ffffff') .. tostring(text) .. "|r" - -end - --- Converts text to Neutral Colour -function addon:Neutral(text) - return self:Colourize(NEUTRAL, text) -end - --- Converts text to Friendly Colour -function addon:Friendly(text) - return self:Colourize(FRIENDLY, text) -end - --- Converts text to Honored Colour -function addon:Honored(text) - return self:Colourize(HONORED, text) -end - --- Converts text to Revered Colour -function addon:Revered(text) - return self:Colourize(REVERED, text) -end - --- Converts text to Exalted Colour -function addon:Exalted(text) - return self:Colourize(EXALTED, text) -end - -function addon:Horde(text) - return self:Colourize(RED, text) -end - -function addon:Alliance(text) - return self:Colourize(CYAN, text) -end - -function addon:Coords(text) - return self:Colourize(WHITE, text) -end - -function addon:Trainer(text) - return self:Colourize(TRAINER, text) -end - -function addon:Vendor(text) - return self:Colourize(VENDOR, text) -end - -function addon:Quest(text) - return self:Colourize(QUEST, text) -end - -function addon:Rep(text) - return self:Colourize(REP, text) -end - -function addon:Season(text) - return self:Colourize(SEASON, text) -end - -function addon:MobDrop(text) - return self:Colourize(MOBDROP, text) -end - --- Rarity Colors -function addon:Poor(text) - return self:Colourize(POOR, text) -end - -function addon:Common(text) - return self:Colourize(COMMON, text) -end - -function addon:Uncommon(text) - return self:Colourize(UNCOMMON, text) -end - -function addon:Rare(text) - return self:Colourize(RARE, text) -end - -function addon:Epic(text) - return self:Colourize(EPIC, text) -end - -function addon:Legendary(text) - return self:Colourize(LEGENDARY, text) -end - -function addon:Artifact(text) - return self:Colourize(ARTIFACT, text) -end - -function addon:RarityColor(rarityColor, text) - if (rarityColor == 1) then - return self:Colourize(POOR, text) - elseif (rarityColor == 2) then - return self:Colourize(COMMON, text) - elseif (rarityColor == 3) then - return self:Colourize(UNCOMMON, text) - elseif (rarityColor == 4) then - return self:Colourize(RARE, text) - elseif (rarityColor == 5) then - return self:Colourize(EPIC, text) - elseif (rarityColor == 6) then - return self:Colourize(LEGENDARY, text) - else - return self:Colourize(ARTIFACT, text) - end -end - --- Converts text to Red -function addon:Red(text) - return self:Colourize(RED, text) -end - --- Converts text to Orange -function addon:Orange(text) - return self:Colourize(ORANGE, text) -end - --- Converts text to Yellow -function addon:Yellow(text) - return self:Colourize(YELLOW, text) -end - --- Converts text to Green -function addon:Green(text) - return self:Colourize(GREEN, text) -end - --- Converts text to White -function addon:White(text) - return self:Colourize(WHITE, text) -end - --- Converts text to Copper -function addon:Copper(text) - return self:Colourize(COPPER, text) -end - --- Converts text to Silver -function addon:Silver(text) - return self:Colourize(SILVER, text) -end - --- Converts text to Gold -function addon:Gold(text) - return self:Colourize(GOLD, text) -end - --- Converts text to Purple -function addon:Purple(text) - return self:Colourize(PURPLE, text) -end - --- Converts text to Blue -function addon:Blue(text) - return self:Colourize(BLUE, text) -end - --- Converts text to Cyan -function addon:Cyan(text) - return self:Colourize(CYAN, text) -end - --- Converts text to Black -function addon:Black(text) - return self:Colourize(BLACK, text) -end - --- Converts text to Grey -function addon:Grey(text) - return self:Colourize(GREY, text) -end - --- Converts text to Middle Grey -function addon:MidGrey(text) - return self:Colourize(MIDGREY, text) -end - --- Standard bliz yellowish sort of thing -function addon:Normal(text) - return self:Colourize(NORMAL, text) -end - --- used for tooltip rgb stuff -function addon:hexcolor(colorstring) - if (colorstring == "NEUTRAL") then return NEUTRAL - elseif (colorstring == "FRIENDLY") then return FRIENDLY - elseif (colorstring == "HONORED") then return HONORED - elseif (colorstring == "REVERED") then return REVERED - elseif (colorstring == "EXALTED") then return EXALTED - - elseif (colorstring == "TRAINER") then return TRAINER - elseif (colorstring == "VENDOR") then return VENDOR - elseif (colorstring == "QUEST") then return QUEST - elseif (colorstring == "REP") then return REP - elseif (colorstring == "SEASON") then return SEASON - elseif (colorstring == "MOBDROP") then return MOBDROP - - elseif (colorstring == "POOR") then return POOR - elseif (colorstring == "COMMON") then return COMMON - elseif (colorstring == "UNCOMMON") then return UNCOMMON - elseif (colorstring == "RARE") then return RARE - elseif (colorstring == "EPIC") then return EPIC - elseif (colorstring == "LEGENDARY") then return LEGENDARY - elseif (colorstring == "ARTIFACT") then return ARTIFACT - - elseif (colorstring == "HORDE") then return HORDE - elseif (colorstring == "ALLIANCE") then return ALLIANCE - - elseif (colorstring == "BLACK") then return BLACK - elseif (colorstring == "ORANGE") then return ORANGE - elseif (colorstring == "GREEN") then return GREEN - elseif (colorstring == "YELLOW") then return YELLOW - elseif (colorstring == "GREY") then return GREY - elseif (colorstring == "MIDGREY") then return MIDGREY - elseif (colorstring == "RED") then return RED - - elseif (colorstring == "HIGH") then return HIGH --- elseif (colorstring == "NORMAL") then return NORMAL - else - return NORMAL - end -end \ No newline at end of file diff --git a/ARLConfig.lua b/ARLConfig.lua deleted file mode 100644 index 54e9c85..0000000 --- a/ARLConfig.lua +++ /dev/null @@ -1,701 +0,0 @@ ---[[ - -**************************************************************************************** - -ARLConfig.lua - -Ace3 Configuration options for ARL - -File date: @file-date-iso@ -File revision: @file-revision@ -Project revision: @project-revision@ -Project version: @project-version@ - -**************************************************************************************** - -Please see http://www.wowace.com/projects/arl/for more information. - -License: - Please see LICENSE.txt - -This source code is released under All Rights Reserved. - -************************************************************************ - -]]-- - -local MODNAME = "Ackis Recipe List" -local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME) - -local BFAC = LibStub("LibBabble-Faction-3.0"):GetLookupTable() -local LC = LOCALIZED_CLASS_NAMES_MALE -local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME) - -local AceConfig = LibStub("AceConfig-3.0") -local AceConfigReg = LibStub("AceConfigRegistry-3.0") -local AceConfigDialog = LibStub("AceConfigDialog-3.0") - -local modularOptions = {} - -local function giveProfiles() - return LibStub("AceDBOptions-3.0"):GetOptionsTable(addon.db) -end - -local function ResetGUI() - addon.db.profile.frameopts.offsetx = 0 - addon.db.profile.frameopts.offsety = 0 - addon.db.profile.frameopts.anchorTo = "" - addon.db.profile.frameopts.anchorFrom = "" - addon.db.profile.frameopts.uiscale = 1 - addon.db.profile.frameopts.tooltipscale = .9 - addon.db.profile.frameopts.fontsize = 11 -end - -local options - -local function fullOptions() - if not options then - options = { - type = "group", - name = MODNAME, - args = { - general = { - order = 1, - type = "group", - name = L["Main Options"], - desc = L["MAIN_OPTIONS_DESC"], - args = { - header1 = { - order = 10, - type = "header", - name = L["General Options"], - }, - version = { - order = 11, - type = "description", - name = _G.GAME_VERSION_LABEL .. ": " .. addon.version .. "\n", - }, - run = { - order = 12, - type = "execute", - name = L["Scan"], - desc = L["SCAN_RECIPES_DESC"], - func = function(info) addon:Scan(false) end, - }, - textdump = { - order = 13, - type = "execute", - name = L["Text Dump"], - desc = L["TEXT_DUMP_DESC"], - func = function(info) addon:Scan(true) end, - }, - exclusionlist = { - order = 14, - type = "execute", - name = L["View Exclusion List"], - desc = L["VIEW_EXCLUSION_LIST_DESC"], - func = function(info) addon:ViewExclusionList() end, - }, - clearexclusionlist = { - order = 15, - type = "execute", - name = L["Clear Exclusion List"], - desc = L["CLEAR_EXCLUSION_LIST_DESC"], - func = function(info) addon:ClearExclusionList() end, - }, - resetallfilters = { - order = 16, - type = "execute", - name = L["Reset All Filters"], - desc = L["RESET_DESC"], - func = function(info) addon.resetFilters() end, - }, - resetguiwindow = { - order = 17, - type = "execute", - name = L["Reset Window Position"], - desc = L["RESET_WINDOW_DESC"], - func = function(info) ResetGUI() end, - }, - spacer1 = { - order = 19, - type = "description", - name = "\n", - }, - header1a = { - order = 20, - type = "header", - name = L["Main Filter Options"], - }, - mainfilter_desc = { - order = 21, - type = "description", - name = L["MAINFILTER_OPTIONS_DESC"] .. "\n", - }, - includefiltered = { - order = 22, - type = "toggle", - name = L["Include Filtered"], - desc = L["FILTERCOUNT_DESC"], - get = function() return addon.db.profile.includefiltered end, - set = function() addon.db.profile.includefiltered = not addon.db.profile.includefiltered end, - }, - includeexcluded = { - order = 23, - type = "toggle", - name = L["Include Excluded"], - desc = L["EXCLUDECOUNT_DESC"], - get = function() return addon.db.profile.includeexcluded end, - set = function() addon.db.profile.includeexcluded = not addon.db.profile.includeexcluded end, - }, - ignoreexclusionlist = { - order = 24, - type = "toggle", - name = L["Display Exclusions"], - desc = L["DISPLAY_EXCLUSION_DESC"], - get = function() return addon.db.profile.ignoreexclusionlist end, - set = function() addon.db.profile.ignoreexclusionlist = not addon.db.profile.ignoreexclusionlist end, - }, - spacer2 = { - order = 39, - type = "description", - name = "\n", - }, - header3 = { - order = 40, - type = "header", - name = L["Sorting Options"], - }, - sort_desc = { - order = 41, - type = "description", - name = L["SORTING_OPTIONS_DESC"] .. "\n", - }, - sorting = { - order = 45, - type = "select", - name = L["Sorting"], - desc = L["SORTING_DESC"], - get = function() - return addon.db.profile.sorting - end, - set = function(info, name) - addon.db.profile.sorting = name - end, - values = function() - return { - Name = _G.NAME, - SkillAsc = L["Skill (Asc)"], - SkillDesc = L["Skill (Desc)"], - Acquisition = L["Acquisition"], - Location = L["Location"] - } - end, - }, - }, - }, - }, - } - - for k,v in pairs(modularOptions) do - options.args[k] = (type(v) == "function") and v() or v - end - - end - - return options - -end - -local arlmap = nil - -local function giveMap() - - local tomtomsupport = true - - if ((TomTom) or ((TomTom) and (Carbonite))) then - tomtomsupport = false - end - - if (not arlmap) then - - arlmap = { - order = 1, - type = "group", - name = L["Map Options"], - desc = L["MAP_OPTIONS_DESC"], - args = { - map_desc = { - order = 1, - type = "description", - name = L["MAP_OPTIONS_DESC"] .. "\n", - }, - autoscanmap = { - order = 2, - type = "toggle", - name = L["Auto Scan Map"], - desc = L["AUTOSCANMAP_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.autoscanmap end, - set = function() addon.db.profile.autoscanmap = not addon.db.profile.autoscanmap end, - }, - worldmap = { - order = 3, - type = "toggle", - name = _G.WORLD_MAP, - desc = L["WORLDMAP_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.worldmap end, - set = function() addon.db.profile.worldmap = not addon.db.profile.worldmap end, - }, - minimap = { - order = 4, - type = "toggle", - name = L["Mini Map"], - desc = L["MINIMAP_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.minimap end, - set = function() addon.db.profile.minimap = not addon.db.profile.minimap end, - }, - maptrainer = { - order = 5, - type = "toggle", - name = L["Trainer"], - desc = L["MAP_TRAINER_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.maptrainer end, - set = function() addon.db.profile.maptrainer = not addon.db.profile.maptrainer end, - }, - mapvendor = { - order = 6, - type = "toggle", - name = L["Vendor"], - desc = L["MAP_VENDOR_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.mapvendor end, - set = function() addon.db.profile.mapvendor = not addon.db.profile.mapvendor end, - }, - mapmob = { - order = 7, - type = "toggle", - name = L["Monster"], - desc = L["MAP_MONSTER_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.mapmob end, - set = function() addon.db.profile.mapmob = not addon.db.profile.mapmob end, - }, - mapquest = { - order = 8, - type = "toggle", - name = L["Quest"], - desc = L["MAP_QUEST_DESC"], - disabled = tomtomsupport, - get = function() return addon.db.profile.mapquest end, - set = function() addon.db.profile.mapquest = not addon.db.profile.mapquest end, - }, - clearmap = { - order = 20, - type = "execute", - name = L["Clear Waypoints"], - disabled = tomtomsupport, - desc = L["CLEAR_WAYPOINTS_DESC"], - func = function() addon:ClearMap() end, - }, - }, - } - - end - - return arlmap - -end - -local datamine = nil - -local function giveDatamine() - - if (not datamine) then - - datamine = { - order = 1, - type = "group", - name = L["Datamine Options"], - desc = L["DATAMINE_OPTIONS_DESC"], - args = { - datamine_desc = { - order = 1, - type = "description", - name = L["DATAMINE_OPTIONS_DESC"] .. "\n", - }, - datamine_warn = { - order = 2, - type = "description", - name = L["DATAMINE_WARNING_DESC"] .. "\n", - }, - generatelinks = { - order = 73, - type = "execute", - name = L["Generate Tradeskill Links"], - desc = L["GENERATE_LINKS_DESC"], - func = function() addon:GenerateLinks() end, - }, - scantrainerskills = { - order = 75, - type = "execute", - name = L["Compare Trainer Skills"], - desc = L["COMPARE_TRAINER_SKILL_DESC"], - func = function() addon:ScanSkillLevelData() end, - }, - scantraineracquire = { - order = 76, - type = "execute", - name = L["Compare Trainer Acquire"], - desc = L["COMPARE_TRAINER_ACQUIRE_DESC"], - func = function() addon:ScanTrainerData() end, - }, - scanentiredatabase = { - order = 77, - type = "execute", - name = L["Scan Entire Database"], - desc = L["SCAN_ENTIRE_DB_DESC"], - func = function() addon:TooltipScanDatabase() end, - }, - scanvendor = { - order = 78, - type = "execute", - name = L["Scan Vendor"], - desc = L["SCAN_VENDOR_DESC"], - func = function() addon:ScanVendor() end, - }, - scanprofessiontooltip = { - type = "input", - name = L["Scan Professions"], - desc = L["SCAN_PROF_DB_DESC"], - get = false, - set = function(info, v) addon:ScanProfession(v) end, - order = 79, - }, - scanspellid = { - type = "input", - name = L["Scan Spell ID"], - desc = L["SCAN_SPELL_ID_DESC"], - get = false, - set = function(info, v) addon:TooltipScanRecipe(tonumber(v),false,false) end, - order = 80, - }, - scantrainers = { - order = 90, - type = "toggle", - name = L["Auto Scan Trainers"], - desc = L["AUTOSCAN_TRAINERS_DESC"], - get = function() return addon.db.profile.scantrainers end, - set = function() - if (addon.db.profile.scantrainers) then - addon:UnregisterEvent("TRAINER_SHOW") - else - addon:RegisterEvent("TRAINER_SHOW") - end - addon.db.profile.scantrainers = not addon.db.profile.scantrainers - end, - }, - scanvendors = { - order = 91, - type = "toggle", - name = L["Auto Scan Vendors"], - desc = L["AUTOSCAN_VENDORS_DESC"], - get = function() return addon.db.profile.scanvendors end, - set = function() - if (addon.db.profile.scanvendors) then - addon:UnregisterEvent("MERCHANT_SHOW") - else - addon:RegisterEvent("MERCHANT_SHOW") - end - addon.db.profile.scanvendors = not addon.db.profile.scanvendors - end, - }, - autoloaddb = { - order = 100, - type = "toggle", - name = L["Auto Load Recipe Database"], - desc = L["AUTOLOAD_DB_DESC"], - get = function() return addon.db.profile.autoloaddb end, - set = function() addon.db.profile.autoloaddb = not addon.db.profile.autoloaddb end, - }, - }, - } - - end - - return datamine - -end - -local documentation = nil - -local function giveDocs() - - if (not documentation) then - - documentation = { - order = 1, - type = "group", - name = L["ARL Documentation"], - desc = L["ARL_DOC_DESC"], - args = { - header1 = { - order = 1, - type = "header", - name = L["ARL Documentation"], - }, - desc1 = { - order = 2, - type = "description", - name = L["ARL_DOC_DESC"], - }, - header2 = { - order = 3, - type = "header", - name = L["Using Filters"], - }, - desc2 = { - order = 4, - type = "description", - name = L["USING_FILTERS_DESC"], - }, - header3 = { - order = 5, - type = "header", - name = L["Common Issues"], - }, - desc3 = { - order = 6, - type = "description", - name = L["COMMON_ISSUES_DESC"], - }, - header4 = { - order = 7, - type = "header", - name = L["Reporting Bugs"], - }, - desc4 = { - order = 8, - type = "description", - name = L["REPORTING_BUGS_DESC"], - }, - header5 = { - order = 9, - type = "header", - name = L["Exclusion Issues"], - }, - desc5 = { - order = 10, - type = "description", - name = L["EXCLUSION_ISSUES_DESC"], - }, - header6 = { - order = 11, - type = "header", - name = L["Map Issues"], - }, - desc6 = { - order = 12, - type = "description", - name = L["MAP_ISSUES_DESC"], - }, - header7 = { - order = 13, - type = "header", - name = L["Game Commands"], - }, - desc7 = { - order = 14, - type = "description", - name = L["GAME_COMMANDS_DESC"], - }, - }, - } - - end - - return documentation - -end - -local displayoptions = nil - -local function giveDisplay() - if not displayoptions then - displayoptions = { - order = 1, - type = "group", - name = L["Display Options"], - desc = L["DISPLAY_OPTIONS_DESC"], - args = { - display_desc = { - order = 1, - type = "description", - name = L["MAP_OPTIONS_DESC"] .. "\n", - }, - scanbuttonlocation = { - order = 2, - type = "select", - name = L["Scan Button Position"], - desc = L["SCANBUTTONPOSITION_DESC"], - get = function() return addon.db.profile.scanbuttonlocation end, - set = function(info,name) addon.db.profile.scanbuttonlocation = name end, - values = function() return {TR = L["Top Right"], TL = L["Top Left"], BR = L["Bottom Right"], BL = L["Bottom Left"]} end, - }, - uiscale = { - order = 3, - type = "range", - name = _G.UI_SCALE, - desc = L["UI_SCALE_DESC"], - min = .5, - max = 1.5, - step = .05, - bigStep = .05, - get = function() return addon.db.profile.frameopts.uiscale end, - set = function(info, v) - addon.db.profile.frameopts.uiscale = v - addon.Frame:SetScale(v) - end, - }, - fontsize = { - order = 4, - type = "range", - name = _G.FONT_SIZE, - desc = L["FONT_SIZE_DESC"], - min = 6, - max = 20, - step = 1, - bigStep = 1, - get = function() return addon.db.profile.frameopts.fontsize end, - set = function(info, v) addon.db.profile.frameopts.fontsize = v end, - }, - closegui = { - order = 5, - type = "toggle", - name = L["Close GUI"], - desc = L["CLOSEGUI_DESC"], - get = function() return addon.db.profile.closeguionskillclose end, - set = function() addon.db.profile.closeguionskillclose = not addon.db.profile.closeguionskillclose end, - }, - hidepopup = { - order = 6, - type = "toggle", - name = L["Hide Pop-Up"], - desc = L["HIDEPOPUP_DESC"], - get = function() return addon.db.profile.hidepopup end, - set = function() addon.db.profile.hidepopup = not addon.db.profile.hidepopup end, - }, - spacer1 = { - order = 10, - type = "description", - name = "\n", - }, - tooltip_header = { - order = 11, - type = "header", - name = L["Tooltip Options"], - }, - tooltip_desc = { - order = 12, - type = "description", - name = L["TOOLTIP_OPTIONS_DESC"] .. "\n", - }, - tooltipscale = { - order = 20, - type = "range", - name = L["Tooltip Scale"], - desc = L["TOOLTIP_SCALE_DESC"], - min = .5, - max = 1.5, - step = .05, - bigStep = .05, - get = function() - return addon.db.profile.frameopts.tooltipscale - end, - set = function(info, v) - addon.db.profile.frameopts.tooltipscale = v - end, - }, - acquiretooltiplocation = { - order = 21, - type = "select", - name = L["Tooltip (Acquire) Position"], - desc = L["ACQUIRETOOLTIPPOSITION_DESC"], - get = function() - return addon.db.profile.acquiretooltiplocation - end, - set = function(info, name) - addon.db.profile.acquiretooltiplocation = name - end, - values = function() - return { - Right = L["Right"], - Left = L["Left"], - Top = L["Top"], - Bottom = L["Bottom"], - Off = _G.OFF, - Mouse = _G.MOUSE_LABEL - } - end, - }, - spelltooltiplocation = { - order = 22, - type = "select", - name = L["Tooltip (Recipe) Position"], - desc = L["SPELLTOOLTIPPOSITION_DESC"], - get = function() - return addon.db.profile.spelltooltiplocation - end, - set = function(info,name) - addon.db.profile.spelltooltiplocation = name - end, - values = function() - return { - Right = L["Right"], - Left = L["Left"], - Top = L["Top"], - Bottom = L["Bottom"], - Off = _G.OFF - } - end, - }, - }, - } - end - return displayoptions -end - -function addon:SetupOptions() - AceConfigReg:RegisterOptionsTable(MODNAME, fullOptions) - self.optionsFrame = AceConfigDialog:AddToBlizOptions(MODNAME, nil, nil, "general") - - -- Add in the about panel to the Bliz options (but not the ace3 config) - if LibStub:GetLibrary("LibAboutPanel", true) then - self.optionsFrame["About"] = LibStub:GetLibrary("LibAboutPanel").new(MODNAME, MODNAME) - else - self:Print("Lib AboutPanel not loaded.") - end - - -- Fill up our modular options... - self:RegisterModuleOptions("Datamining", giveDatamine(), L["Datamine Options"]) - self:RegisterModuleOptions("Display", giveDisplay(), L["Display Options"]) - self:RegisterModuleOptions("Documentation", giveDocs(), L["ARL Documentation"]) - self:RegisterModuleOptions("Map", giveMap(), L["Map Options"]) - self:RegisterModuleOptions("Profiles", giveProfiles(), L["Profile Options"]) -end - --- Description: Function which extends our options table in a modular way --- Expected result: add a new modular options table to the modularOptions upvalue as well as the Blizzard config --- Input: --- name : index of the options table in our main options table --- optionsTable : the sub-table to insert --- displayName : the name to display in the config interface for this set of options --- Output: None. - -function addon:RegisterModuleOptions(name, optionsTable, displayName) - modularOptions[name] = optionsTable - self.optionsFrame[name] = AceConfigDialog:AddToBlizOptions(MODNAME, displayName, MODNAME, name) -end diff --git a/ARLDatamine.lua b/ARLDatamine.lua deleted file mode 100644 index 18c80d3..0000000 --- a/ARLDatamine.lua +++ /dev/null @@ -1,2346 +0,0 @@ ---[[ - -************************************************************************ - -ARLDatamine.lua - -In-game datamining functions for ARL - -File date: @file-date-iso@ -File revision: @file-revision@ -Project revision: @project-revision@ -Project version: @project-version@ - -************************************************************************ - -Please see http://www.wowace.com/projects/arl/for more information. - -License: - Please see LICENSE.txt - -This source code is released under All Rights Reserved. - -************************************************************************ - -]]-- - - -------------------------------------------------------------------------------- --- AddOn namespace. -------------------------------------------------------------------------------- -local MODNAME = "Ackis Recipe List" -local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME) - -local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME) - - -------------------------------------------------------------------------------- --- Upvalues globals. -------------------------------------------------------------------------------- -local table, string = table, string - -local tconcat, tinsert, tsort, twipe = table.concat, table.insert, table.sort, table.wipe -local strlower, strmatch = string.lower, string.match -local gsub = string.gsub -local tonumber, tostring = tonumber, tostring -local ipairs, pairs = ipairs, pairs - -------------------------------------------------------------------------------- --- Upvalued Blizzard API. -------------------------------------------------------------------------------- -local UnitName = UnitName -local UnitGUID = UnitGUID -local UnitExists = UnitExists -local UnitIsPlayer = UnitIsPlayer -local UnitIsEnemy = UnitIsEnemy -local GetNumTrainerServices = GetNumTrainerServices -local GetTrainerServiceInfo = GetTrainerServiceInfo -local IsTradeskillTrainer = IsTradeskillTrainer -local SetTrainerServiceTypeFilter = SetTrainerServiceTypeFilter -local GetTrainerServiceTypeFilter = GetTrainerServiceTypeFilter -local GetTrainerServiceSkillReq = GetTrainerServiceSkillReq -local GetMerchantNumItems = GetMerchantNumItems -local GetMerchantItemLink = GetMerchantItemLink -local GetMerchantItemInfo = GetMerchantItemInfo -local GetSpellInfo = GetSpellInfo - -------------------------------------------------------------------------------- --- Tradeskill professions -------------------------------------------------------------------------------- -local PROFESSIONS = { - ["Alchemy"] = GetSpellInfo(51304), - ["Blacksmithing"] = GetSpellInfo(51300), - ["Cooking"] = GetSpellInfo(51296), - ["Enchanting"] = GetSpellInfo(51313), - ["Engineering"] = GetSpellInfo(51306), - ["FirstAid"] = GetSpellInfo(45542), - ["Inscription"] = GetSpellInfo(45363), - ["Jewelcrafting"] = GetSpellInfo(51311), - ["Leatherworking"] = GetSpellInfo(51302), - ["Runeforging"] = GetSpellInfo(53428), - ["Smelting"] = GetSpellInfo(32606), - ["Tailoring"] = GetSpellInfo(51309), -} - -------------------------------------------------------------------------------- --- Mined via Data-tools --- Table is Public Domain now --- Look up table of Spell IDs to the recipe which trains them. -------------------------------------------------------------------------------- -local SPELL_ITEM = { - ------------------------------------------------------------------------------- - -- First Aid - ------------------------------------------------------------------------------- - [7929] = 16112, [7935] = 6454, [10840] = 16113, [23787] = 19442, - [27032] = 21992, [27033] = 21993, [45546] = 39152, - - ------------------------------------------------------------------------------- - -- Alchemy - ------------------------------------------------------------------------------- - [2333] = 3396, [2335] = 2555, [3172] = 3393, [3174] = 3394, - [3175] = 3395, [3188] = 6211, [3230] = 2553, [3449] = 6068, - [3450] = 3830, [3451] = 3831, [3453] = 3832, [3454] = 14634, - [4508] = 4597, [4942] = 4624, [6617] = 5640, [6618] = 5643, - [6624] = 5642, [7255] = 6053, [7256] = 6054, [7257] = 6055, - [7258] = 6056, [7259] = 6057, [8240] = 6663, [11453] = 9293, - [11456] = 10644, [11458] = 9294, [11459] = 9303, [11464] = 9295, - [11466] = 9296, [11468] = 9297, [11472] = 9298, [11473] = 9302, - [11476] = 9301, [11477] = 9300, [11479] = 9304, [11480] = 9305, - [17187] = 12958, [17552] = 13476, [17553] = 13477, [17554] = 13478, - [17555] = 13479, [17556] = 13480, [17557] = 13481, [17559] = 13482, - [17560] = 13483, [17561] = 13484, [17562] = 13485, [17563] = 13486, - [17564] = 13487, [17565] = 13488, [17566] = 13489, [17570] = 13490, - [17571] = 13491, [17572] = 13492, [17573] = 13493, [17574] = 13494, - [17575] = 13495, [17576] = 13496, [17577] = 13497, [17578] = 13499, - [17580] = 13501, [17632] = 13517, [17634] = 13518, [17635] = 31354, - [17636] = 31356, [17637] = 31355, [17638] = 31357, [21923] = 17709, - [22732] = 18257, [24365] = 20011, [24366] = 20012, [24367] = 20013, - [24368] = 20014, [25146] = 20761, [26277] = 21547, [28543] = 22900, - [28546] = 22901, [28549] = 22902, [28550] = 22903, [28552] = 22904, - [28553] = 24001, [28554] = 22906, [28555] = 22907, [28556] = 22908, - [28557] = 22909, [28558] = 22910, [28562] = 22911, [28563] = 22912, - [28564] = 35295, [28565] = 22914, [28566] = 22915, [28567] = 22916, - [28568] = 30443, [28569] = 22918, [28570] = 22919, [28571] = 22920, - [28572] = 22921, [28573] = 22922, [28575] = 22923, [28576] = 22924, - [28577] = 22925, [28578] = 35294, [28579] = 22927, [29688] = 23574, - [32765] = 25869, [32766] = 29232, [38960] = 31680, [38961] = 31682, - [38962] = 31681, [39637] = 32070, [39639] = 32071, [42736] = 33209, - [47046] = 35752, [47048] = 35753, [47049] = 35754, [47050] = 35755, - [53936] = 44564, [53937] = 44566, [53938] = 44568, [53939] = 44565, - [53942] = 44567, - - ------------------------------------------------------------------------------- - -- Blacksmithing - ------------------------------------------------------------------------------- - [2667] = 2881, [2673] = 5578, [3295] = 2883, [3297] = 3608, - [3321] = 3609, [3325] = 3610, [3330] = 2882, [3334] = 3611, - [3336] = 3612, [3492] = 12162, [3493] = 3866, [3494] = 10858, - [3495] = 3867, [3496] = 12163, [3497] = 3868, [3498] = 12164, - [3500] = 3869, [3503] = 6047, [3504] = 3870, [3505] = 3871, - [3507] = 3872, [3511] = 3873, [3513] = 3874, [3515] = 3875, - [6518] = 5543, [7221] = 6044, [7222] = 6045, [7224] = 6046, - [8367] = 6735, [9811] = 7978, [9813] = 7979, [9814] = 7980, - [9818] = 7981, [9820] = 7982, [9933] = 7975, [9937] = 7995, - [9939] = 7976, [9945] = 7983, [9950] = 7984, [9952] = 7985, - [9964] = 7989, [9966] = 7991, [9970] = 7990, [9995] = 7992, - [9997] = 8029, [10005] = 7993, [10009] = 8028, [10013] = 8030, - [11454] = 10713, [11643] = 9367, [12259] = 10424, [15292] = 11610, - [15293] = 11614, [15294] = 11611, [15295] = 11615, [15296] = 11612, - [15973] = 12261, [16642] = 12682, [16643] = 12683, [16644] = 12684, - [16645] = 12685, [16646] = 12687, [16647] = 12688, [16648] = 12689, - [16649] = 12690, [16650] = 12691, [16651] = 12692, [16652] = 12693, - [16653] = 12694, [16654] = 12695, [16655] = 12699, [16656] = 12697, - [16657] = 12700, [16658] = 12701, [16659] = 12702, [16660] = 12698, - [16661] = 12703, [16662] = 12704, [16663] = 12705, [16664] = 12706, - [16665] = 12707, [16667] = 12696, [16724] = 12711, [16725] = 12713, - [16726] = 12714, [16728] = 12716, [16729] = 12717, [16730] = 12715, - [16731] = 12718, [16732] = 12719, [16741] = 12720, [16742] = 12725, - [16744] = 12726, [16745] = 12727, [16746] = 12728, [16969] = 12819, - [16970] = 12821, [16971] = 12823, [16973] = 12824, [16978] = 12825, - [16983] = 12827, [16984] = 12828, [16985] = 12830, [16988] = 12833, - [16990] = 12834, [16991] = 12835, [16992] = 12836, [16993] = 12837, - [16994] = 12838, [16995] = 12839, [20872] = 17049, [20873] = 17053, - [20874] = 17051, [20876] = 17052, [20890] = 17059, [20897] = 17060, - [21161] = 18592, [21913] = 17706, [22757] = 18264, [23628] = 19202, - [23629] = 19204, [23632] = 19203, [23633] = 19205, [23636] = 19206, - [23637] = 19207, [23638] = 19208, [23639] = 19209, [23650] = 19210, - [23652] = 19211, [23653] = 19212, [24136] = 19776, [24137] = 19777, - [24138] = 19778, [24139] = 19779, [24140] = 19780, [24141] = 19781, - [24399] = 20040, [24912] = 20553, [24913] = 20555, [24914] = 20554, - [27585] = 22209, [27586] = 22219, [27587] = 22222, [27588] = 22214, - [27589] = 22220, [27590] = 22221, [27829] = 22388, [27830] = 22390, - [27832] = 22389, [28461] = 22766, [28462] = 22767, [28463] = 22768, - [29566] = 23590, [29568] = 23591, [29569] = 23592, [29571] = 23593, - [29603] = 23594, [29605] = 23595, [29606] = 23596, [29608] = 23597, - [29610] = 23599, [29611] = 23598, [29613] = 23600, [29614] = 23601, - [29615] = 23602, [29616] = 23603, [29617] = 23604, [29619] = 23605, - [29620] = 23606, [29621] = 23607, [29622] = 23621, [29628] = 23608, - [29629] = 23609, [29630] = 23610, [29642] = 23611, [29643] = 23612, - [29645] = 23613, [29648] = 23615, [29649] = 23617, [29656] = 23618, - [29657] = 24002, [29658] = 23620, [29662] = 23622, [29663] = 23623, - [29664] = 23624, [29668] = 23625, [29669] = 23626, [29671] = 23627, - [29672] = 23628, [29692] = 23629, [29693] = 23630, [29694] = 23631, - [29695] = 23632, [29696] = 23633, [29697] = 23634, [29698] = 23635, - [29699] = 23636, [29700] = 23637, [29728] = 23638, [29729] = 23639, - [32285] = 25526, [32656] = 25846, [32657] = 25847, [34608] = 28632, - [36389] = 30321, [36390] = 30322, [36391] = 30323, [36392] = 30324, - [38473] = 31390, [38475] = 31391, [38476] = 31392, [38477] = 31393, - [38478] = 31394, [38479] = 31395, [40033] = 32441, [40034] = 32442, - [40035] = 32443, [40036] = 32444, [41132] = 32736, [41133] = 32737, - [41134] = 32738, [41135] = 32739, [42688] = 35296, [43549] = 33792, - [43846] = 33954, [46140] = 35208, [46141] = 35209, [46142] = 35210, - [46144] = 35211, [54978] = 41124, [54979] = 41123, [54980] = 41120, - [54981] = 41122, [62202] = 44938, [63187] = 45088, [63188] = 45089, - [63189] = 45090, [63190] = 45091, [63191] = 45092, [63192] = 45093, - [67091] = 47622, [67130] = 47460, [67092] = 47623, [67131] = 47641, - [67096] = 47627, [67135] = 47642, [67095] = 47626, [67134] = 47643, - [67093] = 47624, [67132] = 47644, [67094] = 47625, [67133] = 47645, - - ------------------------------------------------------------------------------- - -- Cooking - ------------------------------------------------------------------------------- - [2542] = 2697, [2543] = 728, [2545] = 2698, [2547] = 2699, - [2548] = 2700, [2549] = 2701, [2795] = 2889, [3370] = 3678, - [3371] = 3679, [3372] = 3680, [3373] = 3681, [3376] = 3682, - [3377] = 3683, [3397] = 3734, [3398] = 3735, [3399] = 3736, - [3400] = 3737, [4094] = 4609, [6412] = 5482, [6413] = 5483, - [6414] = 5484, [6415] = 5485, [6416] = 5486, [6417] = 44977, - [6418] = 5488, [6419] = 5489, [6501] = 5528, [7213] = 6039, - [7751] = 6325, [7752] = 6326, [7753] = 6328, [7754] = 6329, - [7755] = 6330, [7827] = 6368, [7828] = 6369, [8238] = 6661, - [8607] = 6892, [9513] = 18160, [15853] = 12227, [15855] = 12228, - [15856] = 12229, [15861] = 12231, [15863] = 12232, [15865] = 12233, - [15906] = 12239, [15910] = 12240, [15915] = 16111, [15933] = 16110, - [15935] = 12226, [18238] = 13939, [18239] = 13940, [18240] = 13942, - [18241] = 13941, [18242] = 13943, [18243] = 13945, [18244] = 13946, - [18245] = 13947, [18246] = 13948, [18247] = 13949, [20626] = 16767, - [20916] = 17062, [21143] = 17200, [21144] = 17201, [22480] = 18046, - [22761] = 18267, [24418] = 20075, [25659] = 21025, [25704] = 21099, - [25954] = 21219, [28267] = 22647, [33276] = 27685, [33277] = 27686, - [33278] = 27687, [33279] = 27684, [33284] = 27688, [33285] = 27689, - [33286] = 27690, [33287] = 27691, [33288] = 27692, [33289] = 27693, - [33290] = 27694, [33291] = 27695, [33292] = 27696, [33293] = 27697, - [33294] = 27698, [33295] = 27699, [33296] = 27700, [36210] = 30156, - [38867] = 31675, [38868] = 31674, [43707] = 33870, [43758] = 33871, - [43761] = 33869, [43765] = 33873, [43772] = 33875, [43779] = 33925, - [45022] = 34413, [45555] = 43018, [45556] = 43019, [45557] = 43020, - [45558] = 43021, [45559] = 43022, [45567] = 43023, [45568] = 43024, - [45570] = 43026, [45571] = 43025, [45695] = 34834, [46684] = 35564, - [46688] = 35566, [53056] = 39644, [57423] = 43017, [57433] = 43027, - [57434] = 43028, [57435] = 43029, [57436] = 43030, [57437] = 43031, - [57438] = 43032, [57439] = 43033, [57440] = 43034, [57441] = 43035, - [57442] = 43036, [57443] = 43037, [58512] = 43507, [58521] = 43508, - [58523] = 43509, [58525] = 43510, [58527] = 43505, [58528] = 43506, - [62350] = 44954, - - ------------------------------------------------------------------------------- - -- Enchanting - ------------------------------------------------------------------------------- - [7443] = 6342, [7766] = 6344, [7776] = 6346, [7782] = 6347, - [7786] = 6348, [7793] = 6349, [7859] = 6375, [7867] = 6377, - [13380] = 11038, [13419] = 11039, [13464] = 11081, [13522] = 11098, - [13536] = 11101, [13612] = 11150, [13617] = 11151, [13620] = 11152, - [13646] = 11163, [13653] = 11164, [13655] = 11165, [13687] = 11167, - [13689] = 11168, [13698] = 11166, [13817] = 11202, [13841] = 11203, - [13846] = 11204, [13868] = 11205, [13882] = 11206, [13898] = 11207, - [13915] = 11208, [13931] = 11223, [13933] = 11224, [13945] = 11225, - [13947] = 11226, [15596] = 11813, [15596] = 45050, - [20009] = 16218, [20010] = 16246, [20011] = 16251, [20012] = 16219, - [20014] = 16216, [20015] = 16224, [20016] = 16222, - [20017] = 16217, [20020] = 16215, [20023] = 16245, [20024] = 16220, - [20025] = 16253, [20026] = 16221, [20028] = 16242, [20029] = 16223, - [20030] = 16247, [20031] = 16250, [20032] = 16254, [20033] = 16248, - [20034] = 16252, [20035] = 16255, [20036] = 16249, [20051] = 16243, - [21931] = 17725, [22749] = 18259, [22750] = 18260, [23799] = 19444, - [23800] = 19445, [23801] = 19446, [23802] = 19447, [23803] = 19448, - [23804] = 19449, [25072] = 33153, [25072] = 20726, [25073] = 20727, - [25074] = 20728, [25078] = 20729, [25079] = 20730, [25080] = 33152, - [25080] = 20731, [25081] = 20732, [25082] = 20733, [25083] = 33149, - [25083] = 20734, [25084] = 20735, [25084] = 33150, [25084] = 33151, - [25086] = 20736, [25086] = 33148, [25124] = 20758, [25125] = 20752, - [25126] = 20753, [25127] = 20754, [25128] = 20755, [25129] = 20756, - [25130] = 20757, [27837] = 22392, [27906] = 22530, [27911] = 22531, - [27911] = 24000, [27913] = 22532, [27914] = 22533, [27917] = 22534, - [27920] = 22535, [27924] = 22536, [27926] = 22537, [27927] = 22538, - [27945] = 22539, [27946] = 22540, [27947] = 22541, [27948] = 35298, - [27948] = 22542, [27950] = 22543, [27951] = 22544, [27954] = 22545, - [27960] = 24003, [27960] = 22547, [27962] = 22548, [27967] = 22552, - [27968] = 22551, [27971] = 22554, [27972] = 22553, [27975] = 22555, - [27977] = 22556, [27981] = 22560, [27982] = 22561, [27984] = 22559, - [28003] = 22558, [28004] = 22557, [28016] = 22562, [28019] = 22563, - [28022] = 22565, [32665] = 25848, [32667] = 25849, [33992] = 28270, - [33994] = 28271, [33997] = 28272, [33999] = 28273, [34003] = 28274, - [34005] = 28276, [34006] = 28277, [34007] = 35299, [34007] = 28279, - [34008] = 35297, [34008] = 28280, [34009] = 28282, [34010] = 28281, - [42620] = 33165, [42974] = 33307, [44483] = 37332, [44494] = 37333, - [44524] = 37344, [44556] = 37331, [44575] = 44484, [44576] = 44494, - [44588] = 37340, [44590] = 37334, [44591] = 37347, [44595] = 44473, - [44596] = 37330, [44621] = 37339, [44625] = 44485, [44631] = 37349, - [45765] = 34872, [46578] = 35498, [46594] = 35500, [47051] = 35756, - [47672] = 44471, [47898] = 44472, [47899] = 44488, [47901] = 44491, - [59619] = 44496, [59621] = 44492, [59625] = 44495, [60691] = 44483, - [60692] = 44489, [60707] = 44486, [60714] = 44487, [60763] = 44490, - [60767] = 44498, [62256] = 44944, [62257] = 44945, [62948] = 45059, - [64441] = 46027, [64579] = 46348, - - ------------------------------------------------------------------------------- - --Engineering - ------------------------------------------------------------------------------- - [3928] = 4408, [3933] = 4409, [3939] = 13309, [3940] = 4410, - [3944] = 4411, [3952] = 14639, [3954] = 4412, [3957] = 13308, - [3959] = 4413, [3960] = 4414, [3966] = 4415, [3968] = 4416, - [3969] = 13311, [3971] = 7742, [3972] = 4417, [3979] = 13310, - [8243] = 6672, [8339] = 6716, [9269] = 7560, [9273] = 7561, - [12587] = 10601, [12597] = 10602, [12607] = 10603, [12614] = 10604, - [12615] = 10605, [12616] = 10606, [12617] = 10607, [12620] = 10608, - [12624] = 10609, [15628] = 11828, [15633] = 11827, [19790] = 16041, - [19791] = 16042, [19792] = 16043, [19793] = 16044, [19794] = 16045, - [19795] = 16047, [19796] = 16048, [19799] = 16049, [19800] = 16051, - [19814] = 16046, [19815] = 16050, [19819] = 16052, [19825] = 16053, - [19830] = 16054, [19831] = 16055, [19833] = 16056, [21940] = 17720, - [22793] = 18290, [22795] = 18292, [22797] = 18291, [23066] = 18647, - [23067] = 18649, [23068] = 18648, [23069] = 18650, [23071] = 18651, - [23077] = 18652, [23078] = 18653, [23079] = 18655, [23080] = 18656, - [23081] = 18657, [23082] = 18658, [23096] = 18654, [23129] = 18661, - [23507] = 19027, [24356] = 20000, [24357] = 20001, [26416] = 21724, - [26417] = 21725, [26418] = 21726, [26420] = 21727, [26421] = 21728, - [26422] = 21729, [26423] = 21730, [26424] = 21731, [26425] = 21732, - [26426] = 21733, [26427] = 21734, [26428] = 21735, [26442] = 44919, - [26443] = 44918, [28327] = 22729, [30313] = 23799, [30314] = 23800, - [30315] = 23802, [30316] = 23803, [30317] = 23804, [30318] = 23805, - [30325] = 23806, [30329] = 23807, [30332] = 23808, [30334] = 23809, - [30337] = 23810, [30341] = 23811, [30344] = 23814, [30347] = 23815, - [30348] = 23816, [30349] = 23817, [30547] = 23874, [30548] = 23888, - [30551] = 35310, [30552] = 35311, [30556] = 23887, [32814] = 25887, - [39895] = 32381, [43676] = 33804, [44391] = 34114, [46106] = 35191, - [46107] = 35187, [46108] = 35189, [46109] = 35190, [46110] = 35192, - [46111] = 35186, [46112] = 35193, [46113] = 35194, [46114] = 35195, - [46115] = 35196, [46116] = 35197, [46697] = 35582, [60866] = 44502, [60867] = 44503, - - ------------------------------------------------------------------------------- - --Inscription - ------------------------------------------------------------------------------- - - ------------------------------------------------------------------------------- - --Jewelcrafting - ------------------------------------------------------------------------------- - [25320] = 20856, [25323] = 20855, [25339] = 20854, [25610] = 20970, - [25612] = 20971, [25617] = 20973, [25618] = 20974, [25619] = 20975, - [25622] = 20976, [26873] = 21940, [26875] = 21941, [26878] = 21942, - [26881] = 21943, [26882] = 21944, [26887] = 21945, [26896] = 21947, - [26897] = 21948, [26900] = 21949, [26906] = 21952, [26909] = 21953, - [26910] = 21954, [26912] = 21955, [26914] = 21956, [26915] = 21957, - [28903] = 23130, [28905] = 23131, [28906] = 23133, [28907] = 23134, - [28910] = 23135, [28912] = 23136, [28914] = 23137, [28915] = 23138, - [28916] = 23140, [28917] = 23141, [28918] = 31359, [28924] = 23143, - [28927] = 23145, [28933] = 23146, [28936] = 23147, - [28938] = 23148, [28944] = 23149, [28947] = 23150, [28948] = 23151, - [28950] = 23152, [28953] = 23153, [28955] = 23154, [28957] = 23155, - [31053] = 24158, [31054] = 24159, [31055] = 24160, [31056] = 24161, - [31057] = 24162, [31058] = 24163, [31060] = 24164, [31061] = 24165, - [31062] = 24174, [31063] = 24175, [31064] = 24176, [31065] = 24177, - [31066] = 24178, [31067] = 24166, [31068] = 24167, [31070] = 24168, - [31071] = 24169, [31072] = 24170, [31076] = 24171, [31077] = 24172, - [31078] = 24173, [31079] = 24179, [31080] = 31358, [31081] = 24181, - [31082] = 24182, [31083] = 24183, [31084] = 24193, [31085] = 24194, - [31087] = 24195, [31088] = 35305, [31089] = 35306, [31090] = 24197, - [31091] = 24198, [31092] = 35304, [31094] = 24201, [31095] = 24202, - [31096] = 24203, [31097] = 24204, [31098] = 35307, [31099] = 24206, - [31100] = 24207, [31101] = 24208, [31102] = 24209, [31103] = 24210, - [31104] = 24211, [31105] = 24212, [31106] = 24213, [31107] = 24214, - [31108] = 24215, [31109] = 24216, [31110] = 24217, [31111] = 24218, - [31112] = 24219, [31113] = 24220, [31149] = 24200, [32866] = 25902, - [32867] = 25903, [32868] = 25905, [32869] = 25906, [32870] = 25904, - [32871] = 25907, [32872] = 25909, [32873] = 25908, [32874] = 25910, - [34069] = 28291, [34590] = 28596, [37855] = 30826, [38503] = 31401, - [38504] = 31402, [39451] = 31870, [39452] = 31875, [39455] = 31871, - [39458] = 31872, [39462] = 31877, [39463] = 31876, [39466] = 31873, - [39467] = 31874, [39470] = 31878, [39471] = 31879, [39705] = 35244, - [39706] = 35246, [39710] = 35250, [39711] = 35248, [39712] = 35245, - [39713] = 35249, [39714] = 35247, [39715] = 35263, [39716] = 35264, - [39717] = 35262, [39718] = 35265, [39719] = 35255, [39720] = 35260, - [39721] = 35259, [39722] = 35256, [39723] = 35261, [39724] = 35258, - [39725] = 35257, [39727] = 35243, [39728] = 35242, [39729] = 35238, - [39730] = 35240, [39731] = 35239, [39732] = 35241, [39733] = 35267, - [39734] = 35269, [39735] = 35268, [39736] = 35266, [39737] = 35270, - [39738] = 35271, [39739] = 35252, [39740] = 35254, [39741] = 35251, - [39742] = 35253, [39961] = 33622, [39963] = 32411, [42558] = 33305, - [42588] = 33155, [42589] = 33156, [42590] = 33157, [42591] = 33158, - [42592] = 33159, [42593] = 33160, [43493] = 33783, [44794] = 34689, - [46122] = 35198, [46123] = 35538, [46124] = 35200, [46125] = 35201, - [46126] = 35533, [46127] = 35203, [46403] = 35322, [46404] = 35323, - [46405] = 35325, [46597] = 35502, [46601] = 35505, [46775] = 35695, - [46776] = 35696, [46777] = 35697, [46778] = 35698, [46779] = 35699, - [46803] = 35708, [47053] = 35769, [47054] = 35766, [47055] = 35767, - [47056] = 35768, [48789] = 37504, [53830] = 41576, [53857] = 41559, - [53865] = 41575, [53869] = 41574, [53875] = 41566, [53877] = 41562, - [53879] = 41565, [53884] = 41563, [53885] = 41561, [53888] = 41564, - [53917] = 41567, [53919] = 41572, [53921] = 41568, [53924] = 41571, - [53929] = 41573, [53932] = 41570, [53933] = 41569, [53943] = 41560, - [53945] = 41577, [53946] = 41718, [53948] = 41719, [53949] = 41578, - [53950] = 41817, [53951] = 41790, [53952] = 42138, [53954] = 41581, - [53955] = 41728, [53957] = 41720, [53958] = 41580, [53959] = 41791, - [53960] = 41727, [53961] = 41579, [53962] = 41784, [53963] = 41747, - [53964] = 41785, [53965] = 41725, [53966] = 41783, [53967] = 41701, - [53968] = 41740, [53970] = 41796, [53971] = 41703, [53972] = 41820, - [53973] = 41702, [53974] = 41726, [53975] = 41789, [53976] = 41777, - [53977] = 41780, [53978] = 41734, [53979] = 41794, [53980] = 41582, - [53981] = 41733, [53982] = 41792, [53983] = 41689, [53984] = 41686, - [53985] = 41688, [53986] = 41730, [53987] = 41690, [53988] = 41721, - [53990] = 41732, [53991] = 41687, [53992] = 41779, [53993] = 41722, - [53994] = 41818, [53995] = 41795, [53996] = 41723, [53997] = 41698, - [53998] = 41697, [54000] = 41738, [54001] = 41693, [54002] = 41699, - [54003] = 41781, [54004] = 41782, [54005] = 41737, [54006] = 41694, - [54008] = 41724, [54009] = 41696, [54010] = 41739, [54011] = 41692, - [54012] = 41819, [54013] = 41736, [54014] = 41735, [54019] = 41793, - [54023] = 41778, [55384] = 41705, [55387] = 41743, [55388] = 41744, - [55389] = 41704, [55390] = 41786, [55392] = 41706, [55393] = 41742, - [55395] = 41787, [55396] = 41708, [55397] = 41798, [55398] = 41799, - [55400] = 41710, [55401] = 41797, [55403] = 41711, [55404] = 41709, - [55405] = 41788, [55407] = 41707, [56049] = 42298, [56052] = 42301, - [56053] = 42309, [56054] = 42299, [56055] = 42314, [56056] = 42302, - [56074] = 42300, [56076] = 42303, [56077] = 42304, [56079] = 42305, - [56081] = 42306, [56083] = 42307, [56084] = 42308, [56085] = 42310, - [56086] = 42311, [56087] = 42312, [56088] = 42313, [56089] = 42315, - [56496] = 42648, [56497] = 42649, [56498] = 42650, [56499] = 42651, - [56500] = 42652, [56501] = 42653, [58147] = 43317, [58148] = 43318, - [58149] = 43319, [58150] = 43320, [58492] = 43485, [58507] = 43497, - [58954] = 43597, [66556] = 46937, [66447] = 46917 , [66429] = 46899, - [66557] = 46938, [66430] = 46900, [66432] = 46902, [66433] = 46903, - [66497] = 46924, [66561] = 46942, [66434] = 46904, [66498] = 46925, - [66499] = 46926, [66436] = 46906, [66500] = 46927, [66437] = 46907, - [66501] = 46928, [66565] = 46946, [66438] = 46908, [66502] = 46929, - [66566] = 46947, [66439] = 46909, [66503] = 46930 , [66567] = 46948, - [66440] = 46910, [66504] = 46931, [66441] = 46911, [66505] = 46932, - [66569] = 46950, [66442] = 46912, [66506] = 46933, [66570] = 46951, - [66443] = 46913, [66444] = 46914, [66572] = 46953, [66445] = 46915, - [66573] = 46956, [66446] = 46916, [66574] = 47007, [66575] = 47008, - [66448] = 46918, [66576] = 47010, [66449] = 46919, [66577] = 47011, - [66450] = 46920, [66578] = 47012, [66451] = 46921, [66579] = 47015, - [66452] = 46922, [66580] = 47016, [66453] = 46923, [66581] = 47017, - [66582] = 47018, [66583] = 47019, [66584] = 47020, [66586] = 47022, - [68253] = 49112, [66338] = 46897, [66571] = 46952, [66564] = 46945, - [66562] = 46943, [66560] = 46941, [66558] = 46939, [66554] = 46935, - [66559] = 46940, [66585] = 47021, [66555] = 46936, [66587] = 47023, - [66431] = 46901, [66428] = 46898, [66435] = 46905, [66563] = 46944, - [66553] = 46934 , [66568] = 46949, - - ------------------------------------------------------------------------------- - --Leatherworking - ------------------------------------------------------------------------------- - [2158] = 2406, [2163] = 2407, [2164] = 2408, [2169] = 2409, - [3762] = 4293, [3765] = 7360, [3767] = 4294, [3769] = 4296, - [3771] = 4297, [3772] = 7613, [3773] = 4299, [3775] = 4298, - [3777] = 4300, [3778] = 14635, [3779] = 4301, [4096] = 13287, - [4097] = 13288, [5244] = 5083, [6702] = 5786, [6703] = 5787, - [6704] = 5788, [6705] = 5789, [7133] = 5972, [7149] = 5973, - [7153] = 5974, [7953] = 6474, [7954] = 6475, [7955] = 6476, - [8322] = 6710, [9064] = 7288, [9070] = 7289, [9072] = 7290, - [9146] = 7361, [9147] = 7362, [9148] = 7363, [9149] = 7364, - [9195] = 7449, [9197] = 7450, [9202] = 7451, [9207] = 7452, - [9208] = 7453, [10490] = 8384, [10509] = 8385, [10516] = 8409, - [10520] = 8386, [10525] = 8395, [10529] = 8403, [10531] = 8387, - [10533] = 8397, [10542] = 8398, [10544] = 8404, [10546] = 8405, - [10554] = 8399, [10560] = 8389, [10562] = 8390, [10564] = 8400, - [10566] = 8406, [10568] = 8401, [10570] = 8402, [10572] = 8407, - [10574] = 8408, [19048] = 15724, [19049] = 15725, [19050] = 15726, - [19051] = 15727, [19052] = 15728, [19053] = 15729, [19054] = 15730, - [19055] = 15731, [19059] = 15732, [19060] = 15733, [19061] = 15734, - [19062] = 15735, [19063] = 15737, [19064] = 15738, [19065] = 15739, - [19066] = 15740, [19067] = 15741, [19068] = 20253, [19070] = 15743, - [19071] = 15744, [19072] = 15745, [19073] = 15746, [19074] = 15747, - [19075] = 15748, [19076] = 15749, [19077] = 15751, [19078] = 15752, - [19079] = 15753, [19080] = 20254, [19081] = 15755, [19082] = 15756, - [19083] = 15757, [19084] = 15758, [19085] = 15759, [19086] = 15760, - [19087] = 15761, [19088] = 15762, [19089] = 15763, [19090] = 15764, - [19091] = 15765, [19092] = 15768, [19093] = 15769, [19094] = 15770, - [19095] = 15771, [19097] = 15772, [19098] = 15773, [19100] = 15774, - [19101] = 15775, [19102] = 15776, [19103] = 15777, [19104] = 15779, - [19107] = 15781, [20853] = 17022, [20854] = 17023, [20855] = 17025, - [21943] = 17722, [22711] = 18239, [22727] = 18252, [22921] = 18514, - [22922] = 18515, [22923] = 18516, [22926] = 18517, [22927] = 18518, - [22928] = 18519, [23190] = 18731, [23399] = 18949, [23703] = 19326, - [23704] = 19327, [23705] = 19328, [23706] = 19329, [23707] = 19330, - [23708] = 19331, [23709] = 19332, [23710] = 19333, [24121] = 19769, - [24122] = 19770, [24123] = 19771, [24124] = 19772, [24125] = 19773, - [24703] = 20382, [24846] = 20506, [24847] = 20507, [24848] = 20508, - [24849] = 20509, [24850] = 20510, [24851] = 20511, [24940] = 20576, - [26279] = 21548, [28472] = 22771, [28473] = 22770, [28474] = 22769, - [32455] = 25720, [32457] = 25721, [32458] = 25722, [32461] = 25725, - [32482] = 25726, [32485] = 25728, [32487] = 25729, [32488] = 25731, - [32489] = 25730, [32490] = 25732, [32493] = 25733, [32494] = 25734, - [32495] = 25735, [32496] = 25736, [32497] = 25737, [32498] = 29213, - [32499] = 29214, [32500] = 29215, [32501] = 29217, [32502] = 29219, - [32503] = 29218, [35520] = 29669, [35521] = 29672, [35522] = 29673, - [35523] = 29674, [35524] = 29675, [35525] = 29677, [35526] = 29682, - [35527] = 29684, [35528] = 29691, [35529] = 29689, [35530] = 30444, - [35531] = 29693, [35532] = 29698, [35533] = 29700, [35534] = 29701, - [35535] = 29702, [35536] = 29703, [35537] = 29704, [35538] = 29713, - [35539] = 34175, [35543] = 29717, [35544] = 34173, [35549] = 31361, - [35554] = 31362, [35555] = 29720, [35557] = 29721, [35558] = 29723, - [35559] = 35302, [35560] = 29725, [35561] = 29726, [35562] = 35303, - [35563] = 29728, [35564] = 29729, [35567] = 29730, [35568] = 35300, - [35572] = 29732, [35573] = 35301, [35574] = 29734, [36349] = 30301, - [36351] = 30302, [36352] = 30303, [36353] = 30304, [36355] = 30305, - [36357] = 30306, [36358] = 30307, [36359] = 30308, [39997] = 32429, - [40001] = 32431, [40002] = 32432, [40003] = 32433, [40004] = 32434, - [40005] = 32435, [40006] = 32436, [41156] = 32744, [41157] = 35523, - [41158] = 35527, [41160] = 35528, [41161] = 35517, [41162] = 35524, - [41163] = 35520, [41164] = 35521, [42546] = 33124, [42731] = 33205, - [44359] = 34200, [44768] = 34218, [44953] = 34262, [45117] = 34491, - [46132] = 35546, [46133] = 35541, [46134] = 35214, [46135] = 35215, - [46136] = 35216, [46137] = 35217, [46138] = 35218, [46139] = 35549, - [50970] = 44509, [50971] = 44510, [52733] = 32430, [57683] = 43097, - [57692] = 44559, [57694] = 44560, [57696] = 44561, [57699] = 44562, - [57701] = 44563, [60645] = 44511, [60647] = 44512, [60697] = 44513, - [60702] = 44514, [60703] = 44515, [60704] = 44516, [60705] = 44517, - [60706] = 44518, [60711] = 44519, [60712] = 44520, [60715] = 44521, - [60716] = 44522, [60718] = 44523, [60720] = 44524, [60721] = 44525, - [60723] = 44526, [60725] = 44527, [60727] = 44528, [60728] = 44530, - [60729] = 44531, [60730] = 44532, [60731] = 44533, [60732] = 44534, - [60734] = 44535, [60735] = 44536, [60737] = 44537, [60743] = 44538, - [60746] = 44539, [60747] = 44540, [60748] = 44541, [60749] = 44542, - [60750] = 44543, [60751] = 44544, [60752] = 44545, [60754] = 44546, - [60755] = 44547, [60756] = 44548, [60757] = 44549, [60758] = 44550, - [60759] = 44551, [60760] = 44552, [60761] = 44553, [60996] = 44584, - [60997] = 44585, [60998] = 44586, [60999] = 44587, [61000] = 44588, - [61002] = 44589, [62176] = 44932, [62177] = 44933, [63194] = 45094, - [63195] = 45095, [63196] = 45096, [63197] = 45097, [63198] = 45098, - [63199] = 45099, [63200] = 45100, [63201] = 45101, - - ------------------------------------------------------------------------------- - --Smelting - ------------------------------------------------------------------------------- - [22967] = 44956, [46353] = 35273, - - ------------------------------------------------------------------------------- - --Tailoring - ------------------------------------------------------------------------------- - [2389] = 2598, [2403] = 2601, [3758] = 4292, [3844] = 4346, - [3847] = 4345, [3849] = 4347, [3851] = 4349, [3854] = 7114, - [3856] = 4350, [3857] = 14630, [3858] = 4351, [3860] = 4352, - [3862] = 4355, [3863] = 4353, [3864] = 4356, [3868] = 4348, - [3869] = 14627, [3870] = 6401, [3872] = 4354, [3873] = 10728, - [6686] = 5771, [6688] = 5772, [6692] = 5773, [6693] = 5774, - [6695] = 5775, [7629] = 6271, [7630] = 6270, [7633] = 6272, - [7639] = 6274, [7643] = 6275, [7892] = 6390, [7893] = 6391, - [8780] = 7092, [8782] = 7091, [8784] = 7090, [8786] = 7089, - [8789] = 7087, [8793] = 7084, [8795] = 7085, [8797] = 7086, - [8802] = 7088, [12047] = 10316, [12056] = 10300, [12059] = 10301, - [12060] = 10302, [12064] = 10311, [12066] = 10312, [12075] = 10314, - [12078] = 10315, [12080] = 10317, [12081] = 10318, [12084] = 10320, - [12085] = 10321, [12086] = 10463, [12089] = 10323, [12091] = 10325, - [12093] = 10326, [18403] = 14466, [18404] = 14467, [18405] = 14468, - [18406] = 14469, [18407] = 14470, [18408] = 14471, [18409] = 14472, - [18410] = 14473, [18411] = 14474, [18412] = 14476, [18413] = 14477, - [18414] = 14478, [18415] = 14479, [18416] = 14480, [18417] = 14481, - [18418] = 14482, [18419] = 14483, [18420] = 14484, [18421] = 14485, - [18422] = 14486, [18423] = 14488, [18424] = 14489, [18434] = 14490, - [18436] = 14493, [18437] = 14492, [18438] = 14491, [18439] = 14494, - [18440] = 14497, [18441] = 14495, [18442] = 14496, [18444] = 14498, - [18445] = 14499, [18446] = 14500, [18447] = 14501, [18448] = 14507, - [18449] = 14504, [18450] = 14505, [18451] = 14506, [18452] = 14509, - [18453] = 14508, [18454] = 14511, [18455] = 14510, [18456] = 14512, - [18457] = 14513, [18458] = 14514, [18560] = 14526, [20848] = 17017, - [20849] = 17018, [21945] = 17724, [22759] = 18265, [22866] = 18414, - [22867] = 18415, [22868] = 18416, [22869] = 18417, [22870] = 18418, - [22902] = 18487, [23662] = 19215, [23663] = 19218, [23664] = 19216, - [23665] = 19217, [23666] = 19219, [23667] = 19220, [24091] = 19764, - [24092] = 19765, [24093] = 19766, [24901] = 20546, [24902] = 20548, - [24903] = 20547, [26085] = 21358, [26087] = 21371, [26403] = 44916, - [26407] = 44917, [26747] = 21892, [26749] = 21893, [26750] = 21894, - [26751] = 21895, [26752] = 21908, [26753] = 21909, [26754] = 21910, - [26755] = 21911, [26756] = 21912, [26757] = 21914, [26758] = 21913, - [26759] = 21915, [26760] = 21916, [26761] = 21918, [26762] = 21917, - [26763] = 21919, [26773] = 21896, [26774] = 21897, [26775] = 21898, - [26776] = 21899, [26777] = 21900, [26778] = 21901, [26779] = 21902, - [26780] = 21903, [26781] = 21904, [26782] = 21905, [26783] = 21906, - [26784] = 21907, [27658] = 22307, [27659] = 22308, [27660] = 22309, - [27724] = 22310, [27725] = 22312, [28210] = 22683, [28480] = 22774, - [28481] = 22773, [28482] = 22772, [31373] = 24316, [31430] = 24292, - [31431] = 24293, [31432] = 24294, [31433] = 24295, [31434] = 35308, - [31435] = 24297, [31437] = 24298, [31438] = 24299, [31440] = 24300, - [31441] = 24301, [31442] = 35309, [31443] = 24303, [31444] = 24304, - [31448] = 24305, [31449] = 24306, [31450] = 24307, [31451] = 24308, - [31452] = 24309, [31453] = 24310, [31454] = 24311, [31455] = 24312, - [31456] = 24313, [31459] = 24314, [36315] = 30280, [36316] = 30281, - [36317] = 30282, [36318] = 30283, [36686] = 30483, [37873] = 30833, - [37882] = 30842, [37883] = 30843, [37884] = 30844, [40020] = 32437, - [40021] = 32438, [40023] = 32439, [40024] = 32440, [40060] = 32447, - [41205] = 35518, [41206] = 32755, [41207] = 32752, [41208] = 32753, - [44950] = 34261, [44958] = 34319, [46128] = 35204, [46129] = 35205, - [46130] = 35206, [46131] = 35207, [49677] = 37915, [50194] = 38229, - [50644] = 38327, [50647] = 38328, [55993] = 42172, [55994] = 42173, - [55996] = 42175, [55997] = 42177, [55998] = 42176, [55999] = 42178, - [56004] = 42183, [56005] = 42184, [56006] = 42185, [56009] = 42187, - [56011] = 42188, [63924] = 45774, -} - -------------------------------------------------------------------------------- --- Look up table of spell IDs for recipes which do not have a player flag --- BASICALLY A TEMPORARY STORAGE FOR IDS, SO WE CAN SEE CLEANER SCANS AND WHAT NOT, --- WE'LL GO BACK HERE LATER DOWN THE ROAD. -------------------------------------------------------------------------------- -local NO_PLAYER_FLAG = { - [30344] = true, [30341] = true, [32814] = true, [23066] = true, - [26421] = true, [36955] = true, [19788] = true, [23129] = true, - [26422] = true, [12715] = true, [12899] = true, [56459] = true, - [30307] = true, [26423] = true, [3918] = true, [23067] = true, - [30308] = true, [3953] = true, [15255] = true, [26424] = true, - [30548] = true, [44157] = true, [56462] = true, [19567] = true, - [30552] = true, [23068] = true, [44155] = true, [28327] = true, - [26425] = true, [56461] = true, [68067] = true, [15633] = true, - [23096] = true, [12589] = true, [26442] = true, [26426] = true, - [67920] = true, [9273] = true, [3926] = true, [6458] = true, - [19793] = true, [55252] = true, [9271] = true, [26427] = true, - [26443] = true, [30551] = true, [23486] = true, [3922] = true, - [3924] = true, [12590] = true, [3928] = true, [3942] = true, - [26428] = true, [3952] = true, [22704] = true, [12902] = true, - [30569] = true, [15628] = true, [12895] = true, [21940] = true, - [56349] = true, [12584] = true, [56477] = true, [30348] = true, - [26416] = true, [53281] = true, [23507] = true, [12075] = true, - [12079] = true, [26746] = true, [56000] = true, - - ----------------------------------------------------------------------------------------- - ---JEWELCRAFTING - ----------------------------------------------------------------------------------------- - [55401] = true, [53995] = true, [66432] = true, [25255] = true, -[66497] = true, [53996] = true, [56074] = true, [56202] = true, - [66434] = true, [32801] = true, [28948] = true, [53997] = true, - [39963] = true, [32866] = true, [66501] = true, [39452] = true, - [53934] = true, [66502] = true, [55405] = true, [58954] = true, - [56205] = true, [37855] = true, [38175] = true, [25305] = true, - [25321] = true, [66505] = true, [54000] = true, [39742] = true, - [56206] = true, [66506] = true, [32869] = true, [54001] = true, - [56079] = true, [32259] = true, [32870] = true, [56208] = true, - [32807] = true, [32871] = true, [26873] = true, [31061] = true, - [32872] = true, [42591] = true, [46779] = true, [56530] = true, - [42592] = true, [31062] = true, [56083] = true, [32874] = true, - [56531] = true, [31063] = true, [56085] = true, [38503] = true, - [56086] = true, [28938] = true, [38504] = true, [31064] = true, - [31096] = true, [55384] = true, [25278] = true, [68253] = true, - [43493] = true, [26925] = true, [31065] = true, [46403] = true, - [53852] = true, [53916] = true, [39722] = true, [25615] = true, - [28924] = true, [26926] = true, [53853] = true, [36526] = true, - [31098] = true, [55388] = true, [46405] = true, [53854] = true, - [39724] = true, [55389] = true, [26927] = true, [31051] = true, - [53919] = true, [39725] = true, [55390] = true, [53856] = true, - [53920] = true, [53952] = true, [26880] = true, [53857] = true, - [31052] = true, [34069] = true, [25490] = true, [55393] = true, - [39451] = true, [53956] = true, [44794] = true, [36524] = true, - [55395] = true, [38068] = true, [28944] = true, [53957] = true, - [31066] = true, [31082] = true, [66428] = true, [26909] = true, - [55396] = true, [31097] = true, [25284] = true, [56084] = true, - [62941] = true, [66431] = true, [53894] = true, [53958] = true, - [58146] = true, [31099] = true, [47053] = true, [31067] = true, - [28917] = true, [26903] = true, [36525] = true, [66503] = true, - [56197] = true, [47054] = true, [53961] = true, [39715] = true, - [31092] = true, [53960] = true, [31077] = true, [31101] = true, - [39719] = true, [55399] = true, [31113] = true, [32808] = true, - [53917] = true, [63743] = true, [39720] = true, [39721] = true, - [42590] = true, [58149] = true, [56199] = true, [47056] = true, - [28950] = true, [47280] = true, [32809] = true, [31072] = true, -[25318] = true, [66429] = true, [62242] = true, ---------------------------------------------------------------------------------------- - ---------------------------------------------------------------------------------------- ----COOKING ---------------------------------------------------------------------------------------- -[62050]= true, [22761]= true, [62051]= true, [8607]= true, -[18238]= true, [6413]= true, [6417]= true, [42296]= true, -[45557]= true, [6501]= true, [45558]= true, [18239]= true, - [7752]= true, [7828]= true, [45560]= true, [64358]= true, - [57421]= true, [45561]= true, [13028]= true, [2543]= true, - [2545]= true, [25659]= true, [58512]= true, [45565]= true, - [42305]= true, [45566]= true, [62350]= true, [7753]= true, - [45695]= true, [9513]= true, [18244]= true, [20626]= true, - [45569]= true, [43779]= true, [18245]= true, [45571]= true, - [18246]= true, [37836]= true, [57433]= true, [20916]= true, - [58521]= true, [18247]= true, [57435]= true, [7754]= true, - [53056]= true, [58523]= true, [57437]= true, [57438]= true, - [58525]= true, [45570]= true, [2538]= true, [2540]= true, - [2548]= true, [33290]= true, [45562]= true, [15906]= true, - [18241]= true, [45559]= true, [45551]= true, [57443]= true, - [58527]= true, [43758]= true, [58528]= true, [8238]= true, - [7751]= true, [7755]= true, [43761]= true, [7827]= true, - [45552]= true, [45553]= true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- - ---BLACKSMITHING - --------------------------------------------------------------------------------------- - [10015] = true, [55202] = true, [16726] = true, [24399] = true, -[15293] = true, [32655] = true, [3320] = true, [40033] = true, -[34545] = true, [61010] = true, [16639] = true, [3115] = true, -[3116] = true, [3117] = true, [16648] = true, [40034] = true, - [9920] = true, [9928] = true, [29558] = true, [55839] = true, - [9964] = true, [7818] = true, [55732] = true, [29694] = true, - [3326] = true, [9950] = true, [59405] = true, [12260] = true, - [16983] = true, [16991] = true, [23650] = true, [16640] = true, - [2741] = true, [3513] = true, [3497] = true, [8768] = true, - [19666] = true, [2662] = true, [2663] = true, [20201] = true, - [16664] = true, [15294] = true, [3496] = true, [16645] = true, - [29569] = true, [2737] = true, [14380] = true, [16992] = true, - [36125] = true, [19667] = true, [22757] = true, [16665] = true, - [59406] = true, [2738] = true, [2739] = true, [2740] = true, - [24913] = true, [9933] = true, [20873] = true, [36126] = true, - [40035] = true, [8880] = true, [23636] = true, [3292] = true, - [3293] = true, [21161] = true, [32656] = true, [19668] = true, - [9921] = true, [7222] = true, [3319] = true, [15295] = true, - [20874] = true, [20890] = true, [3337] = true, [34546] = true, - [16970] = true, [16978] = true, [61008] = true, [7224] = true, - [11454] = true, [19669] = true, [55656] = true, [16667] = true, - [16731] = true, [61009] = true, [9926] = true, [16984] = true, - [21913] = true, [40036] = true, [9974] = true, [32657] = true, - [32285] = true, [23638] = true, [10011] = true, [36131] = true, - [27830] = true, [32284] = true, [16732] = true, [15292] = true, - [15296] = true, [38478] = true, [20876] = true, [38475] = true, - [23653] = true, [3325] = true, [14379] = true, [29729] = true, - [2661] = true, [29728] = true, [16655] = true, [16993] = true, - [3491] = true, [3494] = true, [3501] = true, [9959] = true, - [9983] = true, [36262] = true, [10003] = true, [10007] = true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- -----INSCRIPTION - --------------------------------------------------------------------------------------- - [58315] = true, [58331] = true, [58347] = true, [56974] = true, [56990] = true, -[64256] = true, [64304] = true, [57166] = true, [57709] = true, [57214] = true, - [57230] = true, [50603] = true, [57262] = true, [59338] = true, [58332] = true, - [56959] = true, [56975] = true, [56991] = true, [57007] = true, [57023] = true, - [53462] = true, [64257] = true, [64273] = true, [64289] = true, [57151] = true, - [57167] = true, [57183] = true, [57710] = true, [57215] = true, [57247] = true, - [50620] = true, [58301] = true, [59339] = true, [58333] = true, [59387] = true, - [52840] = true, [59499] = true, [56960] = true, [56976] = true, [57008] = true, - [57024] = true, [64258] = true, [64274] = true, [57168] = true, [57184] = true, - [61288] = true, [57216] = true, [57232] = true, [58286] = true, [58302] = true, - [59340] = true, [48114] = true, [64051] = true, [59484] = true, [59500] = true, - [56961] = true, [56977] = true, [57009] = true, [57025] = true, [61177] = true, - [64259] = true, [57121] = true, [64291] = true, [57153] = true, [57169] = true, - [57185] = true, [57712] = true, [57217] = true, [57233] = true, [58287] = true, - [58303] = true, [58319] = true, [56946] = true, [56978] = true, [56994] = true, - [57010] = true, [57026] = true, [64260] = true, [57122] = true, [57154] = true, - [57170] = true, [57186] = true, [57713] = true, [57218] = true, [57234] = true, - [57266] = true, [59326] = true, [58320] = true, [58336] = true, [59486] = true, - [59502] = true, [56963] = true, [56995] = true, [57011] = true, [57027] = true, - [64261] = true, [64277] = true, [57155] = true, [57187] = true, [57714] = true, - [57219] = true, [57235] = true, [58289] = true, [58305] = true, [58321] = true, - [58337] = true, [69385] = true, [57243] = true, [64314] = true, [64313] = true, - [56958] = true, [59487] = true, [59503] = true, [58288] = true, [56980] = true, - [56996] = true, [57012] = true, [57028] = true, [59501] = true, [56948] = true, - [57264] = true, [64246] = true, [64262] = true, [57124] = true, [64294] = true, - [57156] = true, [57172] = true, [57188] = true, [57715] = true, [57220] = true, - [57236] = true, [57268] = true, [58306] = true, [58322] = true, [58338] = true, - [48247] = true, [57133] = true, [57270] = true, [57131] = true, [57129] = true, - [50604] = true, [59488] = true, [59504] = true, [56965] = true, [56981] = true, - [56997] = true, [57013] = true, [57029] = true, [64280] = true, [57114] = true, - [64286] = true, [58299] = true, [57125] = true, [64295] = true, [64311] = true, - [57164] = true, [57189] = true, [57716] = true, [57221] = true, [57237] = true, - [57269] = true, [58307] = true, [58323] = true, [58339] = true, [64307] = true, - [57119] = true, [57246] = true, [68166] = true, [64282] = true, [57250] = true, - [59489] = true, [56957] = true, [56982] = true, [56998] = true, [57014] = true, - [57117] = true, [64305] = true, [61677] = true, [52843] = true, [57126] = true, - [64296] = true, [57158] = true, [64310] = true, [57190] = true, [56956] = true, - [57238] = true, [60336] = true, [58308] = true, [58324] = true, [58340] = true, - [64315] = true, [56949] = true, [56950] = true, [64308] = true, [56955] = true, - [59490] = true, [59315] = true, [56983] = true, [56999] = true, [64267] = true, - [57031] = true, [56954] = true, [64276] = true, [57249] = true, [64249] = true, - [56953] = true, [57127] = true, [64297] = true, [57159] = true, [64275] = true, - [57191] = true, [57207] = true, [57223] = true, [57239] = true, [50612] = true, - [60337] = true, [57208] = true, [58325] = true, [48121] = true, [56952] = true, - [56947] = true, [56951] = true, [64268] = true, [57123] = true, [59475] = true, - [59491] = true, [56968] = true, [56984] = true, [57000] = true, [48248] = true, - [58565] = true, [58317] = true, [64266] = true, [57252] = true, [64250] = true, - [57112] = true, [57128] = true, [64298] = true, [57160] = true, [58316] = true, - [57703] = true, [57719] = true, [57224] = true, [57240] = true, [57272] = true, - [58310] = true, [58326] = true, [58342] = true, [57201] = true, [56945] = true, -[57200] = true, [56944] = true, [57711] = true, [56985] = true, [57001] = true, -[57199] = true, [57033] = true, [56943] = true, [57198] = true, [64251] = true, -[57113] = true, [64283] = true, [64299] = true, [57161] = true, [57197] = true, -[57704] = true, [57209] = true, [57225] = true, [57241] = true, [50614] = true, -[57273] = true, [58311] = true, [58327] = true, [58343] = true, [52738] = true, -[57196] = true, [64278] = true, [57195] = true, [58318] = true, [64284] = true, -[57006] = true, [64316] = true, [56986] = true, [57002] = true, [59560] = true, -[57034] = true, [58341] = true, [57192] = true, [64252] = true, [67600] = true, - [57130] = true, [64300] = true, [57162] = true, [57244] = true, [57194] = true, - [57210] = true, [57226] = true, [50599] = true, [57258] = true, [58296] = true, - [58312] = true, [58328] = true, [58344] = true, [52739] = true, [58298] = true, - [57274] = true, [57265] = true, [57251] = true, [59478] = true, [56971] = true, - [56987] = true, [57003] = true, [57019] = true, [57035] = true, [57259] = true, - [57263] = true, [57271] = true, [64253] = true, [57115] = true, [64285] = true, - [57242] = true, [57163] = true, [57120] = true, [57706] = true, [57211] = true, - [57227] = true, [50600] = true, [50616] = true, [58297] = true, [58313] = true, - [58329] = true, [58345] = true, [50602] = true, [57248] = true, [59559] = true, - [57157] = true, [57257] = true, [64309] = true, [64317] = true, [56972] = true, - [56988] = true, [57004] = true, [57020] = true, [57036] = true, [62162] = true, - [57030] = true, [64254] = true, [57116] = true, [57132] = true, [64302] = true, - [64318] = true, [64270] = true, [57707] = true, [57212] = true, [57228] = true, - [50601] = true, [57260] = true, [57276] = true, [58314] = true, [58330] = true, - [58346] = true, [45382] = true, [57267] = true, [57275] = true, [64312] = true, - [64279] = true, [50598] = true, [59480] = true, [59496] = true, [56973] = true, - [56989] = true, [57005] = true, [57021] = true, [50619] = true, [50618] = true, - [65245] = true, [50617] = true, [64255] = true, [64271] = true, [64287] = true, - [64303] = true, [57165] = true, [57181] = true, [57708] = true, [57213] = true, - [57229] = true, [57245] = true, [57261] = true, [57277] = true, [57253] = true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- -----ENCHANTING - --------------------------------------------------------------------------------------- - [46578] = true, [25125] = true, [13612] = true, [13620] = true, [13628] = true, -[13640] = true, [13644] = true, [13648] = true, [59625] = true, [13700] = true, - [17181] = true, [27920] = true, [27960] = true, [28016] = true, [45765] = true, - [14810] = true, [63746] = true, [13836] = true, [20008] = true, [20032] = true, - [13868] = true, [13421] = true, [13948] = true, [27905] = true, [27945] = true, - [13501] = true, [7786] = true, [7788] = true, [13529] = true, [32664] = true, - [44506] = true, [25127] = true, [20025] = true, [20033] = true, [13617] = true, - [64579] = true, [60619] = true, [13657] = true, [13693] = true, [27914] = true, - [44555] = true, [27954] = true, [27962] = true, [14807] = true, [32665] = true, - [7421] = true, [13817] = true, [25072] = true, [44492] = true, [44524] = true, - [7443] = true, [44556] = true, [25128] = true, [20026] = true, [7457] = true, - [13378] = true, [34001] = true, [13917] = true, [13933] = true, [13937] = true, - [13941] = true, [44621] = true, [28003] = true, [28027] = true, [13522] = true, - [13538] = true, [25081] = true, [44494] = true, [20011] = true, [25129] = true, - [44590] = true, [47672] = true, [20051] = true, [13622] = true, [13626] = true, - [69412] = true, [60623] = true, [44383] = true, [13698] = true, [13702] = true, - [23804] = true, [44623] = true, [28004] = true, [28028] = true, [14293] = true, - [32667] = true, [13822] = true, [25082] = true, [44576] = true, [20028] = true, - [20036] = true, [13890] = true, [13898] = true, [60609] = true, [59619] = true, - [47898] = true, [7745] = true, [27957] = true, [13503] = true, [34006] = true, - [7793] = true, [7795] = true, [59636] = true, [25083] = true, [20029] = true, - [13631] = true, [13655] = true, [7861] = true, [7863] = true, [62256] = true, - [13695] = true, [13858] = true, [44483] = true, [27968] = true, [7857] = true, - [27967] = true, [42615] = true, [27958] = true, [42613] = true, [25084] = true, - [20017] = true, [33992] = true, [34008] = true, [13663] = true, [60653] = true, - [44528] = true, [14809] = true, [27961] = true, [47901] = true, [7418] = true, - [7420] = true, [44488] = true, [7426] = true, [44616] = true, [13841] = true, - [44596] = true, [17180] = true, [7454] = true, [33993] = true, [34009] = true, - [27950] = true, [20031] = true, [13915] = true, [47900] = true, [13943] = true, - [13947] = true, [13945] = true, [13464] = true, [27927] = true, [7771] = true, - [20014] = true, [20030] = true, [27947] = true, [33994] = true, [28022] = true, - [60692] = true, [25130] = true, [34005] = true, [13794] = true, [7748] = true, - [44588] = true, [15596] = true, [7776] = true, [44584] = true, [13607] = true, - [13653] = true, [20020] = true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- ----TAILORING - --------------------------------------------------------------------------------------- - [12055] = true, [12059] = true, [12071] = true, [46131] = true, [23664] = true, -[31433] = true, [31441] = true, [7624] = true, [26403] = true, [24902] = true, - [22866] = true, [56001] = true, [18411] = true, [18419] = true, [18451] = true, - [28208] = true, [6686] = true, [8766] = true, [23665] = true, [8786] = true, - [26747] = true, [56002] = true, [26763] = true, [26779] = true, [31434] = true, - [31450] = true, [60969] = true, [28480] = true, [22867] = true, [56003] = true, - [18404] = true, [18412] = true, [18420] = true, [12044] = true, [63924] = true, - [12056] = true, [12064] = true, [12080] = true, [12084] = true, [23666] = true, - [56004] = true, [26780] = true, [31459] = true, [7892] = true, [60971] = true, - [28481] = true, [22868] = true, [20848] = true, [56005] = true, [18405] = true, - [19435] = true, [26086] = true, [18437] = true, [18453] = true, [27659] = true, - [28210] = true, [40021] = true, [23667] = true, [26773] = true, [26781] = true, - [26759] = true, [8774] = true, [31460] = true, [24903] = true, [3755] = true, - [37882] = true, [3757] = true, [3758] = true, [50194] = true, [18446] = true, - [6692] = true, [28482] = true, [22869] = true, [18439] = true, [20849] = true, - [18440] = true, [2389] = true, [56007] = true, [18455] = true, [6521] = true, - [18445] = true, [18406] = true, [18414] = true, [18422] = true, [12045] = true, - [36318] = true, [18454] = true, [27660] = true, [24091] = true, [12065] = true, - [12069] = true, [12077] = true, [12081] = true, [12085] = true, [27724] = true, - [12093] = true, [40060] = true, [26087] = true, [26749] = true, [31373] = true, - [26750] = true, [26782] = true, [28205] = true, [28209] = true, [36686] = true, - [3813] = true, [2394] = true, [7629] = true, [18438] = true, [7633] = true, - [40023] = true, [49677] = true, [26407] = true, [18452] = true, [7643] = true, - [22870] = true, [26755] = true, [22902] = true, [3869] = true, [55993] = true, - [8789] = true, [3839] = true, [3841] = true, [3844] = true, [18407] = true, - [18415] = true, [3847] = true, [3848] = true, [3851] = true, [3852] = true, - [24092] = true, [3854] = true, [3856] = true, [3857] = true, [8760] = true, - [27725] = true, [8776] = true, [8780] = true, [8784] = true, [3865] = true, - [55994] = true, [3868] = true, [26783] = true, [3871] = true, [3872] = true, - [3873] = true, [31438] = true, [22759] = true, [12091] = true, [8804] = true, - [8772] = true, [18560] = true, [18447] = true, [44950] = true, [60993] = true, - [55899] = true, [55898] = true, [55995] = true, [2385] = true, [21945] = true, - [6688] = true, [12066] = true, [18416] = true, [8465] = true, [12046] = true, - [18448] = true, [3915] = true, [24093] = true, [8489] = true, [2386] = true, - [12078] = true, [12082] = true, [60994] = true, [55900] = true, [2392] = true, - [2393] = true, [23662] = true, [2396] = true, [55996] = true, [2399] = true, - [26784] = true, [2402] = true, [2403] = true, [2406] = true, [31431] = true, - [3864] = true, [8782] = true, [37884] = true, [37883] = true, [26751] = true, - [50647] = true, [8802] = true, [8467] = true, [7893] = true, [40020] = true, - [41208] = true, [22813] = true, [41207] = true, [37873] = true, [2387] = true, - [55997] = true, [26085] = true, [8799] = true, [27658] = true, [8483] = true, - [3914] = true, [18401] = true, [56006] = true, [18441] = true, [18449] = true, - [28207] = true, [55769] = true, [18413] = true, [18421] = true, [46129] = true, - [2963] = true, [2964] = true, [12061] = true, [12086] = true, [23663] = true, - [26745] = true, [55998] = true, [3863] = true, [8764] = true, [31440] = true, - [31448] = true, [12089] = true, [6695] = true, [40024] = true, [60990] = true, - [50644] = true, [8793] = true, [46130] = true, [24901] = true, [3870] = true, - [31437] = true, [44958] = true, [55999] = true, [3845] = true, [6693] = true, - [3866] = true, [18456] = true, [18410] = true, [18418] = true, [2397] = true, - [18434] = true, [18450] = true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- - ----LEATHERWORKING - --------------------------------------------------------------------------------------- -[9198] = true, [23704] = true, [60996] = true, [35549] = true, [22921] = true, - [50958] = true, [10509] = true, [10525] = true, [19053] = true, [19085] = true, - [19101] = true, [2149] = true, [36349] = true, [2153] = true, [60997] = true, - [2159] = true, [2163] = true, [2165] = true, [35582] = true, [50959] = true, - [46132] = true, [23705] = true, [60998] = true, [22922] = true, [46133] = true, - [24121] = true, [19054] = true, [19070] = true, [19086] = true, [19102] = true, - [32465] = true, [32481] = true, [22331] = true, [35520] = true, [35584] = true, - [9207] = true, [6661] = true, [46134] = true, [23706] = true, [61000] = true, - [35521] = true, [35585] = true, [50962] = true, [10518] = true, [39997] = true, - [24122] = true, [19055] = true, [19087] = true, [19103] = true, [32466] = true, - [32482] = true, [36353] = true, [35522] = true, [35554] = true, [50963] = true, - [44953] = true, [46136] = true, [23707] = true, [61002] = true, [35523] = true, - [35555] = true, [35587] = true, [50964] = true, [46137] = true, [24123] = true, - [19072] = true, [19104] = true, [9064] = true, [9072] = true, [69386] = true, - [32499] = true, [36355] = true, [7133] = true, [35524] = true, [35588] = true, - [7153] = true, [9208] = true, [46138] = true, [23708] = true, [69388] = true, - [35525] = true, [35557] = true, [10487] = true, [10511] = true, [46139] = true, - [24124] = true, [19073] = true, [19089] = true, [32468] = true, [32500] = true, - [10647] = true, [28472] = true, [35526] = true, [35558] = true, [45117] = true, - [60622] = true, [23709] = true, [35527] = true, [3774] = true, [3778] = true, - [3780] = true, [40003] = true, [24125] = true, [19058] = true, [19074] = true, - [32485] = true, [32501] = true, [36359] = true, [3816] = true, [3818] = true, - [28473] = true, [35528] = true, [35560] = true, [9193] = true, [40004] = true, - [23710] = true, [8322] = true, [35529] = true, [35561] = true, [50970] = true, - [2881] = true, [10520] = true, [40005] = true, [10544] = true, [10552] = true, - [10560] = true, [19091] = true, [19107] = true, [32454] = true, [32502] = true, - [28474] = true, [35530] = true, [50971] = true, [62448] = true, [7953] = true, - [41157] = true, [36074] = true, [24846] = true, [35531] = true, [22928] = true, - [28219] = true, [41158] = true, [36075] = true, [32487] = true, [32503] = true, - [7126] = true, [9146] = true, [35532] = true, [35564] = true, [9194] = true, - [9202] = true, [24655] = true, [36076] = true, [24847] = true, [35533] = true, - [5244] = true, [10529] = true, [28220] = true, [19093] = true, [32456] = true, - [52733] = true, [2158] = true, [2160] = true, [2162] = true, [2166] = true, - [24848] = true, [35535] = true, [35567] = true, [28221] = true, [19094] = true, - [44359] = true, [57690] = true, [32457] = true, [32473] = true, [32489] = true, - [9147] = true, [35536] = true, [35568] = true, [9195] = true, [41163] = true, - [6703] = true, [24849] = true, [20853] = true, [10482] = true, [10490] = true, - [28222] = true, [10546] = true, [10554] = true, [41164] = true, [10570] = true, - [19095] = true, [57692] = true, [32458] = true, [10650] = true, [35538] = true, - [42731] = true, [24850] = true, [20854] = true, [44970] = true, [28223] = true, - [19048] = true, [19064] = true, [19080] = true, [57694] = true, [9148] = true, - [35540] = true, [35572] = true, [24851] = true, [20855] = true, [45100] = true, - [10531] = true, [28224] = true, [57696] = true, [10619] = true, [19081] = true, - [22727] = true, [35539] = true, [19079] = true, [10566] = true, [19065] = true, - [10574] = true, [19097] = true, [60647] = true, [3753] = true, [9065] = true, - [44343] = true, [3763] = true, [3767] = true, [3773] = true, [3775] = true, - [3777] = true, [3779] = true, [32455] = true, [24940] = true, [19050] = true, - [19082] = true, [23190] = true, [32461] = true, [60999] = true, [3817] = true, - [44344] = true, [9149] = true, [35544] = true, [9197] = true, [19077] = true, - [9060] = true, [19076] = true, [35573] = true, [40001] = true, [19066] = true, - [19090] = true, [19098] = true, [22711] = true, [57699] = true, [9059] = true, - [32480] = true, [64661] = true, [10562] = true, [40002] = true, [50936] = true, - [6705] = true, [9058] = true, [24703] = true, [22923] = true, [60645] = true, - [35577] = true, [2152] = true, [10556] = true, [10572] = true, [44770] = true, - [36077] = true, [19059] = true, [19075] = true, [35580] = true, [20648] = true, - [2169] = true, [60643] = true, [19088] = true, [6702] = true, [6704] = true, - [35543] = true, [7149] = true, [36078] = true, [36079] = true, [23703] = true, - [35534] = true, [57701] = true, [46135] = true, [19047] = true, [20649] = true, - [40006] = true, [3765] = true, [41156] = true, [3771] = true, [50956] = true, - [19061] = true, [20650] = true, [32467] = true, [35537] = true, [22926] = true, - [4096] = true, [19062] = true, [44768] = true, [35576] = true, [19063] = true, - [9062] = true, [9070] = true, [32495] = true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- - -----ALCHEMY - --------------------------------------------------------------------------------------- - [53898] = true, [28579] = true, [17566] = true, [53771] = true, [7256] = true, -[53899] = true, [11452] = true, [11460] = true, [11468] = true, [3170] = true, - [3172] = true, [3174] = true, [3176] = true, [53836] = true, [53900] = true, - [28564] = true, [28580] = true, [54220] = true, [17551] = true, [53773] = true, - [53837] = true, [62213] = true, [54221] = true, [53774] = true, [53838] = true, - [6617] = true, [53902] = true, [28581] = true, [2331] = true, [2335] = true, - [2337] = true, [53775] = true, [53839] = true, [11453] = true, [7836] = true, - [24266] = true, [41500] = true, [53904] = true, [53936] = true, [28566] = true, - [28582] = true, [3452] = true, [3454] = true, [33732] = true, [17553] = true, - [22732] = true, [53777] = true, [53905] = true, [53937] = true, [33733] = true, - [62409] = true, [25146] = true, [41502] = true, [53938] = true, [28551] = true, - [28567] = true, [28583] = true, [62410] = true, [7181] = true, [17570] = true, - [17634] = true, [53779] = true, [7257] = true, [53939] = true, [11478] = true, - [17187] = true, [53812] = true, [28552] = true, [28568] = true, [28584] = true, - [60366] = true, [57425] = true, [17635] = true, [53781] = true, [60367] = true, - [4508] = true, [53782] = true, [24365] = true, [6618] = true, [53942] = true, - [28569] = true, [28585] = true, [29688] = true, [57427] = true, [17556] = true, - [17572] = true, [17636] = true, [53783] = true, [11479] = true, [7837] = true, - [7841] = true, [53784] = true, [24366] = true, [53848] = true, [28554] = true, - [28570] = true, [28586] = true, [58868] = true, [33741] = true, [24367] = true, - [28555] = true, [28571] = true, [17574] = true, [17638] = true, [7258] = true, - [11448] = true, [11456] = true, [11464] = true, [11480] = true, [3171] = true, - [3173] = true, [3175] = true, [24368] = true, [28572] = true, [28588] = true, - [45061] = true, [66658] = true, [17559] = true, [17575] = true, [66659] = true, - [66660] = true, [63732] = true, [28573] = true, [66662] = true, [17560] = true, - [2330] = true, [2332] = true, [2334] = true, [66663] = true, [11457] = true, - [11465] = true, [11473] = true, [66664] = true, [3449] = true, [3451] = true, - [3453] = true, [17561] = true, [17577] = true, [28543] = true, [28575] = true, - [7179] = true, [17562] = true, [17578] = true, [7255] = true, [7259] = true, - [11458] = true, [11466] = true, [38962] = true, [53776] = true, [12609] = true, - [53780] = true, [60893] = true, [58871] = true, [3448] = true, [3450] = true, - [3447] = true, [4942] = true, [28576] = true, [15833] = true, [17576] = true, - [41503] = true, [60350] = true, [41501] = true, [17563] = true, [42736] = true, - [54213] = true, [41458] = true, [6624] = true, [39636] = true, [28577] = true, - [32765] = true, [38070] = true, [17564] = true, [17580] = true, [53895] = true, - [11451] = true, [39637] = true, [28546] = true, [28562] = true, [28578] = true, - [60354] = true, [32766] = true, [17565] = true, [22808] = true, [39639] = true, - [60355] = true, [56519] = true, - --------------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------------- - ----ENGINEERING - --------------------------------------------------------------------------------------- - [23081] = true, [12586] = true, [12594] = true, [12622] = true, [30347] = true, -[44391] = true, [30547] = true, [56464] = true, [12754] = true, [12758] = true, - [23489] = true, [23082] = true, [8243] = true, [9269] = true, [30316] = true, - [30332] = true, [12906] = true, [8339] = true, [26420] = true, [56514] = true, - [39971] = true, [12599] = true, [12603] = true, [12607] = true, [43676] = true, - [12619] = true, [54998] = true, [30349] = true, [56468] = true, [12755] = true, - [12759] = true, [63750] = true, [39973] = true, [56465] = true, [56469] = true, - [30318] = true, [30334] = true, [55016] = true, [12903] = true, [54793] = true, - [19795] = true, [8895] = true, [19819] = true, [30558] = true, [39895] = true, - [23069] = true, [23077] = true, [12596] = true, [30303] = true, [56471] = true, - [12624] = true, [19796] = true, [56472] = true, [12760] = true, [63770] = true, - [23070] = true, [23078] = true, [61471] = true, [30304] = true, [30312] = true, - [12908] = true, [12597] = true, [3930] = true, [24356] = true, [67839] = true, - [67326] = true, [56474] = true, [30560] = true, [30568] = true, [30314] = true, - [3929] = true, [56475] = true, [19830] = true, [3946] = true, [54736] = true, - [30563] = true, [24357] = true, [30337] = true, [12591] = true, [19814] = true, - [60866] = true, [12716] = true, [23071] = true, [23079] = true, [12585] = true, - [3923] = true, [3925] = true, [30305] = true, [12621] = true, [30329] = true, - [3931] = true, [3932] = true, [3933] = true, [3936] = true, [3937] = true, - [3938] = true, [3939] = true, [3941] = true, [56473] = true, [3944] = true, - [3945] = true, [3947] = true, [54999] = true, [3949] = true, [3950] = true, - [26417] = true, [12717] = true, [3954] = true, [3955] = true, [3957] = true, - [3958] = true, [3961] = true, [3962] = true, [3963] = true, [3965] = true, - [3966] = true, [3967] = true, [3968] = true, [3969] = true, [3971] = true, - [3972] = true, [3973] = true, [7430] = true, [3977] = true, [3978] = true, - [3979] = true, [19790] = true, [23080] = true, [12620] = true, [30309] = true, - [30346] = true, [12905] = true, [41307] = true, [8334] = true, [56460] = true, - [56476] = true, [12718] = true, [26418] = true, [19791] = true, [3960] = true, - [19815] = true, [13240] = true, [19831] = true, [30570] = true, [19799] = true, - [30306] = true, [30310] = true, [26011] = true, [36954] = true, [3919] = true, - [3920] = true, [19800] = true, [12617] = true, [30311] = true, [56463] = true, ---------------------------------------------------------------------------------------- -} - -local function LoadRecipe() - local recipe_list = addon.recipe_list - - if (not recipe_list) then - if (addon.db.profile.autoloaddb) then - local dbloaded - dbloaded, recipe_list = addon:InitRecipeData() - - if (not dbloaded) then return end - - for idx, prof in pairs(PROFESSIONS) do - addon:AddRecipeData(prof) - end - else - addon:Print(L["DATAMINER_NODB_ERROR"]) - return - end - else - -- Recipe DB exists, we just need to populate it now - if (addon.db.profile.autoloaddb) then - for idx, prof in pairs(PROFESSIONS) do - addon:AddRecipeData(prof) - end - end - end - return recipe_list - -end - -------------------------------------------------------------------------------- --- Creates a reverse lookup for a recipe list -------------------------------------------------------------------------------- -local CreateReverseLookup -do - local reverse_lookup = {} - - function CreateReverseLookup(recipe_list) - if (not recipe_list) then - addon:Print(L["DATAMINER_NODB_ERROR"]) - return - end - - twipe(reverse_lookup) - - for i in pairs(recipe_list) do - --if t[recipe_list[i]["Name"]] then addon:Print("Dupe: " .. i) end - reverse_lookup[recipe_list[i]["Name"]] = i - end - - return reverse_lookup - end - -end - -------------------------------------------------------------------------------- --- Tooltip for data-mining. -------------------------------------------------------------------------------- -local ARLDatamineTT = CreateFrame("GameTooltip", "ARLDatamineTT", UIParent, "GameTooltipTemplate") - -do - -- Tables used in all the Scan functions within this do block. -Torhal - local info, output = {}, {} - - --- Function to compare the skill levels of a trainers recipes with those in the ARL database. - -- @name AckisRecipeList:ScanSkillLevelData - -- @param autoscan True when autoscan is enabled in preferences, it will surpress output letting you know when a scan has occured. - -- @return Does a comparison of the information in your internal ARL database, and those items which are available on the trainer. Compares the skill levels between the two. - function addon:ScanSkillLevelData(autoscan) - if not IsTradeskillTrainer() then - if not autoscan then - self:Print(L["DATAMINER_SKILLLEVEL_ERROR"]) - end - return - end - local recipe_list = LoadRecipe() -- Get internal database - - if not recipe_list then - self:Print(L["DATAMINER_NODB_ERROR"]) - return - end - -- Get the initial trainer filters - local avail = GetTrainerServiceTypeFilter("available") - local unavail = GetTrainerServiceTypeFilter("unavailable") - local used = GetTrainerServiceTypeFilter("used") - - -- Clear the trainer filters - SetTrainerServiceTypeFilter("available", 1) - SetTrainerServiceTypeFilter("unavailable", 1) - SetTrainerServiceTypeFilter("used", 1) - - twipe(info) - - -- Get the skill levels from the trainer - for i = 1, GetNumTrainerServices(), 1 do - local name = GetTrainerServiceInfo(i) - local _, skilllevel = GetTrainerServiceSkillReq(i) - - if not skilllevel then - skilllevel = 0 - end - info[name] = skilllevel - end - local found = false - - twipe(output) - - for i in pairs(recipe_list) do - local i_name = recipe_list[i]["Name"] - - if info[i_name] and info[i_name] ~= recipe_list[i]["Level"] then - found = true - tinsert(output, L["DATAMINER_SKILLELVEL"]:format(i_name, recipe_list[i]["Level"], info[i_name])) - end - end - tinsert(output, "Trainer Skill Level Scan Complete.") - - if found then - self:DisplayTextDump(nil, nil, tconcat(output, "\n")) - end - -- Reset the filters to what they were before - SetTrainerServiceTypeFilter("available", avail or 0) - SetTrainerServiceTypeFilter("unavailable", unavail or 0) - SetTrainerServiceTypeFilter("used", used or 0) - end - - local teach, noteach = {}, {} - - --- Function to compare which recipes are available from a trainer and compare with the internal ARL database. - -- @name AckisRecipeList:ScanTrainerData - -- @param autoscan True when autoscan is enabled in preferences, it will surpress output letting you know when a scan has occured. - -- @return Does a comparison of the information in your internal ARL database, and those items which are available on the trainer. - -- Compares the acquire information of the ARL database with what is available on the trainer. - function addon:ScanTrainerData(autoscan) - if not (UnitExists("target") and (not UnitIsPlayer("target")) and (not UnitIsEnemy("player", "target"))) then -- Make sure the target exists and is a NPC - if not autoscan then - self:Print(L["DATAMINER_TRAINER_NOTTARGETTED"]) - end - return - end - local targetname = UnitName("target") -- Get its name - local targetID = tonumber(string.sub(UnitGUID("target"), -12, -7), 16) -- Get the NPC ID - - if not IsTradeskillTrainer() then -- Are we at a trade skill trainer? - if not autoscan then - self:Print(L["DATAMINER_SKILLLEVEL_ERROR"]) - end - return - end - local recipe_list = LoadRecipe() -- Get internal database - - if not recipe_list then - self:Print(L["DATAMINER_NODB_ERROR"]) - return - end - - -- Get the initial trainer filters - local avail = GetTrainerServiceTypeFilter("available") - local unavail = GetTrainerServiceTypeFilter("unavailable") - local used = GetTrainerServiceTypeFilter("used") - - -- Clear the trainer filters - SetTrainerServiceTypeFilter("available", 1) - SetTrainerServiceTypeFilter("unavailable", 1) - SetTrainerServiceTypeFilter("used", 1) - - if (GetNumTrainerServices() == 0) then - self:Print("Warning: Trainer is bugged, reporting 0 trainer items.") - end - twipe(info) - - -- Get all the names of recipes from the trainer - for i = 1, GetNumTrainerServices(), 1 do - local name = GetTrainerServiceInfo(i) - info[name] = true - end - twipe(teach) - twipe(noteach) - twipe(output) - - -- Dump out trainer info - tinsert(output, L["DATAMINER_TRAINER_INFO"]:format(targetname, targetID)) - - local teachflag = false - local noteachflag = false - - for i in pairs(recipe_list) do - local i_name = recipe_list[i]["Name"] - local acquire = recipe_list[i]["Acquire"] - local flags = recipe_list[i]["Flags"] - - -- If the trainer teaches this recipe - if info[i_name] then - local found = false - - -- Parse acquire info - for j in pairs(acquire) do - if (acquire[j]["Type"] == 1) then - if (acquire[j]["ID"] == targetID) then - found = true - end - end - end - - if (not found) then - tinsert(teach, i) - teachflag = true - - if (not flags[3]) then - tinsert(output, ": Trainer flag needs to be set.") - end - end - -- Trainer does not teach this recipe - else - local found = false - -- Parse acquire info - for j in pairs(acquire) do - if (acquire[j]["Type"] == 1) then - if (acquire[j]["ID"] == targetID) then - found = true - end - end - end - - if found then - noteachflag = true - tinsert(noteach, i) - end - end - end - - if teachflag then - tinsert(output, "Missing entries (need to be added):") - tsort(teach) - - for i in ipairs(teach) do - tinsert(output, L["DATAMINER_TRAINER_TEACH"]:format(teach[i], recipe_list[teach[i]]["Name"])) - end - end - - if noteachflag then - tinsert(output, "Extra entries (need to be removed):") - tsort(noteach) - - for i in ipairs(noteach) do - tinsert(output, L["DATAMINER_TRAINER_NOTTEACH"]:format(noteach[i], recipe_list[noteach[i]]["Name"])) - end - end - tinsert(output, "Trainer Acquire Scan Complete.") - tinsert(output, "If you're doing an engineering scan, there may be some goggles listed as extra. These goggles ONLY show up for those classes who can make them, so they may be false positives.") - - if teachflag or noteachflag then - self:DisplayTextDump(nil, nil, tconcat(output, "\n")) - end - -- Reset the filters to what they were before - SetTrainerServiceTypeFilter("available", avail or 0) - SetTrainerServiceTypeFilter("unavailable", unavail or 0) - SetTrainerServiceTypeFilter("used", used or 0) - end -end -- do - ---- Generates tradeskill links for all professions so you can scan them for completeness. --- @name AckisRecipeList:GenerateLinks --- @return Generates tradeskill links with all recipes. Used for testing to see if a recipe is missing from the database or not. -function addon:GenerateLinks() - -- This code adopted from Gnomish Yellow Pages with permission - - local guid = UnitGUID("player") - local playerGUID = gsub(guid, "0x0+", "") - - -- Listing of all tradeskill professions - local tradelist = {51304, 51300, 51313, 51306, 45363, 51311, 51302, 51309, 51296, 45542} - ---[[ - local encodingLength = floor((#recipeList+5) / 6) - - local encodedString = string.rep("/", encodingLength) -]]-- - local bitmap = {} - bitmap[45542] = "8bffAA" -- First Aid (6) - --bitmap[51296] = "2/7///7///9////7//////////g+/B" -- Cooking (30) - bitmap[51296] = "2/7///7///9////7//////////gC8/B" -- Cooking - --bitmap[51306] = "4/////////////3nFA+///9+/P7//f//n//9dgdJgHA87/3f/TolD" -- Engineering (53) - bitmap[51306] = "4/////////////3nFA+///9+/P7//f//n//9dgdJgHA87/3f/Tol3B" -- Engineering - --bitmap[51302] = "e+//////////////v//P+f///3///7/9f9//////////f///////HQ5+////B4//+///////5///////PA/Eg//" -- LW (87) - bitmap[51302] = "e+//////////////v//P+f///3///7/9f9//////////f///////HQ5+////B4//+//////////////////HgAAw/P" -- Leatherworking - --bitmap[51302] = string.rep("/", 87) - --bitmap[51304] = "2//v//////f////3//v///////6//////////9////X" -- Alchemy (43) - bitmap[51304] = "2//v//////f////3//v///////5//////////9/////v" -- Alchemy - --bitmap[51304] = string.rep("/", 43) -- Alchemy (43) - --bitmap[51300] = string.rep("/", 85) -- Blacksmithing (85) - --bitmap[51309] = string.rep("/", 71) -- Tailoring (71) - bitmap[51309] = "YIEMCCgAicAjAGIAiQKAACBRxgBEAAAAAAAAA45BAqBQBAKAAAEAAAIICLHqiAuKAAAEABAAA" - --bitmap[51311] = string.rep("/", 83) -- JC 83 - bitmap[51311] = "8fJRMqkmRwipmMHAQAACEAAQw/AgDkMJIAQgCA4AAwHMKFr/TCEx6tip+z7WyNsRWrnhm7wGPAAOgAUEALFAAWJWfqsBCAB" - --bitmap[45363] = string.rep("/", 74) -- Inscription (74) - --bitmap[51313] = "4//////////7///////////w//++/9vn7///////3P/t/n//BAB" -- Enchanting - --bitmap[51313] = "4//////////7///////////w//++/9vn7///////3P/t/n//BAD" -- Enchanting (51) - bitmap[51313] = "4//////////7///////////w//+//9/n7///////3f//////ZsD" -- Enchanting - --bitmap[51313] = string.rep("/", 51) -- Enchanting (51) - - for i in pairs(tradelist) do - - local tradeName = GetSpellInfo(tradelist[i]) - local tradelink = {} - tradelink[1] = "|cffffd000|Htrade:" - tradelink[2] = tradelist[i] - tradelink[3] = ":450:450:" - tradelink[4] = playerGUID - tradelink[5] = ":" - tradelink[6] = bitmap[tradelist[i]] - tradelink[7] = "|h[" - tradelink[8] = tradeName - tradelink[9] = "]|h|r" - - if (bitmap[tradelist[i]]) then - self:Print(tconcat(tradelink, "")) - else - self:Print("I don't have the bitmap for " .. tradeName .. " yet (Professions were updated in 3.2. If you want to help, talk to me on IRC.") - end - -- /script DEFAULT_CHAT_FRAME:AddMessage(gsub(GetTradeSkillListLink(), "\124", "\124\124")) - end - -end - -------------------------------------------------------------------------------- ---- Scans the items in the specified profession -------------------------------------------------------------------------------- -do - local ORDERED_PROFESSIONS = { - strlower(PROFESSIONS.Alchemy), -- 1 Alchemy - strlower(PROFESSIONS.Blacksmithing), -- 2 Blacksmithing - strlower(PROFESSIONS.Cooking), -- 3 Cooking - strlower(PROFESSIONS.Enchanting), -- 4 Enchanting - strlower(PROFESSIONS.Engineering), -- 5 Engineering - strlower(PROFESSIONS.FirstAid), -- 6 First Aid - strlower(PROFESSIONS.Inscription), -- 7 Inscription - strlower(PROFESSIONS.Jewelcrafting), -- 8 Jewelcrafting - strlower(PROFESSIONS.Leatherworking), -- 9 Leatherworking - strlower(PROFESSIONS.Runeforging), -- 10 Runeforging - strlower(PROFESSIONS.Smelting), -- 11 Smelting - strlower(PROFESSIONS.Tailoring), -- 12 Tailoring - } - local recipe_list = {} - local output = {} - - local function ProfessionScan(prof_name) - local master_list = LoadRecipe() - - if not master_list then - addon:Print(L["DATAMINER_NODB_ERROR"]) - return - end - twipe(recipe_list) - - for i in pairs(master_list) do - local prof = strlower(master_list[i]["Profession"]) - - if prof and prof == prof_name then - recipe_list[i] = master_list[i] - end - end - twipe(output) - - -- Parse the entire recipe database - for i in pairs(recipe_list) do - local ttscantext = addon:TooltipScanRecipe(i, false, true) - - if (ttscantext) then - tinsert(output, ttscantext) - end - end - addon:DisplayTextDump(nil, nil, tconcat(output, "\n")) - ARLDatamineTT:Hide() - end - - --- Parses all recipes for a specified profession, scanning their tool tips. - -- @name AckisRecipeList:ScanProfession - -- @usage AckisRecipeList:ScanProfession("first aid") - -- @param prof_name The profession name or the spell ID of it, which you wish to scan. - -- @return Recipes in the given profession have their tooltips scanned. - function addon:ScanProfession(prof_name) - if (type(prof_name) == "number") then - prof_name = GetSpellInfo(prof_name) - end - - local found = false - prof_name = strlower(prof_name) - - local scan_all = prof_name == "all" - - if not scan_all then - for idx, name in ipairs(ORDERED_PROFESSIONS) do - if prof_name == name then - found = true - break - end - end - - if not found then - self:Print(L["DATAMINER_NODB_ERROR"]) - return - end - - ProfessionScan(prof_name) - else - for idx, name in ipairs(ORDERED_PROFESSIONS) do - ProfessionScan(name) - end - end - end -end -- do - -local RECIPE_NAMES = { - -- JC - ["design: "] = true, - -- LW or Tailoring - ["pattern: "] = true, - -- Alchemy or Cooking - ["recipe: "] = true, - -- BS - ["plans: "] = true, - -- Enchanting - ["formula: "] = true, - -- Engineering - ["schematic: "] = true, - -- First Aid - ["manual: "] = true, - - ["alchemy: "] = true, - ["blacksmithing: "] = true, - ["cooking: "] = true, - ["enchanting: "] = true, - ["engineering: "] = true, - ["first aid: "] = true, - ["inscription: "] = true, - ["jewelcrafting: "] = true, - ["leatherworking: "] = true, - ["tailoring: "] = true, -} - ---- Scans the items on a vendor, determining which recipes are available if any and compares it with the database entries. --- @name AckisRecipeList:ScanVendor --- @usage AckisRecipeList:ScanVendor() --- @return Obtains all the vendor information on tradeskill recipes and attempts to compare the current vendor with the internal database. -do - local output = {} - - function addon:ScanVendor() - if not (UnitExists("target") and (not UnitIsPlayer("target")) and (not UnitIsEnemy("player", "target"))) then -- Make sure the target exists and is a NPC - self:Print(L["DATAMINER_VENDOR_NOTTARGETTED"]) - return - end - local recipe_list = LoadRecipe() -- Get internal database - - if not recipe_list then - self:Print(L["DATAMINER_NODB_ERROR"]) - return - end - local reverse_lookup = CreateReverseLookup(recipe_list) - local targetname = UnitName("target") -- Get its name - local targetID = tonumber(string.sub(UnitGUID("target"), -12, -7), 16) -- Get the NPC ID - local added = false - - twipe(output) - - -- Parse all the items on the merchant - for i = 1, GetMerchantNumItems(), 1 do - local name, _, _, _, numAvailable = GetMerchantItemInfo(i) - - if name then - -- Lets scan recipes only on vendors - local matchtext = strmatch(name, "%a+: ") - -- Check to see if we're dealing with a recipe - if matchtext and RECIPE_NAMES[strlower(matchtext)] then - local recipename = gsub(name, "%a+\: ", "") -- Get rid of the first part of the item - local spellid = reverse_lookup[recipename] -- Find out what spell ID we're using - - -- Do the scan if we have the spell ID - if (spellid) then - added = true - local ttscantext = addon:TooltipScanRecipe(spellid, true, true) - - if (ttscantext) then - tinsert(output, ttscantext) - end - -- Ok now we know it's a vendor, lets check the database to see if the vendor is listed as an acquire method. - local acquire = recipe_list[spellid]["Acquire"] - local found = false - - for i in pairs(acquire) do - local atype = acquire[i]["Type"] - -- If the acquire type is a vendor - if (((atype == 2) and (acquire[i]["ID"] == targetID)) - or ((atype == 6) and (acquire[i]["RepVendor"] == targetID))) then - found = true - end - end - - if (not found) then - tinsert(output, "Vendor ID missing from " .. spellid) - end - else - --@debug@ - added = true - tinsert(output, "Spell ID not found for: " .. name) - --@end-debug@ - end - end - end - end - - if added then - self:DisplayTextDump(nil, nil, tconcat(output, "\n")) - end - ARLDatamineTT:Hide() - end -end -- do - ---- Parses all the recipes in the database, and scanning their tooltips. --- @name AckisRecipeList:TooltipScanDatabase --- @usage AckisRecipeList:TooltipScanDatabase() --- @return Entire recipe database has its tooltips scanned. -do - local output = {} - - function addon:TooltipScanDatabase() - -- Get internal database - local recipe_list = LoadRecipe() - - if (not recipe_list) then - self:Print(L["DATAMINER_NODB_ERROR"]) - return - end - twipe(output) - - -- Parse the entire recipe database - for i in pairs(recipe_list) do - - local ttscantext = addon:TooltipScanRecipe(i, false, true) - if (ttscantext) then - tinsert(output, ttscantext) - end - end - self:DisplayTextDump(nil, nil, tconcat(output, "\n")) - end -end -- do ---- Parses a specific recipe in the database, and scanning its tooltip. --- @name AckisRecipeList:TooltipScanRecipe --- @param spellid The [[[http://www.wowwiki.com/SpellLink | Spell ID]]] of the recipe being added to the database. --- @param is_vendor Boolean to determine if we're viewing a vendor or not. --- @param is_largescan Boolean to determine if we're doing a large scan. --- @return Recipe has its tooltips scanned. -do - - --------------------------------------------------------------------------------------------------------- - ----This table, DO_NOT_SCAN, contains itemid's that will not cache on the servers - --------------------------------------------------------------------------------------------------------- - - local DO_NOT_SCAN = { - ------------------------------------------------------------------------------- - --Leatherworking - ------------------------------------------------------------------------------- - [35214] = true, [32434] = true, [15769] = true, - [32431] = true, [32432] = true, [35215] = true, [35521] = true, - [35520] = true, [35524] = true, [35517] = true, [35528] = true, - [35527] = true, [35523] = true, [35549] = true, [35218] = true, - [35217] = true, [35216] = true, [35546] = true, [35541] = true, [15756] = true, - [15777] = true, [32433] = true, [29729] = true, [29732] = true, [32744] = true, - - ------------------------------------------------------------------------------- - --Tailoring - ------------------------------------------------------------------------------- - [14477] = true, [14485] = true, [30281] = true, [14478] = true, [14500] = true, - [32439] = true, [14479] = true, [32447] = true, [14480] = true, [32437] = true, - [14495] = true, [14505] = true, [35204] = true, [35205] = true, [35206] = true, - - ------------------------------------------------------------------------------- - --Jewelcrafting - ------------------------------------------------------------------------------- - [23130] = true, [23140] = true, [23137] = true, [23131] = true, [23148] = true, - [35538] = true, [35201] = true, [35533] = true, [35200] = true, [23147] = true, - [23135] = true, [35203] = true, - - ------------------------------------------------------------------------------- - --Alchemy - ------------------------------------------------------------------------------- - [22925] = true, [13480] = true, [13481] = true, [13493] = true, - - ------------------------------------------------------------------------------- - --Cooking - ------------------------------------------------------------------------------- - [39644] = true, - - ------------------------------------------------------------------------------- - --Blacksmithing - ------------------------------------------------------------------------------- - [32441] = true, [32443] = true, [12687] = true, [12714] = true, [12688 ] = true, - [35211] = true, [35209] = true, [35210] = true, [12706] = true, [7982] = true, - - ------------------------------------------------------------------------------- - --Engineering - ------------------------------------------------------------------------------- - [35196] = true, [21734] = true, [18292] = true, [21727] = true, [21735] = true, [16053] = true, [21729] = true, - [16047] = true,[21730] = true,[21731] = true,[21732] = true,[4411] = true, [21733] = true, [21728] = true, - - } - - local output = {} - - function addon:TooltipScanRecipe(spell_id, is_vendor, is_largescan) - local recipe_list = LoadRecipe() - - if not recipe_list then - self:Print(L["DATAMINER_NODB_ERROR"]) - return - end - local spell_info = recipe_list[spell_id] - - if not spell_info then - self:Print(string.format("Spell ID %d does not exist in the database.", tonumber(spell_id))) - return - end - local recipe_name = spell_info["Name"] - local game_vers = spell_info["Game"] - - twipe(output) - - if not game_vers then - tinsert(output, "No expansion information: " .. tostring(spell_id) .. " " .. recipe_name) - elseif game_vers > 2 then - tinsert(output, "Expansion information too high: " .. tostring(spell_id) .. " " .. recipe_name) - end - local Orange = spell_info["Orange"] - local Yellow = spell_info["Yellow"] - local Green = spell_info["Green"] - local Grey = spell_info["Grey"] - local SkillLevel = spell_info["Level"] - - if not Orange then - tinsert(output, "No skill level information: " .. tostring(spell_id) .. " " .. recipe_name) - else - -- Highest level is greater than the skill of the recipe - if Orange > SkillLevel then - tinsert(output, "Skill Level Error (Orange > Skill): " .. tostring(spell_id) .. " " .. recipe_name) - end - -- Level info is messed up - if Orange > Yellow or Orange > Green or Orange > Grey or Yellow > Green or Yellow > Grey or Green > Grey then - tinsert(output, "Skill Level Error: " .. tostring(spell_id) .. " " .. recipe_name) - end - end - local recipe_link = spell_info["RecipeLink"] - - if not recipe_link then - if spell_info["Profession"] ~= GetSpellInfo(53428) then -- Lets hide this output for runeforging. - self:Print("Missing RecipeLink for ID " .. spell_id .. " - " .. recipe_name .. " (Normal for DK abilities.") - end - return - end - ARLDatamineTT:SetOwner(WorldFrame, "ANCHOR_NONE") - GameTooltip_SetDefaultAnchor(ARLDatamineTT, UIParent) - ARLDatamineTT:SetHyperlink(recipe_link) -- Link exists, so load the tooltip for scanning - - -- Lets check to see if it's a recipe tooltip - local text = strlower(_G["ARLDatamineTTTextLeft1"]:GetText()) - local match_text = strmatch(text, "%a+: ") - - -- Check to see if we're dealing with a recipe - if not RECIPE_NAMES[match_text] then - ARLDatamineTT:Hide() - return - end - local reverse_lookup = CreateReverseLookup(recipe_list) - --- tinsert(output, "RECIPE SCAN") - --- for i = 1, ARLDatamineTT:NumLines(), 1 do --- local text_l = _G["ARLDatamineTTTextLeft" .. i]:GetText() --- local text_r = _G["ARLDatamineTTTextRight" .. i]:GetText() --- local text - --- if text_r then --- text = text_l .. "(Left) " .. text_r .. "(Right)" --- else --- text = text_l --- end - --- tinsert(output, text) --- end - self:ScanToolTip(recipe_name, recipe_list, reverse_lookup, is_vendor, false) - - local item_id = SPELL_ITEM[spell_id] - --- tinsert(output, "ITEM SCAN") - -- We have a reverse look-up for the item which creates the spell (aka the recipe itself) - if item_id then - if not DO_NOT_SCAN[item_id] then - local incache = GetItemInfo(item_id) - - if incache then - - ARLDatamineTT:SetHyperlink("item:" .. item_id .. ":0:0:0:0:0:0:0") - --- for i = 1, ARLDatamineTT:NumLines(), 1 do --- local text_l = _G["ARLDatamineTTTextLeft" .. i]:GetText() --- local text_r = _G["ARLDatamineTTTextRight" .. i]:GetText() --- local text - --- if text_r then --- text = text_l .. "(Left) " .. text_r .. "(Right)" --- else --- text = text_l --- end - --- tinsert(output, text) --- end - -- Scan the recipe item (aka pattern) - self:ScanToolTip(recipe_name, recipe_list, reverse_lookup, is_vendor, true) - else - tinsert(output, "Item ID: " .. item_id .. " not in cache. If you have Querier use /iq " .. item_id) - end - end - -- We are dealing with a recipe that does not have an item to learn it from - else - -- Lets check the recipe flags to see if we have a data error and the item should exist - local flags = spell_info["Flags"] - - if (flags[4] or flags[5] or flags[6]) then - tinsert(output, "Spell/Item ID: " .. spell_id .. " does not exist in the SPELL_ITEM table.") - end - end - ARLDatamineTT:Hide() - - -- Add the flag scan to the table if it's not nil - local results = self:PrintScanResults() - - if not results then - return - end - tinsert(output, results) - - if is_largescan then - return tconcat(output, "\n") - else - self:Print(tconcat(output, "\n")) - end - end -end -- do - -------------------------------------------------------------------------------- --- Tooltip-scanning code -------------------------------------------------------------------------------- -do - local SPECIALTY_TEXT = { - ["requires spellfire tailoring"] = 26797, - ["requires mooncloth tailoring"] = 26798, - ["requires shadoweave tailoring"] = 26801, - ["requires dragonscale leatherworking"] = 10657, - ["requires elemental leatherworking"] = 10659, - ["requires tribal leatherworking"] = 10661, - ["requires gnomish engineer"] = 20219, - ["requires goblin engineer"] = 20222, - ["requires armorsmith"] = 9788, - ["requires master axesmith"] = 17041, - ["requires master hammersmith"] = 17040, - ["requires master swordsmith"] = 17039, - ["requires weaponsmith"] = 9787, - } - - local FACTION_TEXT = { - ["thorium brotherhood"] = 98, - ["zandalar tribe"] = 100, - ["argent dawn"] = 96, - ["timbermaw hold"] = 99, - ["cenarion circle"] = 97, - ["the aldor"] = 101, - ["the consortium"] = 105, - ["the scryers"] = 110, - ["the sha'tar"] = 111, - ["the mag'har"] = 108, - ["cenarion expedition"] = 103, - ["honor hold"] = 104, - ["thrallmar"] = 104, - ["the violet eye"] = 114, - ["sporeggar"] = 113, - ["kurenai"] = 108, - ["keepers of time"] = 106, - ["the scale of the sands"] = 109, - ["lower city"] = 107, - ["ashtongue deathsworn"] = 102, - ["alliance vanguard"] = 131, - ["valiance expedition"] = 126, - ["horde expedition"] = 130, - ["the taunka"] = 128, - ["the hand of vengeance"] = 127, - ["explorers' league"] = 125, - ["the kalu'ak"] = 120, - ["shattered sun offensive"] = 112, - ["warsong offensive"] = 129, - ["kirin tor"] = 118, - ["the wyrmrest accord"] = 122, - ["knights of the ebon blade"] = 117, - ["frenzyheart tribe"] = 116, - ["the oracles"] = 121, - ["argent crusade"] = 115, - ["the sons of hodir"] = 119, - } - - local FACTION_LEVELS = { - ["neutral"] = 0, - ["friendly"] = 1, - ["honored"] = 2, - ["revered"] = 3, - ["exalted"] = 4, - } - - local CLASS_TYPES = { - ["Death Knight"] = 21, ["Druid"] = 22, ["Hunter"] = 23, - ["Mage"] = 24, ["Paladin"] = 25, ["Priest"] = 26, - ["Shaman"] = 27, ["Rogue"] = 28, ["Warlock"] = 29, - ["Warrior"] = 30, - } - - local ORDERED_CLASS_TYPES = { - [1] = "Death Knight", [2] = "Druid", [3] = "Hunter", - [4] = "Mage", [5] = "Paladin", [6] = "Priest", - [7] = "Shaman", [8] = "Rogue", [9] = "Warlock", - [10] = "Warrior", - } - - local ROLE_TYPES = { - ["dps"] = 51, ["tank"] = 52, ["healer"] = 53, - ["caster"] = 54, ["RESERVED1"] = 55, - } - - local ORDERED_ROLE_TYPES = { - [1] = "dps", [2] = "tank", [3] = "healer", - [4] = "caster", [5] = "RESERVED1", - } - - local ENCHANT_TO_ITEM = { - ["Cloak"] = "Back", - ["Ring"] = "Finger", - ["2H Weapon"] = "Two-Hand", - } - - local ITEM_TYPES = { - -- Armor types - ["Cloth"] = 56, ["Leather"] = 57, ["Mail"] = 58, - ["Plate"] = 59, ["Back"] = 60, ["Trinket"] = 61, - ["Finger"] = 62, ["Neck"] = 63, ["Shield"] = 64, - ["RESERVED2"] = 65, - - -- Weapon types - ["One-Hand"] = 66, ["Two-Hand"] = 67, ["Axe"] = 68, - ["Sword"] = 69, ["Mace"] = 70, ["Polearm"] = 71, - ["Dagger"] = 72, ["Staff"] = 73, ["Wand"] = 74, - ["Thrown"] = 75, ["Bow"] = 76, ["CrossBow"] = 77, - ["Ammo"] = 78, ["Fist Weapon"] = 79, ["Gun"] = 80, - } - - local ORDERED_ITEM_TYPES = { - -- Armor types - [1] = "Cloth", [2] = "Leather", [3] = "Mail", - [4] = "Plate", [5] = "Back", [6] = "Trinket", - [7] = "Finger", [8] = "Neck", [9] = "Shield", - [10] = "RESERVED2", - - -- Weapon types - [11] = "One-Hand", [12] = "Two-Hand", [13] = "Axe", - [14] = "Sword", [15] = "Mace", [16] = "Polearm", - [17] = "Dagger", [18] = "Staff", [19] = "Wand", - [20] = "Thrown", [21] = "Bow", [22] = "CrossBow", - [23] = "Ammo", [24] = "Fist Weapon", [25] = "Gun", - } - - -- Table to store scanned information. Wiped and re-used every scan. - local scan_data = {} - - --- Parses the mining tooltip for certain keywords, comparing them with the database flags. - -- @name AckisRecipeList:ScanToolTip - -- @param name The name of the recipe - -- @param recipe_list Recipe database - -- @param reverse_lookup Reverse lookup database - -- @param is_vendor Boolean to indicate if we're scanning a vendor. - -- @param is_item Boolean to indicate if we're scanning an item tooltip. - -- @return Scans a tooltip, and outputs the missing or extra filter flags. - function addon:ScanToolTip(name, recipe_list, reverse_lookup, is_vendor, is_item) - -- We only want to wipe the table if we're scanning a new entry (not an item associated with a spell ID) - if not is_item then - twipe(scan_data) - end - scan_data.match_name = name - scan_data.recipe_list = recipe_list - scan_data.reverse_lookup = reverse_lookup - scan_data.is_vendor = is_vendor - scan_data.is_item = is_item - - -- Parse all the lines of the tooltip - for i = 1, ARLDatamineTT:NumLines(), 1 do - local text_l = _G["ARLDatamineTTTextLeft" .. i]:GetText() - local text_r = _G["ARLDatamineTTTextRight" .. i]:GetText() - local text - - if text_r then - text = text_l .. " " .. text_r - else - text = text_l - end - - local text = strlower(text) - - -- Check for recipe/item binding - -- The recipe binding is within the first few lines of the tooltip always - if strmatch(text, "binds when picked up") then - if (i < 3) then - scan_data.boprecipe = true - else - scan_data.bopitem = true - end - end - - -- Recipe Specialities - if SPECIALTY_TEXT[text] then - scan_data.specialty = SPECIALTY_TEXT[text] - end - - -- Recipe Reputations - local rep, replevel = strmatch(text_l, "Requires (.+) %- (.+)") - - if rep and replevel and FACTION_TEXT[rep] then - scan_data.repid = FACTION_TEXT[rep] - scan_data.repidlevel = FACTION_LEVELS[replevel] - end - - -- Flag so that we don't bother checking for classes if we're sure of the class - -- AKA +spell hit == caster DPS only no matter what other stats are on it - -- Saves processing cycles and it won't cause the flags to be overwritten if a non-specific stat is found after - scan_data.verifiedclass = false - - if (not scan_data.verifiedclass) then - -- Certain stats can be considered for a specific role (aka spell hit == caster dps). - if (strmatch(text, "strength") and (strmatch(text, "strength of the clefthoof") == nil) and (strmatch(text, "set:") == nil)) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "agility")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "spirit")) then - scan_data.dps = false - scan_data.tank = false - scan_data.caster = true - scan_data.healer = true - elseif (strmatch(text, "spell power")) then - scan_data.dps = false - scan_data.tank = false - scan_data.caster = true - scan_data.healer = true - elseif (strmatch(text, "spell crit")) then - scan_data.dps = false - scan_data.tank = false - scan_data.caster = true - scan_data.healer = true - elseif (strmatch(text, "spell hit")) then - scan_data.dps = false - scan_data.tank = false - scan_data.caster = true - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "spell penetration")) then - scan_data.dps = false - scan_data.tank = false - scan_data.caster = true - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "mana per 5 sec.") or (strmatch(text, "mana every 5 seconds"))) then - scan_data.dps = false - scan_data.tank = false - scan_data.caster = true - scan_data.healer = true - elseif (strmatch(text, "attack power")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "expertise")) then - scan_data.dps = true - scan_data.tank = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "melee crit")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "critical hit")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "weapon damage")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "ranged crit")) then - scan_data.dps = true - scan_data.tank = false - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "melee haste")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "ranged haste")) then - scan_data.dps = true - scan_data.tank = false - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "melee hit")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "ranged hit")) then - scan_data.dps = true - scan_data.tank = false - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "armor pen")) then - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "feral attack power")) then - scan_data.tank = true - scan_data.dps = true - scan_data.caster = false - scan_data.healer = false - elseif (strmatch(text, "defense") and (strmatch(text, "defenseless") == nil)) then - scan_data.dps = false - scan_data.tank = true - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "block")) then - scan_data.dps = false - scan_data.tank = true - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "parry")) then - scan_data.dps = false - scan_data.tank = true - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - elseif (strmatch(text, "dodge") and (strmatch(text, "set:") == nil)) then - scan_data.dps = false - scan_data.tank = true - scan_data.caster = false - scan_data.healer = false - scan_data.verifiedclass = true - end - end - - -- Classes - local class_type = strmatch(text_l, "Classes: (.+)") - - if class_type then - for idx, class in ipairs(ORDERED_CLASS_TYPES) do - if strmatch(class_type, class) then - scan_data[class] = true - scan_data.found_class = true - end - end - end - - -- Armor types - if ITEM_TYPES[text_l] then - scan_data[text_l] = true - elseif text_l == "Held In Off-hand" or text_l == "Off Hand" or text_l == "Main Hand" then -- Special cases. - scan_data["One-Hand"] = true - elseif text_l == "Projectile" then - scan_data["Ammo"] = true - end - - if text_r and ITEM_TYPES[text_r] then - scan_data[text_r] = true - end - - -- Enchantment voodoo - local ench_type, _ = strmatch(text_l, "Enchant (.+) %- (.+)") - - if ench_type then - if ITEM_TYPES[ench_type] then - scan_data[ench_type] = true - elseif ITEM_TYPES[ENCHANT_TO_ITEM[ench_type]] then - scan_data[ENCHANT_TO_ITEM[ench_type]] = true - elseif ench_type == "Weapon" then -- Special case. - scan_data["One-Hand"] = true - scan_data["Two-Hand"] = true - end - end - end -- for - end - - -- Flag data for printing. Wiped and re-used. - local missing_flags = {} - local extra_flags = {} - local output = {} - - --- Prints out the results of the tooltip scan. - -- @name AckisRecipeList:PrintScanResults - function addon:PrintScanResults() - -- Parse the recipe database until we get a match on the name - local recipe_name = gsub(scan_data.match_name, "%a+%?: ", "") - local spell_id = scan_data.reverse_lookup[recipe_name] - - if (not spell_id) then - self:Print("Recipe " .. recipe_name .. " has no reverse lookup") - return - end - - local flags = scan_data.recipe_list[spell_id]["Flags"] - local acquire = scan_data.recipe_list[spell_id]["Acquire"] - twipe(missing_flags) - twipe(extra_flags) - twipe(output) - - -- If we're a vendor scan, do some extra checks - if (scan_data.is_vendor) then - -- Check to see if the vendor flag is set - if (not flags[4]) then - tinsert(missing_flags, "4 (Vendor)") - end - - -- Check to see if we're in a PVP zone - if (((GetSubZoneText() == "Wintergrasp Fortress") or (GetSubZoneText() == "Halaa")) and (not flags[9])) then - tinsert(missing_flags, "9 (PvP)") - elseif ((flags[9]) and not ((GetSubZoneText() == "Wintergrasp Fortress") or (GetSubZoneText() == "Halaa"))) then - tinsert(extra_flags, "9 (PvP)") - end - end - - -- -- If we've picked up at least one class flag - if (scan_data.found_class) then - for k, v in ipairs(ORDERED_CLASS_TYPES) do - if scan_data[v] and not flags[CLASS_TYPES[v]] then - tinsert(missing_flags, tostring(CLASS_TYPES[v]).." ("..v..")") - elseif not scan_data[v] and flags[CLASS_TYPES[v]] then - tinsert(extra_flags, tostring(CLASS_TYPES[v]).." ("..v..")") - end - end - end - - -- BoP Item - if (scan_data.is_item) then - if (scan_data.bopitem) and (not flags[37]) then - tinsert(missing_flags, "37 (BoP Item)") - -- If it's a BoP item and flags BoE is set, mark it as extra - if (flags[36]) then - tinsert(extra_flags, "36 (BoE Item)") - end - -- If it's a BoP item and flags BoA is set, mark it as extra - if (flags[38]) then - tinsert(extra_flags, "38 (BoA Item)") - end - -- BoE Item, assuming it's not BoA - elseif (not flags[36]) and (not scan_data.bopitem) then - tinsert(missing_flags, "36 (BoE Item)") - -- If it's a BoE item and flags BoP is set, mark it as extra - if (flags[37]) then - tinsert(extra_flags, "37 (BoP Item)") - end - -- If it's a BoE item and flags BoA is set, mark it as extra - if (flags[38]) then - tinsert(extra_flags, "38 (BoA Item)") - end - end - else - -- BoP Recipe - if (scan_data.boprecipe) and (not flags[41]) then - tinsert(missing_flags, "41 (BoP Recipe)") - -- If it's a BoP recipe and flags BoE is set, mark it as extra - if (flags[40]) then - tinsert(extra_flags, "40 (BoE Recipe)") - end - -- If it's a BoP recipe and flags BoA is set, mark it as extra - if (flags[42]) then - tinsert(extra_flags, "42 (BoA Recipe)") - end - -- Not BoP recipe, assuming it's not BoA - trainer-taught recipes don't have bind information, skip those. - elseif not flags[3] and (not flags[40]) and (not scan_data.boprecipe) then - tinsert(missing_flags, "40 (BoE Recipe)") - -- If it's a BoE recipe and flags BoP is set, mark it as extra - if (flags[41]) then - tinsert(extra_flags, "41 (BoP Recipe)") - end - -- If it's a BoE recipe and flags BoA is set, mark it as extra - if (flags[42]) then - tinsert(extra_flags, "42 (BoA Recipe)") - end - end - end - - for k, v in ipairs(ORDERED_ROLE_TYPES) do - if scan_data[v] and not flags[ROLE_TYPES[v]] then - tinsert(missing_flags, tostring(ROLE_TYPES[v]).." ("..v..")") - elseif not scan_data[v] and flags[ROLE_TYPES[v]] then - tinsert(extra_flags, tostring(ROLE_TYPES[v]).." ("..v..")") - end - end - - for k, v in ipairs(ORDERED_ITEM_TYPES) do - if scan_data[v] and not flags[ITEM_TYPES[v]] then - tinsert(missing_flags, tostring(ITEM_TYPES[v]).." ("..v..")") - elseif not scan_data[v] and flags[ITEM_TYPES[v]] then - tinsert(extra_flags, tostring(ITEM_TYPES[v]).." ("..v..")") - end - end - - -- Reputations - local repid = scan_data.repid - local addedtotable = false - - if repid and not flags[repid] then - tinsert(missing_flags, repid) - - for i, j in pairs(acquire) do - if (acquire[j]["Type"] == 6) then - local tmpacquire = acquire[j] - - if (tmpacquire["RepLevel"] ~= scan_data.repidlevel) then - tinsert(output, "Rep level wrong. " .. recipe_name .. " (" .. spell_id .. ")") - end - end - end - end - - if (#missing_flags > 0) or (#extra_flags > 0) then - addedtotable = true - tinsert(output, recipe_name .. " (" .. spell_id .. ")") - - -- Add a string of the missing flag numbers - if (#missing_flags > 0) then - tinsert(output, "Missing flags: " .. tconcat(missing_flags, ", ")) - end - - -- Add a string of the extra flag numbers - if (#extra_flags > 0) then - tinsert(output, "Extra flags: " .. tconcat(extra_flags, ", ")) - end - - local found_type = false - - for k, v in ipairs(ORDERED_ITEM_TYPES) do - if scan_data[v] then - found_type = true - break - end - end - - if not found_type then - tinsert(output, "Missing: item type flag") - end - end - - -- Check to see if we have a horde/alliance flag, all recipes must have one of these - if (not flags[1]) and (not flags[2]) then - addedtotable = true - tinsert(output, "Horde or alliance not selected. " .. recipe_name .. " (" .. spell_id .. ")") - end - - -- Check to see if we have an obtain method flag, all recipes must have at least one of these - if ((not flags[3]) and (not flags[4]) and (not flags[5]) and (not flags[6]) and (not flags[7]) - and (not flags[8]) and (not flags[9]) and (not flags[10]) and (not flags[11]) and (not flags[12])) then - addedtotable = true - tinsert(output, "No obtain flag. " .. recipe_name .. " (" .. spell_id .. ")") - end - - -- Check for recipe binding information, all recipes must have one of these - if (not flags[40]) and (not flags[41]) and (not flags[42]) then - addedtotable = true - tinsert(output, "No recipe binding information. " .. recipe_name .. " (" .. spell_id .. ")") - end - - -- Check for item binding information, all recipes must have one of these - if (not flags[36]) and (not flags[37]) and (not flags[38]) then - addedtotable = true - tinsert(output, "No item binding information. " .. recipe_name .. " (" .. spell_id .. ")") - end - - -- We need to code this better. Some items (aka bags) won't have a role at all. - -- Check for player role flags - if (not scan_data.tank) and (not scan_data.healer) and (not scan_data.caster) and (not scan_data.dps) and (not NO_PLAYER_FLAG[spell_id]) then - addedtotable = true - tinsert(output, "No player role flag. " .. recipe_name .. " (" .. spell_id .. ").") - end - - if (scan_data.specialty) then - if (not scan_data.recipe_list[spell_id]["Specialty"]) then - addedtotable = true - tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Missing Specialty: " .. scan_data.specialty) - elseif (scan_data.recipe_list[spell_id]["Specialty"] ~= scan_data.specialty) then - tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Wrong Specialty, the correct one is: " .. scan_data.specialty) - end - elseif (scan_data.recipe_list[spell_id]["Specialty"]) then - addedtotable = true - tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Extra Specialty: " .. scan_data.recipe_list[spell_id]["Specialty"]) - end - - if (addedtotable) then - return tconcat(output, "\n") - else - return nil - end - - end - -end \ No newline at end of file diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua deleted file mode 100644 index 5521324..0000000 --- a/AckisRecipeList.lua +++ /dev/null @@ -1,1737 +0,0 @@ -------------------------------------------------------------------------------- --- AckisRecipeList.lua -------------------------------------------------------------------------------- --- File date: @file-date-iso@ --- File revision: @file-revision@ --- Project revision: @project-revision@ --- Project version: @project-version@ -------------------------------------------------------------------------------- --- Authors: Ackis, Zhinjio, Jim-Bim, Torhal, Pompy -------------------------------------------------------------------------------- --- Please see http://www.wowace.com/projects/arl/for more information. -------------------------------------------------------------------------------- --- License: --- Please see LICENSE.txt - --- This source code is released under All Rights Reserved. -------------------------------------------------------------------------------- ---- **AckisRecipeList** provides an interface for scanning professions for missing recipes. --- There are a set of functions which allow you make use of the ARL database outside of ARL. --- ARL supports all professions currently in World of Warcraft 3.2 --- @class file --- @name AckisRecipeList.lua --- @release 1.0 - -------------------------------------------------------------------------------- --- Localized Lua globals. -------------------------------------------------------------------------------- -local _G = getfenv(0) - -local tostring = _G.tostring -local tonumber = _G.tonumber - -local pairs, ipairs = _G.pairs, _G.ipairs -local select = _G.select - -local table = _G.table -local twipe = table.wipe -local tconcat = table.concat -local tinsert = table.insert - -local string = _G.string -local strformat = string.format -local strfind = string.find -local strmatch = string.match -local strlower = string.lower - -------------------------------------------------------------------------------- --- Localized Blizzard API. -------------------------------------------------------------------------------- -local GetNumTradeSkills = _G.GetNumTradeSkills -local GetSpellInfo = _G.GetSpellInfo - -------------------------------------------------------------------------------- --- AddOn namespace. -------------------------------------------------------------------------------- -local LibStub = _G.LibStub -local MODNAME = "Ackis Recipe List" -local addon = LibStub("AceAddon-3.0"):NewAddon(MODNAME, "AceConsole-3.0", "AceEvent-3.0") -_G.AckisRecipeList = addon - ---@alpha@ -_G.ARL = addon ---@end-alpha@ - -local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME) - -local BFAC = LibStub("LibBabble-Faction-3.0"):GetLookupTable() - --------------------------------------------------------------------------------------------------------------------- --- Acquire types --------------------------------------------------------------------------------------------------------------------- -local A_TRAINER, A_VENDOR, A_MOB, A_QUEST, A_SEASONAL, A_REPUTATION, A_WORLD_DROP, A_CUSTOM = 1, 2, 3, 4, 5, 6, 7, 8 - ------------------------------------------------------------------------------- --- Constants. ------------------------------------------------------------------------------- -local NUM_FILTER_FLAGS = 128 -local PROFESSION_INITS = {} -- Professions initialization functions. - ------------------------------------------------------------------------------- --- Database tables ------------------------------------------------------------------------------- -local RecipeList = {} -local CustomList = {} -local MobList = {} -local QuestList = {} -local ReputationList = {} -local TrainerList = {} -local SeasonalList = {} -local VendorList = {} -local AllSpecialtiesTable = {} -local SpecialtyTable - -addon.custom_list = CustomList -addon.mob_list = MobList -addon.quest_list = QuestList -addon.recipe_list = RecipeList -addon.reputation_list = ReputationList -addon.trainer_list = TrainerList -addon.seasonal_list = SeasonalList -addon.vendor_list = VendorList - - ------------------------------------------------------------------------------- --- Data which is stored regarding a players statistics (luadoc copied from Collectinator, needs updating) ------------------------------------------------------------------------------- --- @class table --- @name Player --- @field known_filtered Total number of items known filtered during the scan. --- @field Faction Player's faction --- @field Class Player's class --- @field ["Reputation"] Listing of players reputation levels -local Player = {} -addon.Player = Player - --- Global Frame Variables -addon.optionsFrame = {} - -------------------------------------------------------------------------------- --- Check to see if we have mandatory libraries loaded. If not, notify the user --- which are missing and return. -------------------------------------------------------------------------------- -local MissingLibraries -do - local REQUIRED_LIBS = { - "AceLocale-3.0", - "LibBabble-Boss-3.0", - "LibBabble-Faction-3.0", - "LibBabble-Zone-3.0", - } - function MissingLibraries() - local missing = false - - for idx, lib in ipairs(REQUIRED_LIBS) do - if not LibStub:GetLibrary(lib, true) then - missing = true - addon:Print(strformat(L["MISSING_LIBRARY"], lib)) - end - end - return missing - end -end -- do - -if MissingLibraries() then - --@debug@ - addon:Print("You are using an SVN version of ARL. As per WowAce/Curseforge standards, SVN externals are not set up. You will have to install Ace3, Babble-Faction-3.0, Babble-Zone-3.0, Babble-Boss-3.0, LibAboutPanel, and LibSharedMedia-3.0 in order for the addon to function correctly.") - --@end-debug@ - _G.AckisRecipeList = nil - return -end - -function addon:DEBUG(str, ...) - print(string.format(addon:Red("DEBUG: ") .. tostring(str), ...)) -end - -do - local output = {} - - function addon:DumpMembers(match) - twipe(output) - tinsert(output, "Addon Object members.\n") - - local count = 0 - - for key, value in pairs(self) do - local val_type = type(value) - - if not match or val_type == match then - tinsert(output, key.. " ("..val_type..")") - count = count + 1 - end - end - tinsert(output, string.format("\n%d found\n", count)) - self:DisplayTextDump(nil, nil, tconcat(output, "\n")) - end -end -- do - -------------------------------------------------------------------------------- --- Initialization functions -------------------------------------------------------------------------------- -function addon:OnInitialize() - -- Set default options, which are to include everything in the scan - local defaults = { - global = { - -- Saving alts tradeskills (needs to be global so all profiles can access it) - tradeskill = {}, - }, - profile = { - ------------------------------------------------------------------------------- - -- Frame options - ------------------------------------------------------------------------------- - frameopts = { - offsetx = 0, - offsety = 0, - anchorTo = "", - anchorFrom = "", - uiscale = 1, - tooltipscale = .9, - fontsize = 11, - }, - - ------------------------------------------------------------------------------- - -- Sorting Options - ------------------------------------------------------------------------------- - sorting = "SkillAsc", - - ------------------------------------------------------------------------------- - -- Display Options - ------------------------------------------------------------------------------- - includefiltered = false, - includeexcluded = false, - closeguionskillclose = false, - ignoreexclusionlist = false, - scanbuttonlocation = "TR", - spelltooltiplocation = "Right", - acquiretooltiplocation = "Right", - hidepopup = false, - minimap = true, - worldmap = true, - autoscanmap = false, - scantrainers = false, - scanvendors = false, - autoloaddb = false, - maptrainer = false, - mapvendor = true, - mapmob = true, - mapquest = true, - - ------------------------------------------------------------------------------- - -- Recipe Exclusion - ------------------------------------------------------------------------------- - exclusionlist = {}, - - ------------------------------------------------------------------------------- - -- Filter Options - ------------------------------------------------------------------------------- - filters = { - ------------------------------------------------------------------------------- - -- General Filters - ------------------------------------------------------------------------------- - general = { - faction = true, - specialty = false, - skill = true, - known = false, - unknown = true, - }, - ------------------------------------------------------------------------------- - -- Obtain Filters - ------------------------------------------------------------------------------- - obtain = { - trainer = true, - vendor = true, - instance = true, - raid = true, - seasonal = true, - quest = true, - pvp = true, - discovery = true, - worlddrop = true, - mobdrop = true, - originalwow = true, - bc = true, - wrath = true, - }, - ------------------------------------------------------------------------------- - -- Item Filters (Armor/Weapon) - ------------------------------------------------------------------------------- - item = { - armor = { - cloth = true, - leather = true, - mail = true, - plate = true, - trinket = true, - cloak = true, - ring = true, - necklace = true, - shield = true, - }, - weapon = { - onehand = true, - twohand = true, - axe = true, - sword = true, - mace = true, - polearm = true, - dagger = true, - fist = true, - staff = true, - wand = true, - thrown = true, - bow = true, - crossbow = true, - ammo = true, - gun = true, - }, - }, - ------------------------------------------------------------------------------- - -- Binding Filters - ------------------------------------------------------------------------------- - binding = { - itemboe = true, - itembop = true, - recipebop = true, - recipeboe = true, - }, - ------------------------------------------------------------------------------- - -- Player Role Filters - ------------------------------------------------------------------------------- - player = { - melee = true, - tank = true, - healer = true, - caster = true, - }, - ------------------------------------------------------------------------------- - -- Reputation Filters - ------------------------------------------------------------------------------- - rep = { - aldor = true, - scryer = true, - argentdawn = true, - ashtonguedeathsworn = true, - cenarioncircle = true, - cenarionexpedition = true, - consortium = true, - hellfire = true, - keepersoftime = true, - nagrand = true, - lowercity = true, - scaleofthesands = true, - shatar = true, - shatteredsun = true, - sporeggar = true, - thoriumbrotherhood = true, - timbermaw = true, - violeteye = true, - zandalar = true, - argentcrusade = true, - frenzyheart = true, - ebonblade = true, - kirintor = true, - sonsofhodir = true, - kaluak = true, - oracles = true, - wyrmrest = true, - wrathcommon1 = true, - wrathcommon2 = true, - wrathcommon3 = true, - wrathcommon4 = true, - wrathcommon5 = true, - ashenverdict = true, - }, - ------------------------------------------------------------------------------- - -- Class Filters - ------------------------------------------------------------------------------- - classes = { - deathknight = true, - druid = true, - hunter = true, - mage = true, - paladin = true, - priest = true, - rogue = true, - shaman = true, - warlock = true, - warrior = true, - }, - } - } - } - self.db = LibStub("AceDB-3.0"):New("ARLDB2", defaults) - - if not self.db then - self:Print("Error: Database not loaded correctly. Please exit out of WoW and delete the ARL database file (AckisRecipeList.lua) found in: \\World of Warcraft\\WTF\\Account\\>\\SavedVariables\\") - return - end - local version = GetAddOnMetadata("AckisRecipeList", "Version") - version = string.gsub(version, "@project.revision@", "SVN") - self.version = version - - self:SetupOptions() - - -- Register slash commands - self:RegisterChatCommand("arl", "ChatCommand") - self:RegisterChatCommand("ackisrecipelist", "ChatCommand") - - ------------------------------------------------------------------------------- - -- Create the scan button - ------------------------------------------------------------------------------- - local scan_button = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate") - scan_button:SetHeight(20) - - scan_button:RegisterForClicks("LeftButtonUp") - scan_button:SetScript("OnClick", - function(self, button, down) - local cprof = GetTradeSkillLine() - local current_prof = Player["Profession"] - - if addon.Frame:IsVisible() then - if IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then - -- Shift only (Text dump) - addon:Scan(true) - elseif not IsShiftKeyDown() and IsAltKeyDown() and not IsControlKeyDown() then - -- Alt only (Wipe icons from map) - addon:ClearMap() - elseif not IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() and current_prof == cprof then - -- If we have the same profession open, then we close the scanned window - addon.Frame:Hide() - elseif not IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then - -- If we have a different profession open we do a scan - addon:Scan(false) - addon:SetupMap() - end - else - if IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then - -- Shift only (Text dump) - addon:Scan(true) - elseif not IsShiftKeyDown() and IsAltKeyDown() and not IsControlKeyDown() then - -- Alt only (Wipe icons from map) - addon:ClearMap() - elseif not IsShiftKeyDown() and not IsAltKeyDown() and not IsControlKeyDown() then - -- No modification - addon:Scan(false) - addon:SetupMap() - end - end - end) - - scan_button:SetScript("OnEnter", - function(this) - GameTooltip_SetDefaultAnchor(GameTooltip, this) - GameTooltip:SetText(L["SCAN_RECIPES_DESC"]) - GameTooltip:Show() - end) - scan_button:SetScript("OnLeave", function() GameTooltip:Hide() end) - scan_button:SetText(L["Scan"]) - - self.scan_button = scan_button - - ------------------------------------------------------------------------------- - -- Populate the profession initialization functions. - ------------------------------------------------------------------------------- - PROFESSION_INITS[GetSpellInfo(51304)] = addon.InitAlchemy - PROFESSION_INITS[GetSpellInfo(51300)] = addon.InitBlacksmithing - PROFESSION_INITS[GetSpellInfo(51296)] = addon.InitCooking - PROFESSION_INITS[GetSpellInfo(51313)] = addon.InitEnchanting - PROFESSION_INITS[GetSpellInfo(51306)] = addon.InitEngineering - PROFESSION_INITS[GetSpellInfo(45542)] = addon.InitFirstAid - PROFESSION_INITS[GetSpellInfo(51302)] = addon.InitLeatherworking - PROFESSION_INITS[GetSpellInfo(32606)] = addon.InitSmelting - PROFESSION_INITS[GetSpellInfo(51309)] = addon.InitTailoring - PROFESSION_INITS[GetSpellInfo(51311)] = addon.InitJewelcrafting - PROFESSION_INITS[GetSpellInfo(45363)] = addon.InitInscription - PROFESSION_INITS[GetSpellInfo(53428)] = addon.InitRuneforging - - ------------------------------------------------------------------------------- - -- Initialize the databases - ------------------------------------------------------------------------------- - self:InitCustom(CustomList) - self:InitMob(MobList) - self:InitQuest(QuestList) - self:InitReputation(ReputationList) - self:InitTrainer(TrainerList) - self:InitSeasons(SeasonalList) - self:InitVendor(VendorList) - - ------------------------------------------------------------------------------- - -- Hook GameTooltip so we can show information on mobs that drop/sell/train - ------------------------------------------------------------------------------- - GameTooltip:HookScript("OnTooltipSetUnit", - function(self) - local name, unit = self:GetUnit() - - if not unit then - return - end - local guid = UnitGUID(unit) - - if not guid then - return - end - local GUID = tonumber(string.sub(guid, 8, 12), 16) - local mob = MobList[GUID] - local shifted = IsShiftKeyDown() - - if mob and mob["DropList"] then - for spell_id in pairs(mob["DropList"]) do - local recipe = RecipeList[spell_id] - - if not recipe["Known"] or shifted then - local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) - - self:AddLine("Drops: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") - end - end - return - end - local vendor = VendorList[GUID] - - if vendor and vendor["SellList"] then - for spell_id in pairs(vendor["SellList"]) do - local recipe = RecipeList[spell_id] - local skill_level = Player["Professions"][GetSpellInfo(recipe["Profession"])] - local has_skill = skill_level and skill_level >= recipe["Level"] - - if ((not recipe["Known"] and has_skill) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then - local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) - - self:AddLine("Sells: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") - end - end - return - end - local trainer = TrainerList[GUID] - - if trainer and trainer["TrainList"] then - for spell_id in pairs(trainer["TrainList"]) do - local recipe = RecipeList[spell_id] - local skill_level = Player["Professions"][GetSpellInfo(recipe["Profession"])] - local has_skill = skill_level and skill_level >= recipe["Level"] - - if ((not recipe["Known"] and has_skill) or shifted) and Player:IsCorrectFaction(recipe["Flags"]) then - local _, _, _, hex = GetItemQualityColor(recipe["Rarity"]) - - self:AddLine("Trains: "..hex..recipe["Name"].."|r ("..recipe["Level"]..")") - end - end - return - end - end) -end - ----Function run when the addon is enabled. Registers events and pre-loads certain variables. -function addon:OnEnable() - self:RegisterEvent("TRADE_SKILL_SHOW") -- Make addon respond to the tradeskill windows being shown - self:RegisterEvent("TRADE_SKILL_CLOSE") -- Addon responds to tradeskill windows being closed. - - if addon.db.profile.scantrainers then - self:RegisterEvent("TRAINER_SHOW") - end - - if addon.db.profile.scanvendors then - self:RegisterEvent("MERCHANT_SHOW") - end - - ------------------------------------------------------------------------------- - -- Set the parent and scripts for addon.scan_button. - ------------------------------------------------------------------------------- - local scan_button = self.scan_button - - if Skillet and Skillet:IsActive() then - scan_button:SetParent(SkilletFrame) - Skillet:AddButtonToTradeskillWindow(scan_button) - scan_button:SetWidth(80) - elseif MRTUIUtils_RegisterWindowOnShow then - MRTUIUtils_RegisterWindowOnShow(function() - scan_button:SetParent(MRTSkillFrame) - scan_button:ClearAllPoints() - scan_button:SetPoint("RIGHT", MRTSkillFrameCloseButton, "LEFT", 4, 0) - scan_button:SetWidth(scan_button:GetTextWidth() + 10) - scan_button:Show() - end) - elseif ATSWFrame then - scan_button:SetParent(ATSWFrame) - scan_button:ClearAllPoints() - - if TradeJunkieMain and TJ_OpenButtonATSW then - scan_button:SetPoint("RIGHT", TJ_OpenButtonATSW, "LEFT", 0, 0) - else - scan_button:SetPoint("RIGHT", ATSWOptionsButton, "LEFT", 0, 0) - end - scan_button:SetHeight(ATSWOptionsButton:GetHeight()) - scan_button:SetWidth(ATSWOptionsButton:GetWidth()) - elseif CauldronFrame then - scan_button:SetParent(CauldronFrame) - scan_button:ClearAllPoints() - scan_button:SetPoint("TOP", CauldronFrame, "TOPRIGHT", -58, -52) - scan_button:SetWidth(90) - end - - local buttonparent = scan_button:GetParent() - local framelevel = buttonparent:GetFrameLevel() - local framestrata = buttonparent:GetFrameStrata() - - -- Set the frame level of the button to be 1 deeper than its parent - scan_button:SetFrameLevel(framelevel + 1) - scan_button:SetFrameStrata(framestrata) - scan_button:Enable() - - -- Add an option so that ARL will work with Manufac - if Manufac then - Manufac.options.args.ARLScan = { - type = 'execute', - name = L["Scan"], - desc = L["SCAN_RECIPES_DESC"], - func = function() addon:Scan(false) end, - order = 550, - } - end - ---[[ - -- If we're using Skillet, use Skillet's API to work with getting tradeskills - if (Skillet) and (Skillet.GetNumTradeSkills) and - (Skillet.GetTradeSkillLine) and (Skillet.GetTradeSkillInfo) and - (Skillet.GetTradeSkillRecipeLink) and (Skillet.ExpandTradeSkillSubClass) then - self:Print("Enabling Skillet advanced features.") - GetNumTradeSkills = function(...) return Skillet:GetNumTradeSkills(...) end - GetTradeSkillLine = function(...) return Skillet:GetTradeSkillLine(...) end - GetTradeSkillInfo = function(...) return Skillet:GetTradeSkillInfo(...) end - GetTradeSkillRecipeLink = function(...) return Skillet:GetTradeSkillRecipeLink(...) end - ExpandTradeSkillSubClass = function(...) return Skillet:ExpandTradeSkillSubClass(...) end - end -]]-- - ------------------------------------------------------------------------------- - -- Initialize the main panel frame. - ------------------------------------------------------------------------------- - self:InitializeFrame() - self.InitializeFrame = nil - - ------------------------------------------------------------------------------- - -- Initialize the player's data. - ------------------------------------------------------------------------------- - do - Player["Faction"] = UnitFactionGroup("player") - Player["Class"] = select(2, UnitClass("player")) - - ------------------------------------------------------------------------------- - -- Get the player's reputation levels. - ------------------------------------------------------------------------------- - Player["Reputation"] = {} - Player:SetReputationLevels() - - ------------------------------------------------------------------------------- - -- Get the player's professions. - ------------------------------------------------------------------------------- - Player["Professions"] = { - [GetSpellInfo(51304)] = false, -- Alchemy - [GetSpellInfo(51300)] = false, -- Blacksmithing - [GetSpellInfo(51296)] = false, -- Cooking - [GetSpellInfo(51313)] = false, -- Enchanting - [GetSpellInfo(51306)] = false, -- Engineering - [GetSpellInfo(45542)] = false, -- First Aid - [GetSpellInfo(51302)] = false, -- Leatherworking - [GetSpellInfo(32606)] = false, -- Mining - [GetSpellInfo(51309)] = false, -- Tailoring - [GetSpellInfo(51311)] = false, -- Jewelcrafting - [GetSpellInfo(45363)] = false, -- Inscription - [GetSpellInfo(53428)] = false, -- Runeforging - } - Player:SetProfessions() - end -- do - - ------------------------------------------------------------------------------- - -- Initialize the SpecialtyTable and AllSpecialtiesTable. - ------------------------------------------------------------------------------- - do - local AlchemySpec = { - [GetSpellInfo(28674)] = 28674, - [GetSpellInfo(28678)] = 28678, - [GetSpellInfo(28676)] = 28676, - } - - local BlacksmithSpec = { - [GetSpellInfo(9788)] = 9788, -- Armorsmith - [GetSpellInfo(17041)] = 17041, -- Master Axesmith - [GetSpellInfo(17040)] = 17040, -- Master Hammersmith - [GetSpellInfo(17039)] = 17039, -- Master Swordsmith - [GetSpellInfo(9787)] = 9787, -- Weaponsmith - } - - local EngineeringSpec = { - [GetSpellInfo(20219)] = 20219, -- Gnomish - [GetSpellInfo(20222)] = 20222, -- Goblin - } - - local LeatherworkSpec = { - [GetSpellInfo(10657)] = 10657, -- Dragonscale - [GetSpellInfo(10659)] = 10659, -- Elemental - [GetSpellInfo(10661)] = 10661, -- Tribal - } - - local TailorSpec = { - [GetSpellInfo(26797)] = 26797, -- Spellfire - [GetSpellInfo(26801)] = 26801, -- Shadoweave - [GetSpellInfo(26798)] = 26798, -- Primal Mooncloth - } - - SpecialtyTable = { - [GetSpellInfo(51304)] = AlchemySpec, - [GetSpellInfo(51300)] = BlacksmithSpec, - [GetSpellInfo(51306)] = EngineeringSpec, - [GetSpellInfo(51302)] = LeatherworkSpec, - [GetSpellInfo(51309)] = TailorSpec, - } - - -- Populate the Specialty table with all Specialties, adding alchemy even though no recipes have alchemy filters - for i in pairs(AlchemySpec) do AllSpecialtiesTable[i] = true end - for i in pairs(BlacksmithSpec) do AllSpecialtiesTable[i] = true end - for i in pairs(EngineeringSpec) do AllSpecialtiesTable[i] = true end - for i in pairs(LeatherworkSpec) do AllSpecialtiesTable[i] = true end - for i in pairs(TailorSpec) do AllSpecialtiesTable[i] = true end - end -- do -end - ----Run when the addon is disabled. Ace3 takes care of unregistering events, etc. -function addon:OnDisable() - addon.Frame:Hide() - - -- Remove the option from Manufac - if Manufac then - Manufac.options.args.ARLScan = nil - end -end - -------------------------------------------------------------------------------- --- Event handling functions -------------------------------------------------------------------------------- - ----Event used for datamining when a trainer is shown. -function addon:TRAINER_SHOW() - self:ScanSkillLevelData(true) - self:ScanTrainerData(true) -end - -function addon:MERCHANT_SHOW() - addon:ScanVendor() -end - -do - local GetTradeSkillListLink = _G.GetTradeSkillListLink - local UnitName = _G.UnitName - local GetRealmName = _G.GetRealmName - local IsTradeSkillLinked = _G.IsTradeSkillLinked - - function addon:TRADE_SKILL_SHOW() - -- If this is our own skill, save it, if not don't save it - if not IsTradeSkillLinked() then - local tradelink = GetTradeSkillListLink() - - if tradelink then - local pname = UnitName("player") - local prealm = GetRealmName() - local tradename = GetTradeSkillLine() - - -- Actual alt information saved here. -Torhal - addon.db.global.tradeskill = addon.db.global.tradeskill or {} - addon.db.global.tradeskill[prealm] = addon.db.global.tradeskill[prealm] or {} - addon.db.global.tradeskill[prealm][pname] = addon.db.global.tradeskill[prealm][pname] or {} - - addon.db.global.tradeskill[prealm][pname][tradename] = tradelink - end - end - local scan_button = self.scan_button - local scan_parent = self.scan_button:GetParent() - - if not scan_parent or scan_parent == UIParent then - scan_button:SetParent(TradeSkillFrame) - scan_button:ClearAllPoints() - - local loc = addon.db.profile.scanbuttonlocation - - if loc == "TR" then - scan_button:SetPoint("RIGHT", TradeSkillFrameCloseButton, "LEFT",4,0) - elseif loc == "TL" then - scan_button:SetPoint("LEFT", TradeSkillFramePortrait, "RIGHT",2,12) - elseif loc == "BR" then - scan_button:SetPoint("TOP", TradeSkillCancelButton, "BOTTOM",0,-5) - elseif loc == "BL" then - scan_button:SetPoint("TOP", TradeSkillCreateAllButton, "BOTTOM",0,-5) - end - scan_button:SetWidth(scan_button:GetTextWidth() + 10) - end - self.scan_button:Show() - end -end - -function addon:TRADE_SKILL_CLOSE() - if addon.db.profile.closeguionskillclose then - self.Frame:Hide() - end - - if not Skillet then - addon.scan_button:Hide() - end -end - -------------------------------------------------------------------------------- --- Tradeskill functions --- Recipe DB Structures are defined in Documentation.lua -------------------------------------------------------------------------------- - ---- Adds a tradeskill recipe into the specified recipe database. --- @name AckisRecipeList:addTradeSkill --- @usage AckisRecipeList:addTradeSkill(RecipeDB,2329,1,2454,1,2259,0,1,55,75,95) --- @param RecipeDB The database (array) which you wish to add data too. --- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe being added to the database. --- @param SkillLevel The skill level at which the recipe may be learned. --- @param ItemID The [[http://www.wowwiki.com/ItemLink | Item ID]] that is created by the recipe, or nil --- @param Rarity The rarity of the recipe. --- @param Profession The profession ID that uses the recipe. See [[database-documentation]] for a listing of profession IDs. --- @param Specialty The specialty that uses the recipe (ie: goblin engineering) or nil or blank --- @param Game Game version recipe was found in, for example, Original, BC, or Wrath. --- @param Orange Level at which recipe is considered orange. --- @param Yellow Level at which recipe is considered yellow. --- @param Green Level at which recipe is considered green. --- @param Grey Level at which recipe is considered grey. --- @return None, array is passed as a reference. -function addon:addTradeSkill(RecipeDB, SpellID, SkillLevel, ItemID, Rarity, Profession, Specialty, Game, Orange, Yellow, Green, Grey) - local spellLink = GetSpellLink(SpellID) - local profession_id = GetSpellInfo(Profession) - local recipe_name = GetSpellInfo(SpellID) - - if RecipeDB[SpellID] then - --@alpha@ - self:Print("Duplicate recipe: "..profession_id.." "..tostring(SpellID).." "..recipe_name) - --@end-alpha@ - return - end - - ------------------------------------------------------------------------------- - -- Create a table inside the RecipeListing table which stores all information - -- about a recipe - ------------------------------------------------------------------------------- - RecipeDB[SpellID] = { - ["Level"] = SkillLevel, - ["ItemID"] = ItemID, - ["Rarity"] = Rarity, - ["Profession"] = profession_id, - ["Locations"] = nil, - ["RecipeLink"] = spellLink, - ["Name"] = recipe_name, - ["Display"] = true, -- Set to be displayed until the filtering occurs - ["Search"] = true, -- Set to be showing in the search results - ["Flags"] = {}, -- Create the flag space in the RecipeDB - ["Acquire"] = {}, -- Create the Acquire space in the RecipeDB - ["Specialty"] = Specialty, -- Assumption: there will only be 1 speciality for a trade skill - ["Game"] = Game, - ["Orange"] = Orange or SkillLevel, -- If we don't have an orange value in the db, just assume the skill level - ["Yellow"] = Yellow or SkillLevel + 10, -- If we don't have a yellow value in the db, just assume the skill level - ["Green"] = Green or SkillLevel + 15, -- If we don't have a green value in the db, just assume the skill level - ["Grey"] = Grey or SkillLevel + 20, -- If we don't have a grey value in the db, just assume the skill level - } - local recipe = RecipeDB[SpellID] - - if not recipe["Name"] then - self:Print(strformat(L["SpellIDCache"], SpellID)) - end - - -- Set all the flags to be false, will also set the padding spaces to false as well. - for i = 1, NUM_FILTER_FLAGS, 1 do - recipe["Flags"][i] = false - end -end - ---- Adds filtering flags to a specific tradeskill. --- @name AckisRecipeList:addTradeFlags --- @usage AckisRecipeList:addTradeFlags(RecipeDB,2329,1,2,3,21,22,23,24,25,26,27,28,29,30,36,41,51,52) --- @param RecipeDB The database (array) which you wish to add flags too. --- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe which flags are being added to. --- @param ... A listing of filtering flags. See [[database-documentation]] for a listing of filtering flags. --- @return None, array is passed as a reference. -function addon:addTradeFlags(RecipeDB, SpellID, ...) - -- flags are defined in Documentation.lua - local numvars = select('#',...) - local flags = RecipeDB[SpellID]["Flags"] - - -- Find out how many flags we're adding - for i = 1, numvars, 1 do - -- Get the value of the current flag - local flag = select(i, ...) - flags[flag] = true - end -end - ---- Adds acquire methods to a specific tradeskill. --- @name AckisRecipeList:addTradeAcquire --- @usage AckisRecipeList:addTradeAcquire:(RecipeDB,2329,8,8) --- @param RecipeDB The database (array) which you wish to add acquire methods too. --- @param SpellID The [[http://www.wowwiki.com/SpellLink | Spell ID]] of the recipe which acquire methods are being added to. --- @param ... A listing of acquire methods. See [[database-documentation]] for a listing of acquire methods and how they behave. --- @return None, array is passed as a reference. -do - -- Tables for getting the locations - local location_list = {} - local location_checklist = {} - - local function LocationSort(a, b) - return a < b - end - - function addon:addTradeAcquire(DB, SpellID, ...) - local numvars = select('#', ...) -- Find out how many flags we're adding - local index = 1 -- Index for the number of Acquire entries we have - local i = 1 -- Index for which variables we're parsing through - local acquire = DB[SpellID]["Acquire"] - - twipe(location_list) - twipe(location_checklist) - - while i < numvars do - local acquire_type, acquire_id = select(i, ...) - i = i + 2 - - --@alpha@ - if acquire[index] then - self:Print("addTradeAcquire called more than once for SpellID "..SpellID) - end - --@end-alpha@ - - acquire[index] = { - ["Type"] = acquire_type, - ["ID"] = acquire_id - } - local location - - if not acquire_type then - self:Print("SpellID: "..SpellID.." has no acquire type.") - elseif acquire_type == A_TRAINER then - if not acquire_id then - --@alpha@ - self:Print("SpellID "..SpellID..": TrainerID is nil.") - --@end-alpha@ - elseif not TrainerList[acquire_id] then - --@alpha@ - self:Print("SpellID "..SpellID..": TrainerID "..acquire_id.." does not exist in the database.") - --@end-alpha@ - else - location = TrainerList[acquire_id]["Location"] - - if not location_checklist[location] then - tinsert(location_list, location) - location_checklist[location] = true - end - TrainerList[acquire_id]["TrainList"] = TrainerList[acquire_id]["TrainList"] or {} - TrainerList[acquire_id]["TrainList"][SpellID] = true - end - elseif acquire_type == A_VENDOR then - if not acquire_id then - --@alpha@ - self:Print("SpellID "..SpellID..": VendorID is nil.") - --@end-alpha@ - elseif not VendorList[acquire_id] then - --@alpha@ - self:Print("SpellID "..SpellID..": VendorID "..acquire_id.." does not exist in the database.") - --@end-alpha@ - else - location = VendorList[acquire_id]["Location"] - - if not location_checklist[location] then - tinsert(location_list, location) - location_checklist[location] = true - end - VendorList[acquire_id]["SellList"] = VendorList[acquire_id]["SellList"] or {} - VendorList[acquire_id]["SellList"][SpellID] = true - end - elseif acquire_type == A_MOB then - if not acquire_id then - --@alpha@ - self:Print("SpellID "..SpellID..": MobID is nil.") - --@end-alpha@ - elseif not MobList[acquire_id] then - --@alpha@ - self:Print("SpellID "..SpellID..": Mob ID "..acquire_id.." does not exist in the database.") - --@end-alpha@ - else - location = MobList[acquire_id]["Location"] - - if not location_checklist[location] then - tinsert(location_list, location) - location_checklist[location] = true - end - MobList[acquire_id]["DropList"] = MobList[acquire_id]["DropList"] or {} - MobList[acquire_id]["DropList"][SpellID] = true - end - elseif acquire_type == A_QUEST then - if not acquire_id then - --@alpha@ - self:Print("SpellID "..SpellID..": QuestID is nil.") - --@end-alpha@ - elseif not QuestList[acquire_id] then - --@alpha@ - self:Print("SpellID "..SpellID..": Quest ID "..acquire_id.." does not exist in the database.") - --@end-alpha@ - else - location = QuestList[acquire_id]["Location"] - - if not location_checklist[location] then - tinsert(location_list, location) - location_checklist[location] = true - end - end - --@alpha@ - elseif acquire_type == A_SEASONAL then - if not acquire_id then - self:Print("SpellID "..SpellID..": SeasonalID is nil.") - end - --@end-alpha@ - elseif acquire_type == A_REPUTATION then - local RepLevel, RepVendor = select(i, ...) - i = i + 2 - - acquire[index]["RepLevel"] = RepLevel - acquire[index]["RepVendor"] = RepVendor - VendorList[RepVendor]["SellList"] = VendorList[RepVendor]["SellList"] or {} - VendorList[RepVendor]["SellList"][SpellID] = true - - location = VendorList[RepVendor]["Location"] - - if not location_checklist[location] then - tinsert(location_list, location) - location_checklist[location] = true - end - - --@alpha@ - if not acquire_id then - self:Print("SpellID "..SpellID..": ReputationID is nil.") - elseif not ReputationList[acquire_id] then - self:Print("SpellID "..SpellID..": ReputationID "..acquire_id.." does not exist in the database.") - end - - if not RepVendor then - self:Print("SpellID "..SpellID..": Reputation VendorID is nil.") - elseif not VendorList[RepVendor] then - self:Print("SpellID "..SpellID..": Reputation VendorID "..RepVendor.." does not exist in the database.") - end - --@end-alpha@ - elseif acquire_type == A_WORLD_DROP then - local location = L["World Drop"] - - if not location_checklist[location] then - tinsert(location_list, location) - location_checklist[location] = true - end - end - index = index + 1 - end - -- Populate the location field with all the data - table.sort(location_list, LocationSort) - DB[SpellID]["Locations"] = (#location_list == 0 and "" or tconcat(location_list, ", ")) - end -end -- do block - ---- Adds an item to a specific database listing (ie: vendor, mob, etc) --- @name AckisRecipeList:addLookupList --- @usage AckisRecipeList:addLookupList:(VendorDB,NPC ID, NPC Name, NPC Location, X Coord, Y Coord, Faction) --- @param DB Database which the entry will be stored. --- @param ID Unique identified for the entry. --- @param Name Name of the entry. --- @param Loc Location of the entry in the world. --- @param Coordx X coordinate of where the entry is found. --- @param Coordy Y coordinate of where the entry is found. --- @param Faction Faction identifier for the entry. --- @return None, array is passed as a reference. ---For individual database structures, see Documentation.lua -do - local FACTION_NAMES = { - [1] = BFAC["Neutral"], - [2] = BFAC["Alliance"], - [3] = BFAC["Horde"] - } - function addon:addLookupList(DB, ID, Name, Loc, Coordx, Coordy, Faction) - if DB[ID] then - --@alpha@ - self:Print("Duplicate lookup: "..tostring(ID).." "..Name) - --@end-alpha@ - return - end - - DB[ID] = { - ["Name"] = Name, - ["Location"] = Loc or L["Unknown Zone"], - ["Faction"] = Faction and FACTION_NAMES[Faction + 1] or nil - } - if Coordx and Coordy then - DB[ID]["Coordx"] = Coordx - DB[ID]["Coordy"] = Coordy - end - - --@alpha@ - if not Loc then - self:Print("Spell ID: " .. ID .. " (" .. DB[ID]["Name"] .. ") has an unknown location.") - end - --@end-alpha@ - end -end -- do - -------------------------------------------------------------------------------- --- Filter flag functions -------------------------------------------------------------------------------- -do - local F_ALLIANCE, F_HORDE = 1, 2 - - ------------------------------------------------------------------------------- - -- Item "rarity" - ------------------------------------------------------------------------------- - local R_COMMON, R_UNCOMMON, R_RARE, R_EPIC, R_LEGENDARY, R_ARTIFACT = 1, 2, 3, 4, 5, 6 - - -- HardFilterFlags and SoftFilterFlags are used to determine if a recipe should be shown based on the value of the key compared to the value of its saved_var. - -- Its keys and values are populated the first time CanDisplayRecipe() is called. - local HardFilterFlags, SoftFilterFlags, RepFilterFlags - - local F_DK, F_DRUID, F_HUNTER, F_MAGE, F_PALADIN, F_PRIEST, F_SHAMAN, F_ROGUE, F_WARLOCK, F_WARRIOR = 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 - local ClassFilterFlags = { - ["deathknight"] = F_DK, ["druid"] = F_DRUID, ["hunter"] = F_HUNTER, - ["mage"] = F_MAGE, ["paladin"] = F_PALADIN, ["priest"] = F_PRIEST, - ["shaman"] = F_SHAMAN, ["rogue"] = F_ROGUE, ["warlock"] = F_WARLOCK, - ["warrior"] = F_WARRIOR, - } - - ---Scans a specific recipe to determine if it is to be displayed or not. - local function CanDisplayRecipe(recipe) - ------------------------------------------------------------------------------- - -- Origin - ------------------------------------------------------------------------------- - local GAME_ORIG, GAME_TBC, GAME_WOTLK = 0, 1, 2 - - -- For flag info see comments at start of file in comments - local filter_db = addon.db.profile.filters - local general_filters = filter_db.general - local recipe_flags = recipe["Flags"] - - -- See Documentation file for logic explanation - ------------------------------------------------------------------------------- - -- Stage 1 - -- Loop through exclusive flags (hard filters) - -- If one of these does not pass we do not display the recipe - -- So to be more efficient we'll just leave this function if there's a false - ------------------------------------------------------------------------------- - - -- Display both horde and alliance factions? - if not general_filters.faction and not Player:IsCorrectFaction(recipe_flags) then - return false - end - - -- Display all skill levels? - if not general_filters.skill and recipe["Level"] > Player["ProfessionLevel"] then - return false - end - - -- Display all specialities? - if not general_filters.specialty then - local specialty = recipe["Specialty"] - - if specialty and specialty ~= Player["Specialty"] then - return false - end - end - local obtain_filters = filter_db.obtain - local game_version = recipe["Game"] - - -- Filter out game recipes - if not obtain_filters.originalwow and game_version == GAME_ORIG then - return false - end - - if not obtain_filters.bc and game_version == GAME_TBC then - return false - end - - if not obtain_filters.wrath and game_version == GAME_WOTLK then - return false - end - - ------------------------------------------------------------------------------- - -- Check the hard filter flags - ------------------------------------------------------------------------------- - if not HardFilterFlags then - local F_IBOE, F_IBOP, F_IBOA, F_RBOE, F_RBOP, F_RBOA = 36, 37, 38, 40, 41, 42 - local F_DPS, F_TANK, F_HEALER, F_CASTER = 51, 52, 53, 54 - local F_CLOTH, F_LEATHER, F_MAIL, F_PLATE, F_CLOAK, F_TRINKET, F_RING, F_NECK, F_SHIELD = 56, 57, 58, 59, 60, 61, 62, 63, 64 - local F_1H, F_2H, F_AXE, F_SWORD, F_MACE, F_POLEARM, F_DAGGER = 66, 67, 68, 69, 70, 71, 72 - local F_STAFF, F_WAND, F_THROWN, F_BOW, F_XBOW, F_AMMO, F_FIST, F_GUN = 73, 74, 75, 76, 77, 78, 79, 80 - - local binding_filters = filter_db.binding - local player_filters = filter_db.player - local armor_filters = filter_db.item.armor - local weapon_filters = filter_db.item.weapon - - HardFilterFlags = { - ------------------------------------------------------------------------------------------------ - -- Binding flags. - ------------------------------------------------------------------------------------------------ - ["itemboe"] = { flag = F_IBOE, sv_root = binding_filters }, - ["itembop"] = { flag = F_IBOP, sv_root = binding_filters }, - ["itemboa"] = { flag = F_IBOA, sv_root = binding_filters }, - ["recipeboe"] = { flag = F_RBOE, sv_root = binding_filters }, - ["recipebop"] = { flag = F_RBOP, sv_root = binding_filters }, - ["recipeboa"] = { flag = F_RBOA, sv_root = binding_filters }, - ------------------------------------------------------------------------------------------------ - -- Player Type flags. - ------------------------------------------------------------------------------------------------ - ["melee"] = { flag = F_DPS, sv_root = player_filters }, - ["tank"] = { flag = F_TANK, sv_root = player_filters }, - ["healer"] = { flag = F_HEALER, sv_root = player_filters }, - ["caster"] = { flag = F_CASTER, sv_root = player_filters }, - ------------------------------------------------------------------------------------------------ - -- Armor flags. - ------------------------------------------------------------------------------------------------ - ["cloth"] = { flag = F_CLOTH, sv_root = armor_filters }, - ["leather"] = { flag = F_LEATHER, sv_root = armor_filters }, - ["mail"] = { flag = F_MAIL, sv_root = armor_filters }, - ["plate"] = { flag = F_PLATE, sv_root = armor_filters }, - ["trinket"] = { flag = F_TRINKET, sv_root = armor_filters }, - ["cloak"] = { flag = F_CLOAK, sv_root = armor_filters }, - ["ring"] = { flag = F_RING, sv_root = armor_filters }, - ["necklace"] = { flag = F_NECK, sv_root = armor_filters }, - ["shield"] = { flag = F_SHIELD, sv_root = armor_filters }, - ------------------------------------------------------------------------------------------------ - -- Weapon flags. - ------------------------------------------------------------------------------------------------ - ["onehand"] = { flag = F_1H, sv_root = weapon_filters }, - ["twohand"] = { flag = F_2H, sv_root = weapon_filters }, - ["axe"] = { flag = F_AXE, sv_root = weapon_filters }, - ["sword"] = { flag = F_SWORD, sv_root = weapon_filters }, - ["mace"] = { flag = F_MACE, sv_root = weapon_filters }, - ["polearm"] = { flag = F_POLEARM, sv_root = weapon_filters }, - ["dagger"] = { flag = F_DAGGER, sv_root = weapon_filters }, - ["fist"] = { flag = F_FIST, sv_root = weapon_filters }, - ["gun"] = { flag = F_GUN, sv_root = weapon_filters }, - ["staff"] = { flag = F_STAFF, sv_root = weapon_filters }, - ["wand"] = { flag = F_WAND, sv_root = weapon_filters }, - ["thrown"] = { flag = F_THROWN, sv_root = weapon_filters }, - ["bow"] = { flag = F_BOW, sv_root = weapon_filters }, - ["crossbow"] = { flag = F_XBOW, sv_root = weapon_filters }, - ["ammo"] = { flag = F_AMMO, sv_root = weapon_filters }, - } - end - - for filter, data in pairs(HardFilterFlags) do - if recipe_flags[data.flag] and not data.sv_root[filter] then - return false - end - end - - ------------------------------------------------------------------------------- - -- Check the reputation filter flags - ------------------------------------------------------------------------------- - if not RepFilterFlags then - local rep_filters = filter_db.rep - - local F_ARGENTDAWN, F_CENARION_CIRCLE, F_THORIUM_BROTHERHOOD, F_TIMBERMAW_HOLD, F_ZANDALAR = 96, 97, 98, 99, 100 - local F_ALDOR, F_ASHTONGUE, F_CENARION_EXPEDITION, F_HELLFIRE, F_CONSORTIUM = 101, 102, 103, 104, 105 - local F_KOT, F_LOWERCITY, F_NAGRAND, F_SCALE_SANDS, F_SCRYER, F_SHATAR = 106, 107, 108, 109, 110, 111 - local F_SHATTEREDSUN, F_SPOREGGAR, F_VIOLETEYE = 112, 113, 114 - local F_ARGENTCRUSADE, F_FRENZYHEART, F_EBONBLADE, F_KIRINTOR, F_HODIR = 115, 116, 117, 118, 119 - local F_KALUAK, F_ORACLES, F_WYRMREST, F_WRATHCOMMON1, F_WRATHCOMMON2 = 120, 121, 122, 123, 124 - local F_WRATHCOMMON3, F_WRATHCOMMON4, F_WRATHCOMMON5, F_ASHEN_VERDICT = 125, 126, 127, 128 - - RepFilterFlags = { - [F_ARGENTDAWN] = rep_filters.argentdawn, - [F_CENARION_CIRCLE] = rep_filters.cenarioncircle, - [F_THORIUM_BROTHERHOOD] = rep_filters.thoriumbrotherhood, - [F_TIMBERMAW_HOLD] = rep_filters.timbermaw, - [F_ZANDALAR] = rep_filters.zandalar, - [F_ALDOR] = rep_filters.aldor, - [F_ASHTONGUE] = rep_filters.ashtonguedeathsworn, - [F_CENARION_EXPEDITION] = rep_filters.cenarionexpedition, - [F_HELLFIRE] = rep_filters.hellfire, - [F_CONSORTIUM] = rep_filters.consortium, - [F_KOT] = rep_filters.keepersoftime, - [F_LOWERCITY] = rep_filters.lowercity, - [F_NAGRAND] = rep_filters.nagrand, - [F_SCALE_SANDS] = rep_filters.scaleofthesands, - [F_SCRYER] = rep_filters.scryer, - [F_SHATAR] = rep_filters.shatar, - [F_SHATTEREDSUN] = rep_filters.shatteredsun, - [F_SPOREGGAR] = rep_filters.sporeggar, - [F_VIOLETEYE] = rep_filters.violeteye, - [F_ARGENTCRUSADE] = rep_filters.argentcrusade, - [F_FRENZYHEART] = rep_filters.frenzyheart, - [F_EBONBLADE] = rep_filters.ebonblade, - [F_KIRINTOR] = rep_filters.kirintor, - [F_HODIR] = rep_filters.sonsofhodir, - [F_KALUAK] = rep_filters.kaluak, - [F_ORACLES] = rep_filters.oracles, - [F_WYRMREST] = rep_filters.wyrmrest, - [F_WRATHCOMMON1] = rep_filters.wrathcommon1, - [F_WRATHCOMMON2] = rep_filters.wrathcommon2, - [F_WRATHCOMMON3] = rep_filters.wrathcommon3, - [F_WRATHCOMMON4] = rep_filters.wrathcommon4, - [F_WRATHCOMMON5] = rep_filters.wrathcommon5, - [F_ASHEN_VERDICT] = rep_filters.ashenverdict, - } - end - local rep_display = true - - for flag in pairs(RepFilterFlags) do - if recipe_flags[flag] then - rep_display = RepFilterFlags[flag] and true or false - end - end - - if not rep_display then - return false - end - - ------------------------------------------------------------------------------- - -- Check the class filter flags - ------------------------------------------------------------------------------- - local toggled_off, toggled_on = 0, 0 - local class_filters = filter_db.classes - - -- Now we check to see if _all_ of the pertinent class flags are toggled off. If even one is toggled on, we still show the recipe. - for class, flag in pairs(ClassFilterFlags) do - if recipe_flags[flag] then - if class_filters[class] then - toggled_on = toggled_on + 1 - elseif not class_filters[class] then - toggled_off = toggled_off + 1 - end - end - end - - if toggled_off > 0 and toggled_on == 0 then - return false - end - - ------------------------------------------------------------------------------------------------ - -- Stage 2 - -- loop through nonexclusive (soft filters) flags until one is true - -- If one of these is true (ie: we want to see trainers and there is a trainer flag) we display the recipe - ------------------------------------------------------------------------------------------------ - if not SoftFilterFlags then - local F_TRAINER, F_VENDOR, F_INSTANCE, F_RAID, F_SEASONAL, F_QUEST, F_PVP, F_WORLD_DROP, F_MOB_DROP, F_DISC = 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 - - SoftFilterFlags = { - ["trainer"] = { flag = F_TRAINER, sv_root = obtain_filters }, - ["vendor"] = { flag = F_VENDOR, sv_root = obtain_filters }, - ["instance"] = { flag = F_INSTANCE, sv_root = obtain_filters }, - ["raid"] = { flag = F_RAID, sv_root = obtain_filters }, - ["seasonal"] = { flag = F_SEASONAL, sv_root = obtain_filters }, - ["quest"] = { flag = F_QUEST, sv_root = obtain_filters }, - ["pvp"] = { flag = F_PVP, sv_root = obtain_filters }, - ["worlddrop"] = { flag = F_WORLD_DROP, sv_root = obtain_filters }, - ["mobdrop"] = { flag = F_MOB_DROP, sv_root = obtain_filters }, - ["discovery"] = { flag = F_DISC, sv_root = obtain_filters }, - } - end - - for filter, data in pairs(SoftFilterFlags) do - if recipe_flags[data.flag] and data.sv_root[filter] then - return true - end - end - - -- If we get here it means that no flags matched our values - return false - end - - ---Scans the recipe listing and updates the filters according to user preferences - function addon:UpdateFilters() - local general_filters = addon.db.profile.filters.general - local recipes_total = 0 - local recipes_known = 0 - local recipes_total_filtered = 0 - local recipes_known_filtered = 0 - local can_display = false - local current_profession = Player["Profession"] - - for recipe_id, recipe in pairs(RecipeList) do - if recipe["Profession"] == current_profession then - local is_known = recipe["Known"] - - can_display = CanDisplayRecipe(recipe) - recipes_total = recipes_total + 1 - recipes_known = recipes_known + (is_known and 1 or 0) - - if can_display then - recipes_total_filtered = recipes_total_filtered + 1 - recipes_known_filtered = recipes_known_filtered + (is_known and 1 or 0) - - if not general_filters.known and is_known then - can_display = false - end - - if not general_filters.unknown and not is_known then - can_display = false - end - end - else - can_display = false - end - RecipeList[recipe_id]["Display"] = can_display - end - Player.recipes_total = recipes_total - Player.recipes_known = recipes_known - Player.recipes_total_filtered = recipes_total_filtered - Player.recipes_known_filtered = recipes_known_filtered - end - -end -- do - -------------------------------------------------------------------------------- --- ARL Logic Functions -------------------------------------------------------------------------------- - ----Determines which profession we are dealing with and loads up the recipe information for it. -local function InitializeRecipe(profession) - if not profession then - --@alpha@ - addon:Print("nil profession passed to InitializeRecipe()") - --@end-alpha@ - return - end - local func = PROFESSION_INITS[profession] - - if func then - return func(addon, RecipeList) - else - addon:Print(L["UnknownTradeSkill"]:format(profession)) - return 0 - end -end - ----Determines what to do when the slash command is called. -function addon:ChatCommand(input) - - -- Open About panel if there's no parameters or if we do /arl about - if not input or (input and input:trim() == "") or input == strlower(L["Sorting"]) or input == strlower(L["Sort"]) or input == strlower(_G.DISPLAY) then - InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) - elseif (input == strlower(L["About"])) then - if (self.optionsFrame["About"]) then - InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["About"]) - else - InterfaceOptionsFrame_OpenToCategory(self.optionsFrame) - end - elseif (input == strlower(L["Profile"])) then - InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["Profiles"]) - elseif (input == strlower(_G.FILTER)) then - InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["Filters"]) - elseif (input == strlower(L["Documentation"])) then - InterfaceOptionsFrame_OpenToCategory(self.optionsFrame["Documentation"]) - elseif (input == strlower(L["Scan"])) then - self:Scan(false) - elseif (input == strlower("scandata")) then - self:ScanSkillLevelData() - elseif (input == strlower("scanprof")) then - self:ScanProfession("all") - else - -- What happens when we get here? - LibStub("AceConfigCmd-3.0"):HandleCommand("arl", "Ackis Recipe List", input) - end - -end - -------------------------------------------------------------------------------- --- Recipe Scanning Functions -------------------------------------------------------------------------------- -do - -- List of tradeskill headers, used in addon:Scan() - local header_list = {} - - --- Causes a scan of the tradeskill to be conducted. Function called when the scan button is clicked. Parses recipes and displays output - -- @name AckisRecipeList:Scan - -- @usage AckisRecipeList:Scan(true) - -- @param textdump Boolean indicating if we want the output to be a text dump, or if we want to use the ARL GUI. - -- @return A frame with either the text dump, or the ARL frame. - function addon:Scan(textdump) - local scan_parent = self.scan_button:GetParent() - - -- The scan button is re-parented to whichever interface it's anchored to, whether it's TradeSkillFrame or a replacement AddOn, - -- so we make sure its parent exists and is visible before proceeding. - if not scan_parent or scan_parent == UIParent or not scan_parent:IsVisible() then - self:Print(L["OpenTradeSkillWindow"]) - return - end - local current_prof, prof_level = GetTradeSkillLine() - - -- Set the current profession and its level, and update the cached data. - Player["Profession"] = current_prof - Player["ProfessionLevel"] = prof_level - - -- Make sure we're only updating a profession the character actually knows - this could be a scan from a tradeskill link. - if not IsTradeSkillLinked() and Player["Professions"][current_prof] then - Player["Professions"][current_prof] = prof_level - end - - -- Get the current profession Specialty - local specialty = SpecialtyTable[Player["Profession"]] - - for index = 1, 25, 1 do - local spellName = GetSpellName(index, BOOKTYPE_SPELL) - - if not spellName or index == 25 then - Player["Specialty"] = nil - break - elseif specialty and specialty[spellName] then - Player["Specialty"] = specialty[spellName] - break - end - end - - -- Add the recipes to the database - -- TODO: Figure out what this variable was supposed to be for - it isn't used anywhere. -Torhal - Player.totalRecipes = InitializeRecipe(Player["Profession"]) - - --- Set the known flag to false for every recipe in the database. - for SpellID in pairs(RecipeList) do - RecipeList[SpellID]["Known"] = false - end - - ------------------------------------------------------------------------------- - -- Scan all recipes and mark the ones we know - ------------------------------------------------------------------------------- - twipe(header_list) - - if MRTUIUtils_PushFilterSelection then - MRTUIUtils_PushFilterSelection() - else - if not Skillet and TradeSkillFrameAvailableFilterCheckButton:GetChecked() then - TradeSkillFrameAvailableFilterCheckButton:SetChecked(false) - TradeSkillOnlyShowMakeable(false) - end - - -- Clear the inventory slot filter - UIDropDownMenu_Initialize(TradeSkillInvSlotDropDown, TradeSkillInvSlotDropDown_Initialize) - UIDropDownMenu_SetSelectedID(TradeSkillInvSlotDropDown, 1) - SetTradeSkillInvSlotFilter(0, 1, 1) - - -- Clear the sub-classes filters - UIDropDownMenu_Initialize(TradeSkillSubClassDropDown, TradeSkillSubClassDropDown_Initialize) - UIDropDownMenu_SetSelectedID(TradeSkillSubClassDropDown, 1) - SetTradeSkillSubClassFilter(0, 1, 1) - - -- Expand all headers so we can see all the recipes there are - for i = GetNumTradeSkills(), 1, -1 do - local name, tradeType, _, isExpanded = GetTradeSkillInfo(i) - - if tradeType == "header" and not isExpanded then - header_list[name] = true - ExpandTradeSkillSubClass(i) - end - end - end - local recipes_found = 0 - - for i = 1, GetNumTradeSkills() do - local tradeName, tradeType = GetTradeSkillInfo(i) - - if tradeType ~= "header" then - -- Get the trade skill link for the specified recipe - local SpellLink = GetTradeSkillRecipeLink(i) - local SpellString = strmatch(SpellLink, "^|c%x%x%x%x%x%x%x%x|H%w+:(%d+)") - local recipe = RecipeList[tonumber(SpellString)] - - if recipe then - recipe["Known"] = true - recipes_found = recipes_found + 1 - else - self:Print(self:Red(tradeName .. " " .. SpellString) .. self:White(L["MissingFromDB"])) - end - end - end - - -- Close all the headers we've opened - -- If Mr Trader is installed use that API - if MRTUIUtils_PopFilterSelection then - MRTUIUtils_PopFilterSelection() - else - -- Collapse all headers that were collapsed before - for i = GetNumTradeSkills(), 1, -1 do - local name, tradeType, _, isExpanded = GetTradeSkillInfo(i) - - if header_list[name] then - CollapseTradeSkillSubClass(i) - end - end - end - -- TODO: Figure out what this variable was supposed to be for - it isn't used anywhere. -Torhal - Player.foundRecipes = recipes_found - - self:UpdateFilters() - Player:MarkExclusions() - - if textdump then - self:DisplayTextDump(RecipeList, Player["Profession"]) - else - self:DisplayFrame() - end - end -end - -------------------------------------------------------------------------------- --- Recipe Exclusion Functions -------------------------------------------------------------------------------- ----Removes or adds a recipe to the exclusion list. -function addon:ToggleExcludeRecipe(SpellID) - local exclusion_list = addon.db.profile.exclusionlist - - exclusion_list[SpellID] = (not exclusion_list[SpellID] and true or nil) -end - ----Prints all the ID's in the exclusion list out into chat. -function addon:ViewExclusionList() - local exclusion_list = addon.db.profile.exclusionlist - - -- Parse all items in the exclusion list - for i in pairs(exclusion_list) do - self:Print(i .. ": " .. GetSpellInfo(i)) - end -end - -function addon:ClearExclusionList() - local exclusion_list = addon.db.profile.exclusionlist - - exclusion_list = twipe(exclusion_list) -end - -------------------------------------------------------------------------------- --- Text dumping functions -------------------------------------------------------------------------------- -do - ------------------------------------------------------------------------------- - -- Provides a string of comma separated values for all recipe information - ------------------------------------------------------------------------------- - local text_table = {} - local acquire_list = {} - - local ACQUIRE_NAMES = { - [A_TRAINER] = "Trainer", - [A_VENDOR] = "Vendor", - [A_MOB] = "Mob Drop", - [A_QUEST] = "Quest", - [A_SEASONAL] = "Seasonal", - [A_REPUTATION] = "Reputation", - [A_WORLD_DROP] = "World Drop", - [A_CUSTOM] = "Custom", - } - - function addon:GetTextDump(RecipeDB, profession) - twipe(text_table) - - tinsert(text_table, strformat("Ackis Recipe List Text Dump for %s. ", profession)) - tinsert(text_table, "Text output of all recipes and acquire information. Output is in the form of comma separated values.\n") - tinsert(text_table, "Spell ID,Recipe Name,Skill Level,ARL Filter Flags,Acquire Methods,Known\n") - - for SpellID in pairs(RecipeDB) do - local recipe_prof = GetSpellInfo(RecipeDB[SpellID]["Profession"]) - - if recipe_prof == profession then - -- Add Spell ID, Name and Skill Level to the list - tinsert(text_table, SpellID) - tinsert(text_table, ",") - tinsert(text_table, RecipeDB[SpellID]["Name"]) - tinsert(text_table, ",") - tinsert(text_table, RecipeDB[SpellID]["Level"]) - tinsert(text_table, ",\"") - - -- Add in all the filter flags - local recipe_flags = RecipeDB[SpellID]["Flags"] - local prev - - -- Find out which flags are marked as "true" - for i = 1, NUM_FILTER_FLAGS, 1 do - if recipe_flags[i] then - if prev then - tinsert(text_table, ",") - end - tinsert(text_table, i) - prev = true - end - end - tinsert(text_table, "\",\"") - - -- Find out which unique acquire methods we have - local acquire = RecipeDB[SpellID]["Acquire"] - twipe(acquire_list) - - for i in pairs(acquire) do - local acquire_type = acquire[i]["Type"] - - acquire_list[ACQUIRE_NAMES[acquire_type]] = true - end - - -- Add all the acquire methods in - prev = false - - for i in pairs(acquire_list) do - if prev then - tinsert(text_table, ",") - end - tinsert(text_table, i) - prev = true - end - - if (RecipeDB[SpellID]["Known"]) then - tinsert(text_table, "\",true\n") - else - tinsert(text_table, "\",false\n") - end - end - end - return tconcat(text_table, "") - end - -end - ----Clears all saved tradeskills -function addon:ClearSavedSkills() - twipe(addon.db.global.tradeskill) - - if addon.db.profile.tradeskill then - addon.db.profile.tradeskill = nil - end - -end - -------------------------------------------------------------------------------- --- API to interface with external AddOns. -------------------------------------------------------------------------------- ---- Initialize the recipe database with a specific profession --- @name AckisRecipeList:AddRecipeData --- @usage AckisRecipeList:AddRecipeData(GetSpellInfo(51304)) --- @param profession Spell ID of the profession which you want to populate the database with. --- @return Boolean indicating if the operation was successful. The recipe database will be populated with appropriate data. -function addon:AddRecipeData(profession) - return InitializeRecipe(profession) -end - ---- Initialize the recipe database --- @name AckisRecipeList:InitRecipeData --- @usage AckisRecipeList:InitRecipeData() --- @return Boolean indicating if the operation was successful. The recipe database will be populated with appropriate data. --- @return Arrays containing the RecipeList, MobList, TrainerList, VendorList, QuestList, ReputationList, SeasonalList. -function addon:InitRecipeData() - return false, RecipeList, MobList, TrainerList, VendorList, QuestList, ReputationList, SeasonalList -end - ---- Get recipe information from ARL --- @name AckisRecipeList:GetRecipeData --- @param spellID The spell ID of the recipe you want information about. --- @return Table containing all spell ID information or nil if it's not found. -function addon:GetRecipeData(spellID) - return RecipeList[spellID] -end diff --git a/AckisRecipeList.toc b/AckisRecipeList.toc index 00bd31d..c875234 100644 --- a/AckisRecipeList.toc +++ b/AckisRecipeList.toc @@ -62,11 +62,11 @@ embeds.xml # Localization files local.xml -AckisRecipeList.lua -ARLConfig.lua -ARLColour.lua +ARL.lua +Config.lua +Colour.lua Frame.lua -ARLDatamine.lua +Datamine.lua Player.lua # Recipe database files diff --git a/Colour.lua b/Colour.lua new file mode 100644 index 0000000..0b9c7d0 --- /dev/null +++ b/Colour.lua @@ -0,0 +1,320 @@ +--[[ + +**************************************************************************************** + +ARLColour.lua + +Colouring functions for ARL + +File date: @file-date-iso@ +File revision: @file-revision@ +Project revision: @project-revision@ +Project version: @project-version@ + +Code adopted from Crayon library + +**************************************************************************************** + +Please see http://www.wowace.com/projects/arl/for more information. + +License: + Please see LICENSE.txt + +This source code is released under All Rights Reserved. + +************************************************************************ + +]]-- + + +local MODNAME = "Ackis Recipe List" +local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME) + +--[[ + + Colour constants + +]]-- + +local RED = "ff0000" +local ORANGE = "ff7f00" +local YELLOW = "ffff00" +local GREEN = "00ff00" +local WHITE = "ffffff" +local COPPER = "eda55f" +local SILVER = "c7c7cf" +local GOLD = "ffd700" +local PURPLE = "9980CC" +local BLUE = "0000ff" +local CYAN = "00ffff" +local BLACK = "000000" +local GREY = "666666" +local MIDGREY = "858585" +local NEUTRAL = "bfbfbf" +local FRIENDLY = WHITE +local HONORED = "00ff00" +local REVERED = "3f66e5" +local EXALTED = "9933cc" + +local TRAINER = "d9cb9e" +local VENDOR = "aad372" +local QUEST = "2359ff" +local REP = "ff7c0a" +local SEASON = "80590e" +local MOBDROP = "ffffc0" + +local POOR = "919191" +local COMMON = WHITE +local UNCOMMON = "00A900" +local RARE = "0062C3" +local EPIC = "B343FF" +local LEGENDARY = "FA9900" +local ARTIFACT = "e5cc80" + +local HIGH = WHITE +local NORMAL = "ffd100" + +local HORDE = RED +local ALLIANCE = "00ffff" + +--[[ + + Text colourization functions + +]]-- + +function addon:RGBtoHEX(r,g,b) + return string.format("%2x%2x%2x", r*255, g*255, b*255) +end + + +-- Changes any string of text to the specified hex colour +function addon:Colourize(hexColour, text) + + return "|cff" .. tostring(hexColour or 'ffffff') .. tostring(text) .. "|r" + +end + +-- Converts text to Neutral Colour +function addon:Neutral(text) + return self:Colourize(NEUTRAL, text) +end + +-- Converts text to Friendly Colour +function addon:Friendly(text) + return self:Colourize(FRIENDLY, text) +end + +-- Converts text to Honored Colour +function addon:Honored(text) + return self:Colourize(HONORED, text) +end + +-- Converts text to Revered Colour +function addon:Revered(text) + return self:Colourize(REVERED, text) +end + +-- Converts text to Exalted Colour +function addon:Exalted(text) + return self:Colourize(EXALTED, text) +end + +function addon:Horde(text) + return self:Colourize(RED, text) +end + +function addon:Alliance(text) + return self:Colourize(CYAN, text) +end + +function addon:Coords(text) + return self:Colourize(WHITE, text) +end + +function addon:Trainer(text) + return self:Colourize(TRAINER, text) +end + +function addon:Vendor(text) + return self:Colourize(VENDOR, text) +end + +function addon:Quest(text) + return self:Colourize(QUEST, text) +end + +function addon:Rep(text) + return self:Colourize(REP, text) +end + +function addon:Season(text) + return self:Colourize(SEASON, text) +end + +function addon:MobDrop(text) + return self:Colourize(MOBDROP, text) +end + +-- Rarity Colors +function addon:Poor(text) + return self:Colourize(POOR, text) +end + +function addon:Common(text) + return self:Colourize(COMMON, text) +end + +function addon:Uncommon(text) + return self:Colourize(UNCOMMON, text) +end + +function addon:Rare(text) + return self:Colourize(RARE, text) +end + +function addon:Epic(text) + return self:Colourize(EPIC, text) +end + +function addon:Legendary(text) + return self:Colourize(LEGENDARY, text) +end + +function addon:Artifact(text) + return self:Colourize(ARTIFACT, text) +end + +function addon:RarityColor(rarityColor, text) + if (rarityColor == 1) then + return self:Colourize(POOR, text) + elseif (rarityColor == 2) then + return self:Colourize(COMMON, text) + elseif (rarityColor == 3) then + return self:Colourize(UNCOMMON, text) + elseif (rarityColor == 4) then + return self:Colourize(RARE, text) + elseif (rarityColor == 5) then + return self:Colourize(EPIC, text) + elseif (rarityColor == 6) then + return self:Colourize(LEGENDARY, text) + else + return self:Colourize(ARTIFACT, text) + end +end + +-- Converts text to Red +function addon:Red(text) + return self:Colourize(RED, text) +end + +-- Converts text to Orange +function addon:Orange(text) + return self:Colourize(ORANGE, text) +end + +-- Converts text to Yellow +function addon:Yellow(text) + return self:Colourize(YELLOW, text) +end + +-- Converts text to Green +function addon:Green(text) + return self:Colourize(GREEN, text) +end + +-- Converts text to White +function addon:White(text) + return self:Colourize(WHITE, text) +end + +-- Converts text to Copper +function addon:Copper(text) + return self:Colourize(COPPER, text) +end + +-- Converts text to Silver +function addon:Silver(text) + return self:Colourize(SILVER, text) +end + +-- Converts text to Gold +function addon:Gold(text) + return self:Colourize(GOLD, text) +end + +-- Converts text to Purple +function addon:Purple(text) + return self:Colourize(PURPLE, text) +end + +-- Converts text to Blue +function addon:Blue(text) + return self:Colourize(BLUE, text) +end + +-- Converts text to Cyan +function addon:Cyan(text) + return self:Colourize(CYAN, text) +end + +-- Converts text to Black +function addon:Black(text) + return self:Colourize(BLACK, text) +end + +-- Converts text to Grey +function addon:Grey(text) + return self:Colourize(GREY, text) +end + +-- Converts text to Middle Grey +function addon:MidGrey(text) + return self:Colourize(MIDGREY, text) +end + +-- Standard bliz yellowish sort of thing +function addon:Normal(text) + return self:Colourize(NORMAL, text) +end + +-- used for tooltip rgb stuff +function addon:hexcolor(colorstring) + if (colorstring == "NEUTRAL") then return NEUTRAL + elseif (colorstring == "FRIENDLY") then return FRIENDLY + elseif (colorstring == "HONORED") then return HONORED + elseif (colorstring == "REVERED") then return REVERED + elseif (colorstring == "EXALTED") then return EXALTED + + elseif (colorstring == "TRAINER") then return TRAINER + elseif (colorstring == "VENDOR") then return VENDOR + elseif (colorstring == "QUEST") then return QUEST + elseif (colorstring == "REP") then return REP + elseif (colorstring == "SEASON") then return SEASON + elseif (colorstring == "MOBDROP") then return MOBDROP + + elseif (colorstring == "POOR") then return POOR + elseif (colorstring == "COMMON") then return COMMON + elseif (colorstring == "UNCOMMON") then return UNCOMMON + elseif (colorstring == "RARE") then return RARE + elseif (colorstring == "EPIC") then return EPIC + elseif (colorstring == "LEGENDARY") then return LEGENDARY + elseif (colorstring == "ARTIFACT") then return ARTIFACT + + elseif (colorstring == "HORDE") then return HORDE + elseif (colorstring == "ALLIANCE") then return ALLIANCE + + elseif (colorstring == "BLACK") then return BLACK + elseif (colorstring == "ORANGE") then return ORANGE + elseif (colorstring == "GREEN") then return GREEN + elseif (colorstring == "YELLOW") then return YELLOW + elseif (colorstring == "GREY") then return GREY + elseif (colorstring == "MIDGREY") then return MIDGREY + elseif (colorstring == "RED") then return RED + + elseif (colorstring == "HIGH") then return HIGH +-- elseif (colorstring == "NORMAL") then return NORMAL + else + return NORMAL + end +end \ No newline at end of file diff --git a/Config.lua b/Config.lua new file mode 100644 index 0000000..54e9c85 --- /dev/null +++ b/Config.lua @@ -0,0 +1,701 @@ +--[[ + +**************************************************************************************** + +ARLConfig.lua + +Ace3 Configuration options for ARL + +File date: @file-date-iso@ +File revision: @file-revision@ +Project revision: @project-revision@ +Project version: @project-version@ + +**************************************************************************************** + +Please see http://www.wowace.com/projects/arl/for more information. + +License: + Please see LICENSE.txt + +This source code is released under All Rights Reserved. + +************************************************************************ + +]]-- + +local MODNAME = "Ackis Recipe List" +local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME) + +local BFAC = LibStub("LibBabble-Faction-3.0"):GetLookupTable() +local LC = LOCALIZED_CLASS_NAMES_MALE +local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME) + +local AceConfig = LibStub("AceConfig-3.0") +local AceConfigReg = LibStub("AceConfigRegistry-3.0") +local AceConfigDialog = LibStub("AceConfigDialog-3.0") + +local modularOptions = {} + +local function giveProfiles() + return LibStub("AceDBOptions-3.0"):GetOptionsTable(addon.db) +end + +local function ResetGUI() + addon.db.profile.frameopts.offsetx = 0 + addon.db.profile.frameopts.offsety = 0 + addon.db.profile.frameopts.anchorTo = "" + addon.db.profile.frameopts.anchorFrom = "" + addon.db.profile.frameopts.uiscale = 1 + addon.db.profile.frameopts.tooltipscale = .9 + addon.db.profile.frameopts.fontsize = 11 +end + +local options + +local function fullOptions() + if not options then + options = { + type = "group", + name = MODNAME, + args = { + general = { + order = 1, + type = "group", + name = L["Main Options"], + desc = L["MAIN_OPTIONS_DESC"], + args = { + header1 = { + order = 10, + type = "header", + name = L["General Options"], + }, + version = { + order = 11, + type = "description", + name = _G.GAME_VERSION_LABEL .. ": " .. addon.version .. "\n", + }, + run = { + order = 12, + type = "execute", + name = L["Scan"], + desc = L["SCAN_RECIPES_DESC"], + func = function(info) addon:Scan(false) end, + }, + textdump = { + order = 13, + type = "execute", + name = L["Text Dump"], + desc = L["TEXT_DUMP_DESC"], + func = function(info) addon:Scan(true) end, + }, + exclusionlist = { + order = 14, + type = "execute", + name = L["View Exclusion List"], + desc = L["VIEW_EXCLUSION_LIST_DESC"], + func = function(info) addon:ViewExclusionList() end, + }, + clearexclusionlist = { + order = 15, + type = "execute", + name = L["Clear Exclusion List"], + desc = L["CLEAR_EXCLUSION_LIST_DESC"], + func = function(info) addon:ClearExclusionList() end, + }, + resetallfilters = { + order = 16, + type = "execute", + name = L["Reset All Filters"], + desc = L["RESET_DESC"], + func = function(info) addon.resetFilters() end, + }, + resetguiwindow = { + order = 17, + type = "execute", + name = L["Reset Window Position"], + desc = L["RESET_WINDOW_DESC"], + func = function(info) ResetGUI() end, + }, + spacer1 = { + order = 19, + type = "description", + name = "\n", + }, + header1a = { + order = 20, + type = "header", + name = L["Main Filter Options"], + }, + mainfilter_desc = { + order = 21, + type = "description", + name = L["MAINFILTER_OPTIONS_DESC"] .. "\n", + }, + includefiltered = { + order = 22, + type = "toggle", + name = L["Include Filtered"], + desc = L["FILTERCOUNT_DESC"], + get = function() return addon.db.profile.includefiltered end, + set = function() addon.db.profile.includefiltered = not addon.db.profile.includefiltered end, + }, + includeexcluded = { + order = 23, + type = "toggle", + name = L["Include Excluded"], + desc = L["EXCLUDECOUNT_DESC"], + get = function() return addon.db.profile.includeexcluded end, + set = function() addon.db.profile.includeexcluded = not addon.db.profile.includeexcluded end, + }, + ignoreexclusionlist = { + order = 24, + type = "toggle", + name = L["Display Exclusions"], + desc = L["DISPLAY_EXCLUSION_DESC"], + get = function() return addon.db.profile.ignoreexclusionlist end, + set = function() addon.db.profile.ignoreexclusionlist = not addon.db.profile.ignoreexclusionlist end, + }, + spacer2 = { + order = 39, + type = "description", + name = "\n", + }, + header3 = { + order = 40, + type = "header", + name = L["Sorting Options"], + }, + sort_desc = { + order = 41, + type = "description", + name = L["SORTING_OPTIONS_DESC"] .. "\n", + }, + sorting = { + order = 45, + type = "select", + name = L["Sorting"], + desc = L["SORTING_DESC"], + get = function() + return addon.db.profile.sorting + end, + set = function(info, name) + addon.db.profile.sorting = name + end, + values = function() + return { + Name = _G.NAME, + SkillAsc = L["Skill (Asc)"], + SkillDesc = L["Skill (Desc)"], + Acquisition = L["Acquisition"], + Location = L["Location"] + } + end, + }, + }, + }, + }, + } + + for k,v in pairs(modularOptions) do + options.args[k] = (type(v) == "function") and v() or v + end + + end + + return options + +end + +local arlmap = nil + +local function giveMap() + + local tomtomsupport = true + + if ((TomTom) or ((TomTom) and (Carbonite))) then + tomtomsupport = false + end + + if (not arlmap) then + + arlmap = { + order = 1, + type = "group", + name = L["Map Options"], + desc = L["MAP_OPTIONS_DESC"], + args = { + map_desc = { + order = 1, + type = "description", + name = L["MAP_OPTIONS_DESC"] .. "\n", + }, + autoscanmap = { + order = 2, + type = "toggle", + name = L["Auto Scan Map"], + desc = L["AUTOSCANMAP_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.autoscanmap end, + set = function() addon.db.profile.autoscanmap = not addon.db.profile.autoscanmap end, + }, + worldmap = { + order = 3, + type = "toggle", + name = _G.WORLD_MAP, + desc = L["WORLDMAP_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.worldmap end, + set = function() addon.db.profile.worldmap = not addon.db.profile.worldmap end, + }, + minimap = { + order = 4, + type = "toggle", + name = L["Mini Map"], + desc = L["MINIMAP_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.minimap end, + set = function() addon.db.profile.minimap = not addon.db.profile.minimap end, + }, + maptrainer = { + order = 5, + type = "toggle", + name = L["Trainer"], + desc = L["MAP_TRAINER_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.maptrainer end, + set = function() addon.db.profile.maptrainer = not addon.db.profile.maptrainer end, + }, + mapvendor = { + order = 6, + type = "toggle", + name = L["Vendor"], + desc = L["MAP_VENDOR_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.mapvendor end, + set = function() addon.db.profile.mapvendor = not addon.db.profile.mapvendor end, + }, + mapmob = { + order = 7, + type = "toggle", + name = L["Monster"], + desc = L["MAP_MONSTER_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.mapmob end, + set = function() addon.db.profile.mapmob = not addon.db.profile.mapmob end, + }, + mapquest = { + order = 8, + type = "toggle", + name = L["Quest"], + desc = L["MAP_QUEST_DESC"], + disabled = tomtomsupport, + get = function() return addon.db.profile.mapquest end, + set = function() addon.db.profile.mapquest = not addon.db.profile.mapquest end, + }, + clearmap = { + order = 20, + type = "execute", + name = L["Clear Waypoints"], + disabled = tomtomsupport, + desc = L["CLEAR_WAYPOINTS_DESC"], + func = function() addon:ClearMap() end, + }, + }, + } + + end + + return arlmap + +end + +local datamine = nil + +local function giveDatamine() + + if (not datamine) then + + datamine = { + order = 1, + type = "group", + name = L["Datamine Options"], + desc = L["DATAMINE_OPTIONS_DESC"], + args = { + datamine_desc = { + order = 1, + type = "description", + name = L["DATAMINE_OPTIONS_DESC"] .. "\n", + }, + datamine_warn = { + order = 2, + type = "description", + name = L["DATAMINE_WARNING_DESC"] .. "\n", + }, + generatelinks = { + order = 73, + type = "execute", + name = L["Generate Tradeskill Links"], + desc = L["GENERATE_LINKS_DESC"], + func = function() addon:GenerateLinks() end, + }, + scantrainerskills = { + order = 75, + type = "execute", + name = L["Compare Trainer Skills"], + desc = L["COMPARE_TRAINER_SKILL_DESC"], + func = function() addon:ScanSkillLevelData() end, + }, + scantraineracquire = { + order = 76, + type = "execute", + name = L["Compare Trainer Acquire"], + desc = L["COMPARE_TRAINER_ACQUIRE_DESC"], + func = function() addon:ScanTrainerData() end, + }, + scanentiredatabase = { + order = 77, + type = "execute", + name = L["Scan Entire Database"], + desc = L["SCAN_ENTIRE_DB_DESC"], + func = function() addon:TooltipScanDatabase() end, + }, + scanvendor = { + order = 78, + type = "execute", + name = L["Scan Vendor"], + desc = L["SCAN_VENDOR_DESC"], + func = function() addon:ScanVendor() end, + }, + scanprofessiontooltip = { + type = "input", + name = L["Scan Professions"], + desc = L["SCAN_PROF_DB_DESC"], + get = false, + set = function(info, v) addon:ScanProfession(v) end, + order = 79, + }, + scanspellid = { + type = "input", + name = L["Scan Spell ID"], + desc = L["SCAN_SPELL_ID_DESC"], + get = false, + set = function(info, v) addon:TooltipScanRecipe(tonumber(v),false,false) end, + order = 80, + }, + scantrainers = { + order = 90, + type = "toggle", + name = L["Auto Scan Trainers"], + desc = L["AUTOSCAN_TRAINERS_DESC"], + get = function() return addon.db.profile.scantrainers end, + set = function() + if (addon.db.profile.scantrainers) then + addon:UnregisterEvent("TRAINER_SHOW") + else + addon:RegisterEvent("TRAINER_SHOW") + end + addon.db.profile.scantrainers = not addon.db.profile.scantrainers + end, + }, + scanvendors = { + order = 91, + type = "toggle", + name = L["Auto Scan Vendors"], + desc = L["AUTOSCAN_VENDORS_DESC"], + get = function() return addon.db.profile.scanvendors end, + set = function() + if (addon.db.profile.scanvendors) then + addon:UnregisterEvent("MERCHANT_SHOW") + else + addon:RegisterEvent("MERCHANT_SHOW") + end + addon.db.profile.scanvendors = not addon.db.profile.scanvendors + end, + }, + autoloaddb = { + order = 100, + type = "toggle", + name = L["Auto Load Recipe Database"], + desc = L["AUTOLOAD_DB_DESC"], + get = function() return addon.db.profile.autoloaddb end, + set = function() addon.db.profile.autoloaddb = not addon.db.profile.autoloaddb end, + }, + }, + } + + end + + return datamine + +end + +local documentation = nil + +local function giveDocs() + + if (not documentation) then + + documentation = { + order = 1, + type = "group", + name = L["ARL Documentation"], + desc = L["ARL_DOC_DESC"], + args = { + header1 = { + order = 1, + type = "header", + name = L["ARL Documentation"], + }, + desc1 = { + order = 2, + type = "description", + name = L["ARL_DOC_DESC"], + }, + header2 = { + order = 3, + type = "header", + name = L["Using Filters"], + }, + desc2 = { + order = 4, + type = "description", + name = L["USING_FILTERS_DESC"], + }, + header3 = { + order = 5, + type = "header", + name = L["Common Issues"], + }, + desc3 = { + order = 6, + type = "description", + name = L["COMMON_ISSUES_DESC"], + }, + header4 = { + order = 7, + type = "header", + name = L["Reporting Bugs"], + }, + desc4 = { + order = 8, + type = "description", + name = L["REPORTING_BUGS_DESC"], + }, + header5 = { + order = 9, + type = "header", + name = L["Exclusion Issues"], + }, + desc5 = { + order = 10, + type = "description", + name = L["EXCLUSION_ISSUES_DESC"], + }, + header6 = { + order = 11, + type = "header", + name = L["Map Issues"], + }, + desc6 = { + order = 12, + type = "description", + name = L["MAP_ISSUES_DESC"], + }, + header7 = { + order = 13, + type = "header", + name = L["Game Commands"], + }, + desc7 = { + order = 14, + type = "description", + name = L["GAME_COMMANDS_DESC"], + }, + }, + } + + end + + return documentation + +end + +local displayoptions = nil + +local function giveDisplay() + if not displayoptions then + displayoptions = { + order = 1, + type = "group", + name = L["Display Options"], + desc = L["DISPLAY_OPTIONS_DESC"], + args = { + display_desc = { + order = 1, + type = "description", + name = L["MAP_OPTIONS_DESC"] .. "\n", + }, + scanbuttonlocation = { + order = 2, + type = "select", + name = L["Scan Button Position"], + desc = L["SCANBUTTONPOSITION_DESC"], + get = function() return addon.db.profile.scanbuttonlocation end, + set = function(info,name) addon.db.profile.scanbuttonlocation = name end, + values = function() return {TR = L["Top Right"], TL = L["Top Left"], BR = L["Bottom Right"], BL = L["Bottom Left"]} end, + }, + uiscale = { + order = 3, + type = "range", + name = _G.UI_SCALE, + desc = L["UI_SCALE_DESC"], + min = .5, + max = 1.5, + step = .05, + bigStep = .05, + get = function() return addon.db.profile.frameopts.uiscale end, + set = function(info, v) + addon.db.profile.frameopts.uiscale = v + addon.Frame:SetScale(v) + end, + }, + fontsize = { + order = 4, + type = "range", + name = _G.FONT_SIZE, + desc = L["FONT_SIZE_DESC"], + min = 6, + max = 20, + step = 1, + bigStep = 1, + get = function() return addon.db.profile.frameopts.fontsize end, + set = function(info, v) addon.db.profile.frameopts.fontsize = v end, + }, + closegui = { + order = 5, + type = "toggle", + name = L["Close GUI"], + desc = L["CLOSEGUI_DESC"], + get = function() return addon.db.profile.closeguionskillclose end, + set = function() addon.db.profile.closeguionskillclose = not addon.db.profile.closeguionskillclose end, + }, + hidepopup = { + order = 6, + type = "toggle", + name = L["Hide Pop-Up"], + desc = L["HIDEPOPUP_DESC"], + get = function() return addon.db.profile.hidepopup end, + set = function() addon.db.profile.hidepopup = not addon.db.profile.hidepopup end, + }, + spacer1 = { + order = 10, + type = "description", + name = "\n", + }, + tooltip_header = { + order = 11, + type = "header", + name = L["Tooltip Options"], + }, + tooltip_desc = { + order = 12, + type = "description", + name = L["TOOLTIP_OPTIONS_DESC"] .. "\n", + }, + tooltipscale = { + order = 20, + type = "range", + name = L["Tooltip Scale"], + desc = L["TOOLTIP_SCALE_DESC"], + min = .5, + max = 1.5, + step = .05, + bigStep = .05, + get = function() + return addon.db.profile.frameopts.tooltipscale + end, + set = function(info, v) + addon.db.profile.frameopts.tooltipscale = v + end, + }, + acquiretooltiplocation = { + order = 21, + type = "select", + name = L["Tooltip (Acquire) Position"], + desc = L["ACQUIRETOOLTIPPOSITION_DESC"], + get = function() + return addon.db.profile.acquiretooltiplocation + end, + set = function(info, name) + addon.db.profile.acquiretooltiplocation = name + end, + values = function() + return { + Right = L["Right"], + Left = L["Left"], + Top = L["Top"], + Bottom = L["Bottom"], + Off = _G.OFF, + Mouse = _G.MOUSE_LABEL + } + end, + }, + spelltooltiplocation = { + order = 22, + type = "select", + name = L["Tooltip (Recipe) Position"], + desc = L["SPELLTOOLTIPPOSITION_DESC"], + get = function() + return addon.db.profile.spelltooltiplocation + end, + set = function(info,name) + addon.db.profile.spelltooltiplocation = name + end, + values = function() + return { + Right = L["Right"], + Left = L["Left"], + Top = L["Top"], + Bottom = L["Bottom"], + Off = _G.OFF + } + end, + }, + }, + } + end + return displayoptions +end + +function addon:SetupOptions() + AceConfigReg:RegisterOptionsTable(MODNAME, fullOptions) + self.optionsFrame = AceConfigDialog:AddToBlizOptions(MODNAME, nil, nil, "general") + + -- Add in the about panel to the Bliz options (but not the ace3 config) + if LibStub:GetLibrary("LibAboutPanel", true) then + self.optionsFrame["About"] = LibStub:GetLibrary("LibAboutPanel").new(MODNAME, MODNAME) + else + self:Print("Lib AboutPanel not loaded.") + end + + -- Fill up our modular options... + self:RegisterModuleOptions("Datamining", giveDatamine(), L["Datamine Options"]) + self:RegisterModuleOptions("Display", giveDisplay(), L["Display Options"]) + self:RegisterModuleOptions("Documentation", giveDocs(), L["ARL Documentation"]) + self:RegisterModuleOptions("Map", giveMap(), L["Map Options"]) + self:RegisterModuleOptions("Profiles", giveProfiles(), L["Profile Options"]) +end + +-- Description: Function which extends our options table in a modular way +-- Expected result: add a new modular options table to the modularOptions upvalue as well as the Blizzard config +-- Input: +-- name : index of the options table in our main options table +-- optionsTable : the sub-table to insert +-- displayName : the name to display in the config interface for this set of options +-- Output: None. + +function addon:RegisterModuleOptions(name, optionsTable, displayName) + modularOptions[name] = optionsTable + self.optionsFrame[name] = AceConfigDialog:AddToBlizOptions(MODNAME, displayName, MODNAME, name) +end diff --git a/Datamine.lua b/Datamine.lua new file mode 100644 index 0000000..18c80d3 --- /dev/null +++ b/Datamine.lua @@ -0,0 +1,2346 @@ +--[[ + +************************************************************************ + +ARLDatamine.lua + +In-game datamining functions for ARL + +File date: @file-date-iso@ +File revision: @file-revision@ +Project revision: @project-revision@ +Project version: @project-version@ + +************************************************************************ + +Please see http://www.wowace.com/projects/arl/for more information. + +License: + Please see LICENSE.txt + +This source code is released under All Rights Reserved. + +************************************************************************ + +]]-- + + +------------------------------------------------------------------------------- +-- AddOn namespace. +------------------------------------------------------------------------------- +local MODNAME = "Ackis Recipe List" +local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME) + +local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME) + + +------------------------------------------------------------------------------- +-- Upvalues globals. +------------------------------------------------------------------------------- +local table, string = table, string + +local tconcat, tinsert, tsort, twipe = table.concat, table.insert, table.sort, table.wipe +local strlower, strmatch = string.lower, string.match +local gsub = string.gsub +local tonumber, tostring = tonumber, tostring +local ipairs, pairs = ipairs, pairs + +------------------------------------------------------------------------------- +-- Upvalued Blizzard API. +------------------------------------------------------------------------------- +local UnitName = UnitName +local UnitGUID = UnitGUID +local UnitExists = UnitExists +local UnitIsPlayer = UnitIsPlayer +local UnitIsEnemy = UnitIsEnemy +local GetNumTrainerServices = GetNumTrainerServices +local GetTrainerServiceInfo = GetTrainerServiceInfo +local IsTradeskillTrainer = IsTradeskillTrainer +local SetTrainerServiceTypeFilter = SetTrainerServiceTypeFilter +local GetTrainerServiceTypeFilter = GetTrainerServiceTypeFilter +local GetTrainerServiceSkillReq = GetTrainerServiceSkillReq +local GetMerchantNumItems = GetMerchantNumItems +local GetMerchantItemLink = GetMerchantItemLink +local GetMerchantItemInfo = GetMerchantItemInfo +local GetSpellInfo = GetSpellInfo + +------------------------------------------------------------------------------- +-- Tradeskill professions +------------------------------------------------------------------------------- +local PROFESSIONS = { + ["Alchemy"] = GetSpellInfo(51304), + ["Blacksmithing"] = GetSpellInfo(51300), + ["Cooking"] = GetSpellInfo(51296), + ["Enchanting"] = GetSpellInfo(51313), + ["Engineering"] = GetSpellInfo(51306), + ["FirstAid"] = GetSpellInfo(45542), + ["Inscription"] = GetSpellInfo(45363), + ["Jewelcrafting"] = GetSpellInfo(51311), + ["Leatherworking"] = GetSpellInfo(51302), + ["Runeforging"] = GetSpellInfo(53428), + ["Smelting"] = GetSpellInfo(32606), + ["Tailoring"] = GetSpellInfo(51309), +} + +------------------------------------------------------------------------------- +-- Mined via Data-tools +-- Table is Public Domain now +-- Look up table of Spell IDs to the recipe which trains them. +------------------------------------------------------------------------------- +local SPELL_ITEM = { + ------------------------------------------------------------------------------- + -- First Aid + ------------------------------------------------------------------------------- + [7929] = 16112, [7935] = 6454, [10840] = 16113, [23787] = 19442, + [27032] = 21992, [27033] = 21993, [45546] = 39152, + + ------------------------------------------------------------------------------- + -- Alchemy + ------------------------------------------------------------------------------- + [2333] = 3396, [2335] = 2555, [3172] = 3393, [3174] = 3394, + [3175] = 3395, [3188] = 6211, [3230] = 2553, [3449] = 6068, + [3450] = 3830, [3451] = 3831, [3453] = 3832, [3454] = 14634, + [4508] = 4597, [4942] = 4624, [6617] = 5640, [6618] = 5643, + [6624] = 5642, [7255] = 6053, [7256] = 6054, [7257] = 6055, + [7258] = 6056, [7259] = 6057, [8240] = 6663, [11453] = 9293, + [11456] = 10644, [11458] = 9294, [11459] = 9303, [11464] = 9295, + [11466] = 9296, [11468] = 9297, [11472] = 9298, [11473] = 9302, + [11476] = 9301, [11477] = 9300, [11479] = 9304, [11480] = 9305, + [17187] = 12958, [17552] = 13476, [17553] = 13477, [17554] = 13478, + [17555] = 13479, [17556] = 13480, [17557] = 13481, [17559] = 13482, + [17560] = 13483, [17561] = 13484, [17562] = 13485, [17563] = 13486, + [17564] = 13487, [17565] = 13488, [17566] = 13489, [17570] = 13490, + [17571] = 13491, [17572] = 13492, [17573] = 13493, [17574] = 13494, + [17575] = 13495, [17576] = 13496, [17577] = 13497, [17578] = 13499, + [17580] = 13501, [17632] = 13517, [17634] = 13518, [17635] = 31354, + [17636] = 31356, [17637] = 31355, [17638] = 31357, [21923] = 17709, + [22732] = 18257, [24365] = 20011, [24366] = 20012, [24367] = 20013, + [24368] = 20014, [25146] = 20761, [26277] = 21547, [28543] = 22900, + [28546] = 22901, [28549] = 22902, [28550] = 22903, [28552] = 22904, + [28553] = 24001, [28554] = 22906, [28555] = 22907, [28556] = 22908, + [28557] = 22909, [28558] = 22910, [28562] = 22911, [28563] = 22912, + [28564] = 35295, [28565] = 22914, [28566] = 22915, [28567] = 22916, + [28568] = 30443, [28569] = 22918, [28570] = 22919, [28571] = 22920, + [28572] = 22921, [28573] = 22922, [28575] = 22923, [28576] = 22924, + [28577] = 22925, [28578] = 35294, [28579] = 22927, [29688] = 23574, + [32765] = 25869, [32766] = 29232, [38960] = 31680, [38961] = 31682, + [38962] = 31681, [39637] = 32070, [39639] = 32071, [42736] = 33209, + [47046] = 35752, [47048] = 35753, [47049] = 35754, [47050] = 35755, + [53936] = 44564, [53937] = 44566, [53938] = 44568, [53939] = 44565, + [53942] = 44567, + + ------------------------------------------------------------------------------- + -- Blacksmithing + ------------------------------------------------------------------------------- + [2667] = 2881, [2673] = 5578, [3295] = 2883, [3297] = 3608, + [3321] = 3609, [3325] = 3610, [3330] = 2882, [3334] = 3611, + [3336] = 3612, [3492] = 12162, [3493] = 3866, [3494] = 10858, + [3495] = 3867, [3496] = 12163, [3497] = 3868, [3498] = 12164, + [3500] = 3869, [3503] = 6047, [3504] = 3870, [3505] = 3871, + [3507] = 3872, [3511] = 3873, [3513] = 3874, [3515] = 3875, + [6518] = 5543, [7221] = 6044, [7222] = 6045, [7224] = 6046, + [8367] = 6735, [9811] = 7978, [9813] = 7979, [9814] = 7980, + [9818] = 7981, [9820] = 7982, [9933] = 7975, [9937] = 7995, + [9939] = 7976, [9945] = 7983, [9950] = 7984, [9952] = 7985, + [9964] = 7989, [9966] = 7991, [9970] = 7990, [9995] = 7992, + [9997] = 8029, [10005] = 7993, [10009] = 8028, [10013] = 8030, + [11454] = 10713, [11643] = 9367, [12259] = 10424, [15292] = 11610, + [15293] = 11614, [15294] = 11611, [15295] = 11615, [15296] = 11612, + [15973] = 12261, [16642] = 12682, [16643] = 12683, [16644] = 12684, + [16645] = 12685, [16646] = 12687, [16647] = 12688, [16648] = 12689, + [16649] = 12690, [16650] = 12691, [16651] = 12692, [16652] = 12693, + [16653] = 12694, [16654] = 12695, [16655] = 12699, [16656] = 12697, + [16657] = 12700, [16658] = 12701, [16659] = 12702, [16660] = 12698, + [16661] = 12703, [16662] = 12704, [16663] = 12705, [16664] = 12706, + [16665] = 12707, [16667] = 12696, [16724] = 12711, [16725] = 12713, + [16726] = 12714, [16728] = 12716, [16729] = 12717, [16730] = 12715, + [16731] = 12718, [16732] = 12719, [16741] = 12720, [16742] = 12725, + [16744] = 12726, [16745] = 12727, [16746] = 12728, [16969] = 12819, + [16970] = 12821, [16971] = 12823, [16973] = 12824, [16978] = 12825, + [16983] = 12827, [16984] = 12828, [16985] = 12830, [16988] = 12833, + [16990] = 12834, [16991] = 12835, [16992] = 12836, [16993] = 12837, + [16994] = 12838, [16995] = 12839, [20872] = 17049, [20873] = 17053, + [20874] = 17051, [20876] = 17052, [20890] = 17059, [20897] = 17060, + [21161] = 18592, [21913] = 17706, [22757] = 18264, [23628] = 19202, + [23629] = 19204, [23632] = 19203, [23633] = 19205, [23636] = 19206, + [23637] = 19207, [23638] = 19208, [23639] = 19209, [23650] = 19210, + [23652] = 19211, [23653] = 19212, [24136] = 19776, [24137] = 19777, + [24138] = 19778, [24139] = 19779, [24140] = 19780, [24141] = 19781, + [24399] = 20040, [24912] = 20553, [24913] = 20555, [24914] = 20554, + [27585] = 22209, [27586] = 22219, [27587] = 22222, [27588] = 22214, + [27589] = 22220, [27590] = 22221, [27829] = 22388, [27830] = 22390, + [27832] = 22389, [28461] = 22766, [28462] = 22767, [28463] = 22768, + [29566] = 23590, [29568] = 23591, [29569] = 23592, [29571] = 23593, + [29603] = 23594, [29605] = 23595, [29606] = 23596, [29608] = 23597, + [29610] = 23599, [29611] = 23598, [29613] = 23600, [29614] = 23601, + [29615] = 23602, [29616] = 23603, [29617] = 23604, [29619] = 23605, + [29620] = 23606, [29621] = 23607, [29622] = 23621, [29628] = 23608, + [29629] = 23609, [29630] = 23610, [29642] = 23611, [29643] = 23612, + [29645] = 23613, [29648] = 23615, [29649] = 23617, [29656] = 23618, + [29657] = 24002, [29658] = 23620, [29662] = 23622, [29663] = 23623, + [29664] = 23624, [29668] = 23625, [29669] = 23626, [29671] = 23627, + [29672] = 23628, [29692] = 23629, [29693] = 23630, [29694] = 23631, + [29695] = 23632, [29696] = 23633, [29697] = 23634, [29698] = 23635, + [29699] = 23636, [29700] = 23637, [29728] = 23638, [29729] = 23639, + [32285] = 25526, [32656] = 25846, [32657] = 25847, [34608] = 28632, + [36389] = 30321, [36390] = 30322, [36391] = 30323, [36392] = 30324, + [38473] = 31390, [38475] = 31391, [38476] = 31392, [38477] = 31393, + [38478] = 31394, [38479] = 31395, [40033] = 32441, [40034] = 32442, + [40035] = 32443, [40036] = 32444, [41132] = 32736, [41133] = 32737, + [41134] = 32738, [41135] = 32739, [42688] = 35296, [43549] = 33792, + [43846] = 33954, [46140] = 35208, [46141] = 35209, [46142] = 35210, + [46144] = 35211, [54978] = 41124, [54979] = 41123, [54980] = 41120, + [54981] = 41122, [62202] = 44938, [63187] = 45088, [63188] = 45089, + [63189] = 45090, [63190] = 45091, [63191] = 45092, [63192] = 45093, + [67091] = 47622, [67130] = 47460, [67092] = 47623, [67131] = 47641, + [67096] = 47627, [67135] = 47642, [67095] = 47626, [67134] = 47643, + [67093] = 47624, [67132] = 47644, [67094] = 47625, [67133] = 47645, + + ------------------------------------------------------------------------------- + -- Cooking + ------------------------------------------------------------------------------- + [2542] = 2697, [2543] = 728, [2545] = 2698, [2547] = 2699, + [2548] = 2700, [2549] = 2701, [2795] = 2889, [3370] = 3678, + [3371] = 3679, [3372] = 3680, [3373] = 3681, [3376] = 3682, + [3377] = 3683, [3397] = 3734, [3398] = 3735, [3399] = 3736, + [3400] = 3737, [4094] = 4609, [6412] = 5482, [6413] = 5483, + [6414] = 5484, [6415] = 5485, [6416] = 5486, [6417] = 44977, + [6418] = 5488, [6419] = 5489, [6501] = 5528, [7213] = 6039, + [7751] = 6325, [7752] = 6326, [7753] = 6328, [7754] = 6329, + [7755] = 6330, [7827] = 6368, [7828] = 6369, [8238] = 6661, + [8607] = 6892, [9513] = 18160, [15853] = 12227, [15855] = 12228, + [15856] = 12229, [15861] = 12231, [15863] = 12232, [15865] = 12233, + [15906] = 12239, [15910] = 12240, [15915] = 16111, [15933] = 16110, + [15935] = 12226, [18238] = 13939, [18239] = 13940, [18240] = 13942, + [18241] = 13941, [18242] = 13943, [18243] = 13945, [18244] = 13946, + [18245] = 13947, [18246] = 13948, [18247] = 13949, [20626] = 16767, + [20916] = 17062, [21143] = 17200, [21144] = 17201, [22480] = 18046, + [22761] = 18267, [24418] = 20075, [25659] = 21025, [25704] = 21099, + [25954] = 21219, [28267] = 22647, [33276] = 27685, [33277] = 27686, + [33278] = 27687, [33279] = 27684, [33284] = 27688, [33285] = 27689, + [33286] = 27690, [33287] = 27691, [33288] = 27692, [33289] = 27693, + [33290] = 27694, [33291] = 27695, [33292] = 27696, [33293] = 27697, + [33294] = 27698, [33295] = 27699, [33296] = 27700, [36210] = 30156, + [38867] = 31675, [38868] = 31674, [43707] = 33870, [43758] = 33871, + [43761] = 33869, [43765] = 33873, [43772] = 33875, [43779] = 33925, + [45022] = 34413, [45555] = 43018, [45556] = 43019, [45557] = 43020, + [45558] = 43021, [45559] = 43022, [45567] = 43023, [45568] = 43024, + [45570] = 43026, [45571] = 43025, [45695] = 34834, [46684] = 35564, + [46688] = 35566, [53056] = 39644, [57423] = 43017, [57433] = 43027, + [57434] = 43028, [57435] = 43029, [57436] = 43030, [57437] = 43031, + [57438] = 43032, [57439] = 43033, [57440] = 43034, [57441] = 43035, + [57442] = 43036, [57443] = 43037, [58512] = 43507, [58521] = 43508, + [58523] = 43509, [58525] = 43510, [58527] = 43505, [58528] = 43506, + [62350] = 44954, + + ------------------------------------------------------------------------------- + -- Enchanting + ------------------------------------------------------------------------------- + [7443] = 6342, [7766] = 6344, [7776] = 6346, [7782] = 6347, + [7786] = 6348, [7793] = 6349, [7859] = 6375, [7867] = 6377, + [13380] = 11038, [13419] = 11039, [13464] = 11081, [13522] = 11098, + [13536] = 11101, [13612] = 11150, [13617] = 11151, [13620] = 11152, + [13646] = 11163, [13653] = 11164, [13655] = 11165, [13687] = 11167, + [13689] = 11168, [13698] = 11166, [13817] = 11202, [13841] = 11203, + [13846] = 11204, [13868] = 11205, [13882] = 11206, [13898] = 11207, + [13915] = 11208, [13931] = 11223, [13933] = 11224, [13945] = 11225, + [13947] = 11226, [15596] = 11813, [15596] = 45050, + [20009] = 16218, [20010] = 16246, [20011] = 16251, [20012] = 16219, + [20014] = 16216, [20015] = 16224, [20016] = 16222, + [20017] = 16217, [20020] = 16215, [20023] = 16245, [20024] = 16220, + [20025] = 16253, [20026] = 16221, [20028] = 16242, [20029] = 16223, + [20030] = 16247, [20031] = 16250, [20032] = 16254, [20033] = 16248, + [20034] = 16252, [20035] = 16255, [20036] = 16249, [20051] = 16243, + [21931] = 17725, [22749] = 18259, [22750] = 18260, [23799] = 19444, + [23800] = 19445, [23801] = 19446, [23802] = 19447, [23803] = 19448, + [23804] = 19449, [25072] = 33153, [25072] = 20726, [25073] = 20727, + [25074] = 20728, [25078] = 20729, [25079] = 20730, [25080] = 33152, + [25080] = 20731, [25081] = 20732, [25082] = 20733, [25083] = 33149, + [25083] = 20734, [25084] = 20735, [25084] = 33150, [25084] = 33151, + [25086] = 20736, [25086] = 33148, [25124] = 20758, [25125] = 20752, + [25126] = 20753, [25127] = 20754, [25128] = 20755, [25129] = 20756, + [25130] = 20757, [27837] = 22392, [27906] = 22530, [27911] = 22531, + [27911] = 24000, [27913] = 22532, [27914] = 22533, [27917] = 22534, + [27920] = 22535, [27924] = 22536, [27926] = 22537, [27927] = 22538, + [27945] = 22539, [27946] = 22540, [27947] = 22541, [27948] = 35298, + [27948] = 22542, [27950] = 22543, [27951] = 22544, [27954] = 22545, + [27960] = 24003, [27960] = 22547, [27962] = 22548, [27967] = 22552, + [27968] = 22551, [27971] = 22554, [27972] = 22553, [27975] = 22555, + [27977] = 22556, [27981] = 22560, [27982] = 22561, [27984] = 22559, + [28003] = 22558, [28004] = 22557, [28016] = 22562, [28019] = 22563, + [28022] = 22565, [32665] = 25848, [32667] = 25849, [33992] = 28270, + [33994] = 28271, [33997] = 28272, [33999] = 28273, [34003] = 28274, + [34005] = 28276, [34006] = 28277, [34007] = 35299, [34007] = 28279, + [34008] = 35297, [34008] = 28280, [34009] = 28282, [34010] = 28281, + [42620] = 33165, [42974] = 33307, [44483] = 37332, [44494] = 37333, + [44524] = 37344, [44556] = 37331, [44575] = 44484, [44576] = 44494, + [44588] = 37340, [44590] = 37334, [44591] = 37347, [44595] = 44473, + [44596] = 37330, [44621] = 37339, [44625] = 44485, [44631] = 37349, + [45765] = 34872, [46578] = 35498, [46594] = 35500, [47051] = 35756, + [47672] = 44471, [47898] = 44472, [47899] = 44488, [47901] = 44491, + [59619] = 44496, [59621] = 44492, [59625] = 44495, [60691] = 44483, + [60692] = 44489, [60707] = 44486, [60714] = 44487, [60763] = 44490, + [60767] = 44498, [62256] = 44944, [62257] = 44945, [62948] = 45059, + [64441] = 46027, [64579] = 46348, + + ------------------------------------------------------------------------------- + --Engineering + ------------------------------------------------------------------------------- + [3928] = 4408, [3933] = 4409, [3939] = 13309, [3940] = 4410, + [3944] = 4411, [3952] = 14639, [3954] = 4412, [3957] = 13308, + [3959] = 4413, [3960] = 4414, [3966] = 4415, [3968] = 4416, + [3969] = 13311, [3971] = 7742, [3972] = 4417, [3979] = 13310, + [8243] = 6672, [8339] = 6716, [9269] = 7560, [9273] = 7561, + [12587] = 10601, [12597] = 10602, [12607] = 10603, [12614] = 10604, + [12615] = 10605, [12616] = 10606, [12617] = 10607, [12620] = 10608, + [12624] = 10609, [15628] = 11828, [15633] = 11827, [19790] = 16041, + [19791] = 16042, [19792] = 16043, [19793] = 16044, [19794] = 16045, + [19795] = 16047, [19796] = 16048, [19799] = 16049, [19800] = 16051, + [19814] = 16046, [19815] = 16050, [19819] = 16052, [19825] = 16053, + [19830] = 16054, [19831] = 16055, [19833] = 16056, [21940] = 17720, + [22793] = 18290, [22795] = 18292, [22797] = 18291, [23066] = 18647, + [23067] = 18649, [23068] = 18648, [23069] = 18650, [23071] = 18651, + [23077] = 18652, [23078] = 18653, [23079] = 18655, [23080] = 18656, + [23081] = 18657, [23082] = 18658, [23096] = 18654, [23129] = 18661, + [23507] = 19027, [24356] = 20000, [24357] = 20001, [26416] = 21724, + [26417] = 21725, [26418] = 21726, [26420] = 21727, [26421] = 21728, + [26422] = 21729, [26423] = 21730, [26424] = 21731, [26425] = 21732, + [26426] = 21733, [26427] = 21734, [26428] = 21735, [26442] = 44919, + [26443] = 44918, [28327] = 22729, [30313] = 23799, [30314] = 23800, + [30315] = 23802, [30316] = 23803, [30317] = 23804, [30318] = 23805, + [30325] = 23806, [30329] = 23807, [30332] = 23808, [30334] = 23809, + [30337] = 23810, [30341] = 23811, [30344] = 23814, [30347] = 23815, + [30348] = 23816, [30349] = 23817, [30547] = 23874, [30548] = 23888, + [30551] = 35310, [30552] = 35311, [30556] = 23887, [32814] = 25887, + [39895] = 32381, [43676] = 33804, [44391] = 34114, [46106] = 35191, + [46107] = 35187, [46108] = 35189, [46109] = 35190, [46110] = 35192, + [46111] = 35186, [46112] = 35193, [46113] = 35194, [46114] = 35195, + [46115] = 35196, [46116] = 35197, [46697] = 35582, [60866] = 44502, [60867] = 44503, + + ------------------------------------------------------------------------------- + --Inscription + ------------------------------------------------------------------------------- + + ------------------------------------------------------------------------------- + --Jewelcrafting + ------------------------------------------------------------------------------- + [25320] = 20856, [25323] = 20855, [25339] = 20854, [25610] = 20970, + [25612] = 20971, [25617] = 20973, [25618] = 20974, [25619] = 20975, + [25622] = 20976, [26873] = 21940, [26875] = 21941, [26878] = 21942, + [26881] = 21943, [26882] = 21944, [26887] = 21945, [26896] = 21947, + [26897] = 21948, [26900] = 21949, [26906] = 21952, [26909] = 21953, + [26910] = 21954, [26912] = 21955, [26914] = 21956, [26915] = 21957, + [28903] = 23130, [28905] = 23131, [28906] = 23133, [28907] = 23134, + [28910] = 23135, [28912] = 23136, [28914] = 23137, [28915] = 23138, + [28916] = 23140, [28917] = 23141, [28918] = 31359, [28924] = 23143, + [28927] = 23145, [28933] = 23146, [28936] = 23147, + [28938] = 23148, [28944] = 23149, [28947] = 23150, [28948] = 23151, + [28950] = 23152, [28953] = 23153, [28955] = 23154, [28957] = 23155, + [31053] = 24158, [31054] = 24159, [31055] = 24160, [31056] = 24161, + [31057] = 24162, [31058] = 24163, [31060] = 24164, [31061] = 24165, + [31062] = 24174, [31063] = 24175, [31064] = 24176, [31065] = 24177, + [31066] = 24178, [31067] = 24166, [31068] = 24167, [31070] = 24168, + [31071] = 24169, [31072] = 24170, [31076] = 24171, [31077] = 24172, + [31078] = 24173, [31079] = 24179, [31080] = 31358, [31081] = 24181, + [31082] = 24182, [31083] = 24183, [31084] = 24193, [31085] = 24194, + [31087] = 24195, [31088] = 35305, [31089] = 35306, [31090] = 24197, + [31091] = 24198, [31092] = 35304, [31094] = 24201, [31095] = 24202, + [31096] = 24203, [31097] = 24204, [31098] = 35307, [31099] = 24206, + [31100] = 24207, [31101] = 24208, [31102] = 24209, [31103] = 24210, + [31104] = 24211, [31105] = 24212, [31106] = 24213, [31107] = 24214, + [31108] = 24215, [31109] = 24216, [31110] = 24217, [31111] = 24218, + [31112] = 24219, [31113] = 24220, [31149] = 24200, [32866] = 25902, + [32867] = 25903, [32868] = 25905, [32869] = 25906, [32870] = 25904, + [32871] = 25907, [32872] = 25909, [32873] = 25908, [32874] = 25910, + [34069] = 28291, [34590] = 28596, [37855] = 30826, [38503] = 31401, + [38504] = 31402, [39451] = 31870, [39452] = 31875, [39455] = 31871, + [39458] = 31872, [39462] = 31877, [39463] = 31876, [39466] = 31873, + [39467] = 31874, [39470] = 31878, [39471] = 31879, [39705] = 35244, + [39706] = 35246, [39710] = 35250, [39711] = 35248, [39712] = 35245, + [39713] = 35249, [39714] = 35247, [39715] = 35263, [39716] = 35264, + [39717] = 35262, [39718] = 35265, [39719] = 35255, [39720] = 35260, + [39721] = 35259, [39722] = 35256, [39723] = 35261, [39724] = 35258, + [39725] = 35257, [39727] = 35243, [39728] = 35242, [39729] = 35238, + [39730] = 35240, [39731] = 35239, [39732] = 35241, [39733] = 35267, + [39734] = 35269, [39735] = 35268, [39736] = 35266, [39737] = 35270, + [39738] = 35271, [39739] = 35252, [39740] = 35254, [39741] = 35251, + [39742] = 35253, [39961] = 33622, [39963] = 32411, [42558] = 33305, + [42588] = 33155, [42589] = 33156, [42590] = 33157, [42591] = 33158, + [42592] = 33159, [42593] = 33160, [43493] = 33783, [44794] = 34689, + [46122] = 35198, [46123] = 35538, [46124] = 35200, [46125] = 35201, + [46126] = 35533, [46127] = 35203, [46403] = 35322, [46404] = 35323, + [46405] = 35325, [46597] = 35502, [46601] = 35505, [46775] = 35695, + [46776] = 35696, [46777] = 35697, [46778] = 35698, [46779] = 35699, + [46803] = 35708, [47053] = 35769, [47054] = 35766, [47055] = 35767, + [47056] = 35768, [48789] = 37504, [53830] = 41576, [53857] = 41559, + [53865] = 41575, [53869] = 41574, [53875] = 41566, [53877] = 41562, + [53879] = 41565, [53884] = 41563, [53885] = 41561, [53888] = 41564, + [53917] = 41567, [53919] = 41572, [53921] = 41568, [53924] = 41571, + [53929] = 41573, [53932] = 41570, [53933] = 41569, [53943] = 41560, + [53945] = 41577, [53946] = 41718, [53948] = 41719, [53949] = 41578, + [53950] = 41817, [53951] = 41790, [53952] = 42138, [53954] = 41581, + [53955] = 41728, [53957] = 41720, [53958] = 41580, [53959] = 41791, + [53960] = 41727, [53961] = 41579, [53962] = 41784, [53963] = 41747, + [53964] = 41785, [53965] = 41725, [53966] = 41783, [53967] = 41701, + [53968] = 41740, [53970] = 41796, [53971] = 41703, [53972] = 41820, + [53973] = 41702, [53974] = 41726, [53975] = 41789, [53976] = 41777, + [53977] = 41780, [53978] = 41734, [53979] = 41794, [53980] = 41582, + [53981] = 41733, [53982] = 41792, [53983] = 41689, [53984] = 41686, + [53985] = 41688, [53986] = 41730, [53987] = 41690, [53988] = 41721, + [53990] = 41732, [53991] = 41687, [53992] = 41779, [53993] = 41722, + [53994] = 41818, [53995] = 41795, [53996] = 41723, [53997] = 41698, + [53998] = 41697, [54000] = 41738, [54001] = 41693, [54002] = 41699, + [54003] = 41781, [54004] = 41782, [54005] = 41737, [54006] = 41694, + [54008] = 41724, [54009] = 41696, [54010] = 41739, [54011] = 41692, + [54012] = 41819, [54013] = 41736, [54014] = 41735, [54019] = 41793, + [54023] = 41778, [55384] = 41705, [55387] = 41743, [55388] = 41744, + [55389] = 41704, [55390] = 41786, [55392] = 41706, [55393] = 41742, + [55395] = 41787, [55396] = 41708, [55397] = 41798, [55398] = 41799, + [55400] = 41710, [55401] = 41797, [55403] = 41711, [55404] = 41709, + [55405] = 41788, [55407] = 41707, [56049] = 42298, [56052] = 42301, + [56053] = 42309, [56054] = 42299, [56055] = 42314, [56056] = 42302, + [56074] = 42300, [56076] = 42303, [56077] = 42304, [56079] = 42305, + [56081] = 42306, [56083] = 42307, [56084] = 42308, [56085] = 42310, + [56086] = 42311, [56087] = 42312, [56088] = 42313, [56089] = 42315, + [56496] = 42648, [56497] = 42649, [56498] = 42650, [56499] = 42651, + [56500] = 42652, [56501] = 42653, [58147] = 43317, [58148] = 43318, + [58149] = 43319, [58150] = 43320, [58492] = 43485, [58507] = 43497, + [58954] = 43597, [66556] = 46937, [66447] = 46917 , [66429] = 46899, + [66557] = 46938, [66430] = 46900, [66432] = 46902, [66433] = 46903, + [66497] = 46924, [66561] = 46942, [66434] = 46904, [66498] = 46925, + [66499] = 46926, [66436] = 46906, [66500] = 46927, [66437] = 46907, + [66501] = 46928, [66565] = 46946, [66438] = 46908, [66502] = 46929, + [66566] = 46947, [66439] = 46909, [66503] = 46930 , [66567] = 46948, + [66440] = 46910, [66504] = 46931, [66441] = 46911, [66505] = 46932, + [66569] = 46950, [66442] = 46912, [66506] = 46933, [66570] = 46951, + [66443] = 46913, [66444] = 46914, [66572] = 46953, [66445] = 46915, + [66573] = 46956, [66446] = 46916, [66574] = 47007, [66575] = 47008, + [66448] = 46918, [66576] = 47010, [66449] = 46919, [66577] = 47011, + [66450] = 46920, [66578] = 47012, [66451] = 46921, [66579] = 47015, + [66452] = 46922, [66580] = 47016, [66453] = 46923, [66581] = 47017, + [66582] = 47018, [66583] = 47019, [66584] = 47020, [66586] = 47022, + [68253] = 49112, [66338] = 46897, [66571] = 46952, [66564] = 46945, + [66562] = 46943, [66560] = 46941, [66558] = 46939, [66554] = 46935, + [66559] = 46940, [66585] = 47021, [66555] = 46936, [66587] = 47023, + [66431] = 46901, [66428] = 46898, [66435] = 46905, [66563] = 46944, + [66553] = 46934 , [66568] = 46949, + + ------------------------------------------------------------------------------- + --Leatherworking + ------------------------------------------------------------------------------- + [2158] = 2406, [2163] = 2407, [2164] = 2408, [2169] = 2409, + [3762] = 4293, [3765] = 7360, [3767] = 4294, [3769] = 4296, + [3771] = 4297, [3772] = 7613, [3773] = 4299, [3775] = 4298, + [3777] = 4300, [3778] = 14635, [3779] = 4301, [4096] = 13287, + [4097] = 13288, [5244] = 5083, [6702] = 5786, [6703] = 5787, + [6704] = 5788, [6705] = 5789, [7133] = 5972, [7149] = 5973, + [7153] = 5974, [7953] = 6474, [7954] = 6475, [7955] = 6476, + [8322] = 6710, [9064] = 7288, [9070] = 7289, [9072] = 7290, + [9146] = 7361, [9147] = 7362, [9148] = 7363, [9149] = 7364, + [9195] = 7449, [9197] = 7450, [9202] = 7451, [9207] = 7452, + [9208] = 7453, [10490] = 8384, [10509] = 8385, [10516] = 8409, + [10520] = 8386, [10525] = 8395, [10529] = 8403, [10531] = 8387, + [10533] = 8397, [10542] = 8398, [10544] = 8404, [10546] = 8405, + [10554] = 8399, [10560] = 8389, [10562] = 8390, [10564] = 8400, + [10566] = 8406, [10568] = 8401, [10570] = 8402, [10572] = 8407, + [10574] = 8408, [19048] = 15724, [19049] = 15725, [19050] = 15726, + [19051] = 15727, [19052] = 15728, [19053] = 15729, [19054] = 15730, + [19055] = 15731, [19059] = 15732, [19060] = 15733, [19061] = 15734, + [19062] = 15735, [19063] = 15737, [19064] = 15738, [19065] = 15739, + [19066] = 15740, [19067] = 15741, [19068] = 20253, [19070] = 15743, + [19071] = 15744, [19072] = 15745, [19073] = 15746, [19074] = 15747, + [19075] = 15748, [19076] = 15749, [19077] = 15751, [19078] = 15752, + [19079] = 15753, [19080] = 20254, [19081] = 15755, [19082] = 15756, + [19083] = 15757, [19084] = 15758, [19085] = 15759, [19086] = 15760, + [19087] = 15761, [19088] = 15762, [19089] = 15763, [19090] = 15764, + [19091] = 15765, [19092] = 15768, [19093] = 15769, [19094] = 15770, + [19095] = 15771, [19097] = 15772, [19098] = 15773, [19100] = 15774, + [19101] = 15775, [19102] = 15776, [19103] = 15777, [19104] = 15779, + [19107] = 15781, [20853] = 17022, [20854] = 17023, [20855] = 17025, + [21943] = 17722, [22711] = 18239, [22727] = 18252, [22921] = 18514, + [22922] = 18515, [22923] = 18516, [22926] = 18517, [22927] = 18518, + [22928] = 18519, [23190] = 18731, [23399] = 18949, [23703] = 19326, + [23704] = 19327, [23705] = 19328, [23706] = 19329, [23707] = 19330, + [23708] = 19331, [23709] = 19332, [23710] = 19333, [24121] = 19769, + [24122] = 19770, [24123] = 19771, [24124] = 19772, [24125] = 19773, + [24703] = 20382, [24846] = 20506, [24847] = 20507, [24848] = 20508, + [24849] = 20509, [24850] = 20510, [24851] = 20511, [24940] = 20576, + [26279] = 21548, [28472] = 22771, [28473] = 22770, [28474] = 22769, + [32455] = 25720, [32457] = 25721, [32458] = 25722, [32461] = 25725, + [32482] = 25726, [32485] = 25728, [32487] = 25729, [32488] = 25731, + [32489] = 25730, [32490] = 25732, [32493] = 25733, [32494] = 25734, + [32495] = 25735, [32496] = 25736, [32497] = 25737, [32498] = 29213, + [32499] = 29214, [32500] = 29215, [32501] = 29217, [32502] = 29219, + [32503] = 29218, [35520] = 29669, [35521] = 29672, [35522] = 29673, + [35523] = 29674, [35524] = 29675, [35525] = 29677, [35526] = 29682, + [35527] = 29684, [35528] = 29691, [35529] = 29689, [35530] = 30444, + [35531] = 29693, [35532] = 29698, [35533] = 29700, [35534] = 29701, + [35535] = 29702, [35536] = 29703, [35537] = 29704, [35538] = 29713, + [35539] = 34175, [35543] = 29717, [35544] = 34173, [35549] = 31361, + [35554] = 31362, [35555] = 29720, [35557] = 29721, [35558] = 29723, + [35559] = 35302, [35560] = 29725, [35561] = 29726, [35562] = 35303, + [35563] = 29728, [35564] = 29729, [35567] = 29730, [35568] = 35300, + [35572] = 29732, [35573] = 35301, [35574] = 29734, [36349] = 30301, + [36351] = 30302, [36352] = 30303, [36353] = 30304, [36355] = 30305, + [36357] = 30306, [36358] = 30307, [36359] = 30308, [39997] = 32429, + [40001] = 32431, [40002] = 32432, [40003] = 32433, [40004] = 32434, + [40005] = 32435, [40006] = 32436, [41156] = 32744, [41157] = 35523, + [41158] = 35527, [41160] = 35528, [41161] = 35517, [41162] = 35524, + [41163] = 35520, [41164] = 35521, [42546] = 33124, [42731] = 33205, + [44359] = 34200, [44768] = 34218, [44953] = 34262, [45117] = 34491, + [46132] = 35546, [46133] = 35541, [46134] = 35214, [46135] = 35215, + [46136] = 35216, [46137] = 35217, [46138] = 35218, [46139] = 35549, + [50970] = 44509, [50971] = 44510, [52733] = 32430, [57683] = 43097, + [57692] = 44559, [57694] = 44560, [57696] = 44561, [57699] = 44562, + [57701] = 44563, [60645] = 44511, [60647] = 44512, [60697] = 44513, + [60702] = 44514, [60703] = 44515, [60704] = 44516, [60705] = 44517, + [60706] = 44518, [60711] = 44519, [60712] = 44520, [60715] = 44521, + [60716] = 44522, [60718] = 44523, [60720] = 44524, [60721] = 44525, + [60723] = 44526, [60725] = 44527, [60727] = 44528, [60728] = 44530, + [60729] = 44531, [60730] = 44532, [60731] = 44533, [60732] = 44534, + [60734] = 44535, [60735] = 44536, [60737] = 44537, [60743] = 44538, + [60746] = 44539, [60747] = 44540, [60748] = 44541, [60749] = 44542, + [60750] = 44543, [60751] = 44544, [60752] = 44545, [60754] = 44546, + [60755] = 44547, [60756] = 44548, [60757] = 44549, [60758] = 44550, + [60759] = 44551, [60760] = 44552, [60761] = 44553, [60996] = 44584, + [60997] = 44585, [60998] = 44586, [60999] = 44587, [61000] = 44588, + [61002] = 44589, [62176] = 44932, [62177] = 44933, [63194] = 45094, + [63195] = 45095, [63196] = 45096, [63197] = 45097, [63198] = 45098, + [63199] = 45099, [63200] = 45100, [63201] = 45101, + + ------------------------------------------------------------------------------- + --Smelting + ------------------------------------------------------------------------------- + [22967] = 44956, [46353] = 35273, + + ------------------------------------------------------------------------------- + --Tailoring + ------------------------------------------------------------------------------- + [2389] = 2598, [2403] = 2601, [3758] = 4292, [3844] = 4346, + [3847] = 4345, [3849] = 4347, [3851] = 4349, [3854] = 7114, + [3856] = 4350, [3857] = 14630, [3858] = 4351, [3860] = 4352, + [3862] = 4355, [3863] = 4353, [3864] = 4356, [3868] = 4348, + [3869] = 14627, [3870] = 6401, [3872] = 4354, [3873] = 10728, + [6686] = 5771, [6688] = 5772, [6692] = 5773, [6693] = 5774, + [6695] = 5775, [7629] = 6271, [7630] = 6270, [7633] = 6272, + [7639] = 6274, [7643] = 6275, [7892] = 6390, [7893] = 6391, + [8780] = 7092, [8782] = 7091, [8784] = 7090, [8786] = 7089, + [8789] = 7087, [8793] = 7084, [8795] = 7085, [8797] = 7086, + [8802] = 7088, [12047] = 10316, [12056] = 10300, [12059] = 10301, + [12060] = 10302, [12064] = 10311, [12066] = 10312, [12075] = 10314, + [12078] = 10315, [12080] = 10317, [12081] = 10318, [12084] = 10320, + [12085] = 10321, [12086] = 10463, [12089] = 10323, [12091] = 10325, + [12093] = 10326, [18403] = 14466, [18404] = 14467, [18405] = 14468, + [18406] = 14469, [18407] = 14470, [18408] = 14471, [18409] = 14472, + [18410] = 14473, [18411] = 14474, [18412] = 14476, [18413] = 14477, + [18414] = 14478, [18415] = 14479, [18416] = 14480, [18417] = 14481, + [18418] = 14482, [18419] = 14483, [18420] = 14484, [18421] = 14485, + [18422] = 14486, [18423] = 14488, [18424] = 14489, [18434] = 14490, + [18436] = 14493, [18437] = 14492, [18438] = 14491, [18439] = 14494, + [18440] = 14497, [18441] = 14495, [18442] = 14496, [18444] = 14498, + [18445] = 14499, [18446] = 14500, [18447] = 14501, [18448] = 14507, + [18449] = 14504, [18450] = 14505, [18451] = 14506, [18452] = 14509, + [18453] = 14508, [18454] = 14511, [18455] = 14510, [18456] = 14512, + [18457] = 14513, [18458] = 14514, [18560] = 14526, [20848] = 17017, + [20849] = 17018, [21945] = 17724, [22759] = 18265, [22866] = 18414, + [22867] = 18415, [22868] = 18416, [22869] = 18417, [22870] = 18418, + [22902] = 18487, [23662] = 19215, [23663] = 19218, [23664] = 19216, + [23665] = 19217, [23666] = 19219, [23667] = 19220, [24091] = 19764, + [24092] = 19765, [24093] = 19766, [24901] = 20546, [24902] = 20548, + [24903] = 20547, [26085] = 21358, [26087] = 21371, [26403] = 44916, + [26407] = 44917, [26747] = 21892, [26749] = 21893, [26750] = 21894, + [26751] = 21895, [26752] = 21908, [26753] = 21909, [26754] = 21910, + [26755] = 21911, [26756] = 21912, [26757] = 21914, [26758] = 21913, + [26759] = 21915, [26760] = 21916, [26761] = 21918, [26762] = 21917, + [26763] = 21919, [26773] = 21896, [26774] = 21897, [26775] = 21898, + [26776] = 21899, [26777] = 21900, [26778] = 21901, [26779] = 21902, + [26780] = 21903, [26781] = 21904, [26782] = 21905, [26783] = 21906, + [26784] = 21907, [27658] = 22307, [27659] = 22308, [27660] = 22309, + [27724] = 22310, [27725] = 22312, [28210] = 22683, [28480] = 22774, + [28481] = 22773, [28482] = 22772, [31373] = 24316, [31430] = 24292, + [31431] = 24293, [31432] = 24294, [31433] = 24295, [31434] = 35308, + [31435] = 24297, [31437] = 24298, [31438] = 24299, [31440] = 24300, + [31441] = 24301, [31442] = 35309, [31443] = 24303, [31444] = 24304, + [31448] = 24305, [31449] = 24306, [31450] = 24307, [31451] = 24308, + [31452] = 24309, [31453] = 24310, [31454] = 24311, [31455] = 24312, + [31456] = 24313, [31459] = 24314, [36315] = 30280, [36316] = 30281, + [36317] = 30282, [36318] = 30283, [36686] = 30483, [37873] = 30833, + [37882] = 30842, [37883] = 30843, [37884] = 30844, [40020] = 32437, + [40021] = 32438, [40023] = 32439, [40024] = 32440, [40060] = 32447, + [41205] = 35518, [41206] = 32755, [41207] = 32752, [41208] = 32753, + [44950] = 34261, [44958] = 34319, [46128] = 35204, [46129] = 35205, + [46130] = 35206, [46131] = 35207, [49677] = 37915, [50194] = 38229, + [50644] = 38327, [50647] = 38328, [55993] = 42172, [55994] = 42173, + [55996] = 42175, [55997] = 42177, [55998] = 42176, [55999] = 42178, + [56004] = 42183, [56005] = 42184, [56006] = 42185, [56009] = 42187, + [56011] = 42188, [63924] = 45774, +} + +------------------------------------------------------------------------------- +-- Look up table of spell IDs for recipes which do not have a player flag +-- BASICALLY A TEMPORARY STORAGE FOR IDS, SO WE CAN SEE CLEANER SCANS AND WHAT NOT, +-- WE'LL GO BACK HERE LATER DOWN THE ROAD. +------------------------------------------------------------------------------- +local NO_PLAYER_FLAG = { + [30344] = true, [30341] = true, [32814] = true, [23066] = true, + [26421] = true, [36955] = true, [19788] = true, [23129] = true, + [26422] = true, [12715] = true, [12899] = true, [56459] = true, + [30307] = true, [26423] = true, [3918] = true, [23067] = true, + [30308] = true, [3953] = true, [15255] = true, [26424] = true, + [30548] = true, [44157] = true, [56462] = true, [19567] = true, + [30552] = true, [23068] = true, [44155] = true, [28327] = true, + [26425] = true, [56461] = true, [68067] = true, [15633] = true, + [23096] = true, [12589] = true, [26442] = true, [26426] = true, + [67920] = true, [9273] = true, [3926] = true, [6458] = true, + [19793] = true, [55252] = true, [9271] = true, [26427] = true, + [26443] = true, [30551] = true, [23486] = true, [3922] = true, + [3924] = true, [12590] = true, [3928] = true, [3942] = true, + [26428] = true, [3952] = true, [22704] = true, [12902] = true, + [30569] = true, [15628] = true, [12895] = true, [21940] = true, + [56349] = true, [12584] = true, [56477] = true, [30348] = true, + [26416] = true, [53281] = true, [23507] = true, [12075] = true, + [12079] = true, [26746] = true, [56000] = true, + + ----------------------------------------------------------------------------------------- + ---JEWELCRAFTING + ----------------------------------------------------------------------------------------- + [55401] = true, [53995] = true, [66432] = true, [25255] = true, +[66497] = true, [53996] = true, [56074] = true, [56202] = true, + [66434] = true, [32801] = true, [28948] = true, [53997] = true, + [39963] = true, [32866] = true, [66501] = true, [39452] = true, + [53934] = true, [66502] = true, [55405] = true, [58954] = true, + [56205] = true, [37855] = true, [38175] = true, [25305] = true, + [25321] = true, [66505] = true, [54000] = true, [39742] = true, + [56206] = true, [66506] = true, [32869] = true, [54001] = true, + [56079] = true, [32259] = true, [32870] = true, [56208] = true, + [32807] = true, [32871] = true, [26873] = true, [31061] = true, + [32872] = true, [42591] = true, [46779] = true, [56530] = true, + [42592] = true, [31062] = true, [56083] = true, [32874] = true, + [56531] = true, [31063] = true, [56085] = true, [38503] = true, + [56086] = true, [28938] = true, [38504] = true, [31064] = true, + [31096] = true, [55384] = true, [25278] = true, [68253] = true, + [43493] = true, [26925] = true, [31065] = true, [46403] = true, + [53852] = true, [53916] = true, [39722] = true, [25615] = true, + [28924] = true, [26926] = true, [53853] = true, [36526] = true, + [31098] = true, [55388] = true, [46405] = true, [53854] = true, + [39724] = true, [55389] = true, [26927] = true, [31051] = true, + [53919] = true, [39725] = true, [55390] = true, [53856] = true, + [53920] = true, [53952] = true, [26880] = true, [53857] = true, + [31052] = true, [34069] = true, [25490] = true, [55393] = true, + [39451] = true, [53956] = true, [44794] = true, [36524] = true, + [55395] = true, [38068] = true, [28944] = true, [53957] = true, + [31066] = true, [31082] = true, [66428] = true, [26909] = true, + [55396] = true, [31097] = true, [25284] = true, [56084] = true, + [62941] = true, [66431] = true, [53894] = true, [53958] = true, + [58146] = true, [31099] = true, [47053] = true, [31067] = true, + [28917] = true, [26903] = true, [36525] = true, [66503] = true, + [56197] = true, [47054] = true, [53961] = true, [39715] = true, + [31092] = true, [53960] = true, [31077] = true, [31101] = true, + [39719] = true, [55399] = true, [31113] = true, [32808] = true, + [53917] = true, [63743] = true, [39720] = true, [39721] = true, + [42590] = true, [58149] = true, [56199] = true, [47056] = true, + [28950] = true, [47280] = true, [32809] = true, [31072] = true, +[25318] = true, [66429] = true, [62242] = true, +--------------------------------------------------------------------------------------- + +--------------------------------------------------------------------------------------- +---COOKING +--------------------------------------------------------------------------------------- +[62050]= true, [22761]= true, [62051]= true, [8607]= true, +[18238]= true, [6413]= true, [6417]= true, [42296]= true, +[45557]= true, [6501]= true, [45558]= true, [18239]= true, + [7752]= true, [7828]= true, [45560]= true, [64358]= true, + [57421]= true, [45561]= true, [13028]= true, [2543]= true, + [2545]= true, [25659]= true, [58512]= true, [45565]= true, + [42305]= true, [45566]= true, [62350]= true, [7753]= true, + [45695]= true, [9513]= true, [18244]= true, [20626]= true, + [45569]= true, [43779]= true, [18245]= true, [45571]= true, + [18246]= true, [37836]= true, [57433]= true, [20916]= true, + [58521]= true, [18247]= true, [57435]= true, [7754]= true, + [53056]= true, [58523]= true, [57437]= true, [57438]= true, + [58525]= true, [45570]= true, [2538]= true, [2540]= true, + [2548]= true, [33290]= true, [45562]= true, [15906]= true, + [18241]= true, [45559]= true, [45551]= true, [57443]= true, + [58527]= true, [43758]= true, [58528]= true, [8238]= true, + [7751]= true, [7755]= true, [43761]= true, [7827]= true, + [45552]= true, [45553]= true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- + ---BLACKSMITHING + --------------------------------------------------------------------------------------- + [10015] = true, [55202] = true, [16726] = true, [24399] = true, +[15293] = true, [32655] = true, [3320] = true, [40033] = true, +[34545] = true, [61010] = true, [16639] = true, [3115] = true, +[3116] = true, [3117] = true, [16648] = true, [40034] = true, + [9920] = true, [9928] = true, [29558] = true, [55839] = true, + [9964] = true, [7818] = true, [55732] = true, [29694] = true, + [3326] = true, [9950] = true, [59405] = true, [12260] = true, + [16983] = true, [16991] = true, [23650] = true, [16640] = true, + [2741] = true, [3513] = true, [3497] = true, [8768] = true, + [19666] = true, [2662] = true, [2663] = true, [20201] = true, + [16664] = true, [15294] = true, [3496] = true, [16645] = true, + [29569] = true, [2737] = true, [14380] = true, [16992] = true, + [36125] = true, [19667] = true, [22757] = true, [16665] = true, + [59406] = true, [2738] = true, [2739] = true, [2740] = true, + [24913] = true, [9933] = true, [20873] = true, [36126] = true, + [40035] = true, [8880] = true, [23636] = true, [3292] = true, + [3293] = true, [21161] = true, [32656] = true, [19668] = true, + [9921] = true, [7222] = true, [3319] = true, [15295] = true, + [20874] = true, [20890] = true, [3337] = true, [34546] = true, + [16970] = true, [16978] = true, [61008] = true, [7224] = true, + [11454] = true, [19669] = true, [55656] = true, [16667] = true, + [16731] = true, [61009] = true, [9926] = true, [16984] = true, + [21913] = true, [40036] = true, [9974] = true, [32657] = true, + [32285] = true, [23638] = true, [10011] = true, [36131] = true, + [27830] = true, [32284] = true, [16732] = true, [15292] = true, + [15296] = true, [38478] = true, [20876] = true, [38475] = true, + [23653] = true, [3325] = true, [14379] = true, [29729] = true, + [2661] = true, [29728] = true, [16655] = true, [16993] = true, + [3491] = true, [3494] = true, [3501] = true, [9959] = true, + [9983] = true, [36262] = true, [10003] = true, [10007] = true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- +----INSCRIPTION + --------------------------------------------------------------------------------------- + [58315] = true, [58331] = true, [58347] = true, [56974] = true, [56990] = true, +[64256] = true, [64304] = true, [57166] = true, [57709] = true, [57214] = true, + [57230] = true, [50603] = true, [57262] = true, [59338] = true, [58332] = true, + [56959] = true, [56975] = true, [56991] = true, [57007] = true, [57023] = true, + [53462] = true, [64257] = true, [64273] = true, [64289] = true, [57151] = true, + [57167] = true, [57183] = true, [57710] = true, [57215] = true, [57247] = true, + [50620] = true, [58301] = true, [59339] = true, [58333] = true, [59387] = true, + [52840] = true, [59499] = true, [56960] = true, [56976] = true, [57008] = true, + [57024] = true, [64258] = true, [64274] = true, [57168] = true, [57184] = true, + [61288] = true, [57216] = true, [57232] = true, [58286] = true, [58302] = true, + [59340] = true, [48114] = true, [64051] = true, [59484] = true, [59500] = true, + [56961] = true, [56977] = true, [57009] = true, [57025] = true, [61177] = true, + [64259] = true, [57121] = true, [64291] = true, [57153] = true, [57169] = true, + [57185] = true, [57712] = true, [57217] = true, [57233] = true, [58287] = true, + [58303] = true, [58319] = true, [56946] = true, [56978] = true, [56994] = true, + [57010] = true, [57026] = true, [64260] = true, [57122] = true, [57154] = true, + [57170] = true, [57186] = true, [57713] = true, [57218] = true, [57234] = true, + [57266] = true, [59326] = true, [58320] = true, [58336] = true, [59486] = true, + [59502] = true, [56963] = true, [56995] = true, [57011] = true, [57027] = true, + [64261] = true, [64277] = true, [57155] = true, [57187] = true, [57714] = true, + [57219] = true, [57235] = true, [58289] = true, [58305] = true, [58321] = true, + [58337] = true, [69385] = true, [57243] = true, [64314] = true, [64313] = true, + [56958] = true, [59487] = true, [59503] = true, [58288] = true, [56980] = true, + [56996] = true, [57012] = true, [57028] = true, [59501] = true, [56948] = true, + [57264] = true, [64246] = true, [64262] = true, [57124] = true, [64294] = true, + [57156] = true, [57172] = true, [57188] = true, [57715] = true, [57220] = true, + [57236] = true, [57268] = true, [58306] = true, [58322] = true, [58338] = true, + [48247] = true, [57133] = true, [57270] = true, [57131] = true, [57129] = true, + [50604] = true, [59488] = true, [59504] = true, [56965] = true, [56981] = true, + [56997] = true, [57013] = true, [57029] = true, [64280] = true, [57114] = true, + [64286] = true, [58299] = true, [57125] = true, [64295] = true, [64311] = true, + [57164] = true, [57189] = true, [57716] = true, [57221] = true, [57237] = true, + [57269] = true, [58307] = true, [58323] = true, [58339] = true, [64307] = true, + [57119] = true, [57246] = true, [68166] = true, [64282] = true, [57250] = true, + [59489] = true, [56957] = true, [56982] = true, [56998] = true, [57014] = true, + [57117] = true, [64305] = true, [61677] = true, [52843] = true, [57126] = true, + [64296] = true, [57158] = true, [64310] = true, [57190] = true, [56956] = true, + [57238] = true, [60336] = true, [58308] = true, [58324] = true, [58340] = true, + [64315] = true, [56949] = true, [56950] = true, [64308] = true, [56955] = true, + [59490] = true, [59315] = true, [56983] = true, [56999] = true, [64267] = true, + [57031] = true, [56954] = true, [64276] = true, [57249] = true, [64249] = true, + [56953] = true, [57127] = true, [64297] = true, [57159] = true, [64275] = true, + [57191] = true, [57207] = true, [57223] = true, [57239] = true, [50612] = true, + [60337] = true, [57208] = true, [58325] = true, [48121] = true, [56952] = true, + [56947] = true, [56951] = true, [64268] = true, [57123] = true, [59475] = true, + [59491] = true, [56968] = true, [56984] = true, [57000] = true, [48248] = true, + [58565] = true, [58317] = true, [64266] = true, [57252] = true, [64250] = true, + [57112] = true, [57128] = true, [64298] = true, [57160] = true, [58316] = true, + [57703] = true, [57719] = true, [57224] = true, [57240] = true, [57272] = true, + [58310] = true, [58326] = true, [58342] = true, [57201] = true, [56945] = true, +[57200] = true, [56944] = true, [57711] = true, [56985] = true, [57001] = true, +[57199] = true, [57033] = true, [56943] = true, [57198] = true, [64251] = true, +[57113] = true, [64283] = true, [64299] = true, [57161] = true, [57197] = true, +[57704] = true, [57209] = true, [57225] = true, [57241] = true, [50614] = true, +[57273] = true, [58311] = true, [58327] = true, [58343] = true, [52738] = true, +[57196] = true, [64278] = true, [57195] = true, [58318] = true, [64284] = true, +[57006] = true, [64316] = true, [56986] = true, [57002] = true, [59560] = true, +[57034] = true, [58341] = true, [57192] = true, [64252] = true, [67600] = true, + [57130] = true, [64300] = true, [57162] = true, [57244] = true, [57194] = true, + [57210] = true, [57226] = true, [50599] = true, [57258] = true, [58296] = true, + [58312] = true, [58328] = true, [58344] = true, [52739] = true, [58298] = true, + [57274] = true, [57265] = true, [57251] = true, [59478] = true, [56971] = true, + [56987] = true, [57003] = true, [57019] = true, [57035] = true, [57259] = true, + [57263] = true, [57271] = true, [64253] = true, [57115] = true, [64285] = true, + [57242] = true, [57163] = true, [57120] = true, [57706] = true, [57211] = true, + [57227] = true, [50600] = true, [50616] = true, [58297] = true, [58313] = true, + [58329] = true, [58345] = true, [50602] = true, [57248] = true, [59559] = true, + [57157] = true, [57257] = true, [64309] = true, [64317] = true, [56972] = true, + [56988] = true, [57004] = true, [57020] = true, [57036] = true, [62162] = true, + [57030] = true, [64254] = true, [57116] = true, [57132] = true, [64302] = true, + [64318] = true, [64270] = true, [57707] = true, [57212] = true, [57228] = true, + [50601] = true, [57260] = true, [57276] = true, [58314] = true, [58330] = true, + [58346] = true, [45382] = true, [57267] = true, [57275] = true, [64312] = true, + [64279] = true, [50598] = true, [59480] = true, [59496] = true, [56973] = true, + [56989] = true, [57005] = true, [57021] = true, [50619] = true, [50618] = true, + [65245] = true, [50617] = true, [64255] = true, [64271] = true, [64287] = true, + [64303] = true, [57165] = true, [57181] = true, [57708] = true, [57213] = true, + [57229] = true, [57245] = true, [57261] = true, [57277] = true, [57253] = true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- +----ENCHANTING + --------------------------------------------------------------------------------------- + [46578] = true, [25125] = true, [13612] = true, [13620] = true, [13628] = true, +[13640] = true, [13644] = true, [13648] = true, [59625] = true, [13700] = true, + [17181] = true, [27920] = true, [27960] = true, [28016] = true, [45765] = true, + [14810] = true, [63746] = true, [13836] = true, [20008] = true, [20032] = true, + [13868] = true, [13421] = true, [13948] = true, [27905] = true, [27945] = true, + [13501] = true, [7786] = true, [7788] = true, [13529] = true, [32664] = true, + [44506] = true, [25127] = true, [20025] = true, [20033] = true, [13617] = true, + [64579] = true, [60619] = true, [13657] = true, [13693] = true, [27914] = true, + [44555] = true, [27954] = true, [27962] = true, [14807] = true, [32665] = true, + [7421] = true, [13817] = true, [25072] = true, [44492] = true, [44524] = true, + [7443] = true, [44556] = true, [25128] = true, [20026] = true, [7457] = true, + [13378] = true, [34001] = true, [13917] = true, [13933] = true, [13937] = true, + [13941] = true, [44621] = true, [28003] = true, [28027] = true, [13522] = true, + [13538] = true, [25081] = true, [44494] = true, [20011] = true, [25129] = true, + [44590] = true, [47672] = true, [20051] = true, [13622] = true, [13626] = true, + [69412] = true, [60623] = true, [44383] = true, [13698] = true, [13702] = true, + [23804] = true, [44623] = true, [28004] = true, [28028] = true, [14293] = true, + [32667] = true, [13822] = true, [25082] = true, [44576] = true, [20028] = true, + [20036] = true, [13890] = true, [13898] = true, [60609] = true, [59619] = true, + [47898] = true, [7745] = true, [27957] = true, [13503] = true, [34006] = true, + [7793] = true, [7795] = true, [59636] = true, [25083] = true, [20029] = true, + [13631] = true, [13655] = true, [7861] = true, [7863] = true, [62256] = true, + [13695] = true, [13858] = true, [44483] = true, [27968] = true, [7857] = true, + [27967] = true, [42615] = true, [27958] = true, [42613] = true, [25084] = true, + [20017] = true, [33992] = true, [34008] = true, [13663] = true, [60653] = true, + [44528] = true, [14809] = true, [27961] = true, [47901] = true, [7418] = true, + [7420] = true, [44488] = true, [7426] = true, [44616] = true, [13841] = true, + [44596] = true, [17180] = true, [7454] = true, [33993] = true, [34009] = true, + [27950] = true, [20031] = true, [13915] = true, [47900] = true, [13943] = true, + [13947] = true, [13945] = true, [13464] = true, [27927] = true, [7771] = true, + [20014] = true, [20030] = true, [27947] = true, [33994] = true, [28022] = true, + [60692] = true, [25130] = true, [34005] = true, [13794] = true, [7748] = true, + [44588] = true, [15596] = true, [7776] = true, [44584] = true, [13607] = true, + [13653] = true, [20020] = true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- +---TAILORING + --------------------------------------------------------------------------------------- + [12055] = true, [12059] = true, [12071] = true, [46131] = true, [23664] = true, +[31433] = true, [31441] = true, [7624] = true, [26403] = true, [24902] = true, + [22866] = true, [56001] = true, [18411] = true, [18419] = true, [18451] = true, + [28208] = true, [6686] = true, [8766] = true, [23665] = true, [8786] = true, + [26747] = true, [56002] = true, [26763] = true, [26779] = true, [31434] = true, + [31450] = true, [60969] = true, [28480] = true, [22867] = true, [56003] = true, + [18404] = true, [18412] = true, [18420] = true, [12044] = true, [63924] = true, + [12056] = true, [12064] = true, [12080] = true, [12084] = true, [23666] = true, + [56004] = true, [26780] = true, [31459] = true, [7892] = true, [60971] = true, + [28481] = true, [22868] = true, [20848] = true, [56005] = true, [18405] = true, + [19435] = true, [26086] = true, [18437] = true, [18453] = true, [27659] = true, + [28210] = true, [40021] = true, [23667] = true, [26773] = true, [26781] = true, + [26759] = true, [8774] = true, [31460] = true, [24903] = true, [3755] = true, + [37882] = true, [3757] = true, [3758] = true, [50194] = true, [18446] = true, + [6692] = true, [28482] = true, [22869] = true, [18439] = true, [20849] = true, + [18440] = true, [2389] = true, [56007] = true, [18455] = true, [6521] = true, + [18445] = true, [18406] = true, [18414] = true, [18422] = true, [12045] = true, + [36318] = true, [18454] = true, [27660] = true, [24091] = true, [12065] = true, + [12069] = true, [12077] = true, [12081] = true, [12085] = true, [27724] = true, + [12093] = true, [40060] = true, [26087] = true, [26749] = true, [31373] = true, + [26750] = true, [26782] = true, [28205] = true, [28209] = true, [36686] = true, + [3813] = true, [2394] = true, [7629] = true, [18438] = true, [7633] = true, + [40023] = true, [49677] = true, [26407] = true, [18452] = true, [7643] = true, + [22870] = true, [26755] = true, [22902] = true, [3869] = true, [55993] = true, + [8789] = true, [3839] = true, [3841] = true, [3844] = true, [18407] = true, + [18415] = true, [3847] = true, [3848] = true, [3851] = true, [3852] = true, + [24092] = true, [3854] = true, [3856] = true, [3857] = true, [8760] = true, + [27725] = true, [8776] = true, [8780] = true, [8784] = true, [3865] = true, + [55994] = true, [3868] = true, [26783] = true, [3871] = true, [3872] = true, + [3873] = true, [31438] = true, [22759] = true, [12091] = true, [8804] = true, + [8772] = true, [18560] = true, [18447] = true, [44950] = true, [60993] = true, + [55899] = true, [55898] = true, [55995] = true, [2385] = true, [21945] = true, + [6688] = true, [12066] = true, [18416] = true, [8465] = true, [12046] = true, + [18448] = true, [3915] = true, [24093] = true, [8489] = true, [2386] = true, + [12078] = true, [12082] = true, [60994] = true, [55900] = true, [2392] = true, + [2393] = true, [23662] = true, [2396] = true, [55996] = true, [2399] = true, + [26784] = true, [2402] = true, [2403] = true, [2406] = true, [31431] = true, + [3864] = true, [8782] = true, [37884] = true, [37883] = true, [26751] = true, + [50647] = true, [8802] = true, [8467] = true, [7893] = true, [40020] = true, + [41208] = true, [22813] = true, [41207] = true, [37873] = true, [2387] = true, + [55997] = true, [26085] = true, [8799] = true, [27658] = true, [8483] = true, + [3914] = true, [18401] = true, [56006] = true, [18441] = true, [18449] = true, + [28207] = true, [55769] = true, [18413] = true, [18421] = true, [46129] = true, + [2963] = true, [2964] = true, [12061] = true, [12086] = true, [23663] = true, + [26745] = true, [55998] = true, [3863] = true, [8764] = true, [31440] = true, + [31448] = true, [12089] = true, [6695] = true, [40024] = true, [60990] = true, + [50644] = true, [8793] = true, [46130] = true, [24901] = true, [3870] = true, + [31437] = true, [44958] = true, [55999] = true, [3845] = true, [6693] = true, + [3866] = true, [18456] = true, [18410] = true, [18418] = true, [2397] = true, + [18434] = true, [18450] = true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- + ----LEATHERWORKING + --------------------------------------------------------------------------------------- +[9198] = true, [23704] = true, [60996] = true, [35549] = true, [22921] = true, + [50958] = true, [10509] = true, [10525] = true, [19053] = true, [19085] = true, + [19101] = true, [2149] = true, [36349] = true, [2153] = true, [60997] = true, + [2159] = true, [2163] = true, [2165] = true, [35582] = true, [50959] = true, + [46132] = true, [23705] = true, [60998] = true, [22922] = true, [46133] = true, + [24121] = true, [19054] = true, [19070] = true, [19086] = true, [19102] = true, + [32465] = true, [32481] = true, [22331] = true, [35520] = true, [35584] = true, + [9207] = true, [6661] = true, [46134] = true, [23706] = true, [61000] = true, + [35521] = true, [35585] = true, [50962] = true, [10518] = true, [39997] = true, + [24122] = true, [19055] = true, [19087] = true, [19103] = true, [32466] = true, + [32482] = true, [36353] = true, [35522] = true, [35554] = true, [50963] = true, + [44953] = true, [46136] = true, [23707] = true, [61002] = true, [35523] = true, + [35555] = true, [35587] = true, [50964] = true, [46137] = true, [24123] = true, + [19072] = true, [19104] = true, [9064] = true, [9072] = true, [69386] = true, + [32499] = true, [36355] = true, [7133] = true, [35524] = true, [35588] = true, + [7153] = true, [9208] = true, [46138] = true, [23708] = true, [69388] = true, + [35525] = true, [35557] = true, [10487] = true, [10511] = true, [46139] = true, + [24124] = true, [19073] = true, [19089] = true, [32468] = true, [32500] = true, + [10647] = true, [28472] = true, [35526] = true, [35558] = true, [45117] = true, + [60622] = true, [23709] = true, [35527] = true, [3774] = true, [3778] = true, + [3780] = true, [40003] = true, [24125] = true, [19058] = true, [19074] = true, + [32485] = true, [32501] = true, [36359] = true, [3816] = true, [3818] = true, + [28473] = true, [35528] = true, [35560] = true, [9193] = true, [40004] = true, + [23710] = true, [8322] = true, [35529] = true, [35561] = true, [50970] = true, + [2881] = true, [10520] = true, [40005] = true, [10544] = true, [10552] = true, + [10560] = true, [19091] = true, [19107] = true, [32454] = true, [32502] = true, + [28474] = true, [35530] = true, [50971] = true, [62448] = true, [7953] = true, + [41157] = true, [36074] = true, [24846] = true, [35531] = true, [22928] = true, + [28219] = true, [41158] = true, [36075] = true, [32487] = true, [32503] = true, + [7126] = true, [9146] = true, [35532] = true, [35564] = true, [9194] = true, + [9202] = true, [24655] = true, [36076] = true, [24847] = true, [35533] = true, + [5244] = true, [10529] = true, [28220] = true, [19093] = true, [32456] = true, + [52733] = true, [2158] = true, [2160] = true, [2162] = true, [2166] = true, + [24848] = true, [35535] = true, [35567] = true, [28221] = true, [19094] = true, + [44359] = true, [57690] = true, [32457] = true, [32473] = true, [32489] = true, + [9147] = true, [35536] = true, [35568] = true, [9195] = true, [41163] = true, + [6703] = true, [24849] = true, [20853] = true, [10482] = true, [10490] = true, + [28222] = true, [10546] = true, [10554] = true, [41164] = true, [10570] = true, + [19095] = true, [57692] = true, [32458] = true, [10650] = true, [35538] = true, + [42731] = true, [24850] = true, [20854] = true, [44970] = true, [28223] = true, + [19048] = true, [19064] = true, [19080] = true, [57694] = true, [9148] = true, + [35540] = true, [35572] = true, [24851] = true, [20855] = true, [45100] = true, + [10531] = true, [28224] = true, [57696] = true, [10619] = true, [19081] = true, + [22727] = true, [35539] = true, [19079] = true, [10566] = true, [19065] = true, + [10574] = true, [19097] = true, [60647] = true, [3753] = true, [9065] = true, + [44343] = true, [3763] = true, [3767] = true, [3773] = true, [3775] = true, + [3777] = true, [3779] = true, [32455] = true, [24940] = true, [19050] = true, + [19082] = true, [23190] = true, [32461] = true, [60999] = true, [3817] = true, + [44344] = true, [9149] = true, [35544] = true, [9197] = true, [19077] = true, + [9060] = true, [19076] = true, [35573] = true, [40001] = true, [19066] = true, + [19090] = true, [19098] = true, [22711] = true, [57699] = true, [9059] = true, + [32480] = true, [64661] = true, [10562] = true, [40002] = true, [50936] = true, + [6705] = true, [9058] = true, [24703] = true, [22923] = true, [60645] = true, + [35577] = true, [2152] = true, [10556] = true, [10572] = true, [44770] = true, + [36077] = true, [19059] = true, [19075] = true, [35580] = true, [20648] = true, + [2169] = true, [60643] = true, [19088] = true, [6702] = true, [6704] = true, + [35543] = true, [7149] = true, [36078] = true, [36079] = true, [23703] = true, + [35534] = true, [57701] = true, [46135] = true, [19047] = true, [20649] = true, + [40006] = true, [3765] = true, [41156] = true, [3771] = true, [50956] = true, + [19061] = true, [20650] = true, [32467] = true, [35537] = true, [22926] = true, + [4096] = true, [19062] = true, [44768] = true, [35576] = true, [19063] = true, + [9062] = true, [9070] = true, [32495] = true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- + -----ALCHEMY + --------------------------------------------------------------------------------------- + [53898] = true, [28579] = true, [17566] = true, [53771] = true, [7256] = true, +[53899] = true, [11452] = true, [11460] = true, [11468] = true, [3170] = true, + [3172] = true, [3174] = true, [3176] = true, [53836] = true, [53900] = true, + [28564] = true, [28580] = true, [54220] = true, [17551] = true, [53773] = true, + [53837] = true, [62213] = true, [54221] = true, [53774] = true, [53838] = true, + [6617] = true, [53902] = true, [28581] = true, [2331] = true, [2335] = true, + [2337] = true, [53775] = true, [53839] = true, [11453] = true, [7836] = true, + [24266] = true, [41500] = true, [53904] = true, [53936] = true, [28566] = true, + [28582] = true, [3452] = true, [3454] = true, [33732] = true, [17553] = true, + [22732] = true, [53777] = true, [53905] = true, [53937] = true, [33733] = true, + [62409] = true, [25146] = true, [41502] = true, [53938] = true, [28551] = true, + [28567] = true, [28583] = true, [62410] = true, [7181] = true, [17570] = true, + [17634] = true, [53779] = true, [7257] = true, [53939] = true, [11478] = true, + [17187] = true, [53812] = true, [28552] = true, [28568] = true, [28584] = true, + [60366] = true, [57425] = true, [17635] = true, [53781] = true, [60367] = true, + [4508] = true, [53782] = true, [24365] = true, [6618] = true, [53942] = true, + [28569] = true, [28585] = true, [29688] = true, [57427] = true, [17556] = true, + [17572] = true, [17636] = true, [53783] = true, [11479] = true, [7837] = true, + [7841] = true, [53784] = true, [24366] = true, [53848] = true, [28554] = true, + [28570] = true, [28586] = true, [58868] = true, [33741] = true, [24367] = true, + [28555] = true, [28571] = true, [17574] = true, [17638] = true, [7258] = true, + [11448] = true, [11456] = true, [11464] = true, [11480] = true, [3171] = true, + [3173] = true, [3175] = true, [24368] = true, [28572] = true, [28588] = true, + [45061] = true, [66658] = true, [17559] = true, [17575] = true, [66659] = true, + [66660] = true, [63732] = true, [28573] = true, [66662] = true, [17560] = true, + [2330] = true, [2332] = true, [2334] = true, [66663] = true, [11457] = true, + [11465] = true, [11473] = true, [66664] = true, [3449] = true, [3451] = true, + [3453] = true, [17561] = true, [17577] = true, [28543] = true, [28575] = true, + [7179] = true, [17562] = true, [17578] = true, [7255] = true, [7259] = true, + [11458] = true, [11466] = true, [38962] = true, [53776] = true, [12609] = true, + [53780] = true, [60893] = true, [58871] = true, [3448] = true, [3450] = true, + [3447] = true, [4942] = true, [28576] = true, [15833] = true, [17576] = true, + [41503] = true, [60350] = true, [41501] = true, [17563] = true, [42736] = true, + [54213] = true, [41458] = true, [6624] = true, [39636] = true, [28577] = true, + [32765] = true, [38070] = true, [17564] = true, [17580] = true, [53895] = true, + [11451] = true, [39637] = true, [28546] = true, [28562] = true, [28578] = true, + [60354] = true, [32766] = true, [17565] = true, [22808] = true, [39639] = true, + [60355] = true, [56519] = true, + --------------------------------------------------------------------------------------- + + --------------------------------------------------------------------------------------- + ----ENGINEERING + --------------------------------------------------------------------------------------- + [23081] = true, [12586] = true, [12594] = true, [12622] = true, [30347] = true, +[44391] = true, [30547] = true, [56464] = true, [12754] = true, [12758] = true, + [23489] = true, [23082] = true, [8243] = true, [9269] = true, [30316] = true, + [30332] = true, [12906] = true, [8339] = true, [26420] = true, [56514] = true, + [39971] = true, [12599] = true, [12603] = true, [12607] = true, [43676] = true, + [12619] = true, [54998] = true, [30349] = true, [56468] = true, [12755] = true, + [12759] = true, [63750] = true, [39973] = true, [56465] = true, [56469] = true, + [30318] = true, [30334] = true, [55016] = true, [12903] = true, [54793] = true, + [19795] = true, [8895] = true, [19819] = true, [30558] = true, [39895] = true, + [23069] = true, [23077] = true, [12596] = true, [30303] = true, [56471] = true, + [12624] = true, [19796] = true, [56472] = true, [12760] = true, [63770] = true, + [23070] = true, [23078] = true, [61471] = true, [30304] = true, [30312] = true, + [12908] = true, [12597] = true, [3930] = true, [24356] = true, [67839] = true, + [67326] = true, [56474] = true, [30560] = true, [30568] = true, [30314] = true, + [3929] = true, [56475] = true, [19830] = true, [3946] = true, [54736] = true, + [30563] = true, [24357] = true, [30337] = true, [12591] = true, [19814] = true, + [60866] = true, [12716] = true, [23071] = true, [23079] = true, [12585] = true, + [3923] = true, [3925] = true, [30305] = true, [12621] = true, [30329] = true, + [3931] = true, [3932] = true, [3933] = true, [3936] = true, [3937] = true, + [3938] = true, [3939] = true, [3941] = true, [56473] = true, [3944] = true, + [3945] = true, [3947] = true, [54999] = true, [3949] = true, [3950] = true, + [26417] = true, [12717] = true, [3954] = true, [3955] = true, [3957] = true, + [3958] = true, [3961] = true, [3962] = true, [3963] = true, [3965] = true, + [3966] = true, [3967] = true, [3968] = true, [3969] = true, [3971] = true, + [3972] = true, [3973] = true, [7430] = true, [3977] = true, [3978] = true, + [3979] = true, [19790] = true, [23080] = true, [12620] = true, [30309] = true, + [30346] = true, [12905] = true, [41307] = true, [8334] = true, [56460] = true, + [56476] = true, [12718] = true, [26418] = true, [19791] = true, [3960] = true, + [19815] = true, [13240] = true, [19831] = true, [30570] = true, [19799] = true, + [30306] = true, [30310] = true, [26011] = true, [36954] = true, [3919] = true, + [3920] = true, [19800] = true, [12617] = true, [30311] = true, [56463] = true, +--------------------------------------------------------------------------------------- +} + +local function LoadRecipe() + local recipe_list = addon.recipe_list + + if (not recipe_list) then + if (addon.db.profile.autoloaddb) then + local dbloaded + dbloaded, recipe_list = addon:InitRecipeData() + + if (not dbloaded) then return end + + for idx, prof in pairs(PROFESSIONS) do + addon:AddRecipeData(prof) + end + else + addon:Print(L["DATAMINER_NODB_ERROR"]) + return + end + else + -- Recipe DB exists, we just need to populate it now + if (addon.db.profile.autoloaddb) then + for idx, prof in pairs(PROFESSIONS) do + addon:AddRecipeData(prof) + end + end + end + return recipe_list + +end + +------------------------------------------------------------------------------- +-- Creates a reverse lookup for a recipe list +------------------------------------------------------------------------------- +local CreateReverseLookup +do + local reverse_lookup = {} + + function CreateReverseLookup(recipe_list) + if (not recipe_list) then + addon:Print(L["DATAMINER_NODB_ERROR"]) + return + end + + twipe(reverse_lookup) + + for i in pairs(recipe_list) do + --if t[recipe_list[i]["Name"]] then addon:Print("Dupe: " .. i) end + reverse_lookup[recipe_list[i]["Name"]] = i + end + + return reverse_lookup + end + +end + +------------------------------------------------------------------------------- +-- Tooltip for data-mining. +------------------------------------------------------------------------------- +local ARLDatamineTT = CreateFrame("GameTooltip", "ARLDatamineTT", UIParent, "GameTooltipTemplate") + +do + -- Tables used in all the Scan functions within this do block. -Torhal + local info, output = {}, {} + + --- Function to compare the skill levels of a trainers recipes with those in the ARL database. + -- @name AckisRecipeList:ScanSkillLevelData + -- @param autoscan True when autoscan is enabled in preferences, it will surpress output letting you know when a scan has occured. + -- @return Does a comparison of the information in your internal ARL database, and those items which are available on the trainer. Compares the skill levels between the two. + function addon:ScanSkillLevelData(autoscan) + if not IsTradeskillTrainer() then + if not autoscan then + self:Print(L["DATAMINER_SKILLLEVEL_ERROR"]) + end + return + end + local recipe_list = LoadRecipe() -- Get internal database + + if not recipe_list then + self:Print(L["DATAMINER_NODB_ERROR"]) + return + end + -- Get the initial trainer filters + local avail = GetTrainerServiceTypeFilter("available") + local unavail = GetTrainerServiceTypeFilter("unavailable") + local used = GetTrainerServiceTypeFilter("used") + + -- Clear the trainer filters + SetTrainerServiceTypeFilter("available", 1) + SetTrainerServiceTypeFilter("unavailable", 1) + SetTrainerServiceTypeFilter("used", 1) + + twipe(info) + + -- Get the skill levels from the trainer + for i = 1, GetNumTrainerServices(), 1 do + local name = GetTrainerServiceInfo(i) + local _, skilllevel = GetTrainerServiceSkillReq(i) + + if not skilllevel then + skilllevel = 0 + end + info[name] = skilllevel + end + local found = false + + twipe(output) + + for i in pairs(recipe_list) do + local i_name = recipe_list[i]["Name"] + + if info[i_name] and info[i_name] ~= recipe_list[i]["Level"] then + found = true + tinsert(output, L["DATAMINER_SKILLELVEL"]:format(i_name, recipe_list[i]["Level"], info[i_name])) + end + end + tinsert(output, "Trainer Skill Level Scan Complete.") + + if found then + self:DisplayTextDump(nil, nil, tconcat(output, "\n")) + end + -- Reset the filters to what they were before + SetTrainerServiceTypeFilter("available", avail or 0) + SetTrainerServiceTypeFilter("unavailable", unavail or 0) + SetTrainerServiceTypeFilter("used", used or 0) + end + + local teach, noteach = {}, {} + + --- Function to compare which recipes are available from a trainer and compare with the internal ARL database. + -- @name AckisRecipeList:ScanTrainerData + -- @param autoscan True when autoscan is enabled in preferences, it will surpress output letting you know when a scan has occured. + -- @return Does a comparison of the information in your internal ARL database, and those items which are available on the trainer. + -- Compares the acquire information of the ARL database with what is available on the trainer. + function addon:ScanTrainerData(autoscan) + if not (UnitExists("target") and (not UnitIsPlayer("target")) and (not UnitIsEnemy("player", "target"))) then -- Make sure the target exists and is a NPC + if not autoscan then + self:Print(L["DATAMINER_TRAINER_NOTTARGETTED"]) + end + return + end + local targetname = UnitName("target") -- Get its name + local targetID = tonumber(string.sub(UnitGUID("target"), -12, -7), 16) -- Get the NPC ID + + if not IsTradeskillTrainer() then -- Are we at a trade skill trainer? + if not autoscan then + self:Print(L["DATAMINER_SKILLLEVEL_ERROR"]) + end + return + end + local recipe_list = LoadRecipe() -- Get internal database + + if not recipe_list then + self:Print(L["DATAMINER_NODB_ERROR"]) + return + end + + -- Get the initial trainer filters + local avail = GetTrainerServiceTypeFilter("available") + local unavail = GetTrainerServiceTypeFilter("unavailable") + local used = GetTrainerServiceTypeFilter("used") + + -- Clear the trainer filters + SetTrainerServiceTypeFilter("available", 1) + SetTrainerServiceTypeFilter("unavailable", 1) + SetTrainerServiceTypeFilter("used", 1) + + if (GetNumTrainerServices() == 0) then + self:Print("Warning: Trainer is bugged, reporting 0 trainer items.") + end + twipe(info) + + -- Get all the names of recipes from the trainer + for i = 1, GetNumTrainerServices(), 1 do + local name = GetTrainerServiceInfo(i) + info[name] = true + end + twipe(teach) + twipe(noteach) + twipe(output) + + -- Dump out trainer info + tinsert(output, L["DATAMINER_TRAINER_INFO"]:format(targetname, targetID)) + + local teachflag = false + local noteachflag = false + + for i in pairs(recipe_list) do + local i_name = recipe_list[i]["Name"] + local acquire = recipe_list[i]["Acquire"] + local flags = recipe_list[i]["Flags"] + + -- If the trainer teaches this recipe + if info[i_name] then + local found = false + + -- Parse acquire info + for j in pairs(acquire) do + if (acquire[j]["Type"] == 1) then + if (acquire[j]["ID"] == targetID) then + found = true + end + end + end + + if (not found) then + tinsert(teach, i) + teachflag = true + + if (not flags[3]) then + tinsert(output, ": Trainer flag needs to be set.") + end + end + -- Trainer does not teach this recipe + else + local found = false + -- Parse acquire info + for j in pairs(acquire) do + if (acquire[j]["Type"] == 1) then + if (acquire[j]["ID"] == targetID) then + found = true + end + end + end + + if found then + noteachflag = true + tinsert(noteach, i) + end + end + end + + if teachflag then + tinsert(output, "Missing entries (need to be added):") + tsort(teach) + + for i in ipairs(teach) do + tinsert(output, L["DATAMINER_TRAINER_TEACH"]:format(teach[i], recipe_list[teach[i]]["Name"])) + end + end + + if noteachflag then + tinsert(output, "Extra entries (need to be removed):") + tsort(noteach) + + for i in ipairs(noteach) do + tinsert(output, L["DATAMINER_TRAINER_NOTTEACH"]:format(noteach[i], recipe_list[noteach[i]]["Name"])) + end + end + tinsert(output, "Trainer Acquire Scan Complete.") + tinsert(output, "If you're doing an engineering scan, there may be some goggles listed as extra. These goggles ONLY show up for those classes who can make them, so they may be false positives.") + + if teachflag or noteachflag then + self:DisplayTextDump(nil, nil, tconcat(output, "\n")) + end + -- Reset the filters to what they were before + SetTrainerServiceTypeFilter("available", avail or 0) + SetTrainerServiceTypeFilter("unavailable", unavail or 0) + SetTrainerServiceTypeFilter("used", used or 0) + end +end -- do + +--- Generates tradeskill links for all professions so you can scan them for completeness. +-- @name AckisRecipeList:GenerateLinks +-- @return Generates tradeskill links with all recipes. Used for testing to see if a recipe is missing from the database or not. +function addon:GenerateLinks() + -- This code adopted from Gnomish Yellow Pages with permission + + local guid = UnitGUID("player") + local playerGUID = gsub(guid, "0x0+", "") + + -- Listing of all tradeskill professions + local tradelist = {51304, 51300, 51313, 51306, 45363, 51311, 51302, 51309, 51296, 45542} + +--[[ + local encodingLength = floor((#recipeList+5) / 6) + + local encodedString = string.rep("/", encodingLength) +]]-- + local bitmap = {} + bitmap[45542] = "8bffAA" -- First Aid (6) + --bitmap[51296] = "2/7///7///9////7//////////g+/B" -- Cooking (30) + bitmap[51296] = "2/7///7///9////7//////////gC8/B" -- Cooking + --bitmap[51306] = "4/////////////3nFA+///9+/P7//f//n//9dgdJgHA87/3f/TolD" -- Engineering (53) + bitmap[51306] = "4/////////////3nFA+///9+/P7//f//n//9dgdJgHA87/3f/Tol3B" -- Engineering + --bitmap[51302] = "e+//////////////v//P+f///3///7/9f9//////////f///////HQ5+////B4//+///////5///////PA/Eg//" -- LW (87) + bitmap[51302] = "e+//////////////v//P+f///3///7/9f9//////////f///////HQ5+////B4//+//////////////////HgAAw/P" -- Leatherworking + --bitmap[51302] = string.rep("/", 87) + --bitmap[51304] = "2//v//////f////3//v///////6//////////9////X" -- Alchemy (43) + bitmap[51304] = "2//v//////f////3//v///////5//////////9/////v" -- Alchemy + --bitmap[51304] = string.rep("/", 43) -- Alchemy (43) + --bitmap[51300] = string.rep("/", 85) -- Blacksmithing (85) + --bitmap[51309] = string.rep("/", 71) -- Tailoring (71) + bitmap[51309] = "YIEMCCgAicAjAGIAiQKAACBRxgBEAAAAAAAAA45BAqBQBAKAAAEAAAIICLHqiAuKAAAEABAAA" + --bitmap[51311] = string.rep("/", 83) -- JC 83 + bitmap[51311] = "8fJRMqkmRwipmMHAQAACEAAQw/AgDkMJIAQgCA4AAwHMKFr/TCEx6tip+z7WyNsRWrnhm7wGPAAOgAUEALFAAWJWfqsBCAB" + --bitmap[45363] = string.rep("/", 74) -- Inscription (74) + --bitmap[51313] = "4//////////7///////////w//++/9vn7///////3P/t/n//BAB" -- Enchanting + --bitmap[51313] = "4//////////7///////////w//++/9vn7///////3P/t/n//BAD" -- Enchanting (51) + bitmap[51313] = "4//////////7///////////w//+//9/n7///////3f//////ZsD" -- Enchanting + --bitmap[51313] = string.rep("/", 51) -- Enchanting (51) + + for i in pairs(tradelist) do + + local tradeName = GetSpellInfo(tradelist[i]) + local tradelink = {} + tradelink[1] = "|cffffd000|Htrade:" + tradelink[2] = tradelist[i] + tradelink[3] = ":450:450:" + tradelink[4] = playerGUID + tradelink[5] = ":" + tradelink[6] = bitmap[tradelist[i]] + tradelink[7] = "|h[" + tradelink[8] = tradeName + tradelink[9] = "]|h|r" + + if (bitmap[tradelist[i]]) then + self:Print(tconcat(tradelink, "")) + else + self:Print("I don't have the bitmap for " .. tradeName .. " yet (Professions were updated in 3.2. If you want to help, talk to me on IRC.") + end + -- /script DEFAULT_CHAT_FRAME:AddMessage(gsub(GetTradeSkillListLink(), "\124", "\124\124")) + end + +end + +------------------------------------------------------------------------------- +--- Scans the items in the specified profession +------------------------------------------------------------------------------- +do + local ORDERED_PROFESSIONS = { + strlower(PROFESSIONS.Alchemy), -- 1 Alchemy + strlower(PROFESSIONS.Blacksmithing), -- 2 Blacksmithing + strlower(PROFESSIONS.Cooking), -- 3 Cooking + strlower(PROFESSIONS.Enchanting), -- 4 Enchanting + strlower(PROFESSIONS.Engineering), -- 5 Engineering + strlower(PROFESSIONS.FirstAid), -- 6 First Aid + strlower(PROFESSIONS.Inscription), -- 7 Inscription + strlower(PROFESSIONS.Jewelcrafting), -- 8 Jewelcrafting + strlower(PROFESSIONS.Leatherworking), -- 9 Leatherworking + strlower(PROFESSIONS.Runeforging), -- 10 Runeforging + strlower(PROFESSIONS.Smelting), -- 11 Smelting + strlower(PROFESSIONS.Tailoring), -- 12 Tailoring + } + local recipe_list = {} + local output = {} + + local function ProfessionScan(prof_name) + local master_list = LoadRecipe() + + if not master_list then + addon:Print(L["DATAMINER_NODB_ERROR"]) + return + end + twipe(recipe_list) + + for i in pairs(master_list) do + local prof = strlower(master_list[i]["Profession"]) + + if prof and prof == prof_name then + recipe_list[i] = master_list[i] + end + end + twipe(output) + + -- Parse the entire recipe database + for i in pairs(recipe_list) do + local ttscantext = addon:TooltipScanRecipe(i, false, true) + + if (ttscantext) then + tinsert(output, ttscantext) + end + end + addon:DisplayTextDump(nil, nil, tconcat(output, "\n")) + ARLDatamineTT:Hide() + end + + --- Parses all recipes for a specified profession, scanning their tool tips. + -- @name AckisRecipeList:ScanProfession + -- @usage AckisRecipeList:ScanProfession("first aid") + -- @param prof_name The profession name or the spell ID of it, which you wish to scan. + -- @return Recipes in the given profession have their tooltips scanned. + function addon:ScanProfession(prof_name) + if (type(prof_name) == "number") then + prof_name = GetSpellInfo(prof_name) + end + + local found = false + prof_name = strlower(prof_name) + + local scan_all = prof_name == "all" + + if not scan_all then + for idx, name in ipairs(ORDERED_PROFESSIONS) do + if prof_name == name then + found = true + break + end + end + + if not found then + self:Print(L["DATAMINER_NODB_ERROR"]) + return + end + + ProfessionScan(prof_name) + else + for idx, name in ipairs(ORDERED_PROFESSIONS) do + ProfessionScan(name) + end + end + end +end -- do + +local RECIPE_NAMES = { + -- JC + ["design: "] = true, + -- LW or Tailoring + ["pattern: "] = true, + -- Alchemy or Cooking + ["recipe: "] = true, + -- BS + ["plans: "] = true, + -- Enchanting + ["formula: "] = true, + -- Engineering + ["schematic: "] = true, + -- First Aid + ["manual: "] = true, + + ["alchemy: "] = true, + ["blacksmithing: "] = true, + ["cooking: "] = true, + ["enchanting: "] = true, + ["engineering: "] = true, + ["first aid: "] = true, + ["inscription: "] = true, + ["jewelcrafting: "] = true, + ["leatherworking: "] = true, + ["tailoring: "] = true, +} + +--- Scans the items on a vendor, determining which recipes are available if any and compares it with the database entries. +-- @name AckisRecipeList:ScanVendor +-- @usage AckisRecipeList:ScanVendor() +-- @return Obtains all the vendor information on tradeskill recipes and attempts to compare the current vendor with the internal database. +do + local output = {} + + function addon:ScanVendor() + if not (UnitExists("target") and (not UnitIsPlayer("target")) and (not UnitIsEnemy("player", "target"))) then -- Make sure the target exists and is a NPC + self:Print(L["DATAMINER_VENDOR_NOTTARGETTED"]) + return + end + local recipe_list = LoadRecipe() -- Get internal database + + if not recipe_list then + self:Print(L["DATAMINER_NODB_ERROR"]) + return + end + local reverse_lookup = CreateReverseLookup(recipe_list) + local targetname = UnitName("target") -- Get its name + local targetID = tonumber(string.sub(UnitGUID("target"), -12, -7), 16) -- Get the NPC ID + local added = false + + twipe(output) + + -- Parse all the items on the merchant + for i = 1, GetMerchantNumItems(), 1 do + local name, _, _, _, numAvailable = GetMerchantItemInfo(i) + + if name then + -- Lets scan recipes only on vendors + local matchtext = strmatch(name, "%a+: ") + -- Check to see if we're dealing with a recipe + if matchtext and RECIPE_NAMES[strlower(matchtext)] then + local recipename = gsub(name, "%a+\: ", "") -- Get rid of the first part of the item + local spellid = reverse_lookup[recipename] -- Find out what spell ID we're using + + -- Do the scan if we have the spell ID + if (spellid) then + added = true + local ttscantext = addon:TooltipScanRecipe(spellid, true, true) + + if (ttscantext) then + tinsert(output, ttscantext) + end + -- Ok now we know it's a vendor, lets check the database to see if the vendor is listed as an acquire method. + local acquire = recipe_list[spellid]["Acquire"] + local found = false + + for i in pairs(acquire) do + local atype = acquire[i]["Type"] + -- If the acquire type is a vendor + if (((atype == 2) and (acquire[i]["ID"] == targetID)) + or ((atype == 6) and (acquire[i]["RepVendor"] == targetID))) then + found = true + end + end + + if (not found) then + tinsert(output, "Vendor ID missing from " .. spellid) + end + else + --@debug@ + added = true + tinsert(output, "Spell ID not found for: " .. name) + --@end-debug@ + end + end + end + end + + if added then + self:DisplayTextDump(nil, nil, tconcat(output, "\n")) + end + ARLDatamineTT:Hide() + end +end -- do + +--- Parses all the recipes in the database, and scanning their tooltips. +-- @name AckisRecipeList:TooltipScanDatabase +-- @usage AckisRecipeList:TooltipScanDatabase() +-- @return Entire recipe database has its tooltips scanned. +do + local output = {} + + function addon:TooltipScanDatabase() + -- Get internal database + local recipe_list = LoadRecipe() + + if (not recipe_list) then + self:Print(L["DATAMINER_NODB_ERROR"]) + return + end + twipe(output) + + -- Parse the entire recipe database + for i in pairs(recipe_list) do + + local ttscantext = addon:TooltipScanRecipe(i, false, true) + if (ttscantext) then + tinsert(output, ttscantext) + end + end + self:DisplayTextDump(nil, nil, tconcat(output, "\n")) + end +end -- do +--- Parses a specific recipe in the database, and scanning its tooltip. +-- @name AckisRecipeList:TooltipScanRecipe +-- @param spellid The [[[http://www.wowwiki.com/SpellLink | Spell ID]]] of the recipe being added to the database. +-- @param is_vendor Boolean to determine if we're viewing a vendor or not. +-- @param is_largescan Boolean to determine if we're doing a large scan. +-- @return Recipe has its tooltips scanned. +do + + --------------------------------------------------------------------------------------------------------- + ----This table, DO_NOT_SCAN, contains itemid's that will not cache on the servers + --------------------------------------------------------------------------------------------------------- + + local DO_NOT_SCAN = { + ------------------------------------------------------------------------------- + --Leatherworking + ------------------------------------------------------------------------------- + [35214] = true, [32434] = true, [15769] = true, + [32431] = true, [32432] = true, [35215] = true, [35521] = true, + [35520] = true, [35524] = true, [35517] = true, [35528] = true, + [35527] = true, [35523] = true, [35549] = true, [35218] = true, + [35217] = true, [35216] = true, [35546] = true, [35541] = true, [15756] = true, + [15777] = true, [32433] = true, [29729] = true, [29732] = true, [32744] = true, + + ------------------------------------------------------------------------------- + --Tailoring + ------------------------------------------------------------------------------- + [14477] = true, [14485] = true, [30281] = true, [14478] = true, [14500] = true, + [32439] = true, [14479] = true, [32447] = true, [14480] = true, [32437] = true, + [14495] = true, [14505] = true, [35204] = true, [35205] = true, [35206] = true, + + ------------------------------------------------------------------------------- + --Jewelcrafting + ------------------------------------------------------------------------------- + [23130] = true, [23140] = true, [23137] = true, [23131] = true, [23148] = true, + [35538] = true, [35201] = true, [35533] = true, [35200] = true, [23147] = true, + [23135] = true, [35203] = true, + + ------------------------------------------------------------------------------- + --Alchemy + ------------------------------------------------------------------------------- + [22925] = true, [13480] = true, [13481] = true, [13493] = true, + + ------------------------------------------------------------------------------- + --Cooking + ------------------------------------------------------------------------------- + [39644] = true, + + ------------------------------------------------------------------------------- + --Blacksmithing + ------------------------------------------------------------------------------- + [32441] = true, [32443] = true, [12687] = true, [12714] = true, [12688 ] = true, + [35211] = true, [35209] = true, [35210] = true, [12706] = true, [7982] = true, + + ------------------------------------------------------------------------------- + --Engineering + ------------------------------------------------------------------------------- + [35196] = true, [21734] = true, [18292] = true, [21727] = true, [21735] = true, [16053] = true, [21729] = true, + [16047] = true,[21730] = true,[21731] = true,[21732] = true,[4411] = true, [21733] = true, [21728] = true, + + } + + local output = {} + + function addon:TooltipScanRecipe(spell_id, is_vendor, is_largescan) + local recipe_list = LoadRecipe() + + if not recipe_list then + self:Print(L["DATAMINER_NODB_ERROR"]) + return + end + local spell_info = recipe_list[spell_id] + + if not spell_info then + self:Print(string.format("Spell ID %d does not exist in the database.", tonumber(spell_id))) + return + end + local recipe_name = spell_info["Name"] + local game_vers = spell_info["Game"] + + twipe(output) + + if not game_vers then + tinsert(output, "No expansion information: " .. tostring(spell_id) .. " " .. recipe_name) + elseif game_vers > 2 then + tinsert(output, "Expansion information too high: " .. tostring(spell_id) .. " " .. recipe_name) + end + local Orange = spell_info["Orange"] + local Yellow = spell_info["Yellow"] + local Green = spell_info["Green"] + local Grey = spell_info["Grey"] + local SkillLevel = spell_info["Level"] + + if not Orange then + tinsert(output, "No skill level information: " .. tostring(spell_id) .. " " .. recipe_name) + else + -- Highest level is greater than the skill of the recipe + if Orange > SkillLevel then + tinsert(output, "Skill Level Error (Orange > Skill): " .. tostring(spell_id) .. " " .. recipe_name) + end + -- Level info is messed up + if Orange > Yellow or Orange > Green or Orange > Grey or Yellow > Green or Yellow > Grey or Green > Grey then + tinsert(output, "Skill Level Error: " .. tostring(spell_id) .. " " .. recipe_name) + end + end + local recipe_link = spell_info["RecipeLink"] + + if not recipe_link then + if spell_info["Profession"] ~= GetSpellInfo(53428) then -- Lets hide this output for runeforging. + self:Print("Missing RecipeLink for ID " .. spell_id .. " - " .. recipe_name .. " (Normal for DK abilities.") + end + return + end + ARLDatamineTT:SetOwner(WorldFrame, "ANCHOR_NONE") + GameTooltip_SetDefaultAnchor(ARLDatamineTT, UIParent) + ARLDatamineTT:SetHyperlink(recipe_link) -- Link exists, so load the tooltip for scanning + + -- Lets check to see if it's a recipe tooltip + local text = strlower(_G["ARLDatamineTTTextLeft1"]:GetText()) + local match_text = strmatch(text, "%a+: ") + + -- Check to see if we're dealing with a recipe + if not RECIPE_NAMES[match_text] then + ARLDatamineTT:Hide() + return + end + local reverse_lookup = CreateReverseLookup(recipe_list) + +-- tinsert(output, "RECIPE SCAN") + +-- for i = 1, ARLDatamineTT:NumLines(), 1 do +-- local text_l = _G["ARLDatamineTTTextLeft" .. i]:GetText() +-- local text_r = _G["ARLDatamineTTTextRight" .. i]:GetText() +-- local text + +-- if text_r then +-- text = text_l .. "(Left) " .. text_r .. "(Right)" +-- else +-- text = text_l +-- end + +-- tinsert(output, text) +-- end + self:ScanToolTip(recipe_name, recipe_list, reverse_lookup, is_vendor, false) + + local item_id = SPELL_ITEM[spell_id] + +-- tinsert(output, "ITEM SCAN") + -- We have a reverse look-up for the item which creates the spell (aka the recipe itself) + if item_id then + if not DO_NOT_SCAN[item_id] then + local incache = GetItemInfo(item_id) + + if incache then + + ARLDatamineTT:SetHyperlink("item:" .. item_id .. ":0:0:0:0:0:0:0") + +-- for i = 1, ARLDatamineTT:NumLines(), 1 do +-- local text_l = _G["ARLDatamineTTTextLeft" .. i]:GetText() +-- local text_r = _G["ARLDatamineTTTextRight" .. i]:GetText() +-- local text + +-- if text_r then +-- text = text_l .. "(Left) " .. text_r .. "(Right)" +-- else +-- text = text_l +-- end + +-- tinsert(output, text) +-- end + -- Scan the recipe item (aka pattern) + self:ScanToolTip(recipe_name, recipe_list, reverse_lookup, is_vendor, true) + else + tinsert(output, "Item ID: " .. item_id .. " not in cache. If you have Querier use /iq " .. item_id) + end + end + -- We are dealing with a recipe that does not have an item to learn it from + else + -- Lets check the recipe flags to see if we have a data error and the item should exist + local flags = spell_info["Flags"] + + if (flags[4] or flags[5] or flags[6]) then + tinsert(output, "Spell/Item ID: " .. spell_id .. " does not exist in the SPELL_ITEM table.") + end + end + ARLDatamineTT:Hide() + + -- Add the flag scan to the table if it's not nil + local results = self:PrintScanResults() + + if not results then + return + end + tinsert(output, results) + + if is_largescan then + return tconcat(output, "\n") + else + self:Print(tconcat(output, "\n")) + end + end +end -- do + +------------------------------------------------------------------------------- +-- Tooltip-scanning code +------------------------------------------------------------------------------- +do + local SPECIALTY_TEXT = { + ["requires spellfire tailoring"] = 26797, + ["requires mooncloth tailoring"] = 26798, + ["requires shadoweave tailoring"] = 26801, + ["requires dragonscale leatherworking"] = 10657, + ["requires elemental leatherworking"] = 10659, + ["requires tribal leatherworking"] = 10661, + ["requires gnomish engineer"] = 20219, + ["requires goblin engineer"] = 20222, + ["requires armorsmith"] = 9788, + ["requires master axesmith"] = 17041, + ["requires master hammersmith"] = 17040, + ["requires master swordsmith"] = 17039, + ["requires weaponsmith"] = 9787, + } + + local FACTION_TEXT = { + ["thorium brotherhood"] = 98, + ["zandalar tribe"] = 100, + ["argent dawn"] = 96, + ["timbermaw hold"] = 99, + ["cenarion circle"] = 97, + ["the aldor"] = 101, + ["the consortium"] = 105, + ["the scryers"] = 110, + ["the sha'tar"] = 111, + ["the mag'har"] = 108, + ["cenarion expedition"] = 103, + ["honor hold"] = 104, + ["thrallmar"] = 104, + ["the violet eye"] = 114, + ["sporeggar"] = 113, + ["kurenai"] = 108, + ["keepers of time"] = 106, + ["the scale of the sands"] = 109, + ["lower city"] = 107, + ["ashtongue deathsworn"] = 102, + ["alliance vanguard"] = 131, + ["valiance expedition"] = 126, + ["horde expedition"] = 130, + ["the taunka"] = 128, + ["the hand of vengeance"] = 127, + ["explorers' league"] = 125, + ["the kalu'ak"] = 120, + ["shattered sun offensive"] = 112, + ["warsong offensive"] = 129, + ["kirin tor"] = 118, + ["the wyrmrest accord"] = 122, + ["knights of the ebon blade"] = 117, + ["frenzyheart tribe"] = 116, + ["the oracles"] = 121, + ["argent crusade"] = 115, + ["the sons of hodir"] = 119, + } + + local FACTION_LEVELS = { + ["neutral"] = 0, + ["friendly"] = 1, + ["honored"] = 2, + ["revered"] = 3, + ["exalted"] = 4, + } + + local CLASS_TYPES = { + ["Death Knight"] = 21, ["Druid"] = 22, ["Hunter"] = 23, + ["Mage"] = 24, ["Paladin"] = 25, ["Priest"] = 26, + ["Shaman"] = 27, ["Rogue"] = 28, ["Warlock"] = 29, + ["Warrior"] = 30, + } + + local ORDERED_CLASS_TYPES = { + [1] = "Death Knight", [2] = "Druid", [3] = "Hunter", + [4] = "Mage", [5] = "Paladin", [6] = "Priest", + [7] = "Shaman", [8] = "Rogue", [9] = "Warlock", + [10] = "Warrior", + } + + local ROLE_TYPES = { + ["dps"] = 51, ["tank"] = 52, ["healer"] = 53, + ["caster"] = 54, ["RESERVED1"] = 55, + } + + local ORDERED_ROLE_TYPES = { + [1] = "dps", [2] = "tank", [3] = "healer", + [4] = "caster", [5] = "RESERVED1", + } + + local ENCHANT_TO_ITEM = { + ["Cloak"] = "Back", + ["Ring"] = "Finger", + ["2H Weapon"] = "Two-Hand", + } + + local ITEM_TYPES = { + -- Armor types + ["Cloth"] = 56, ["Leather"] = 57, ["Mail"] = 58, + ["Plate"] = 59, ["Back"] = 60, ["Trinket"] = 61, + ["Finger"] = 62, ["Neck"] = 63, ["Shield"] = 64, + ["RESERVED2"] = 65, + + -- Weapon types + ["One-Hand"] = 66, ["Two-Hand"] = 67, ["Axe"] = 68, + ["Sword"] = 69, ["Mace"] = 70, ["Polearm"] = 71, + ["Dagger"] = 72, ["Staff"] = 73, ["Wand"] = 74, + ["Thrown"] = 75, ["Bow"] = 76, ["CrossBow"] = 77, + ["Ammo"] = 78, ["Fist Weapon"] = 79, ["Gun"] = 80, + } + + local ORDERED_ITEM_TYPES = { + -- Armor types + [1] = "Cloth", [2] = "Leather", [3] = "Mail", + [4] = "Plate", [5] = "Back", [6] = "Trinket", + [7] = "Finger", [8] = "Neck", [9] = "Shield", + [10] = "RESERVED2", + + -- Weapon types + [11] = "One-Hand", [12] = "Two-Hand", [13] = "Axe", + [14] = "Sword", [15] = "Mace", [16] = "Polearm", + [17] = "Dagger", [18] = "Staff", [19] = "Wand", + [20] = "Thrown", [21] = "Bow", [22] = "CrossBow", + [23] = "Ammo", [24] = "Fist Weapon", [25] = "Gun", + } + + -- Table to store scanned information. Wiped and re-used every scan. + local scan_data = {} + + --- Parses the mining tooltip for certain keywords, comparing them with the database flags. + -- @name AckisRecipeList:ScanToolTip + -- @param name The name of the recipe + -- @param recipe_list Recipe database + -- @param reverse_lookup Reverse lookup database + -- @param is_vendor Boolean to indicate if we're scanning a vendor. + -- @param is_item Boolean to indicate if we're scanning an item tooltip. + -- @return Scans a tooltip, and outputs the missing or extra filter flags. + function addon:ScanToolTip(name, recipe_list, reverse_lookup, is_vendor, is_item) + -- We only want to wipe the table if we're scanning a new entry (not an item associated with a spell ID) + if not is_item then + twipe(scan_data) + end + scan_data.match_name = name + scan_data.recipe_list = recipe_list + scan_data.reverse_lookup = reverse_lookup + scan_data.is_vendor = is_vendor + scan_data.is_item = is_item + + -- Parse all the lines of the tooltip + for i = 1, ARLDatamineTT:NumLines(), 1 do + local text_l = _G["ARLDatamineTTTextLeft" .. i]:GetText() + local text_r = _G["ARLDatamineTTTextRight" .. i]:GetText() + local text + + if text_r then + text = text_l .. " " .. text_r + else + text = text_l + end + + local text = strlower(text) + + -- Check for recipe/item binding + -- The recipe binding is within the first few lines of the tooltip always + if strmatch(text, "binds when picked up") then + if (i < 3) then + scan_data.boprecipe = true + else + scan_data.bopitem = true + end + end + + -- Recipe Specialities + if SPECIALTY_TEXT[text] then + scan_data.specialty = SPECIALTY_TEXT[text] + end + + -- Recipe Reputations + local rep, replevel = strmatch(text_l, "Requires (.+) %- (.+)") + + if rep and replevel and FACTION_TEXT[rep] then + scan_data.repid = FACTION_TEXT[rep] + scan_data.repidlevel = FACTION_LEVELS[replevel] + end + + -- Flag so that we don't bother checking for classes if we're sure of the class + -- AKA +spell hit == caster DPS only no matter what other stats are on it + -- Saves processing cycles and it won't cause the flags to be overwritten if a non-specific stat is found after + scan_data.verifiedclass = false + + if (not scan_data.verifiedclass) then + -- Certain stats can be considered for a specific role (aka spell hit == caster dps). + if (strmatch(text, "strength") and (strmatch(text, "strength of the clefthoof") == nil) and (strmatch(text, "set:") == nil)) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "agility")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "spirit")) then + scan_data.dps = false + scan_data.tank = false + scan_data.caster = true + scan_data.healer = true + elseif (strmatch(text, "spell power")) then + scan_data.dps = false + scan_data.tank = false + scan_data.caster = true + scan_data.healer = true + elseif (strmatch(text, "spell crit")) then + scan_data.dps = false + scan_data.tank = false + scan_data.caster = true + scan_data.healer = true + elseif (strmatch(text, "spell hit")) then + scan_data.dps = false + scan_data.tank = false + scan_data.caster = true + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "spell penetration")) then + scan_data.dps = false + scan_data.tank = false + scan_data.caster = true + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "mana per 5 sec.") or (strmatch(text, "mana every 5 seconds"))) then + scan_data.dps = false + scan_data.tank = false + scan_data.caster = true + scan_data.healer = true + elseif (strmatch(text, "attack power")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "expertise")) then + scan_data.dps = true + scan_data.tank = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "melee crit")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "critical hit")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "weapon damage")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "ranged crit")) then + scan_data.dps = true + scan_data.tank = false + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "melee haste")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "ranged haste")) then + scan_data.dps = true + scan_data.tank = false + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "melee hit")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "ranged hit")) then + scan_data.dps = true + scan_data.tank = false + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "armor pen")) then + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "feral attack power")) then + scan_data.tank = true + scan_data.dps = true + scan_data.caster = false + scan_data.healer = false + elseif (strmatch(text, "defense") and (strmatch(text, "defenseless") == nil)) then + scan_data.dps = false + scan_data.tank = true + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "block")) then + scan_data.dps = false + scan_data.tank = true + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "parry")) then + scan_data.dps = false + scan_data.tank = true + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + elseif (strmatch(text, "dodge") and (strmatch(text, "set:") == nil)) then + scan_data.dps = false + scan_data.tank = true + scan_data.caster = false + scan_data.healer = false + scan_data.verifiedclass = true + end + end + + -- Classes + local class_type = strmatch(text_l, "Classes: (.+)") + + if class_type then + for idx, class in ipairs(ORDERED_CLASS_TYPES) do + if strmatch(class_type, class) then + scan_data[class] = true + scan_data.found_class = true + end + end + end + + -- Armor types + if ITEM_TYPES[text_l] then + scan_data[text_l] = true + elseif text_l == "Held In Off-hand" or text_l == "Off Hand" or text_l == "Main Hand" then -- Special cases. + scan_data["One-Hand"] = true + elseif text_l == "Projectile" then + scan_data["Ammo"] = true + end + + if text_r and ITEM_TYPES[text_r] then + scan_data[text_r] = true + end + + -- Enchantment voodoo + local ench_type, _ = strmatch(text_l, "Enchant (.+) %- (.+)") + + if ench_type then + if ITEM_TYPES[ench_type] then + scan_data[ench_type] = true + elseif ITEM_TYPES[ENCHANT_TO_ITEM[ench_type]] then + scan_data[ENCHANT_TO_ITEM[ench_type]] = true + elseif ench_type == "Weapon" then -- Special case. + scan_data["One-Hand"] = true + scan_data["Two-Hand"] = true + end + end + end -- for + end + + -- Flag data for printing. Wiped and re-used. + local missing_flags = {} + local extra_flags = {} + local output = {} + + --- Prints out the results of the tooltip scan. + -- @name AckisRecipeList:PrintScanResults + function addon:PrintScanResults() + -- Parse the recipe database until we get a match on the name + local recipe_name = gsub(scan_data.match_name, "%a+%?: ", "") + local spell_id = scan_data.reverse_lookup[recipe_name] + + if (not spell_id) then + self:Print("Recipe " .. recipe_name .. " has no reverse lookup") + return + end + + local flags = scan_data.recipe_list[spell_id]["Flags"] + local acquire = scan_data.recipe_list[spell_id]["Acquire"] + twipe(missing_flags) + twipe(extra_flags) + twipe(output) + + -- If we're a vendor scan, do some extra checks + if (scan_data.is_vendor) then + -- Check to see if the vendor flag is set + if (not flags[4]) then + tinsert(missing_flags, "4 (Vendor)") + end + + -- Check to see if we're in a PVP zone + if (((GetSubZoneText() == "Wintergrasp Fortress") or (GetSubZoneText() == "Halaa")) and (not flags[9])) then + tinsert(missing_flags, "9 (PvP)") + elseif ((flags[9]) and not ((GetSubZoneText() == "Wintergrasp Fortress") or (GetSubZoneText() == "Halaa"))) then + tinsert(extra_flags, "9 (PvP)") + end + end + + -- -- If we've picked up at least one class flag + if (scan_data.found_class) then + for k, v in ipairs(ORDERED_CLASS_TYPES) do + if scan_data[v] and not flags[CLASS_TYPES[v]] then + tinsert(missing_flags, tostring(CLASS_TYPES[v]).." ("..v..")") + elseif not scan_data[v] and flags[CLASS_TYPES[v]] then + tinsert(extra_flags, tostring(CLASS_TYPES[v]).." ("..v..")") + end + end + end + + -- BoP Item + if (scan_data.is_item) then + if (scan_data.bopitem) and (not flags[37]) then + tinsert(missing_flags, "37 (BoP Item)") + -- If it's a BoP item and flags BoE is set, mark it as extra + if (flags[36]) then + tinsert(extra_flags, "36 (BoE Item)") + end + -- If it's a BoP item and flags BoA is set, mark it as extra + if (flags[38]) then + tinsert(extra_flags, "38 (BoA Item)") + end + -- BoE Item, assuming it's not BoA + elseif (not flags[36]) and (not scan_data.bopitem) then + tinsert(missing_flags, "36 (BoE Item)") + -- If it's a BoE item and flags BoP is set, mark it as extra + if (flags[37]) then + tinsert(extra_flags, "37 (BoP Item)") + end + -- If it's a BoE item and flags BoA is set, mark it as extra + if (flags[38]) then + tinsert(extra_flags, "38 (BoA Item)") + end + end + else + -- BoP Recipe + if (scan_data.boprecipe) and (not flags[41]) then + tinsert(missing_flags, "41 (BoP Recipe)") + -- If it's a BoP recipe and flags BoE is set, mark it as extra + if (flags[40]) then + tinsert(extra_flags, "40 (BoE Recipe)") + end + -- If it's a BoP recipe and flags BoA is set, mark it as extra + if (flags[42]) then + tinsert(extra_flags, "42 (BoA Recipe)") + end + -- Not BoP recipe, assuming it's not BoA - trainer-taught recipes don't have bind information, skip those. + elseif not flags[3] and (not flags[40]) and (not scan_data.boprecipe) then + tinsert(missing_flags, "40 (BoE Recipe)") + -- If it's a BoE recipe and flags BoP is set, mark it as extra + if (flags[41]) then + tinsert(extra_flags, "41 (BoP Recipe)") + end + -- If it's a BoE recipe and flags BoA is set, mark it as extra + if (flags[42]) then + tinsert(extra_flags, "42 (BoA Recipe)") + end + end + end + + for k, v in ipairs(ORDERED_ROLE_TYPES) do + if scan_data[v] and not flags[ROLE_TYPES[v]] then + tinsert(missing_flags, tostring(ROLE_TYPES[v]).." ("..v..")") + elseif not scan_data[v] and flags[ROLE_TYPES[v]] then + tinsert(extra_flags, tostring(ROLE_TYPES[v]).." ("..v..")") + end + end + + for k, v in ipairs(ORDERED_ITEM_TYPES) do + if scan_data[v] and not flags[ITEM_TYPES[v]] then + tinsert(missing_flags, tostring(ITEM_TYPES[v]).." ("..v..")") + elseif not scan_data[v] and flags[ITEM_TYPES[v]] then + tinsert(extra_flags, tostring(ITEM_TYPES[v]).." ("..v..")") + end + end + + -- Reputations + local repid = scan_data.repid + local addedtotable = false + + if repid and not flags[repid] then + tinsert(missing_flags, repid) + + for i, j in pairs(acquire) do + if (acquire[j]["Type"] == 6) then + local tmpacquire = acquire[j] + + if (tmpacquire["RepLevel"] ~= scan_data.repidlevel) then + tinsert(output, "Rep level wrong. " .. recipe_name .. " (" .. spell_id .. ")") + end + end + end + end + + if (#missing_flags > 0) or (#extra_flags > 0) then + addedtotable = true + tinsert(output, recipe_name .. " (" .. spell_id .. ")") + + -- Add a string of the missing flag numbers + if (#missing_flags > 0) then + tinsert(output, "Missing flags: " .. tconcat(missing_flags, ", ")) + end + + -- Add a string of the extra flag numbers + if (#extra_flags > 0) then + tinsert(output, "Extra flags: " .. tconcat(extra_flags, ", ")) + end + + local found_type = false + + for k, v in ipairs(ORDERED_ITEM_TYPES) do + if scan_data[v] then + found_type = true + break + end + end + + if not found_type then + tinsert(output, "Missing: item type flag") + end + end + + -- Check to see if we have a horde/alliance flag, all recipes must have one of these + if (not flags[1]) and (not flags[2]) then + addedtotable = true + tinsert(output, "Horde or alliance not selected. " .. recipe_name .. " (" .. spell_id .. ")") + end + + -- Check to see if we have an obtain method flag, all recipes must have at least one of these + if ((not flags[3]) and (not flags[4]) and (not flags[5]) and (not flags[6]) and (not flags[7]) + and (not flags[8]) and (not flags[9]) and (not flags[10]) and (not flags[11]) and (not flags[12])) then + addedtotable = true + tinsert(output, "No obtain flag. " .. recipe_name .. " (" .. spell_id .. ")") + end + + -- Check for recipe binding information, all recipes must have one of these + if (not flags[40]) and (not flags[41]) and (not flags[42]) then + addedtotable = true + tinsert(output, "No recipe binding information. " .. recipe_name .. " (" .. spell_id .. ")") + end + + -- Check for item binding information, all recipes must have one of these + if (not flags[36]) and (not flags[37]) and (not flags[38]) then + addedtotable = true + tinsert(output, "No item binding information. " .. recipe_name .. " (" .. spell_id .. ")") + end + + -- We need to code this better. Some items (aka bags) won't have a role at all. + -- Check for player role flags + if (not scan_data.tank) and (not scan_data.healer) and (not scan_data.caster) and (not scan_data.dps) and (not NO_PLAYER_FLAG[spell_id]) then + addedtotable = true + tinsert(output, "No player role flag. " .. recipe_name .. " (" .. spell_id .. ").") + end + + if (scan_data.specialty) then + if (not scan_data.recipe_list[spell_id]["Specialty"]) then + addedtotable = true + tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Missing Specialty: " .. scan_data.specialty) + elseif (scan_data.recipe_list[spell_id]["Specialty"] ~= scan_data.specialty) then + tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Wrong Specialty, the correct one is: " .. scan_data.specialty) + end + elseif (scan_data.recipe_list[spell_id]["Specialty"]) then + addedtotable = true + tinsert(output, "Recipe: " .. recipe_name .. " (" .. spell_id .. ") Extra Specialty: " .. scan_data.recipe_list[spell_id]["Specialty"]) + end + + if (addedtotable) then + return tconcat(output, "\n") + else + return nil + end + + end + +end \ No newline at end of file diff --git a/Frame.lua b/Frame.lua index 8d49045..ed4cacc 100644 --- a/Frame.lua +++ b/Frame.lua @@ -9,8 +9,7 @@ -- Please see http://www.wowace.com/projects/arl/for more information. ------------------------------------------------------------------------------- -- License: --- Please see LICENSE.txt - +-- Please see LICENSE.txt -- This source code is released under All Rights Reserved. ------------------------------------------------------------------------------- --- **AckisRecipeList** provides an interface for scanning professions for missing recipes. -- 1.7.9.5