diff --git a/CreatureMethods.h b/CreatureMethods.h
index 25b334a..3843677 100644
--- a/CreatureMethods.h
+++ b/CreatureMethods.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2010 - 2016 Eluna Lua Engine
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
@@ -1037,9 +1037,12 @@ auto const& threatlist = creature->getThreatManager().getThreatList();
*/
int SetInCombatWithZone(lua_State* /*L*/, Creature* creature)
{
-#if defined TRINITY || AZEROTHCORE
+#if defined AZEROTHCORE
if (creature->IsAIEnabled)
creature->AI()->DoZoneInCombat();
+#elif defined TRINITY
+ if (creature->IsAIEnabled())
+ creature->AI()->DoZoneInCombat();
#else
creature->SetInCombatWithZone();
#endif
diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp
index a80f6cc..643af39 100644
--- a/LuaFunctions.cpp
+++ b/LuaFunctions.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2010 - 2016 Eluna Lua Engine
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
@@ -328,7 +328,6 @@ ElunaRegister UnitMethods[] =
{ "SetSheath", &LuaUnit::SetSheath },
{ "SetCreatorGUID", &LuaUnit::SetCreatorGUID },
{ "SetMinionGUID", &LuaUnit::SetPetGUID },
- { "SetCharmerGUID", &LuaUnit::SetCharmerGUID },
{ "SetPetGUID", &LuaUnit::SetPetGUID },
#if (!defined(TBC) && !defined(CLASSIC))
{ "SetCritterGUID", &LuaUnit::SetCritterGUID },
diff --git a/UnitMethods.h b/UnitMethods.h
index 843d063..937cc98 100644
--- a/UnitMethods.h
+++ b/UnitMethods.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2010 - 2016 Eluna Lua Engine
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
@@ -68,9 +68,12 @@ namespace LuaUnit
*/
int IsRooted(lua_State* L, Unit* unit)
{
-#if defined TRINITY || AZEROTHCORE
+#ifdef AZEROTHCORE
Eluna::Push(L, unit->isInRoots() || unit->HasUnitMovementFlag(MOVEMENTFLAG_ROOT));
#endif
+#ifdef TRINITY
+ Eluna::Push(L, unit->IsRooted() || unit->HasUnitMovementFlag(MOVEMENTFLAG_ROOT));
+#endif
#ifdef CMANGOS
Eluna::Push(L, unit->isInRoots() || unit->IsRooted());
#endif
@@ -659,8 +662,10 @@ namespace LuaUnit
*/
int GetCharmGUID(lua_State* L, Unit* unit)
{
-#if defined TRINITY || AZEROTHCORE
+#if defined AZEROTHCORE
Eluna::Push(L, unit->GetCharmGUID());
+#elif defined TRINITY
+ Eluna::Push(L, unit->GetCharmedGUID());
#else
Eluna::Push(L, unit->GetCharmGuid());
#endif
@@ -1755,22 +1760,6 @@ namespace LuaUnit
return 0;
}
- /**
- * Sets charmer GUID
- *
- * @param uint64 guid
- */
- int SetCharmerGUID(lua_State* L, Unit* unit)
- {
- uint64 guid = Eluna::CHECKVAL(L, 2);
-#if defined TRINITY || AZEROTHCORE
- unit->SetCharmerGUID(ObjectGuid(guid));
-#else
- unit->SetCharmerGuid(ObjectGuid(guid));
-#endif
- return 0;
- }
-
/**
* Sets pet GUID
*