mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_BOT_CREATE (#2886)
* [Quest API] Optionally parse EVENT_BOT_CREATE - Optionally parse this event instead of always doing so. * Cleanup * Cleanup
This commit is contained in:
parent
5be3780a54
commit
384de31989
@ -9935,8 +9935,8 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
|||||||
);
|
);
|
||||||
|
|
||||||
bot_id = my_bot->GetBotID();
|
bot_id = my_bot->GetBotID();
|
||||||
|
if (parse->PlayerHasQuestSub(EVENT_BOT_CREATE)) {
|
||||||
const auto export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {}",
|
||||||
bot_name,
|
bot_name,
|
||||||
bot_id,
|
bot_id,
|
||||||
@ -9946,6 +9946,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
|||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_BOT_CREATE, bot_owner, export_string, 0);
|
parse->EventPlayer(EVENT_BOT_CREATE, bot_owner, export_string, 0);
|
||||||
|
}
|
||||||
|
|
||||||
safe_delete(my_bot);
|
safe_delete(my_bot);
|
||||||
|
|
||||||
|
|||||||
@ -2427,7 +2427,8 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
|
|||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
const auto export_string = fmt::format(
|
if (parse->PlayerHasQuestSub(EVENT_BOT_CREATE)) {
|
||||||
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {}",
|
||||||
name,
|
name,
|
||||||
new_bot->GetBotID(),
|
new_bot->GetBotID(),
|
||||||
@ -2437,6 +2438,7 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
|
|||||||
);
|
);
|
||||||
|
|
||||||
parse->EventPlayer(EVENT_BOT_CREATE, initiator, export_string, 0);
|
parse->EventPlayer(EVENT_BOT_CREATE, initiator, export_string, 0);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user