diff --git a/ElunaUtility.h b/ElunaUtility.h index 444d801..6a28557 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -13,6 +13,7 @@ #define EXP_TBC 1 #define EXP_WOTLK 2 #define EXP_CATA 3 +#define EXP_MISTS 4 #if !defined ELUNA_CMANGOS #include "SharedDefines.h" diff --git a/hooks/CreatureHooks.cpp b/hooks/CreatureHooks.cpp index 8a5ebdf..7a1d3b9 100644 --- a/hooks/CreatureHooks.cpp +++ b/hooks/CreatureHooks.cpp @@ -285,7 +285,7 @@ bool Eluna::SpellHit(Creature* me, WorldObject* caster, SpellInfo const* spell) START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_HIT_BY_SPELL, me, false); HookPush(me); HookPush(caster); -#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK) +#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK || ELUNA_EXPANSION == EXP_MISTS) HookPush(spell->ID); // Pass spell object? #else HookPush(spell->Id); // Pass spell object? @@ -299,7 +299,7 @@ bool Eluna::SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* s START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_SPELL_HIT_TARGET, me, false); HookPush(me); HookPush(target); -#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK) +#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK || ELUNA_EXPANSION == EXP_MISTS) HookPush(spell->ID); // Pass spell object? #else HookPush(spell->Id); // Pass spell object? diff --git a/hooks/ServerHooks.cpp b/hooks/ServerHooks.cpp index 1f0ab11..47bbe28 100644 --- a/hooks/ServerHooks.cpp +++ b/hooks/ServerHooks.cpp @@ -119,6 +119,8 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger) HookPush(pTrigger->entry); #elif defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_WOTLK) HookPush(pTrigger->ID); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + HookPush(pTrigger->ID); #else HookPush(pTrigger->id); #endif diff --git a/methods/Mangos/BattleGroundMethods.h b/methods/Mangos/BattleGroundMethods.h index 5ca31c5..d874f62 100644 --- a/methods/Mangos/BattleGroundMethods.h +++ b/methods/Mangos/BattleGroundMethods.h @@ -81,7 +81,7 @@ namespace LuaBattleGround */ int GetEndTime(Eluna* E, BattleGround* bg) { -#ifdef CATA +#if defined(CATA) || defined(MISTS) E->Push(bg->GetRemainingTime()); #else E->Push(bg->GetEndTime()); diff --git a/methods/Mangos/CreatureMethods.h b/methods/Mangos/CreatureMethods.h index 394a8f7..c264780 100644 --- a/methods/Mangos/CreatureMethods.h +++ b/methods/Mangos/CreatureMethods.h @@ -708,7 +708,7 @@ namespace LuaCreature */ int GetShieldBlockValue(Eluna* E, Creature* creature) { -#if ELUNA_EXPANSION == EXP_CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(creature->GetShieldBlockDamageValue()); #else E->Push(creature->GetShieldBlockValue()); diff --git a/methods/Mangos/GlobalMethods.h b/methods/Mangos/GlobalMethods.h index e3b345a..14e6b49 100644 --- a/methods/Mangos/GlobalMethods.h +++ b/methods/Mangos/GlobalMethods.h @@ -470,6 +470,8 @@ namespace LuaGlobalFunctions #if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)) E->Push(areaEntry->AreaName_lang[locale]); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + E->Push(areaEntry->AreaName_lang[locale]); #else E->Push(areaEntry->area_name[locale]); #endif @@ -1752,7 +1754,7 @@ namespace LuaGlobalFunctions auto const itemlist = items->m_items; for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr) -#if ELUNA_EXPANSION == EXP_CATA +#if ELUNA_EXPANSION >= EXP_CATA eObjectMgr->RemoveVendorItem(entry, (*itr)->item, (*itr)->type); #else eObjectMgr->RemoveVendorItem(entry, (*itr)->item); @@ -2092,6 +2094,11 @@ namespace LuaGlobalFunctions entry.LocX = E->CHECKVAL(start + 1); entry.LocY = E->CHECKVAL(start + 2); entry.LocZ = E->CHECKVAL(start + 3); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + entry.ContinentID = E->CHECKVAL(start); + entry.x = E->CHECKVAL(start + 1); + entry.y = E->CHECKVAL(start + 2); + entry.z = E->CHECKVAL(start + 3); #else entry.mapid = E->CHECKVAL(start); entry.x = E->CHECKVAL(start + 1); @@ -2102,6 +2109,9 @@ namespace LuaGlobalFunctions #if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)) entry.Flags = E->CHECKVAL(start + 4, 0); entry.Delay = E->CHECKVAL(start + 5, 0); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + entry.Flags = E->CHECKVAL(start + 4, 0); + entry.Delay = E->CHECKVAL(start + 5, 0); #else entry.actionFlag = E->CHECKVAL(start + 4, 0); entry.delay = E->CHECKVAL(start + 5, 0); @@ -2149,6 +2159,14 @@ namespace LuaGlobalFunctions nodeEntry->x = entry.LocX; nodeEntry->y = entry.LocY; nodeEntry->z = entry.LocZ; +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + entry.PathID = pathId; + entry.NodeIndex = nodeId; + nodeEntry->ID = index; + nodeEntry->ContinentID = entry.ContinentID; + nodeEntry->x = entry.x; + nodeEntry->y = entry.y; + nodeEntry->z = entry.z; #else entry.path = pathId; entry.index = nodeId; @@ -2173,6 +2191,10 @@ namespace LuaGlobalFunctions pathEntry->FromTaxiNode = startNode; pathEntry->ToTaxiNode = nodeId - 1; pathEntry->Cost = price; +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + pathEntry->FromTaxiNode = startNode; + pathEntry->ToTaxiNode = nodeId - 1; + pathEntry->Cost = price; #else pathEntry->from = startNode; pathEntry->to = nodeId - 1; diff --git a/methods/Mangos/ItemMethods.h b/methods/Mangos/ItemMethods.h index f78a61d..bc913d9 100644 --- a/methods/Mangos/ItemMethods.h +++ b/methods/Mangos/ItemMethods.h @@ -273,6 +273,8 @@ namespace LuaItem if (itemRandEntry) #if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK) suffix = itemRandEntry->Name_lang; +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + suffix = itemRandEntry->Name_lang; #else suffix = itemRandEntry->nameSuffix; #endif @@ -283,6 +285,8 @@ namespace LuaItem if (itemRandEntry) #if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK) suffix = itemRandEntry->Name_lang; +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + suffix = itemRandEntry->Name_lang; #else suffix = itemRandEntry->nameSuffix; #endif diff --git a/methods/Mangos/PlayerMethods.h b/methods/Mangos/PlayerMethods.h index b9acfcb..b842cb7 100644 --- a/methods/Mangos/PlayerMethods.h +++ b/methods/Mangos/PlayerMethods.h @@ -732,7 +732,7 @@ namespace LuaPlayer */ int GetShieldBlockValue(Eluna* E, Player* player) { -#if ELUNA_EXPANSION == EXP_CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(player->GetShieldBlockDamageValue()); #else E->Push(player->GetShieldBlockValue()); @@ -2080,6 +2080,8 @@ namespace LuaPlayer data << unit->GET_GUID(); #if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC data << uint32(ahEntry->ID); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + data << uint32(ahEntry->ID); #else data << uint32(ahEntry->houseId); #endif @@ -2424,7 +2426,7 @@ namespace LuaPlayer */ int ResetTalentsCost(Eluna* E, Player* player) { -#ifdef CATA +#if defined(CATA) || defined(MISTS) E->Push(player->GetNextResetTalentsCost()); #else E->Push(player->resetTalentsCost()); @@ -2986,6 +2988,12 @@ namespace LuaPlayer if (entry->CategoryID == SKILL_CATEGORY_LANGUAGES || entry->CategoryID == SKILL_CATEGORY_GENERIC) continue; + if (player->HasSkill(entry->ID)) + player->UpdateSkill(entry->ID, step); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + if (entry->CategoryID == SKILL_CATEGORY_LANGUAGES || entry->CategoryID == SKILL_CATEGORY_GENERIC) + continue; + if (player->HasSkill(entry->ID)) player->UpdateSkill(entry->ID, step); #else diff --git a/methods/Mangos/SpellMethods.h b/methods/Mangos/SpellMethods.h index 81509b3..1ee4a88 100644 --- a/methods/Mangos/SpellMethods.h +++ b/methods/Mangos/SpellMethods.h @@ -56,6 +56,8 @@ namespace LuaSpell { #if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)) E->Push(spell->m_spellInfo->ID); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + E->Push(spell->m_spellInfo->ID); #else E->Push(spell->m_spellInfo->Id); #endif diff --git a/methods/Mangos/UnitMethods.h b/methods/Mangos/UnitMethods.h index 96542a5..4a8f284 100644 --- a/methods/Mangos/UnitMethods.h +++ b/methods/Mangos/UnitMethods.h @@ -950,6 +950,8 @@ namespace LuaUnit #if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)) E->Push(entry->Name_lang[locale]); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + E->Push(entry->Name_lang[locale]); #else E->Push(entry->name[locale]); #endif @@ -989,6 +991,8 @@ namespace LuaUnit #if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)) E->Push(entry->Name_lang[locale]); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + E->Push(entry->Name_lang[locale]); #else E->Push(entry->name[locale]); #endif @@ -2186,7 +2190,7 @@ namespace LuaUnit for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i) { -#if ELUNA_EXPANSION == EXP_CATA +#if ELUNA_EXPANSION >= EXP_CATA SpellEffectEntry const* spellEffect = spellEntry->GetSpellEffect(SpellEffectIndex(i)); uint8 eff = spellEffect->Effect; #else diff --git a/methods/Mangos/VehicleMethods.h b/methods/Mangos/VehicleMethods.h index 468979b..d73090d 100644 --- a/methods/Mangos/VehicleMethods.h +++ b/methods/Mangos/VehicleMethods.h @@ -48,6 +48,8 @@ namespace LuaVehicle { #if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_WOTLK E->Push(vehicle->GetVehicleEntry()->ID); +#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS + E->Push(vehicle->GetVehicleEntry()->ID); #else E->Push(vehicle->GetVehicleEntry()->m_ID); #endif