diff --git a/src/modules/Eluna/ElunaIncludes.h b/src/modules/Eluna/ElunaIncludes.h index 26e611421..4b4d98edb 100644 --- a/src/modules/Eluna/ElunaIncludes.h +++ b/src/modules/Eluna/ElunaIncludes.h @@ -128,7 +128,7 @@ typedef ThreatContainer::StorageType ThreatList; #define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT #endif -#if defined(WOTLK) && !defined(MANGOS) +#if defined(CATA) || (defined(WOTLK) && !defined(MANGOS)) #define UNIT_BYTE2_FLAG_SANCTUARY UNIT_BYTE2_FLAG_SUPPORTABLE #endif diff --git a/src/modules/Eluna/GameObjectMethods.h b/src/modules/Eluna/GameObjectMethods.h index 38d084539..b39499ada 100644 --- a/src/modules/Eluna/GameObjectMethods.h +++ b/src/modules/Eluna/GameObjectMethods.h @@ -59,7 +59,11 @@ namespace LuaGameObject */ int IsActive(lua_State* L, GameObject* go) { +#if defined(MANGOS) && defined(CATA) + Eluna::Push(L, go->IsActiveObject()); +#else Eluna::Push(L, go->isActiveObject()); +#endif return 1; } diff --git a/src/modules/Eluna/GlobalMethods.h b/src/modules/Eluna/GlobalMethods.h index d09fd90b7..6b28ea319 100644 --- a/src/modules/Eluna/GlobalMethods.h +++ b/src/modules/Eluna/GlobalMethods.h @@ -1786,15 +1786,7 @@ namespace LuaGlobalFunctions uint32 incrtime = Eluna::CHECKVAL(L, 4); uint32 extendedcost = Eluna::CHECKVAL(L, 5); -#ifndef TRINITY - if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0)) - return 0; -#ifndef CLASSIC - eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost); -#else - eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime); -#endif -#else +#ifdef TRINITY #ifdef CATA if (!eObjectMgr->IsVendorItemValid(entry, item, maxcount, incrtime, extendedcost, 1)) return 0; @@ -1804,6 +1796,20 @@ namespace LuaGlobalFunctions return 0; eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost); #endif +#else +#ifdef CATA + if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, VENDOR_ITEM_TYPE_ITEM, maxcount, incrtime, extendedcost, 0)) + return 0; + eObjectMgr->AddVendorItem(entry, item, VENDOR_ITEM_TYPE_ITEM, maxcount, incrtime, extendedcost); +#else + if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0)) + return 0; +#ifndef CLASSIC + eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost); +#else + eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime); +#endif +#endif #endif return 0; } diff --git a/src/modules/Eluna/PlayerMethods.h b/src/modules/Eluna/PlayerMethods.h index 5908f7379..5ead36c64 100644 --- a/src/modules/Eluna/PlayerMethods.h +++ b/src/modules/Eluna/PlayerMethods.h @@ -2597,15 +2597,15 @@ namespace LuaPlayer { bool no_cost = Eluna::CHECKVAL(L, 2, true); +#ifdef TRINITY #ifdef CATA player->ResetTalents(no_cost); #else -#ifdef TRINITY player->ResetTalents(no_cost); +#endif #else player->resetTalents(no_cost); #endif -#endif #if (!defined(TBC) && !defined(CLASSIC)) player->SendTalentsInfoData(false); #endif diff --git a/src/modules/Eluna/UnitMethods.h b/src/modules/Eluna/UnitMethods.h index 2150636dd..a0db0a465 100644 --- a/src/modules/Eluna/UnitMethods.h +++ b/src/modules/Eluna/UnitMethods.h @@ -2183,7 +2183,7 @@ namespace LuaUnit float maxHeight = Eluna::CHECKVAL(L, 6); uint32 id = Eluna::CHECKVAL(L, 7, 0); -#if (defined(CMANGOS) || defined(MANGOS)) && defined(WOTLK) +#if (defined(CMANGOS) || defined(MANGOS)) && (defined(WOTLK) || defined(CATA)) unit->GetMotionMaster()->MoveJump(x, y, z, zSpeed, maxHeight, id); #else Position pos(x, y, z); @@ -2449,7 +2449,14 @@ namespace LuaUnit for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i) { +#if defined(MANGOS) && defined(CATA) + SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(i)); + if (!spellEffect) + continue; + uint8 eff = spellEffect->Effect; +#else uint8 eff = spellInfo->Effect[i]; +#endif if (eff >= TOTAL_SPELL_EFFECTS) continue; if (IsAreaAuraEffect(eff) ||