[Quest API] Add EVENT_LEVEL_UP and EVENT_LEVEL_DOWN to Bots (#3750)

* [Quest API] Add EVENT_LEVEL_UP and EVENT_LEVEL_DOWN to bots

# Notes
- Bots did not have these events, this will allow operators to perform events on bot level up/down.

* Update bot.cpp
This commit is contained in:
Alex King
2023-12-16 23:23:38 -05:00
committed by GitHub
parent 33adb9bcc1
commit 9c238cd08d
4 changed files with 76 additions and 24 deletions
+26
View File
@@ -2300,4 +2300,30 @@ void handle_bot_damage(
lua_setfield(L, -2, "other");
}
void handle_bot_level_up(
QuestInterface *parse,
lua_State* L,
Bot* bot,
Mob *init,
std::string data,
uint32 extra_data,
std::vector<std::any> *extra_pointers
) {
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "levels_gained");
}
void handle_bot_level_down(
QuestInterface *parse,
lua_State* L,
Bot* bot,
Mob *init,
std::string data,
uint32 extra_data,
std::vector<std::any> *extra_pointers
) {
lua_pushinteger(L, Strings::ToInt(data));
lua_setfield(L, -2, "levels_lost");
}
#endif