Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jul 20, 2023
2 parents 95e298b + 82ab457 commit 8fdb8a3
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ jobs:
fail-fast: false
matrix:
eluna: [ON, OFF]
patch: [classic, tbc, wotlk]
patch: [Classic, TBC, WotLK]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: false
repository: Niam5/mangos-${{ matrix.patch }}
repository: Niam5/Eluna-CMaNGOS-${{ matrix.patch }}
ref: master
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion BattleGroundMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace LuaBattleGround
*/
int GetMap(lua_State* L, BattleGround* bg)
{
Eluna::Push(L, bg->GetBgMap());
Eluna::Push(L, static_cast<Map*>(bg->GetBgMap()));
return 1;
}

Expand Down
3 changes: 3 additions & 0 deletions ElunaCreatureAI.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#define _ELUNA_CREATURE_AI_H

#include "LuaEngine.h"
#ifdef CMANGOS
#include "AI/BaseAI/CreatureAI.h"
#endif

#if defined TRINITY || AZEROTHCORE
struct ScriptedAI;
Expand Down
2 changes: 2 additions & 0 deletions ElunaEventMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "Common.h"
#ifdef TRINITY
#include "Random.h"
#elif defined CMANGOS
#include "Util/Util.h"
#else
#include "Util.h"
#endif
Expand Down
15 changes: 7 additions & 8 deletions ElunaIncludes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "SpellMgr.h"
#include "TemporarySummon.h"
#include "WorldSession.h"
#include "WorldPacket.h"
#else
#include "Accounts/AccountMgr.h"
#include "AuctionHouse/AuctionHouseMgr.h"
Expand Down Expand Up @@ -67,18 +68,16 @@
#include "Spells/SpellMgr.h"
#include "Entities/TemporarySpawn.h"
#include "Server/WorldSession.h"
#include "Server/WorldPacket.h"
#endif
#include "WorldPacket.h"

#if defined TRINITY
#include "SpellHistory.h"
#endif

#if defined AZEROTHCORE
#include "MapMgr.h"
#elif defined CMANGOS
#include "Maps/MapManager.h"
#else
#elif !defined CMANGOS
#include "MapManager.h"
#endif

Expand Down Expand Up @@ -107,8 +106,12 @@
#else
#include "Server/SQLStorages.h"
#endif
#ifdef MANGOS
#include "GitRevision.h"
#else
#include "revision.h"
#endif
#endif

#if (!defined(TBC) && !defined(CLASSIC))
#ifndef CMANGOS
Expand Down Expand Up @@ -186,10 +189,6 @@ typedef Opcodes OpcodesList;
#define MAX_TALENT_SPECS MAX_TALENT_SPEC_COUNT
#define TEAM_NEUTRAL TEAM_INDEX_NEUTRAL

#if defined(TBC) || defined(WOTLK) || defined(CATA)
#define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS
#endif

#ifdef TBC
#define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT
#endif
Expand Down
3 changes: 2 additions & 1 deletion ElunaUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#include "Entities/Unit.h"
#include "Entities/GameObject.h"
#include "Server/DBCStores.h"
#include "Util/Timer.h"
#endif
#if defined(MANGOS) || CMANGOS
#if defined MANGOS
#include "Timer.h"
#endif

Expand Down
30 changes: 24 additions & 6 deletions GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ namespace LuaGlobalFunctions
*/
int GetCoreVersion(lua_State* L)
{
#ifdef MANGOS
Eluna::Push(L, GitRevision::GetProjectRevision());
#else
Eluna::Push(L, CORE_VERSION);
#endif
return 1;
}

Expand Down Expand Up @@ -1219,9 +1223,12 @@ namespace LuaGlobalFunctions
{
const char* command = Eluna::CHECKVAL<const char*>(L, 1);
#if defined TRINITY || AZEROTHCORE
eWorld->QueueCliCommand(new CliCommandHolder(nullptr, command, nullptr, nullptr));
// ignores output of the command
eWorld->QueueCliCommand(new CliCommandHolder(nullptr, command, [](void*, std::string_view) {}, [](void*, bool) {}));
#elif defined MANGOS
eWorld->QueueCliCommand(new CliCommandHolder(0, SEC_CONSOLE, nullptr, command, nullptr, nullptr));
#elif defined CMANGOS
eWorld->QueueCliCommand(new CliCommandHolder(0, SEC_CONSOLE, command, nullptr, nullptr));
#endif
return 0;
}
Expand Down Expand Up @@ -1551,8 +1558,11 @@ namespace LuaGlobalFunctions
Eluna::Push(L);
return 1;
}

