mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-07 17:22:26 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_TRADE (#2906)
# Notes - Optionally parse this event instead of always doing so.
This commit is contained in:
parent
84156829a7
commit
90def9b882
14
zone/bot.cpp
14
zone/bot.cpp
@ -5208,8 +5208,11 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
|||||||
std::vector<EQ::ItemInstance*> items(insts, insts + std::size(insts));
|
std::vector<EQ::ItemInstance*> items(insts, insts + std::size(insts));
|
||||||
|
|
||||||
// Check if EVENT_TRADE accepts any items
|
// Check if EVENT_TRADE accepts any items
|
||||||
std::vector<std::any> item_list(items.begin(), items.end());
|
if (parse->BotHasQuestSub(EVENT_TRADE)) {
|
||||||
parse->EventBot(EVENT_TRADE, this, client, "", 0, &item_list);
|
std::vector<std::any> item_list(items.begin(), items.end());
|
||||||
|
parse->EventBot(EVENT_TRADE, this, client, "", 0, &item_list);
|
||||||
|
}
|
||||||
|
|
||||||
CalcBotStats(false);
|
CalcBotStats(false);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -5224,8 +5227,11 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
|||||||
std::vector<EQ::ItemInstance*> items(insts, insts + std::size(insts));
|
std::vector<EQ::ItemInstance*> items(insts, insts + std::size(insts));
|
||||||
|
|
||||||
// Check if EVENT_TRADE accepts any items
|
// Check if EVENT_TRADE accepts any items
|
||||||
std::vector<std::any> item_list(items.begin(), items.end());
|
if (parse->BotHasQuestSub(EVENT_TRADE)) {
|
||||||
parse->EventBot(EVENT_TRADE, this, client, "", 0, &item_list);
|
std::vector<std::any> item_list(items.begin(), items.end());
|
||||||
|
parse->EventBot(EVENT_TRADE, this, client, "", 0, &item_list);
|
||||||
|
}
|
||||||
|
|
||||||
CalcBotStats(false);
|
CalcBotStats(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -851,8 +851,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
|||||||
tradingWith->FaceTarget(this);
|
tradingWith->FaceTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::any> item_list(items.begin(), items.end());
|
if (parse->HasQuestSub(tradingWith->GetNPCTypeID(), EVENT_TRADE)) {
|
||||||
parse->EventNPC(EVENT_TRADE, tradingWith->CastToNPC(), this, "", 0, &item_list);
|
std::vector<std::any> item_list(items.begin(), items.end());
|
||||||
|
parse->EventNPC(EVENT_TRADE, tradingWith->CastToNPC(), this, "", 0, &item_list);
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = 0; i < 4; ++i) {
|
for(int i = 0; i < 4; ++i) {
|
||||||
if(insts[i]) {
|
if(insts[i]) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user