Added functions for getting raw bot data for stats and info

This commit is contained in:
2024-02-10 23:05:09 -05:00
parent 23fb801724
commit 93246b2551
2 changed files with 17 additions and 0 deletions

View File

@@ -630,6 +630,22 @@ namespace LuaCreature
return 1;
}
int GetBotDump(lua_State* L, Creature* creature)
{
if(!creature->IsNPCBot())
return 0;
bot_ai* ai = creature->GetBotAI();
Player* owner = creature->GetBotOwner();
const char* dump = ai->BotDump(owner, creature);
if(!dump)
return luaL_argerror(L, 1, "BotDump failed for bot.");
Eluna::Push(L, dump);
return 1;
}
// #endif
/** -- NPCBot End */

View File

@@ -927,6 +927,7 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "GetBotAverageItemLevel", &LuaCreature::GetBotAverageItemLevel },
{ "GetBotEquipment", &LuaCreature::GetBotEquipment },
{ "GetBotStat", &LuaCreature::GetBotStat },
{ "GetBotDump", &LuaCreature::GetBotDump },
// Setters