From caa7936ebcd491e0d6bb324045880d1b6cd91271 Mon Sep 17 00:00:00 2001 From: MadMax Date: Tue, 7 Jul 2026 13:46:50 +0100 Subject: [PATCH 1/4] methods/Mangos: TBC guards for AuctionHouse.houseId->ID, ItemRandom(Suffix/Properties).nameSuffix->Name_lang, TaxiPath.ID->Id (One DBC align) --- methods/Mangos/GlobalMethods.h | 4 ++++ methods/Mangos/ItemMethods.h | 8 ++++++++ methods/Mangos/PlayerMethods.h | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/methods/Mangos/GlobalMethods.h b/methods/Mangos/GlobalMethods.h index d1e5592..3604d28 100644 --- a/methods/Mangos/GlobalMethods.h +++ b/methods/Mangos/GlobalMethods.h @@ -2168,7 +2168,11 @@ namespace LuaGlobalFunctions pathEntry->from = startNode; pathEntry->to = nodeId - 1; pathEntry->price = price; +#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC + pathEntry->Id = pathId; +#else pathEntry->ID = pathId; +#endif sTaxiPathStore.SetEntry(pathId, pathEntry); E->Push(pathId); diff --git a/methods/Mangos/ItemMethods.h b/methods/Mangos/ItemMethods.h index b1928c3..baed007 100644 --- a/methods/Mangos/ItemMethods.h +++ b/methods/Mangos/ItemMethods.h @@ -271,13 +271,21 @@ namespace LuaItem { const ItemRandomSuffixEntry* itemRandEntry = sItemRandomSuffixStore.LookupEntry(-item->GetItemRandomPropertyId()); if (itemRandEntry) +#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC + suffix = itemRandEntry->Name_lang; +#else suffix = itemRandEntry->nameSuffix; +#endif } else { const ItemRandomPropertiesEntry* itemRandEntry = sItemRandomPropertiesStore.LookupEntry(item->GetItemRandomPropertyId()); if (itemRandEntry) +#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC + suffix = itemRandEntry->Name_lang; +#else suffix = itemRandEntry->nameSuffix; +#endif } if (suffix) { diff --git a/methods/Mangos/PlayerMethods.h b/methods/Mangos/PlayerMethods.h index 16282ee..b332731 100644 --- a/methods/Mangos/PlayerMethods.h +++ b/methods/Mangos/PlayerMethods.h @@ -2078,7 +2078,11 @@ namespace LuaPlayer WorldPacket data(MSG_AUCTION_HELLO, 12); data << unit->GET_GUID(); +#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC + data << uint32(ahEntry->ID); +#else data << uint32(ahEntry->houseId); +#endif data << uint8(1); player->GetSession()->SendPacket(&data); From 515f45be1d9ebeb6d642d4a59f9d89a0eb3897bb Mon Sep 17 00:00:00 2001 From: MadMax Date: Tue, 7 Jul 2026 15:54:42 +0100 Subject: [PATCH 2/4] feat(dbc-tbc): guard ChrClasses/ChrRaces name + TaxiNodes map_id for mangos-TBC DBC alignment renames ChrClasses.name/ChrRaces.name -> Name_lang and TaxiNodes.map_id -> ContinentID on mangos-one (TBC). Extend the existing per-expansion guards additively: - ChrClasses/ChrRaces name: EXP_CLASSIC branch now also covers (ELUNA_MANGOS && EXP_TBC) -> Name_lang; #else keeps name (other forks). - TaxiNodes map_id: nested (ELUNA_MANGOS && EXP_TBC) -> ContinentID in the shared non-CLASSIC #else; #else keeps map_id (Wrath+/cmangos/vmangos). Co-Authored-By: Claude Opus 4.8 (1M context) --- methods/Mangos/GlobalMethods.h | 4 ++++ methods/Mangos/UnitMethods.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/methods/Mangos/GlobalMethods.h b/methods/Mangos/GlobalMethods.h index 3604d28..07360d2 100644 --- a/methods/Mangos/GlobalMethods.h +++ b/methods/Mangos/GlobalMethods.h @@ -2149,7 +2149,11 @@ namespace LuaGlobalFunctions entry.path = pathId; entry.index = nodeId; nodeEntry->ID = index; +#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC + nodeEntry->ContinentID = entry.mapid; +#else nodeEntry->map_id = entry.mapid; +#endif nodeEntry->x = entry.x; nodeEntry->y = entry.y; nodeEntry->z = entry.z; diff --git a/methods/Mangos/UnitMethods.h b/methods/Mangos/UnitMethods.h index 0730088..15be2c4 100644 --- a/methods/Mangos/UnitMethods.h +++ b/methods/Mangos/UnitMethods.h @@ -948,7 +948,7 @@ namespace LuaUnit if (!entry) return 1; -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) E->Push(entry->Name_lang[locale]); #else E->Push(entry->name[locale]); @@ -987,7 +987,7 @@ namespace LuaUnit if (!entry) return 1; -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) E->Push(entry->Name_lang[locale]); #else E->Push(entry->name[locale]); From 1c9cda218cea31b0c8a556557aaf423aa585f026 Mon Sep 17 00:00:00 2001 From: MadMax Date: Tue, 7 Jul 2026 16:10:46 +0100 Subject: [PATCH 3/4] feat(dbc-tbc): guard TaxiPathNode/AreaTable/SkillLine reads for mangos-TBC DBC alignment renames on mangos-one (TBC): TaxiPathNode path/index/mapid/ x/y/z/actionFlag/delay, AreaTable area_name, SkillLine categoryId/id. Extend the per-expansion guards additively: - GlobalMethods CreateTaxiPath: promote mangos-TBC into the aligned (EXP_CLASSIC) arm (PathID/NodeIndex/LocX/Y/Z/Flags/Delay), with a nested (ELUNA_MANGOS && EXP_TBC) branch for nodeEntry->ContinentID vs map_id; #else keeps old names for Wrath+/cmangos/vmangos. - GetAreaName area_name and PlayerMethods SkillLine categoryId/id: EXP_CLASSIC arm now also covers (ELUNA_MANGOS && EXP_TBC). Co-Authored-By: Claude Opus 4.8 (1M context) --- methods/Mangos/GlobalMethods.h | 16 ++++++++-------- methods/Mangos/PlayerMethods.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/methods/Mangos/GlobalMethods.h b/methods/Mangos/GlobalMethods.h index 07360d2..f4bb5f4 100644 --- a/methods/Mangos/GlobalMethods.h +++ b/methods/Mangos/GlobalMethods.h @@ -468,7 +468,7 @@ namespace LuaGlobalFunctions if (!areaEntry) return luaL_argerror(E->L, 1, "valid Area or Zone ID expected"); -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) E->Push(areaEntry->AreaName_lang[locale]); #else E->Push(areaEntry->area_name[locale]); @@ -2087,7 +2087,7 @@ namespace LuaGlobalFunctions TaxiPathNodeEntry entry; // mandatory -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) entry.ContinentID = E->CHECKVAL(start); entry.LocX = E->CHECKVAL(start + 1); entry.LocY = E->CHECKVAL(start + 2); @@ -2099,7 +2099,7 @@ namespace LuaGlobalFunctions entry.z = E->CHECKVAL(start + 3); #endif // optional -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) entry.Flags = E->CHECKVAL(start + 4, 0); entry.Delay = E->CHECKVAL(start + 5, 0); #else @@ -2137,11 +2137,15 @@ namespace LuaGlobalFunctions TaxiPathNodeEntry& entry = *it; TaxiNodesEntry* nodeEntry = new TaxiNodesEntry(); -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) entry.PathID = pathId; entry.NodeIndex = nodeId; nodeEntry->ID = index; +#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC + nodeEntry->ContinentID = entry.ContinentID; +#else nodeEntry->map_id = entry.ContinentID; +#endif nodeEntry->x = entry.LocX; nodeEntry->y = entry.LocY; nodeEntry->z = entry.LocZ; @@ -2149,11 +2153,7 @@ namespace LuaGlobalFunctions entry.path = pathId; entry.index = nodeId; nodeEntry->ID = index; -#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC - nodeEntry->ContinentID = entry.mapid; -#else nodeEntry->map_id = entry.mapid; -#endif nodeEntry->x = entry.x; nodeEntry->y = entry.y; nodeEntry->z = entry.z; diff --git a/methods/Mangos/PlayerMethods.h b/methods/Mangos/PlayerMethods.h index b332731..e36c0c5 100644 --- a/methods/Mangos/PlayerMethods.h +++ b/methods/Mangos/PlayerMethods.h @@ -2982,7 +2982,7 @@ namespace LuaPlayer { if (SkillLineEntry const* entry = sSkillLineStore.LookupEntry(i)) { -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) if (entry->CategoryID == SKILL_CATEGORY_LANGUAGES || entry->CategoryID == SKILL_CATEGORY_GENERIC) continue; From c458796f8c8c9ac53b89e1d439f02cda033754b3 Mon Sep 17 00:00:00 2001 From: MadMax Date: Tue, 7 Jul 2026 18:09:00 +0100 Subject: [PATCH 4/4] feat(dbc-tbc): guard SpellEntry.Id reads for mangos-TBC (CreatureHooks + SpellMethods) Extend the existing EXP_CLASSIC guards to also cover (ELUNA_MANGOS && EXP_TBC) so mangos-one reads SpellEntry->ID; #else keeps ->Id for Wrath+/cmangos/vmangos/Trinity. CreatureHooks SpellHit/SpellHitTarget TBC clause is ELUNA_MANGOS-gated (cross-emulator safe). Co-Authored-By: Claude Opus 4.8 (1M context) --- hooks/CreatureHooks.cpp | 4 ++-- methods/Mangos/SpellMethods.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/CreatureHooks.cpp b/hooks/CreatureHooks.cpp index 07b0783..dcbb9c0 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 +#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC) 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 +#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC) HookPush(spell->ID); // Pass spell object? #else HookPush(spell->Id); // Pass spell object? diff --git a/methods/Mangos/SpellMethods.h b/methods/Mangos/SpellMethods.h index 5ebbb36..37f8edd 100644 --- a/methods/Mangos/SpellMethods.h +++ b/methods/Mangos/SpellMethods.h @@ -54,7 +54,7 @@ namespace LuaSpell */ int GetEntry(Eluna* E, Spell* spell) { -#if ELUNA_EXPANSION == EXP_CLASSIC +#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC) E->Push(spell->m_spellInfo->ID); #else E->Push(spell->m_spellInfo->Id);