mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Feature] Add Support for Tradeskill Recipe Inspect (#4648)
* [Feature] Add Support for Tradeskill Recipe Inspect * Push * Update client_packet.cpp
This commit is contained in:
@@ -67,6 +67,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/repositories/guild_tributes_repository.h"
|
||||
#include "../common/repositories/buyer_buy_lines_repository.h"
|
||||
#include "../common/repositories/character_pet_name_repository.h"
|
||||
#include "../common/repositories/tradeskill_recipe_entries_repository.h"
|
||||
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "../common/repositories/character_stats_record_repository.h"
|
||||
@@ -408,6 +409,7 @@ void MapOpcodes()
|
||||
ConnectedOpcodes[OP_TradeRequestAck] = &Client::Handle_OP_TradeRequestAck;
|
||||
ConnectedOpcodes[OP_TraderShop] = &Client::Handle_OP_TraderShop;
|
||||
ConnectedOpcodes[OP_TradeSkillCombine] = &Client::Handle_OP_TradeSkillCombine;
|
||||
ConnectedOpcodes[OP_TradeSkillRecipeInspect] = &Client::Handle_OP_TradeSkillRecipeInspect;
|
||||
ConnectedOpcodes[OP_Translocate] = &Client::Handle_OP_Translocate;
|
||||
ConnectedOpcodes[OP_TributeItem] = &Client::Handle_OP_TributeItem;
|
||||
ConnectedOpcodes[OP_TributeMoney] = &Client::Handle_OP_TributeMoney;
|
||||
@@ -15644,6 +15646,40 @@ void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_TradeSkillRecipeInspect(const EQApplicationPacket* app)
|
||||
{
|
||||
if (app->size != sizeof(TradeSkillRecipeInspect_Struct)) {
|
||||
LogError(
|
||||
"Invalid size for TradeSkillRecipeInspect_Struct: Expected: [{}] Got: [{}]",
|
||||
sizeof(TradeSkillRecipeInspect_Struct),
|
||||
app->size
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
auto s = (TradeSkillRecipeInspect_Struct*) app->pBuffer;
|
||||
|
||||
const auto& v = TradeskillRecipeEntriesRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`recipe_id` = {} AND `componentcount` = 0 AND `successcount` > 0 LIMIT 1",
|
||||
s->recipe_id
|
||||
)
|
||||
);
|
||||
|
||||
if (v.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32 item_id = v.front().item_id;
|
||||
|
||||
auto inst = database.CreateItem(item_id);
|
||||
if (inst) {
|
||||
SendItemPacket(0, inst, ItemPacketViewLink);
|
||||
safe_delete(inst);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Translocate(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(Translocate_Struct)) {
|
||||
|
||||
@@ -310,6 +310,7 @@
|
||||
void Handle_OP_TradeRequestAck(const EQApplicationPacket *app);
|
||||
void Handle_OP_TraderShop(const EQApplicationPacket *app);
|
||||
void Handle_OP_TradeSkillCombine(const EQApplicationPacket *app);
|
||||
void Handle_OP_TradeSkillRecipeInspect(const EQApplicationPacket* app);
|
||||
void Handle_OP_Translocate(const EQApplicationPacket *app);
|
||||
void Handle_OP_TributeItem(const EQApplicationPacket *app);
|
||||
void Handle_OP_TributeMoney(const EQApplicationPacket *app);
|
||||
|
||||
+2
-1
@@ -917,7 +917,8 @@ luabind::scope lua_register_packet_opcodes() {
|
||||
luabind::value("ClientTimeStamp", static_cast<int>(OP_ClientTimeStamp)),
|
||||
luabind::value("GuildPromote", static_cast<int>(OP_GuildPromote)),
|
||||
luabind::value("Fling", static_cast<int>(OP_Fling)),
|
||||
luabind::value("PickZoneWindow", static_cast<int>(OP_PickZoneWindow))
|
||||
luabind::value("PickZoneWindow", static_cast<int>(OP_PickZoneWindow)),
|
||||
luabind::value("TradeSkillRecipeInspect", static_cast<int>(OP_TradeSkillRecipeInspect))
|
||||
)];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user