diff --git a/AuraMethods.h b/AuraMethods.h index 141b117..4ff9a86 100644 --- a/AuraMethods.h +++ b/AuraMethods.h @@ -17,7 +17,7 @@ namespace LuaAura int GetCasterGUID(lua_State* L, Aura* aura) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, aura->GetCasterGuid()); #else Eluna::Push(L, aura->GetCasterGUID()); @@ -33,7 +33,7 @@ namespace LuaAura int GetDuration(lua_State* L, Aura* aura) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, aura->GetAuraDuration()); #else Eluna::Push(L, aura->GetDuration()); @@ -55,7 +55,7 @@ namespace LuaAura int GetMaxDuration(lua_State* L, Aura* aura) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, aura->GetAuraMaxDuration()); #else Eluna::Push(L, aura->GetMaxDuration()); @@ -71,7 +71,7 @@ namespace LuaAura int GetOwner(lua_State* L, Aura* aura) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, aura->GetTarget()); #else Eluna::Push(L, aura->GetOwner()); @@ -82,7 +82,7 @@ namespace LuaAura int SetDuration(lua_State* L, Aura* aura) { int duration = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY aura->GetHolder()->SetAuraDuration(duration); #else aura->SetDuration(duration); @@ -93,7 +93,7 @@ namespace LuaAura int SetMaxDuration(lua_State* L, Aura* aura) { int duration = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY aura->GetHolder()->SetAuraMaxDuration(duration); #else aura->SetMaxDuration(duration); @@ -104,7 +104,7 @@ namespace LuaAura int SetStackAmount(lua_State* L, Aura* aura) { int amount = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY aura->GetHolder()->SetStackAmount(amount); #else aura->SetStackAmount(amount); @@ -114,7 +114,7 @@ namespace LuaAura int Remove(lua_State* /*L*/, Aura* aura) { -#ifdef MANGOS +#ifndef TRINITY aura->GetHolder()->RemoveAura(aura->GetEffIndex()); #else aura->Remove(); diff --git a/CorpseMethods.h b/CorpseMethods.h index e71c272..615f4b5 100644 --- a/CorpseMethods.h +++ b/CorpseMethods.h @@ -11,7 +11,7 @@ namespace LuaCorpse { int GetOwnerGUID(lua_State* L, Corpse* corpse) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, corpse->GetOwnerGuid()); #else Eluna::Push(L, corpse->GetOwnerGUID()); diff --git a/CreatureMethods.h b/CreatureMethods.h index 924873e..5d5849c 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -18,7 +18,7 @@ namespace LuaCreature int IsRegeneratingHealth(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->IsRegeneratingHealth()); #else Eluna::Push(L, creature->isRegeneratingHealth()); @@ -30,7 +30,7 @@ namespace LuaCreature { uint32 quest_id = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->HasInvolvedQuest(quest_id)); #else Eluna::Push(L, creature->hasInvolvedQuest(quest_id)); @@ -72,7 +72,7 @@ namespace LuaCreature int HasLootRecipient(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->HasLootRecipient()); #else Eluna::Push(L, creature->hasLootRecipient()); @@ -82,7 +82,7 @@ namespace LuaCreature int IsCombatAllowed(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY if (CreatureAI* ai = creature->AI()) Eluna::Push(L, ai->IsCombatMovement()); else @@ -113,7 +113,7 @@ namespace LuaCreature int IsElite(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->IsElite()); #else Eluna::Push(L, creature->isElite()); @@ -141,7 +141,7 @@ namespace LuaCreature int IsWorldBoss(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->IsWorldBoss()); #else Eluna::Push(L, creature->isWorldBoss()); @@ -169,7 +169,7 @@ namespace LuaCreature { uint32 questId = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->HasQuest(questId)); #else Eluna::Push(L, creature->hasQuest(questId)); @@ -243,7 +243,7 @@ namespace LuaCreature { Unit* target = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY float AttackDist = creature->GetAttackDistance(target); float ThreatRadius = sWorld.getConfig(CONFIG_FLOAT_THREAT_RADIUS); Eluna::Push(L, ThreatRadius > AttackDist ? ThreatRadius : AttackDist); @@ -263,7 +263,7 @@ namespace LuaCreature int GetLootRecipientGroup(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->GetGroupLootRecipient()); #else Eluna::Push(L, creature->GetLootRecipientGroup()); @@ -312,7 +312,7 @@ namespace LuaCreature int GetHomePosition(lua_State* L, Creature* creature) { float x, y, z, o; -#ifdef MANGOS +#ifndef TRINITY creature->GetRespawnCoord(x, y, z, &o); #else creature->GetHomePosition(x, y, z, o); @@ -465,7 +465,7 @@ namespace LuaCreature { int32 state = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY creature->SetDeathState((DeathState)state); #else creature->setDeathState((DeathState)state); @@ -485,7 +485,7 @@ namespace LuaCreature { bool allow = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY if (CreatureAI* ai = creature->AI()) ai->SetCombatMovement(allow); #else @@ -552,7 +552,7 @@ namespace LuaCreature { bool enable = Eluna::CHECKVAL(L, 2, true); -#ifdef MANGOS +#ifndef TRINITY creature->SetLevitate(enable); #else creature->SetHover(enable); @@ -582,7 +582,7 @@ namespace LuaCreature { uint32 msTimeToDespawn = Eluna::CHECKVAL(L, 2, 0); -#ifdef MANGOS +#ifndef TRINITY creature->ForcedDespawn(msTimeToDespawn); #else creature->DespawnOrUnsummon(msTimeToDespawn); @@ -604,7 +604,7 @@ namespace LuaCreature int MoveWaypoint(lua_State* /*L*/, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY creature->GetMotionMaster()->MoveWaypoint(); #else creature->GetMotionMaster()->MovePath(creature->GetWaypointPath(), true); @@ -648,7 +648,7 @@ namespace LuaCreature int SelectVictim(lua_State* L, Creature* creature) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, creature->SelectHostileTarget()); #else Eluna::Push(L, creature->SelectVictim()); @@ -661,7 +661,7 @@ namespace LuaCreature uint32 entry = Eluna::CHECKVAL(L, 2); uint32 dataGuidLow = Eluna::CHECKVAL(L, 3, 0); -#ifdef MANGOS +#ifndef TRINITY creature->UpdateEntry(entry, ALLIANCE, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL); #else creature->UpdateEntry(entry, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL); diff --git a/GameObjectMethods.h b/GameObjectMethods.h index 675bab8..816f3ff 100644 --- a/GameObjectMethods.h +++ b/GameObjectMethods.h @@ -14,7 +14,7 @@ namespace LuaGameObject { uint32 questId = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, go->HasQuest(questId)); #else Eluna::Push(L, go->hasQuest(questId)); diff --git a/GlobalMethods.h b/GlobalMethods.h index 939c260..361db96 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -88,7 +88,7 @@ namespace LuaGlobalFunctions { if (Player* player = it->second->GetPlayer()) { -#ifdef MANGOS +#ifndef TRINITY if (player->GetSession() && ((team >= TEAM_NEUTRAL || player->GetTeamId() == team) && (!onlyGM || player->isGameMaster()))) #else if (player->GetSession() && ((team >= TEAM_NEUTRAL || player->GetTeamId() == team) && (!onlyGM || player->IsGameMaster()))) @@ -123,7 +123,7 @@ namespace LuaGlobalFunctions Map::PlayerList const& players = map->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) { -#ifdef MANGOS +#ifndef TRINITY Player* player = itr->getSource(); #else Player* player = itr->GetSource(); @@ -437,7 +437,7 @@ namespace LuaGlobalFunctions const char* query = Eluna::CHECKVAL(L, 1); QueryResult* result = NULL; -#ifdef MANGOS +#ifndef TRINITY result = WorldDatabase.Query(query); #else QueryResult res = WorldDatabase.Query(query); @@ -463,7 +463,7 @@ namespace LuaGlobalFunctions const char* query = Eluna::CHECKVAL(L, 1); QueryResult* result = NULL; -#ifdef MANGOS +#ifndef TRINITY result = CharacterDatabase.Query(query); #else QueryResult res = CharacterDatabase.Query(query); @@ -489,7 +489,7 @@ namespace LuaGlobalFunctions const char* query = Eluna::CHECKVAL(L, 1); QueryResult* result = NULL; -#ifdef MANGOS +#ifndef TRINITY result = LoginDatabase.Query(query); #else QueryResult res = LoginDatabase.Query(query); @@ -570,7 +570,7 @@ namespace LuaGlobalFunctions } #endif -#ifdef MANGOS +#ifndef TRINITY Map* map = eMapMgr->FindMap(mapID, instanceID); if (!map) { @@ -883,7 +883,7 @@ namespace LuaGlobalFunctions uint32 incrtime = Eluna::CHECKVAL(L, 4); uint32 extendedcost = Eluna::CHECKVAL(L, 5); -#ifdef MANGOS +#ifndef TRINITY if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0)) return 0; #ifndef CLASSIC @@ -1013,7 +1013,7 @@ namespace LuaGlobalFunctions MailSender sender(MAIL_NORMAL, senderGUIDLow, (MailStationery)stationary); MailDraft draft(subject, text); -#ifndef MANGOS +#ifdef TRINITY SQLTransaction trans = CharacterDatabase.BeginTransaction(); #endif uint8 addedItems = 0; @@ -1022,7 +1022,7 @@ namespace LuaGlobalFunctions uint32 entry = luaL_checkunsigned(L, ++i); uint32 amount = luaL_checkunsigned(L, ++i); -#ifdef MANGOS +#ifndef TRINITY ItemTemplate const* item_proto = ObjectMgr::GetItemPrototype(entry); #else ItemTemplate const* item_proto = eObjectMgr->GetItemTemplate(entry); @@ -1039,7 +1039,7 @@ namespace LuaGlobalFunctions } if (Item* item = Item::CreateItem(entry, amount)) { -#ifdef MANGOS +#ifndef TRINITY item->SaveToDB(); #else item->SaveToDB(trans); @@ -1050,7 +1050,7 @@ namespace LuaGlobalFunctions } } -#ifdef MANGOS +#ifndef TRINITY draft.SendMailTo(MailReceiver(MAKE_NEW_GUID(receiverGUIDLow, 0, HIGHGUID_PLAYER)), sender); #else draft.SendMailTo(trans, MailReceiver(receiverGUIDLow), sender, MAIL_CHECK_MASK_NONE, delay); @@ -1243,7 +1243,7 @@ namespace LuaGlobalFunctions int FindWeather(lua_State* L) { uint32 zoneId = Eluna::CHECKVAL(L, 1); -#ifdef MANGOS +#ifndef TRINITY Weather* weather = eWorld->FindWeather(zoneId); #else Weather* weather = WeatherMgr::FindWeather(zoneId); @@ -1255,7 +1255,7 @@ namespace LuaGlobalFunctions int AddWeather(lua_State* L) { uint32 zoneId = Eluna::CHECKVAL(L, 1); -#ifdef MANGOS +#ifndef TRINITY Weather* weather = eWorld->AddWeather(zoneId); #else Weather* weather = WeatherMgr::AddWeather(zoneId); @@ -1267,7 +1267,7 @@ namespace LuaGlobalFunctions int RemoveWeather(lua_State* L) { uint32 zoneId = Eluna::CHECKVAL(L, 1); -#ifdef MANGOS +#ifndef TRINITY eWorld->RemoveWeather(zoneId); #else WeatherMgr::RemoveWeather(zoneId); @@ -1278,7 +1278,7 @@ namespace LuaGlobalFunctions int SendFineWeatherToPlayer(lua_State* L) { Player* player = Eluna::CHECKOBJ(L, 1); -#ifdef MANGOS +#ifndef TRINITY Weather::SendFineWeatherUpdateToPlayer(player); #else WeatherMgr::SendFineWeatherUpdateToPlayer(player); diff --git a/GroupMethods.h b/GroupMethods.h index 9f4a791..d149709 100644 --- a/GroupMethods.h +++ b/GroupMethods.h @@ -94,7 +94,7 @@ namespace LuaGroup for (GroupReference* itr = group->GetFirstMember(); itr; itr = itr->next()) { -#ifdef MANGOS +#ifndef TRINITY Player* member = itr->getSource(); #else Player* member = itr->GetSource(); @@ -115,7 +115,7 @@ namespace LuaGroup int GetLeaderGUID(lua_State* L, Group* group) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, group->GetLeaderGuid()); #else Eluna::Push(L, group->GetLeaderGUID()); @@ -125,7 +125,7 @@ namespace LuaGroup int GetLeader(lua_State* L, Group* group) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, eObjectAccessor->FindPlayer(group->GetLeaderGuid())); #else Eluna::Push(L, eObjectAccessor->FindPlayer(group->GetLeaderGUID())); @@ -146,7 +146,7 @@ namespace LuaGroup int GetMemberGUID(lua_State* L, Group* group) { const char* name = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, group->GetMemberGuid(name)); #else Eluna::Push(L, group->GetMemberGUID(name)); @@ -193,7 +193,7 @@ namespace LuaGroup Player* player = Eluna::CHECKOBJ(L, 2); uint32 method = Eluna::CHECKVAL(L, 3, 0); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, group->RemoveMember(player->GET_GUID(), method)); #else Eluna::Push(L, group->RemoveMember(player->GET_GUID(), (RemoveMethod)method)); diff --git a/GuildMethods.h b/GuildMethods.h index d76e9db..1dcee51 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -43,7 +43,7 @@ namespace LuaGuild int GetLeader(lua_State* L, Guild* guild) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, eObjectAccessor->FindPlayer(guild->GetLeaderGuid())); #else Eluna::Push(L, eObjectAccessor->FindPlayer(guild->GetLeaderGUID())); @@ -53,7 +53,7 @@ namespace LuaGuild int GetLeaderGUID(lua_State* L, Guild* guild) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, guild->GetLeaderGuid()); #else Eluna::Push(L, guild->GetLeaderGUID()); @@ -81,7 +81,7 @@ namespace LuaGuild int GetInfo(lua_State* L, Guild* guild) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, guild->GetGINFO()); #else Eluna::Push(L, guild->GetInfo()); @@ -95,7 +95,7 @@ namespace LuaGuild { Player* player = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY guild->SetLeader(player->GET_GUID()); #else guild->HandleSetLeader(player->GetSession(), player->GetName()); @@ -109,7 +109,7 @@ namespace LuaGuild { uint8 tabId = Eluna::CHECKVAL(L, 2); const char* text = Eluna::CHECKVAL(L, 3); -#ifdef MANGOS +#ifndef TRINITY guild->SetGuildBankTabText(tabId, text); #else guild->SetBankTabText(tabId, text); @@ -158,7 +158,7 @@ namespace LuaGuild Player* player = Eluna::CHECKOBJ(L, 2); bool isDisbanding = Eluna::CHECKVAL(L, 3, false); -#ifdef MANGOS +#ifndef TRINITY guild->DelMember(player->GET_GUID(), isDisbanding); #else guild->DeleteMember(player->GET_GUID(), isDisbanding); @@ -181,7 +181,7 @@ namespace LuaGuild { Player* player = Eluna::CHECKOBJ(L, 2); uint32 money = Eluna::CHECKVAL(L, 3); -#ifdef MANGOS +#ifndef TRINITY if (guild->GetGuildBankMoney() < money) return 0; guild->SetBankMoney(guild->GetGuildBankMoney() - money); @@ -197,7 +197,7 @@ namespace LuaGuild Player* player = Eluna::CHECKOBJ(L, 2); uint32 money = Eluna::CHECKVAL(L, 3); -#ifdef MANGOS +#ifndef TRINITY guild->SetBankMoney(guild->GetGuildBankMoney() + money); #else guild->HandleMemberDepositMoney(player->GetSession(), money); diff --git a/HookMgr.cpp b/HookMgr.cpp index 8cd195f..a44399f 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -430,7 +430,7 @@ bool Eluna::OnItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targ ENTRY_BEGIN(ItemEventBindings, pItem->GetEntry(), ITEM_EVENT_ON_USE, return result); Push(L, pPlayer); Push(L, pItem); -#ifdef MANGOS +#ifndef TRINITY if (GameObject* target = targets.getGOTarget()) Push(L, target); else if (Item* target = targets.getItemTarget()) @@ -1376,7 +1376,7 @@ void Eluna::OnSummoned(Creature* pCreature, Unit* pSummoner) struct ElunaCreatureAI : ScriptedAI { -#ifdef MANGOS +#ifndef TRINITY #define me m_creature #endif @@ -1387,13 +1387,13 @@ struct ElunaCreatureAI : ScriptedAI ~ElunaCreatureAI() {} //Called at World update tick -#ifdef MANGOS +#ifndef TRINITY void UpdateAI(const uint32 diff) override #else void UpdateAI(uint32 diff) override #endif { -#ifdef MANGOS +#ifndef TRINITY if (IsCombatMovement()) ScriptedAI::UpdateAI(diff); #else @@ -1577,7 +1577,7 @@ struct ElunaCreatureAI : ScriptedAI ENDCALL(); } -#ifdef MANGOS +#ifndef TRINITY // Enables use of MoveInLineOfSight bool IsVisible(Unit* who) const override { @@ -1628,7 +1628,7 @@ struct ElunaCreatureAI : ScriptedAI ENDCALL(); } -#ifndef MANGOS +#ifdef TRINITY // Called when the creature is summoned successfully by other creature void IsSummonedBy(Unit* summoner) override @@ -1671,7 +1671,7 @@ struct ElunaCreatureAI : ScriptedAI } #endif -#ifdef MANGOS +#ifndef TRINITY #undef me #endif }; diff --git a/Includes.h b/Includes.h index 7eea620..ffda7c9 100644 --- a/Includes.h +++ b/Includes.h @@ -34,7 +34,7 @@ #include "TemporarySummon.h" #include "WorldPacket.h" #include "WorldSession.h" -#ifdef MANGOS +#ifndef TRINITY #include "ReactorAI.h" #include "revision_nr.h" #else diff --git a/ItemMethods.h b/ItemMethods.h index fda2dee..2e74e61 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -102,7 +102,7 @@ namespace LuaItem int HasQuest(lua_State* L, Item* item) { uint32 quest = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, item->HasQuest(quest)); #else Eluna::Push(L, item->hasQuest(quest)); @@ -217,7 +217,7 @@ namespace LuaItem int GetOwnerGUID(lua_State* L, Item* item) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, item->GetOwnerGuid()); #else Eluna::Push(L, item->GetOwnerGUID()); @@ -405,7 +405,7 @@ namespace LuaItem int SetOwner(lua_State* L, Item* item) { Player* player = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY item->SetOwnerGuid(player->GET_GUID()); #else item->SetOwnerGUID(player->GET_GUID()); @@ -483,7 +483,7 @@ namespace LuaItem int SaveToDB(lua_State* /*L*/, Item* item) { -#ifdef MANGOS +#ifndef TRINITY item->SaveToDB(); #else SQLTransaction trans = SQLTransaction(NULL); diff --git a/LuaEngine.h b/LuaEngine.h index 1902d96..7051d81 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -21,7 +21,7 @@ extern "C" #include // enums & singletons #include "HookMgr.h" -#ifdef MANGOS +#ifndef TRINITY #include "AccountMgr.h" #include "Config/Config.h" #include "Player.h" @@ -35,7 +35,7 @@ extern "C" #include "Weather.h" #include "World.h" -#ifdef MANGOS +#ifndef TRINITY typedef SpellEffectIndex SpellEffIndex; typedef SpellEntry SpellInfo; typedef ItemPrototype ItemTemplate; @@ -46,7 +46,7 @@ typedef int Difficulty; #endif struct AreaTriggerEntry; -#ifdef MANGOS +#ifndef TRINITY class ReactorAI; typedef ReactorAI ScriptedAI; #else @@ -82,7 +82,7 @@ typedef VehicleInfo Vehicle; #endif #endif -#ifdef MANGOS +#ifndef TRINITY #define eWorld (&sWorld) #define eMapMgr (&sMapMgr) #define eConfigMgr (&sConfig) @@ -423,7 +423,7 @@ public: static inline uint32 GetCurrTime() { -#ifdef MANGOS +#ifndef TRINITY return WorldTimer::getMSTime(); #else return getMSTime(); @@ -432,7 +432,7 @@ public: static inline uint32 GetTimeDiff(uint32 oldMSTime) { -#ifdef MANGOS +#ifndef TRINITY return WorldTimer::getMSTimeDiff(oldMSTime, GetCurrTime()); #else return GetMSTimeDiffToNow(oldMSTime); @@ -484,7 +484,7 @@ public: return false; if (Unit* unit = u->ToUnit()) { -#ifdef MANGOS +#ifndef TRINITY if (!unit->isAlive()) return false; #else @@ -516,7 +516,7 @@ public: }; CreatureAI* GetAI(Creature* creature); -#ifndef MANGOS +#ifdef TRINITY GameObjectAI* GetAI(GameObject* gameObject); #endif diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 6d83c6a..50fd4ac 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -444,7 +444,7 @@ ElunaRegister PlayerMethods[] = { "GetNextRandomRaidMember", &LuaPlayer::GetNextRandomRaidMember }, // :GetNextRandomRaidMember(radius) - Gets a random raid member in given radius { "GetOriginalGroup", &LuaPlayer::GetOriginalGroup }, // :GetOriginalGroup() - Gets the original group object { "GetOriginalSubGroup", &LuaPlayer::GetOriginalSubGroup }, // :GetOriginalSubGroup() - Returns the original subgroup ID -#ifndef MANGOS +#ifdef TRINITY { "GetChampioningFaction", &LuaPlayer::GetChampioningFaction }, // :GetChampioningFaction() - Returns the player's championing faction #endif { "GetLatency", &LuaPlayer::GetLatency }, // :GetLatency() - Returns player's latency @@ -507,7 +507,7 @@ ElunaRegister PlayerMethods[] = { "SetPlayerLock", &LuaPlayer::SetPlayerLock }, // :SetPlayerLock(on/off) { "SetGender", &LuaPlayer::SetGender }, // :SetGender(value) - 0 = male 1 = female { "SetSheath", &LuaPlayer::SetSheath }, // :SetSheath(SheathState) - Sets player's sheathstate -#ifdef MANGOS +#ifndef TRINITY { "SetFFA", &LuaPlayer::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off #endif diff --git a/MapMethods.h b/MapMethods.h index 9bb0650..4013c00 100644 --- a/MapMethods.h +++ b/MapMethods.h @@ -20,7 +20,7 @@ namespace LuaMap int IsBattleground(lua_State* L, Map* map) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, map->IsBattleGround()); #else Eluna::Push(L, map->IsBattleground()); @@ -110,7 +110,7 @@ namespace LuaMap float y = Eluna::CHECKVAL(L, 3); float z = Eluna::CHECKVAL(L, 4); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z)); #else Eluna::Push(L, map->GetAreaId(x, y, z)); @@ -122,7 +122,7 @@ namespace LuaMap { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, map->GetWorldObject(ObjectGuid(guid))); #else switch (GUID_HIPART(guid)) diff --git a/PlayerMethods.h b/PlayerMethods.h index fcce8d7..af78dd8 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -30,7 +30,7 @@ namespace LuaPlayer int HasAchieved(lua_State* L, Player* player) { uint32 achievementId = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->GetAchievementMgr().HasAchievement(achievementId)); #else Eluna::Push(L, player->HasAchieved(achievementId)); @@ -236,7 +236,7 @@ namespace LuaPlayer int IsGM(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->isGameMaster()); #else Eluna::Push(L, player->IsGameMaster()); @@ -355,7 +355,7 @@ namespace LuaPlayer int InBattlegroundQueue(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->InBattleGroundQueue()); #else Eluna::Push(L, player->InBattlegroundQueue()); @@ -373,7 +373,7 @@ namespace LuaPlayer int InBattleground(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->InBattleGround()); #else Eluna::Push(L, player->InBattleground()); @@ -511,7 +511,7 @@ namespace LuaPlayer return 1; } -#ifndef MANGOS +#ifdef TRINITY int GetChampioningFaction(lua_State* L, Player* player) { Eluna::Push(L, player->GetChampioningFaction()); @@ -567,7 +567,7 @@ namespace LuaPlayer int GetBattlegroundTypeId(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->GetBattleGroundTypeId()); #else Eluna::Push(L, player->GetBattlegroundTypeId()); @@ -577,7 +577,7 @@ namespace LuaPlayer int GetBattlegroundId(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->GetBattleGroundId()); #else Eluna::Push(L, player->GetBattlegroundId()); @@ -728,7 +728,7 @@ namespace LuaPlayer int GetComboTarget(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->GetMap()->GetUnit(player->GetComboTargetGuid())); #else Eluna::Push(L, ObjectAccessor::GetUnit(*player, player->GetComboTarget())); @@ -777,7 +777,7 @@ namespace LuaPlayer { Quest* quest = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->GetQuestLevelForPlayer(quest)); #else Eluna::Push(L, player->GetQuestLevel(quest)); @@ -855,7 +855,7 @@ namespace LuaPlayer int GetSelection(lua_State* L, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->GetMap()->GetUnit(player->GetSelectionGuid())); #else Eluna::Push(L, player->GetSelectedUnit()); @@ -1256,7 +1256,7 @@ namespace LuaPlayer uint32 areaId = Eluna::CHECKVAL(L, 6); WorldLocation loc(mapId, x, y, z); -#ifdef MANGOS +#ifndef TRINITY player->SetHomebindToLocation(loc, areaId); #else player->SetHomebind(loc, areaId); @@ -1275,7 +1275,7 @@ namespace LuaPlayer } #endif -#ifdef MANGOS +#ifndef TRINITY int SetFFA(lua_State* L, Player* player) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -1297,7 +1297,7 @@ namespace LuaPlayer #if (!defined(TBC) && !defined(CLASSIC)) int ResetPetTalents(lua_State* /*L*/, Player* player) { -#ifdef MANGOS +#ifndef TRINITY Pet* pet = player->GetPet(); Pet::resetTalentsForAllPetsOf(player, pet); if (pet) @@ -1311,7 +1311,7 @@ namespace LuaPlayer int ResetAchievements(lua_State* /*L*/, Player* player) { -#ifdef MANGOS +#ifndef TRINITY player->GetAchievementMgr().Reset(); #else player->ResetAchievements(); @@ -1412,7 +1412,7 @@ namespace LuaPlayer { Unit* unit = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit); #else AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->getFaction()); @@ -1478,7 +1478,7 @@ namespace LuaPlayer { Player* plr = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY player->GetSession()->SendGuildInvite(plr); #else if (Guild* guild = player->GetGuild()) @@ -1497,7 +1497,7 @@ namespace LuaPlayer int RemoveFromBattlegroundRaid(lua_State* /*L*/, Player* player) { -#ifdef MANGOS +#ifndef TRINITY player->RemoveFromBattleGroundRaid(); #else player->RemoveFromBattlegroundOrBattlefieldRaid(); @@ -1918,7 +1918,7 @@ namespace LuaPlayer float y = Eluna::CHECKVAL(L, 4); float z = Eluna::CHECKVAL(L, 5); float o = Eluna::CHECKVAL(L, 6); -#ifdef MANGOS +#ifndef TRINITY if (player->IsTaxiFlying()) #else if (player->IsInFlight()) @@ -1943,7 +1943,7 @@ namespace LuaPlayer { uint32 itemId = Eluna::CHECKVAL(L, 2); uint32 itemCount = Eluna::CHECKVAL(L, 3); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, player->StoreNewItemInInventorySlot(itemId, itemCount) ? true : false); #else Eluna::Push(L, player->AddItem(itemId, itemCount)); @@ -2111,7 +2111,7 @@ namespace LuaPlayer bool _code = Eluna::CHECKVAL(L, 6, false); const char* _promptMsg = Eluna::CHECKVAL(L, 7, ""); uint32 _money = Eluna::CHECKVAL(L, 8, 0); -#ifdef MANGOS +#ifndef TRINITY #ifndef CLASSIC player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code); #else @@ -2125,7 +2125,7 @@ namespace LuaPlayer int GossipComplete(lua_State* /*L*/, Player* player) { -#ifdef MANGOS +#ifndef TRINITY player->PlayerTalkClass->CloseGossip(); #else player->PlayerTalkClass->SendCloseGossip(); diff --git a/QueryMethods.h b/QueryMethods.h index 9dc1b26..91a3591 100644 --- a/QueryMethods.h +++ b/QueryMethods.h @@ -7,7 +7,7 @@ #ifndef QUERYMETHODS_H #define QUERYMETHODS_H -#ifdef MANGOS +#ifndef TRINITY #define RESULT result #else #define RESULT (*result) @@ -18,7 +18,7 @@ namespace LuaQuery int IsNull(lua_State* L, QueryResult* result) { uint32 col = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY if (col < RESULT->GetFieldCount()) Eluna::Push(L, RESULT->Fetch()[col].IsNULL()); #else @@ -136,7 +136,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); if (col < RESULT->GetFieldCount()) -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, RESULT->Fetch()[col].GetCppString()); #else Eluna::Push(L, RESULT->Fetch()[col].GetString()); @@ -148,7 +148,7 @@ namespace LuaQuery { uint32 col = Eluna::CHECKVAL(L, 2); if (col < RESULT->GetFieldCount()) -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, RESULT->Fetch()[col].GetString()); #else Eluna::Push(L, RESULT->Fetch()[col].GetCString()); diff --git a/QuestMethods.h b/QuestMethods.h index f417d82..5792a34 100644 --- a/QuestMethods.h +++ b/QuestMethods.h @@ -13,7 +13,7 @@ namespace LuaQuest int HasFlag(lua_State* L, Quest* quest) { uint32 flag = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, quest->HasQuestFlag((QuestFlags)flag)); #else Eluna::Push(L, quest->HasFlag(flag)); @@ -74,7 +74,7 @@ namespace LuaQuest int GetFlags(lua_State* L, Quest* quest) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, quest->GetQuestFlags()); #else Eluna::Push(L, quest->GetFlags()); diff --git a/SpellMethods.h b/SpellMethods.h index af3c4e9..a6038b3 100644 --- a/SpellMethods.h +++ b/SpellMethods.h @@ -43,7 +43,7 @@ namespace LuaSpell int GetDuration(lua_State* L, Spell* spell) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, GetSpellDuration(spell->m_spellInfo)); #else Eluna::Push(L, spell->GetSpellInfo()->GetDuration()); @@ -53,7 +53,7 @@ namespace LuaSpell int GetTargetDest(lua_State* L, Spell* spell) { -#ifdef MANGOS +#ifndef TRINITY if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) return 3; float x, y, z; @@ -72,7 +72,7 @@ namespace LuaSpell int GetTarget(lua_State* L, Spell* spell) { -#ifdef MANGOS +#ifndef TRINITY if (GameObject* target = spell->m_targets.getGOTarget()) Eluna::Push(L, target); else if (Item* target = spell->m_targets.getItemTarget()) diff --git a/UnitMethods.h b/UnitMethods.h index 10376fd..cb72750 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -49,7 +49,7 @@ namespace LuaUnit int IsRooted(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isInRoots() || unit->IsRooted()); #else Eluna::Push(L, unit->isInRoots() || unit->HasUnitMovementFlag(MOVEMENTFLAG_ROOT)); @@ -76,7 +76,7 @@ namespace LuaUnit { Creature* creature = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isInAccessablePlaceFor(creature)); #else Eluna::Push(L, unit->isInAccessiblePlaceFor(creature)); @@ -86,7 +86,7 @@ namespace LuaUnit int IsAuctioneer(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isAuctioner()); #else Eluna::Push(L, unit->IsAuctioner()); @@ -96,7 +96,7 @@ namespace LuaUnit int IsGuildMaster(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isGuildMaster()); #else Eluna::Push(L, unit->IsGuildMaster()); @@ -106,7 +106,7 @@ namespace LuaUnit int IsInnkeeper(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isInnkeeper()); #else Eluna::Push(L, unit->IsInnkeeper()); @@ -116,7 +116,7 @@ namespace LuaUnit int IsTrainer(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isTrainer()); #else Eluna::Push(L, unit->IsTrainer()); @@ -126,7 +126,7 @@ namespace LuaUnit int IsGossip(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isGossip()); #else Eluna::Push(L, unit->IsGossip()); @@ -136,7 +136,7 @@ namespace LuaUnit int IsTaxi(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isTaxi()); #else Eluna::Push(L, unit->IsTaxi()); @@ -146,7 +146,7 @@ namespace LuaUnit int IsSpiritHealer(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isSpiritHealer()); #else Eluna::Push(L, unit->IsSpiritHealer()); @@ -156,7 +156,7 @@ namespace LuaUnit int IsSpiritGuide(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isSpiritGuide()); #else Eluna::Push(L, unit->IsSpiritGuide()); @@ -166,7 +166,7 @@ namespace LuaUnit int IsTabardDesigner(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isTabardDesigner()); #else Eluna::Push(L, unit->IsTabardDesigner()); @@ -176,7 +176,7 @@ namespace LuaUnit int IsServiceProvider(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isServiceProvider()); #else Eluna::Push(L, unit->IsServiceProvider()); @@ -186,7 +186,7 @@ namespace LuaUnit int IsSpiritService(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isSpiritService()); #else Eluna::Push(L, unit->IsSpiritService()); @@ -196,7 +196,7 @@ namespace LuaUnit int IsAlive(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isAlive()); #else Eluna::Push(L, unit->IsAlive()); @@ -218,7 +218,7 @@ namespace LuaUnit int IsBanker(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isBanker()); #else Eluna::Push(L, unit->IsBanker()); @@ -228,7 +228,7 @@ namespace LuaUnit int IsVendor(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isVendor()); #else Eluna::Push(L, unit->IsVendor()); @@ -238,7 +238,7 @@ namespace LuaUnit int IsBattleMaster(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isBattleMaster()); #else Eluna::Push(L, unit->IsBattleMaster()); @@ -248,7 +248,7 @@ namespace LuaUnit int IsCharmed(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isCharmed()); #else Eluna::Push(L, unit->IsCharmed()); @@ -258,7 +258,7 @@ namespace LuaUnit int IsArmorer(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isArmorer()); #else Eluna::Push(L, unit->IsArmorer()); @@ -281,7 +281,7 @@ namespace LuaUnit #ifndef CLASSIC int IsOnVehicle(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->IsBoarded()); #else Eluna::Push(L, unit->GetVehicle()); @@ -292,7 +292,7 @@ namespace LuaUnit int IsInCombat(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isInCombat()); #else Eluna::Push(L, unit->IsInCombat()); @@ -320,7 +320,7 @@ namespace LuaUnit int IsQuestGiver(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->isQuestGiver()); #else Eluna::Push(L, unit->IsQuestGiver()); @@ -351,7 +351,7 @@ namespace LuaUnit int HasUnitState(lua_State* L, Unit* unit) { uint32 state = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->hasUnitState(state)); #else Eluna::Push(L, unit->HasUnitState(state)); @@ -386,7 +386,7 @@ namespace LuaUnit int GetOwnerGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetOwnerGuid()); #else Eluna::Push(L, unit->GetOwnerGUID()); @@ -402,7 +402,7 @@ namespace LuaUnit int GetCreatorGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetCreatorGuid()); #else Eluna::Push(L, unit->GetCreatorGUID()); @@ -412,7 +412,7 @@ namespace LuaUnit int GetMinionGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetPetGuid()); #else Eluna::Push(L, unit->GetPetGUID()); @@ -422,7 +422,7 @@ namespace LuaUnit int GetCharmerGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetCharmerGuid()); #else Eluna::Push(L, unit->GetCharmerGUID()); @@ -432,7 +432,7 @@ namespace LuaUnit int GetCharmGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetCharmGuid()); #else Eluna::Push(L, unit->GetCharmGUID()); @@ -442,7 +442,7 @@ namespace LuaUnit int GetPetGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetPetGuid()); #else Eluna::Push(L, unit->GetPetGUID()); @@ -452,7 +452,7 @@ namespace LuaUnit int GetControllerGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetCharmerOrOwnerGuid()); #else Eluna::Push(L, unit->GetCharmerOrOwnerGUID()); @@ -462,7 +462,7 @@ namespace LuaUnit int GetControllerGUIDS(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetCharmerOrOwnerOrOwnGuid()); #else Eluna::Push(L, unit->GetCharmerOrOwnerOrOwnGUID()); @@ -494,7 +494,7 @@ namespace LuaUnit int GetVictim(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->getVictim()); #else Eluna::Push(L, unit->GetVictim()); @@ -621,7 +621,7 @@ namespace LuaUnit int GetPowerType(lua_State* L, Unit* unit) { -#if (defined(MANGOS) && defined(WOTLK)) +#if (!defined(TRINITY) && defined(WOTLK)) Eluna::Push(L, unit->GetPowerType()); #else Eluna::Push(L, unit->getPowerType()); @@ -637,7 +637,7 @@ namespace LuaUnit int GetHealthPct(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetHealthPercent()); #else Eluna::Push(L, unit->GetHealthPct()); @@ -647,7 +647,7 @@ namespace LuaUnit int GetPowerPct(lua_State* L, Unit* unit) { -#if (defined(MANGOS) && defined(WOTLK)) +#if (!defined(TRINITY) && defined(WOTLK)) float percent = (unit->GetPower(unit->GetPowerType()) / unit->GetMaxPower(unit->GetPowerType())) * 100; #else float percent = (unit->GetPower(unit->getPowerType()) / unit->GetMaxPower(unit->getPowerType())) * 100; @@ -733,7 +733,7 @@ namespace LuaUnit int GetAura(lua_State* L, Unit* unit) { uint32 spellID = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetAura(spellID, EFFECT_INDEX_0)); #else Eluna::Push(L, unit->GetAura(spellID)); @@ -752,7 +752,7 @@ namespace LuaUnit float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); std::list list; -#ifdef MANGOS +#ifndef TRINITY MaNGOS::AnyFriendlyUnitInObjectRangeCheck checker(unit, range); MaNGOS::UnitListSearcher searcher(list, checker); Cell::VisitGridObjects(unit, searcher, range); @@ -784,7 +784,7 @@ namespace LuaUnit float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); std::list list; -#ifdef MANGOS +#ifndef TRINITY MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck checker(unit, range); MaNGOS::UnitListSearcher searcher(list, checker); Cell::VisitGridObjects(unit, searcher, range); @@ -814,7 +814,7 @@ namespace LuaUnit #if (!defined(TBC) && !defined(CLASSIC)) int GetVehicleKit(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetVehicleInfo()); #else Eluna::Push(L, unit->GetVehicleKit()); @@ -832,7 +832,7 @@ namespace LuaUnit int GetCritterGUID(lua_State* L, Unit* unit) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, unit->GetCritterGuid()); #else Eluna::Push(L, unit->GetCritterGUID()); @@ -846,7 +846,7 @@ namespace LuaUnit { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->SetOwnerGuid(ObjectGuid(guid)); #else unit->SetOwnerGUID(ObjectGuid(guid)); @@ -887,7 +887,7 @@ namespace LuaUnit bool forced = Eluna::CHECKVAL(L, 4, false); if (type >= MAX_MOVE_TYPE) return luaL_argerror(L, 2, "valid UnitMoveType expected"); -#ifdef MANGOS +#ifndef TRINITY unit->SetSpeedRate((UnitMoveType)type, rate, forced); #else unit->SetSpeed((UnitMoveType)type, rate, forced); @@ -1010,7 +1010,7 @@ namespace LuaUnit int SetCreatorGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->SetOwnerGuid(ObjectGuid(guid)); #else unit->SetOwnerGUID(ObjectGuid(guid)); @@ -1021,7 +1021,7 @@ namespace LuaUnit int SetMinionGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->SetPetGuid(ObjectGuid(guid)); #else unit->SetMinionGUID(ObjectGuid(guid)); @@ -1032,7 +1032,7 @@ namespace LuaUnit int SetCharmerGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->SetCharmerGuid(ObjectGuid(guid)); #else unit->SetCharmerGUID(ObjectGuid(guid)); @@ -1043,7 +1043,7 @@ namespace LuaUnit int SetPetGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->SetPetGuid(ObjectGuid(guid)); #else unit->SetPetGUID(ObjectGuid(guid)); @@ -1054,7 +1054,7 @@ namespace LuaUnit int SetWaterWalk(lua_State* L, Unit* unit) { bool enable = Eluna::CHECKVAL(L, 2, true); -#ifdef MANGOS +#ifndef TRINITY unit->SetWaterWalk(enable); #else unit->SetWaterWalking(enable); @@ -1074,7 +1074,7 @@ namespace LuaUnit { bool apply = Eluna::CHECKVAL(L, 2, true); -#ifdef MANGOS +#ifndef TRINITY unit->SetFFAPvP(apply); #else if (apply) @@ -1120,7 +1120,7 @@ namespace LuaUnit int SetCritterGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->SetCritterGuid(ObjectGuid(guid)); #else unit->SetCritterGUID(ObjectGuid(guid)); @@ -1190,7 +1190,7 @@ namespace LuaUnit { if (unit->IsMounted()) { -#ifdef MANGOS +#ifndef TRINITY unit->Unmount(); unit->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); #else @@ -1280,7 +1280,7 @@ namespace LuaUnit float radius = Eluna::CHECKVAL(L, 2); float x, y, z; unit->GetPosition(x, y, z); -#ifdef MANGOS +#ifndef TRINITY unit->GetMotionMaster()->MoveRandomAroundPoint(x, y, z, radius); #else unit->GetMotionMaster()->MoveRandom(radius); @@ -1466,7 +1466,7 @@ namespace LuaUnit if (!spellInfo) return 1; -#ifdef MANGOS +#ifndef TRINITY if (!IsSpellAppliesAura(spellInfo) && !IsSpellHaveEffect(spellInfo, SPELL_EFFECT_PERSISTENT_AREA_AURA)) return 1; @@ -1564,7 +1564,7 @@ namespace LuaUnit { uint32 state = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->addUnitState(state); #else unit->AddUnitState(state); @@ -1576,7 +1576,7 @@ namespace LuaUnit { uint32 state = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY unit->clearUnitState(state); #else unit->ClearUnitState(state); @@ -1612,7 +1612,7 @@ namespace LuaUnit uint32 amount = Eluna::CHECKVAL(L, 4); uint32 critical = Eluna::CHECKVAL(L, 5, false); -#ifdef MANGOS +#ifndef TRINITY if (const SpellInfo* info = sSpellStore.LookupEntry(spell)) unit->DealHeal(target, amount, info, critical); #else @@ -1627,7 +1627,7 @@ namespace LuaUnit Unit* target = Eluna::CHECKOBJ(L, 2); bool durLoss = Eluna::CHECKVAL(L, 3, true); -#ifdef MANGOS +#ifndef TRINITY unit->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durLoss); #else unit->Kill(target, durLoss); diff --git a/VehicleMethods.h b/VehicleMethods.h index 33b0d0a..2868803 100644 --- a/VehicleMethods.h +++ b/VehicleMethods.h @@ -15,7 +15,7 @@ namespace LuaVehicle int IsOnBoard(lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, vehicle->HasOnBoard(passenger)); #else Eluna::Push(L, passenger->IsOnVehicle(vehicle->GetBase())); @@ -26,7 +26,7 @@ namespace LuaVehicle /* GETTERS */ int GetOwner(lua_State* L, Vehicle* vehicle) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, vehicle->GetOwner()); #else Eluna::Push(L, vehicle->GetBase()); @@ -36,7 +36,7 @@ namespace LuaVehicle int GetEntry(lua_State* L, Vehicle* vehicle) { -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, vehicle->GetVehicleEntry()->m_ID); #else Eluna::Push(L, vehicle->GetVehicleInfo()->m_ID); @@ -56,7 +56,7 @@ namespace LuaVehicle { Unit* passenger = Eluna::CHECKOBJ(L, 2); int8 seatId = Eluna::CHECKVAL(L, 3); -#ifdef MANGOS +#ifndef TRINITY if (vehicle->CanBoard(passenger)) vehicle->Board(passenger, seatId); #else @@ -68,7 +68,7 @@ namespace LuaVehicle int RemovePassenger(lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); -#ifdef MANGOS +#ifndef TRINITY vehicle->UnBoard(passenger, false); #else vehicle->RemovePassenger(passenger); diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index 4fc8148..67c6c07 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -93,7 +93,7 @@ namespace LuaWorldObject Unit* target = NULL; Eluna::WorldObjectInRangeCheck checker(true, obj, range, TYPEMASK_PLAYER); -#ifdef MANGOS +#ifndef TRINITY MaNGOS::UnitLastSearcher searcher(target, checker); Cell::VisitWorldObjects(obj, searcher, range); #else @@ -112,7 +112,7 @@ namespace LuaWorldObject GameObject* target = NULL; Eluna::WorldObjectInRangeCheck checker(true, obj, range, TYPEMASK_GAMEOBJECT, entry); -#ifdef MANGOS +#ifndef TRINITY MaNGOS::GameObjectLastSearcher searcher(target, checker); Cell::VisitGridObjects(obj, searcher, range); #else @@ -131,7 +131,7 @@ namespace LuaWorldObject Creature* target = NULL; Eluna::WorldObjectInRangeCheck checker(true, obj, range, TYPEMASK_UNIT, entry); -#ifdef MANGOS +#ifndef TRINITY MaNGOS::CreatureLastSearcher searcher(target, checker); Cell::VisitGridObjects(obj, searcher, range); #else @@ -149,7 +149,7 @@ namespace LuaWorldObject std::list list; Eluna::WorldObjectInRangeCheck checker(false, obj, range, TYPEMASK_PLAYER); -#ifdef MANGOS +#ifndef TRINITY MaNGOS::PlayerListSearcher searcher(list, checker); Cell::VisitWorldObjects(obj, searcher, range); #else @@ -179,7 +179,7 @@ namespace LuaWorldObject std::list list; Eluna::WorldObjectInRangeCheck checker(false, obj, range, TYPEMASK_UNIT, entry); -#ifdef MANGOS +#ifndef TRINITY MaNGOS::CreatureListSearcher searcher(list, checker); Cell::VisitGridObjects(obj, searcher, range); #else @@ -209,7 +209,7 @@ namespace LuaWorldObject std::list list; Eluna::WorldObjectInRangeCheck checker(false, obj, range, TYPEMASK_GAMEOBJECT, entry); -#ifdef MANGOS +#ifndef TRINITY MaNGOS::GameObjectListSearcher searcher(list, checker); Cell::VisitGridObjects(obj, searcher, range); #else @@ -246,7 +246,7 @@ namespace LuaWorldObject if (nearest) { WorldObject* target = NULL; -#ifdef MANGOS +#ifndef TRINITY MaNGOS::WorldObjectLastSearcher searcher(target, checker); Cell::VisitAllObjects(obj, searcher, range); #else @@ -260,7 +260,7 @@ namespace LuaWorldObject else { std::list list; -#ifdef MANGOS +#ifndef TRINITY MaNGOS::WorldObjectListSearcher searcher(list, checker); Cell::VisitAllObjects(obj, searcher, range); #else @@ -290,7 +290,7 @@ namespace LuaWorldObject { uint64 guid = Eluna::CHECKVAL(L, 2); -#ifdef MANGOS +#ifndef TRINITY switch (GUID_HIPART(guid)) { case HIGHGUID_PLAYER: Eluna::Push(L, obj->GetMap()->GetPlayer(ObjectGuid(guid))); break; @@ -378,7 +378,7 @@ namespace LuaWorldObject float z = Eluna::CHECKVAL(L, 5); float o = Eluna::CHECKVAL(L, 6); uint32 respawnDelay = Eluna::CHECKVAL(L, 7, 30); -#ifdef MANGOS +#ifndef TRINITY Eluna::Push(L, obj->SummonGameObject(entry, x, y, z, o, respawnDelay)); #else Eluna::Push(L, obj->SummonGameObject(entry, x, y, z, o, 0, 0, 0, 0, respawnDelay));