mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 12:31:31 +00:00
[Quest API] (Performance) Check merchant events exist before export and execute (#2893)
* [Quest API] Optionally parse merchant events - Optionally parse these events instead of always doing so. * Cleanup
This commit is contained in:
parent
3474c00e7a
commit
21e42714eb
@ -2596,6 +2596,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
|
|||||||
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
|
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_ALT_CURRENCY_MERCHANT_BUY)) {
|
||||||
const auto& export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {}",
|
||||||
alt_cur_id,
|
alt_cur_id,
|
||||||
@ -2604,7 +2605,9 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
|
|||||||
item->ID,
|
item->ID,
|
||||||
cost
|
cost
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_ALT_CURRENCY_MERCHANT_BUY, this, export_string, 0);
|
parse->EventPlayer(EVENT_ALT_CURRENCY_MERCHANT_BUY, this, export_string, 0);
|
||||||
|
}
|
||||||
|
|
||||||
uint64 current_balance = AddAlternateCurrencyValue(alt_cur_id, -((int32) cost));
|
uint64 current_balance = AddAlternateCurrencyValue(alt_cur_id, -((int32) cost));
|
||||||
int16 charges = 1;
|
int16 charges = 1;
|
||||||
@ -2787,6 +2790,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app)
|
|||||||
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
|
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_ALT_CURRENCY_MERCHANT_SELL)) {
|
||||||
const auto& export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {}",
|
||||||
alt_cur_id,
|
alt_cur_id,
|
||||||
@ -2795,7 +2799,9 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app)
|
|||||||
item->ID,
|
item->ID,
|
||||||
cost
|
cost
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_ALT_CURRENCY_MERCHANT_SELL, this, export_string, 0);
|
parse->EventPlayer(EVENT_ALT_CURRENCY_MERCHANT_SELL, this, export_string, 0);
|
||||||
|
}
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
uint64 new_balance = AddAlternateCurrencyValue(alt_cur_id, cost);
|
uint64 new_balance = AddAlternateCurrencyValue(alt_cur_id, cost);
|
||||||
@ -13576,6 +13582,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
// end QS code
|
// end QS code
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_MERCHANT_BUY)) {
|
||||||
const auto& export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {}",
|
||||||
tmp->GetNPCTypeID(),
|
tmp->GetNPCTypeID(),
|
||||||
@ -13584,7 +13591,9 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
|||||||
mpo->quantity,
|
mpo->quantity,
|
||||||
mpo->price
|
mpo->price
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_MERCHANT_BUY, this, export_string, 0);
|
parse->EventPlayer(EVENT_MERCHANT_BUY, this, export_string, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (player_event_logs.IsEventEnabled(PlayerEvent::MERCHANT_PURCHASE)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::MERCHANT_PURCHASE)) {
|
||||||
auto e = PlayerEvent::MerchantPurchaseEvent{
|
auto e = PlayerEvent::MerchantPurchaseEvent{
|
||||||
@ -13772,6 +13781,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
// end QS code
|
// end QS code
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_MERCHANT_SELL)) {
|
||||||
const auto& export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {}",
|
||||||
vendor->GetNPCTypeID(),
|
vendor->GetNPCTypeID(),
|
||||||
@ -13780,7 +13790,9 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app)
|
|||||||
mp->quantity,
|
mp->quantity,
|
||||||
price
|
price
|
||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_MERCHANT_SELL, this, export_string, 0);
|
parse->EventPlayer(EVENT_MERCHANT_SELL, this, export_string, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (player_event_logs.IsEventEnabled(PlayerEvent::MERCHANT_SELL)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::MERCHANT_SELL)) {
|
||||||
auto e = PlayerEvent::MerchantSellEvent{
|
auto e = PlayerEvent::MerchantSellEvent{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user