Quantcast

Add in some dry-coded stuff to deal with cooking and first aid books/quests for the profession levels... this is gonna shit out on you if you're in that small skill level where you know the book but your level isn't past the book yet... because I'm lazy. Also optimize a counter to save between 17 to 500 table look ups depending on your profession. Fo' drizzle!

ackis [01-21-09 - 19:20]
Add in some dry-coded stuff to deal with cooking and first aid books/quests for the profession levels... this is gonna shit out on you if you're in that small skill level where you know the book but your level isn't past the book yet... because I'm lazy.  Also optimize a counter to save between 17 to 500 table look ups depending on your profession. Fo' drizzle!
Filename
AckisRecipeList.lua
RecipeDB/ARL-Cook.lua
RecipeDB/ARL-FirstAid.lua
diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index b40eaee..e7b41e5 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -732,10 +732,8 @@ function addon:ScanForKnownRecipes(RecipeDB, playerData)

 	-- Clear the "Have Materials" check box
 	if (not Skillet) and TradeSkillFrameAvailableFilterCheckButton:GetChecked() then
-
 		TradeSkillFrameAvailableFilterCheckButton:SetChecked(false)
 		TradeSkillOnlyShowMakeable(false)
-
 	end

 	-- Clear the sub-classes filters
@@ -748,27 +746,20 @@ function addon:ScanForKnownRecipes(RecipeDB, playerData)

 	-- Expand all headers so we can see all the recipes there are
 	for i = GetNumTradeSkills(), 1, -1 do
-
 		local _, tradeType = GetTradeSkillInfo(i)
-
 		if tradeType == "header" then
-
 			ExpandTradeSkillSubClass(i)
-
 		end
-
 	end

-	playerData.foundRecipes = 0
+	local foundRecipes = 0

 	-- Scan through all recipes
 	for i = 1, GetNumTradeSkills() do
-
 		local tradeName, tradeType = GetTradeSkillInfo(i)

 		-- Ignore all trade skill headers
 		if (tradeType ~= "header") then
-
 			-- Get the trade skill link for the specified recipe
 			local SpellLink = GetTradeSkillRecipeLink(i)

@@ -779,20 +770,53 @@ function addon:ScanForKnownRecipes(RecipeDB, playerData)

 			-- Spell ID is in RecipeDB so lets flag it as known
 			if (RecipeDB[SpellID]) then
-
 				-- Update array that recipe was found
 				RecipeDB[SpellID]["Known"] = true
-				playerData.foundRecipes = playerData.foundRecipes + 1
-
+				foundRecipes = foundRecipes + 1
 			-- We didn't find it in our database, lets notify people that we don't have it
 			else
-
 				self:Print(self:Red(tradeName .. " " .. SpellString) .. self:White(L["MissingFromDB"]))
-
 			end
+		end
+
+	end
+
+	playerData.foundRecipes = foundRecipes
+
+	--@debug@
+	self:Print("DEBUG: Checking for First Aid/Cooking skill books.")
+	--@end-debug@

+	-- Cooking
+	if (playerData.playerProfession == GetSpellInfo(2550)) then
+		if (playerData.playerProfessionLevel > 300) then
+			--@debug@
+			self:Print("DEBUG: Cooking 300 book known.")
+			--@end-debug@
+			RecipeDB[33359]["Known"] = true
+		end
+		if (playerData.playerProfessionLevel > 225) then
+			--@debug@
+			self:Print("DEBUG: Cooking 225 book known.")
+			--@end-debug@
+			RecipeDB[3413]["Known"] = true
 		end
+	end

+	-- First Aid
+	if ((playerData.playerProfession == GetSpellInfo(756)) or (playerData.playerProfession == "Premiers soins")) then
+		if (playerData.playerProfessionLevel > 225) then
+			--@debug@
+			self:Print("DEBUG: First Aid 225 quest known.")
+			--@end-debug@
+			RecipeDB[10846]["Known"] = true
+		end
+		if (playerData.playerProfessionLevel > 150) then
+			--@debug@
+			self:Print("DEBUG: First Aid 150 book known.")
+			--@end-debug@
+			RecipeDB[7924]["Known"] = true
+		end
 	end

 end
diff --git a/RecipeDB/ARL-Cook.lua b/RecipeDB/ARL-Cook.lua
index a0f9975..996e388 100644
--- a/RecipeDB/ARL-Cook.lua
+++ b/RecipeDB/ARL-Cook.lua
@@ -1006,6 +1006,18 @@ function addon:InitCooking(RecipeDB)
 	self:addTradeFlags(RecipeDB,58528,1,2,4,21,22,23,24,25,26,27,28,29,30,37,41)
 	self:addTradeAcquire(RecipeDB,58528,2,31031,2,31032)

+	-- Expert Cooking -- 3413 - 225 Cooking
+	--recipecount = recipecount + 1
+	--self:addTradeSkill(RecipeDB,3413,125,16072,1,2550)
+	--self:addTradeFlags(RecipeDB,3413,1,2,4,21,22,23,24,25,26,27,28,29,30)
+	--self:addTradeAcquire(RecipeDB,3413,2,3955,2,12033)
+
+	-- Master Cooking -- 33359 - 300 cooking
+	--recipecount = recipecount + 1
+	--self:addTradeSkill(RecipeDB,33359,300,27736,1,2550)
+	--self:addTradeFlags(RecipeDB,33359,1,2,4,21,22,23,24,25,26,27,28,29,30)
+	--self:addTradeAcquire(RecipeDB,33359,2,18988,2,18987,2,18993)
+
 	return recipecount

 end
diff --git a/RecipeDB/ARL-FirstAid.lua b/RecipeDB/ARL-FirstAid.lua
index d3a4f3d..cbf6e64 100644
--- a/RecipeDB/ARL-FirstAid.lua
+++ b/RecipeDB/ARL-FirstAid.lua
@@ -134,6 +134,18 @@ function addon:InitFirstAid(RecipeDB)
 	self:addTradeFlags(RecipeDB,45546,1,2,10,21,22,23,24,25,26,27,28,29,30,36,41)
 	self:addTradeAcquire(RecipeDB,45546,7,2)

+	-- Expert First Aid -- 7924 (150 training)
+	--recipecount = recipecount + 1
+	--self:addTradeSkill(RecipeDB,7924,125,16084,1,2550)
+	--self:addTradeFlags(RecipeDB,7924,1,2,4,21,22,23,24,25,26,27,28,29,30)
+	--self:addTradeAcquire(RecipeDB,7924,2,2805,2,13476)
+
+	-- Artisan First Aid -- 10846 (225 training)
+	--recipecount = recipecount + 1
+	--self:addTradeSkill(RecipeDB,10846,225,nil,1,2550)
+	--self:addTradeFlags(RecipeDB,10846,1,2,8,21,22,23,24,25,26,27,28,29,30)
+	--self:addTradeAcquire(RecipeDB,10846,4,6622,4,6624)
+
 	return recipecount

 end