mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-21 10:11:30 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_DUEL_LOSE and EVENT_DUEL_WIN (#2915)
# Notes - Optionally parse these events instead of always doing so.
This commit is contained in:
parent
604256a223
commit
241f900dc4
@ -1787,12 +1787,29 @@ void EntityList::QueueClientsStatus(Mob *sender, const EQApplicationPacket *app,
|
|||||||
void EntityList::DuelMessage(Mob *winner, Mob *loser, bool flee)
|
void EntityList::DuelMessage(Mob *winner, Mob *loser, bool flee)
|
||||||
{
|
{
|
||||||
if (winner->GetLevelCon(winner->GetLevel(), loser->GetLevel()) > 2) {
|
if (winner->GetLevelCon(winner->GetLevel(), loser->GetLevel()) > 2) {
|
||||||
std::vector<std::any> args;
|
if (parse->PlayerHasQuestSub(EVENT_DUEL_WIN)) {
|
||||||
args.push_back(winner);
|
std::vector<std::any> args = { winner, loser };
|
||||||
args.push_back(loser);
|
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_DUEL_WIN, winner->CastToClient(), loser->GetName(), loser->CastToClient()->CharacterID(), &args);
|
parse->EventPlayer(
|
||||||
parse->EventPlayer(EVENT_DUEL_LOSE, loser->CastToClient(), winner->GetName(), winner->CastToClient()->CharacterID(), &args);
|
EVENT_DUEL_WIN,
|
||||||
|
winner->CastToClient(),
|
||||||
|
loser->GetName(),
|
||||||
|
loser->CastToClient()->CharacterID(),
|
||||||
|
&args
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_DUEL_LOSE)) {
|
||||||
|
std::vector<std::any> args = { winner, loser };
|
||||||
|
|
||||||
|
parse->EventPlayer(
|
||||||
|
EVENT_DUEL_LOSE,
|
||||||
|
loser->CastToClient(),
|
||||||
|
winner->GetName(),
|
||||||
|
winner->CastToClient()->CharacterID(),
|
||||||
|
&args
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto it = client_list.begin();
|
auto it = client_list.begin();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user