Merge pull request #87 from Leere/recipe_disable

Add the ability to disable a tradeskill recipe
This commit is contained in:
JJ 2013-11-01 08:33:13 -07:00
commit aba535b589
4 changed files with 10 additions and 5 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 10/31/2013 ==
Leere: Add the ability to disable a tradeskill recipe
== 10/28/2013 ==
Uleat: Client patch prep work for extending usable skill range (no apparent issues with Ti through RoF[12-10-2012] testing - i.e., clients showed proper skills and they didn't crash)
Uleat: This final patch aligns the existing server PlayerProfile_Struct with the previous changes. The pp_struct, as well as the character 'pp' blob, remains unchanged in size and alignment. The only difference is that the first trailing 100 bytes of the unknown array have been re-assigned to the skills array, and the unknown array decreased by the same amount.

View File

@ -0,0 +1 @@
ALTER TABLE `tradeskill_recipe` ADD `enabled` tinyint(1) NOT NULL DEFAULT '1';

View File

@ -6021,7 +6021,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app)
" FROM tradeskill_recipe AS tr "
" LEFT JOIN tradeskill_recipe_entries AS tre ON tr.id=tre.recipe_id "
" LEFT JOIN (SELECT recipe_id, madecount FROM char_recipe_list WHERE char_id = %u) AS crl ON tr.id=crl.recipe_id "
" WHERE tr.id IN (%s) "
" WHERE tr.enabled <> 0 AND tr.id IN (%s) "
" AND tr.must_learn & 0x20 <> 0x20 AND ((tr.must_learn & 0x3 <> 0 AND crl.madecount IS NOT NULL) OR (tr.must_learn & 0x3 = 0)) "
" GROUP BY tr.id "
" HAVING sum(if(tre.item_id %s AND tre.iscontainer > 0,1,0)) > 0 "
@ -6076,7 +6076,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app)
" FROM tradeskill_recipe AS tr "
" LEFT JOIN tradeskill_recipe_entries AS tre ON tr.id=tre.recipe_id "
" LEFT JOIN (SELECT recipe_id, madecount FROM char_recipe_list WHERE char_id = %u) AS crl ON tr.id=crl.recipe_id "
" WHERE %s tr.trivial >= %u AND tr.trivial <= %u "
" WHERE %s tr.trivial >= %u AND tr.trivial <= %u AND tr.enabled <> 0 "
" AND tr.must_learn & 0x20 <> 0x20 AND((tr.must_learn & 0x3 <> 0 AND crl.madecount IS NOT NULL) OR (tr.must_learn & 0x3 = 0)) "
" GROUP BY tr.id "
" HAVING sum(if(tre.item_id %s AND tre.iscontainer > 0,1,0)) > 0 "

View File

@ -1223,8 +1223,9 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
qlen = MakeAnyLenString(&query, "SELECT tre.recipe_id "
" FROM tradeskill_recipe_entries AS tre"
" WHERE ( tre.item_id IN(%s) AND tre.componentcount>0 )"
" OR ( tre.item_id %s AND tre.iscontainer=1 )"
" INNER JOIN tradeskill_recipe AS tr ON (tre.recipe_id = tr.id) "
" WHERE tr.enabled AND (( tre.item_id IN(%s) AND tre.componentcount>0 )"
" OR ( tre.item_id %s AND tre.iscontainer=1 ))"
" GROUP BY tre.recipe_id HAVING sum(tre.componentcount) = %u"
" AND sum(tre.item_id * tre.componentcount) = %u", buf2, containers, count, sum);
@ -1387,7 +1388,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
" ON tr.id = tre.recipe_id"
" LEFT JOIN (SELECT recipe_id, madecount from char_recipe_list WHERE char_id = %u) AS crl "
" ON tr.id = crl.recipe_id "
" WHERE tr.id = %lu AND tre.item_id %s"
" WHERE tr.id = %lu AND tre.item_id %s AND tr.enabled "
" GROUP BY tr.id", char_id, (unsigned long)recipe_id, containers);
if (!RunQuery(query, qlen, errbuf, &result)) {