#ifdef CMANGOS
if (!pCreature->Create(lowguid, lowguid, pos, cinfo))
#else
if (!pCreature->Create(lowguid, pos, cinfo))
#endif
{
delete pCreature;
Eluna::Push(L);
Expand Down Expand Up @@ -1605,7 +1615,7 @@ namespace LuaGlobalFunctions
#ifndef CMANGOS
if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo, TEAM_NONE))
#else
if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo))
if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo))
#endif
{
delete pCreature;
Expand Down Expand Up @@ -1653,8 +1663,12 @@ namespace LuaGlobalFunctions
}

GameObject* pGameObj = new GameObject;
#if (defined(TBC) || defined(CLASSIC))
#if ((defined(TBC) || defined(CLASSIC)) && !defined(CMANGOS))
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, x, y, z, o))
#elif ((defined(TBC) || defined(CLASSIC)) && defined(CMANGOS))
if (!pGameObj->Create(db_lowGUID, db_lowGUID, gInfo->id, map, x, y, z, o))
#elif defined CMANGOS
if (!pGameObj->Create(db_lowGUID, db_lowGUID, gInfo->id, map, phase, x, y, z, o))
#else
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, phase, x, y, z, o))
#endif
Expand Down Expand Up @@ -1701,8 +1715,12 @@ namespace LuaGlobalFunctions
{
GameObject* pGameObj = new GameObject;

#if (defined(TBC) || defined(CLASSIC))
#if ((defined(TBC) || defined(CLASSIC)) && !defined(CMANGOS))
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, o))
#elif ((defined(TBC) || defined(CLASSIC)) && defined(CMANGOS))
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, o))
#elif defined CMANGOS
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, phase, x, y, z, o))
#else
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, phase, x, y, z, o))
#endif
Expand Down Expand Up @@ -2020,7 +2038,7 @@ namespace LuaGlobalFunctions
switch (banMode)
{
case BAN_ACCOUNT:
#if defined TRINITY || AZEROTHCORE
#ifndef CMANGOS
if (!Utf8ToUpperOnlyLatin(nameOrIP))
return luaL_argerror(L, 2, "invalid account name");
#else
Expand Down
2 changes: 1 addition & 1 deletion GroupMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace LuaGroup
int IsLFGGroup(lua_State* L, Group* group)
{
#ifdef CMANGOS
Eluna::Push(L, group->IsLfgGroup());
Eluna::Push(L, group->IsLFGGroup());
#else
Eluna::Push(L, group->isLFGGroup());
#endif
Expand Down
14 changes: 7 additions & 7 deletions PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -3862,19 +3862,19 @@ namespace LuaPlayer
bool _code = Eluna::CHECKVAL<bool>(L, 6, false);
const char* _promptMsg = Eluna::CHECKVAL<const char*>(L, 7, "");
uint32 _money = Eluna::CHECKVAL<uint32>(L, 8, 0);
#if defined TRINITY || AZEROTHCORE
#if defined(TRINITY)
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, GossipOptionIcon(_icon), msg, _sender, _intid, _promptMsg, _money, _code);
#elif defined(AZEROTHCORE)
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, _icon, msg, _sender, _intid, _promptMsg, _money, _code);
#else
#if !defined(CLASSIC) && !defined(CMANGOS)
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code);
#elif CMANGOS && !defined CLASSIC
#elif defined(CMANGOS) && !defined(CLASSIC)
player->GetPlayerMenu()->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code);
#elif CMANGOS && CLASSIC
#elif defined(CMANGOS) && defined(CLASSIC)
player->GetPlayerMenu()->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _code);
#elif !defined(CLASSIC) && !defined(CMANGOS)
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code);
#else
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _code);
#endif
#endif//TRINITY
return 0;
}

Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,21 @@ You can join the official Eluna Discord server, where you'll be able to find res
* [Contributing](https://github.com/ElunaLuaEngine/Eluna/blob/master/docs/CONTRIBUTING.md)

## Source
Eluna source code: [Source](https://github.com/ElunaLuaEngine/Eluna)
Core forks with required modifications for Eluna:
Eluna source code: [Source](https://github.com/ElunaLuaEngine/Eluna)

[![Build Status](https://api.travis-ci.org/mangoszero/server.svg)](https://travis-ci.org/mangoszero/server) [Official MaNGOS Zero with Eluna](https://github.com/mangoszero/server)
[![Build Status](https://api.travis-ci.org/mangosone/server.svg)](https://travis-ci.org/mangosone/server) [Official MaNGOS One with Eluna](https://github.com/mangosone/server)
[![Build Status](https://api.travis-ci.org/mangostwo/server.svg)](https://travis-ci.org/mangostwo/server) [Official MaNGOS Two with Eluna](https://github.com/mangostwo/server)
Core sources and forks with required modifications for Eluna:

[![Build Status](https://travis-ci.org/ElunaLuaEngine/ElunaTrinityWotlk.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/ElunaTrinityWotlk) [Eluna TrinityCore WotLK](https://github.com/ElunaLuaEngine/ElunaTrinityWotlk)
[TrinityCore WotLK](https://github.com/ElunaLuaEngine/ElunaTrinityWotlk) [![automerge](https://github.com/ElunaLuaEngine/ElunaTrinityWotlk/actions/workflows/auto-merge.yml/badge.svg)](https://github.com/ElunaLuaEngine/ElunaTrinityWotlk/actions/workflows/auto-merge.yml)

[![Build Status](https://travis-ci.org/ElunaLuaEngine/ElunaMangosClassic.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/ElunaMangosClassic) [Eluna cMaNGOS Classic](https://github.com/ElunaLuaEngine/ElunaMangosClassic)
[![Build Status](https://travis-ci.org/ElunaLuaEngine/ElunaMangosTbc.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/ElunaMangosTbc) [Eluna cMaNGOS TBC](https://github.com/ElunaLuaEngine/ElunaMangosTbc)
[![Build Status](https://travis-ci.org/ElunaLuaEngine/ElunaMangosWotlk.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/ElunaMangosWotlk) [Eluna cMaNGOS WotLK](https://github.com/ElunaLuaEngine/ElunaMangosWotlk)
[Official MaNGOS Zero with Eluna](https://github.com/mangoszero/server)
[Official MaNGOS One with Eluna](https://github.com/mangosone/server)
[Official MaNGOS Two with Eluna](https://github.com/mangostwo/server)

Core plugin modules for Eluna:
[Eluna cMaNGOS Classic](https://github.com/Niam5/Eluna-CMaNGOS-Classic) - maintained by [Niam5](https://github.com/Niam5)
[Eluna cMaNGOS TBC](https://github.com/Niam5/Eluna-CMaNGOS-TBC) - maintained by [Niam5](https://github.com/Niam5)
[Eluna cMaNGOS WoTLK](https://github.com/Niam5/Eluna-CMaNGOS-WotLK) - maintained by [Niam5](https://github.com/Niam5)

- [AzerothCore Eluna Module](https://github.com/azerothcore/mod-eluna-lua-engine)
[AzerothCore Eluna Module](https://github.com/azerothcore/mod-eluna)

## Links

Expand Down
10 changes: 9 additions & 1 deletion UnitMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,11 @@ namespace LuaUnit
*/
int GetMountId(lua_State* L, Unit* unit)
{
#ifdef TRINITY
Eluna::Push(L, unit->GetMountDisplayId());
#else
Eluna::Push(L, unit->GetMountID());
#endif
return 1;
}

Expand Down Expand Up @@ -1261,7 +1265,7 @@ namespace LuaUnit
Acore::UnitListSearcher<Acore::AnyFriendlyUnitInObjectRangeCheck> searcher(unit, list, checker);
Cell::VisitAllObjects(unit, searcher, range);
#elif CMANGOS
MaNGOS::AnyFriendlyUnitInObjectRangeCheck checker(unit, nullptr, range);
MaNGOS::AnyFriendlyUnitInObjectRangeCheck checker(unit, range);
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(list, checker);
Cell::VisitGridObjects(unit, searcher, range);
#else
Expand Down Expand Up @@ -1837,7 +1841,11 @@ namespace LuaUnit
int SetStandState(lua_State* L, Unit* unit)
{
uint8 state = Eluna::CHECKVAL<uint8>(L, 2);
#ifdef TRINITY
unit->SetStandState(UnitStandStateType(state));
#else
unit->SetStandState(state);
#endif
return 0;
}

Expand Down

0 comments on commit 8fdb8a3

Please sign in to comment.