mirror of
https://github.com/araxiaonline/mod-eluna.git
synced 2026-06-13 03:02:27 -04:00
Added functions for getting raw bot data for stats and info
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
@@ -927,6 +927,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
||||
{ "GetBotAverageItemLevel", &LuaCreature::GetBotAverageItemLevel },
|
||||
{ "GetBotEquipment", &LuaCreature::GetBotEquipment },
|
||||
{ "GetBotStat", &LuaCreature::GetBotStat },
|
||||
{ "GetBotDump", &LuaCreature::GetBotDump },
|
||||
|
||||
|
||||
// Setters
|
||||
|
||||
Reference in New Issue
Block a user