From 44e6e103c761f1ac046477073b1d9c79e937cb42 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 13 Jul 2026 23:54:37 +0100 Subject: [PATCH 1/5] feat(mists): add EXP_MISTS=4 expansion constant --- ElunaUtility.h | 1 + 1 file changed, 1 insertion(+) 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" From 6e41e4e2aec8aa7ad24e9eb5b50259bc89ca3b4d Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 13 Jul 2026 23:54:37 +0100 Subject: [PATCH 2/5] fix(mists): include EXP_MISTS in CATA-era ELUNA_EXPANSION==CATA conditionals --- methods/Mangos/CreatureMethods.h | 2 +- methods/Mangos/GlobalMethods.h | 2 +- methods/Mangos/PlayerMethods.h | 2 +- methods/Mangos/UnitMethods.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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..1ac874e 100644 --- a/methods/Mangos/GlobalMethods.h +++ b/methods/Mangos/GlobalMethods.h @@ -1752,7 +1752,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); diff --git a/methods/Mangos/PlayerMethods.h b/methods/Mangos/PlayerMethods.h index b9acfcb..8625ac7 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()); diff --git a/methods/Mangos/UnitMethods.h b/methods/Mangos/UnitMethods.h index 96542a5..a903212 100644 --- a/methods/Mangos/UnitMethods.h +++ b/methods/Mangos/UnitMethods.h @@ -2186,7 +2186,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 From a20b446c42318bb30b7ee872e9264c7443056876 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 14 Jul 2026 00:11:17 +0100 Subject: [PATCH 3/5] feat(mists): MISTS guard arms for Four DBC field renames --- hooks/ServerHooks.cpp | 2 ++ methods/Mangos/GlobalMethods.h | 22 ++++++++++++++++++++++ methods/Mangos/ItemMethods.h | 4 ++++ methods/Mangos/PlayerMethods.h | 8 ++++++++ methods/Mangos/SpellMethods.h | 2 ++ methods/Mangos/UnitMethods.h | 4 ++++ methods/Mangos/VehicleMethods.h | 2 ++ 7 files changed, 44 insertions(+) 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/GlobalMethods.h b/methods/Mangos/GlobalMethods.h index 1ac874e..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 @@ -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 8625ac7..ca168d5 100644 --- a/methods/Mangos/PlayerMethods.h +++ b/methods/Mangos/PlayerMethods.h @@ -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 @@ -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 a903212..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 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 From ea387b6458f5833ae4cd23bdb8e0f663f2fc3078 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 14 Jul 2026 00:23:20 +0100 Subject: [PATCH 4/5] feat(mists): CreatureHooks SpellHit/SpellHitTarget include EXP_MISTS (spell->ID) Additive: MISTS joins the CLASSIC/TBC/WOTLK new-name group; #else (CATA) unchanged. --- hooks/CreatureHooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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? From 32740c74caa298c5ecbe416b798ec788d0e1a9d1 Mon Sep 17 00:00:00 2001 From: MadMax Date: Tue, 14 Jul 2026 01:27:48 +0100 Subject: [PATCH 5/5] MISTS: cover the two remaining CATA-only API guards ResetTalentsCost and GetEndTime gated their Cata+ API on `#ifdef CATA`, but a MoP (Four) build defines MISTS, not CATA, so both fell through to the pre-Cata `#else` and returned wrong values on MoP (resetTalentsCost vs GetNextResetTalentsCost; GetEndTime vs GetRemainingTime). Widen both to `#if defined(CATA) || defined(MISTS)`. Purely additive: no other fork's branch selection changes. Both Cata+ APIs exist in the Four core, so the MISTS arm compiles. Addresses Codex review (ElunaUtility.h:16 thread) on PR #6. Co-Authored-By: Claude Opus 4.8 (1M context) --- methods/Mangos/BattleGroundMethods.h | 2 +- methods/Mangos/PlayerMethods.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/PlayerMethods.h b/methods/Mangos/PlayerMethods.h index ca168d5..b842cb7 100644 --- a/methods/Mangos/PlayerMethods.h +++ b/methods/Mangos/PlayerMethods.h @@ -2426,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());