Added NPCBot commands

This commit is contained in:
2024-01-21 21:12:53 -05:00
parent a3997ac988
commit d0dbc0c349
3 changed files with 28 additions and 0 deletions

View File

@@ -237,6 +237,7 @@ class Eluna_AllMapScript : public AllMapScript
public:
Eluna_AllMapScript() : AllMapScript("Eluna_AllMapScript") { }
void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override
{
instanceData = sEluna->GetInstanceData(instanceMap);

View File

@@ -393,6 +393,25 @@ namespace LuaCreature
return 1;
}
/** -- NPCBOT Start */
#if defined(AZEROTHCORE)
int IsNPCBot(lua_State* L, Creature* creature)
{
Eluna::Push(L, creature->IsNPCBot());
return 1;
}
int GetBotOwner(lua_State* L, Creature* creature)
{
if(!creature->IsNPCBot())
return 0;
Eluna::Push(L, creature->GetBotOwner());
return 1;
}
#endif
/** -- NPCBot End */
#if defined(TRINITY) || defined(AZEROTHCORE)
/**
* Returns `true` if the [Creature] is an invisible trigger,

View File

@@ -910,6 +910,14 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "MoveWaypoint", &LuaCreature::MoveWaypoint },
{ "UpdateEntry", &LuaCreature::UpdateEntry },
/** -- NPCBOT Start */
#if defined(AZEROTHCORE)
{ "IsNPCBot", &LuaCreature::IsNPCBot },
{ "GetBotOwner", }
#endif
/** -- NPCBOT End */
{ NULL, NULL }
};