mirror of
https://github.com/araxiaonline/mod-eluna.git
synced 2026-06-13 03:02:27 -04:00
Added NPCBot commands
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user