[Tradeskills] Implement learning recipes from books (#4170)

This uses the book scribe button to learn recipes in SoF+ clients. For
Titanium clients the button is not available so a workaround will need
to be added later.

Note live gives no feedback when scribing books (at least those tested).
This commit is contained in:
hg
2024-03-23 00:50:06 -04:00
committed by GitHub
parent 96830b4a19
commit 5bfd8f5da2
5 changed files with 66 additions and 23 deletions
+4 -3
View File
@@ -4168,10 +4168,11 @@ void Client::Handle_OP_BookButton(const EQApplicationPacket* app)
BookButton_Struct* book = reinterpret_cast<BookButton_Struct*>(app->pBuffer);
const EQ::ItemInstance* const inst = GetInv().GetItem(book->invslot);
if (inst && inst->GetItem()->Book)
if (inst && inst->GetItem())
{
// todo: if scribe book learn recipes and delete book from inventory
// todo: if cast book use its spell on target and delete book from inventory (unless reusable?)
// todo: cast spell button (unknown if anything on live uses this)
ScribeRecipes(inst->GetItem()->ID);
DeleteItemInInventory(book->invslot, 1, true);
}
EQApplicationPacket outapp(OP_FinishWindow, 0);