Quantcast

Add function to compare skill levels internally with the skill levels off of a trainer, update alchemy and enchanting skill levels to match. To run this command, open up a trainer, do a scan, then type /arl scandata

ackis [03-16-09 - 21:38]
Add function to compare skill levels internally with the skill levels off of a trainer, update alchemy and enchanting skill levels to match.  To run this command, open up a trainer, do a scan, then type /arl scandata
Filename
AckisRecipeList.lua
RecipeDB/ARL-Alchemy.lua
RecipeDB/ARL-Enchant.lua
diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index 79349d3..ab6e2fb 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -1352,6 +1352,8 @@ function addon:ChatCommand(input)
 		self:AckisRecipeList_Command(false)
 	elseif (input == tolower("minedata")) then
 		self:MineSkillLevelData()
+	elseif (input == tolower("scandata")) then
+		self:ScanSkillLevelData()
 	else
 		-- What happens when we get here?
 		LibStub("AceConfigCmd-3.0"):HandleCommand("arl", "Ackis Recipe List", input)
@@ -1797,6 +1799,24 @@ do

 	end

+	-- Description: API for external addons to get recipe database from ARL
+	-- Expected result: The recipe database is returned if it exists
+	-- Input: None
+	-- Output: A table containing all its information
+
+	--- API for external addons to get recipe database from ARL
+	-- @name AckisRecipeList:GetRecipeTable
+	-- @return Table containing all recipe information or nil if it's not found.
+	function addon:GetRecipeTable()
+
+		if (RecipeList) then
+			return RecipeList
+		else
+			return nil
+		end
+
+	end
+
 end

 --[[
@@ -2146,7 +2166,7 @@ function addon:MineSkillLevelData()
 			local name = GetTrainerServiceInfo(i)
 			local _,skilllevel = GetTrainerServiceSkillReq(i)
 			if not skilllevel then
-				skilllevel = 1
+				skilllevel = 0
 			end
 			local skillleveltext = "\"" .. name .. "\" => " .. skilllevel .. ","
 			tinsert(t,skillleveltext)
@@ -2157,3 +2177,36 @@ function addon:MineSkillLevelData()
 	end

 end
+
+-- Description: Parses a trainer, comparing skill levels internal to those on the trainer.
+-- Expected result: Trade skills with a skill level different are output.
+-- Input: None
+-- Output: Text in chat window
+
+function addon:ScanSkillLevelData()
+
+	if (IsTradeskillTrainer()) then
+		SetTrainerServiceTypeFilter("available", 1)
+		SetTrainerServiceTypeFilter("unavailable", 1)
+		SetTrainerServiceTypeFilter("used", 1)
+		local t = {}
+		for i=1,GetNumTrainerServices(),1 do
+			local name = GetTrainerServiceInfo(i)
+			local _,skilllevel = GetTrainerServiceSkillReq(i)
+			if not skilllevel then
+				skilllevel = 0
+			end
+			t[name] = skilllevel
+		end
+		local recipelist = addon:GetRecipeTable()
+		for i in pairs(recipelist) do
+			local i_name = recipelist[i]["Name"]
+			if (t[i_name]) and (t[i_name] ~= recipelist[i]["Level"]) then
+				self:Print("DEBUG: Recipe level different! Name: " .. i_name .. " Internal Level: " ..  recipelist[i]["Level"] .. " External Level: " .. t[i_name])
+			end
+		end
+	else
+		self:Print("This can only be used for a trade skill trainer.  Dumbass.")
+	end
+
+end
diff --git a/RecipeDB/ARL-Alchemy.lua b/RecipeDB/ARL-Alchemy.lua
index e7f8e04..77a1cce 100644
--- a/RecipeDB/ARL-Alchemy.lua
+++ b/RecipeDB/ARL-Alchemy.lua
@@ -1504,13 +1504,13 @@ function addon:InitAlchemy(RecipeDB)

 	-- Ethereal Oil -- 62409
 	recipecount = recipecount + 1
-	self:addTradeSkill(RecipeDB,62409,395,nil,1,2259)
+	self:addTradeSkill(RecipeDB,62409,375,nil,1,2259)
 	self:addTradeFlags(RecipeDB,62409,1,2,3,21,22,23,24,25,26,27,28,29,30,36,41)
 	self:addTradeAcquire(RecipeDB,62409,1,26903,1,26951,1,26975,1,26987,1,28703)

 	-- Lesser Flask of Resistance -- 62213
 	recipecount = recipecount + 1
-	self:addTradeSkill(RecipeDB,62213,395,44939,1,2259)
+	self:addTradeSkill(RecipeDB,62213,385,44939,1,2259)
 	self:addTradeFlags(RecipeDB,62213,1,2,3,21,22,23,24,25,26,27,28,29,30,36,41)
 	self:addTradeAcquire(RecipeDB,62213,1,26903,1,26951,1,26975,1,26987,1,28703)

diff --git a/RecipeDB/ARL-Enchant.lua b/RecipeDB/ARL-Enchant.lua
index dc45c66..cda3db8 100644
--- a/RecipeDB/ARL-Enchant.lua
+++ b/RecipeDB/ARL-Enchant.lua
@@ -1546,7 +1546,7 @@ function addon:InitEnchanting(RecipeDB)

 	-- Enchant 2H Weapon - Greater Savagery -- 44630
 	recipecount = recipecount + 1
-	self:addTradeSkill(RecipeDB,44630,380,nil,1,7411)
+	self:addTradeSkill(RecipeDB,44630,390,nil,1,7411)
 	self:addTradeFlags(RecipeDB,44630,1,2,3,21,22,23,24,25,26,27,28,29,30,36,41)
 	self:addTradeAcquire(RecipeDB,44630,1,26906,1,26954,1,26980,1,26990,1,28693)