From c2f2dd566ccdf7404ca431d8ab09b4574948a8f3 Mon Sep 17 00:00:00 2001 From: antz Date: Wed, 28 Mar 2018 19:36:45 +0100 Subject: [PATCH] Add Mangos Four support --- CreatureMethods.h | 2 +- ElunaIncludes.h | 4 ++-- GlobalMethods.h | 4 ++-- GuildMethods.h | 2 +- ItemMethods.h | 4 ++-- LuaFunctions.cpp | 20 +++++++------------- PlayerMethods.h | 12 +++--------- 7 files changed, 18 insertions(+), 30 deletions(-) diff --git a/CreatureMethods.h b/CreatureMethods.h index 5b7e12e..1daaf53 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -834,7 +834,7 @@ namespace LuaCreature return 1; } -#ifndef CATA +#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) /** * Returns the [Creature]'s shield block value. * diff --git a/ElunaIncludes.h b/ElunaIncludes.h index d433181..2e450be 100644 --- a/ElunaIncludes.h +++ b/ElunaIncludes.h @@ -127,7 +127,7 @@ typedef Opcodes OpcodesList; #define MAX_TALENT_SPECS MAX_TALENT_SPEC_COUNT #define TEAM_NEUTRAL TEAM_INDEX_NEUTRAL -#ifndef CLASSIC +#if defined(TBC) || (defined(WOTLK) && !defined(MANGOS)) || defined(CATA) #define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS #endif @@ -135,7 +135,7 @@ typedef Opcodes OpcodesList; #define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT #endif -#if defined(WOTLK) && !defined(MANGOS) +#if defined(CATA) || defined(MISTS) || (defined(WOTLK) && !defined(MANGOS)) #define UNIT_BYTE2_FLAG_SANCTUARY UNIT_BYTE2_FLAG_SUPPORTABLE #endif diff --git a/GlobalMethods.h b/GlobalMethods.h index e41dfb2..3f6e186 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -1844,7 +1844,7 @@ namespace LuaGlobalFunctions if (!eObjectMgr->GetCreatureTemplate(entry)) return luaL_argerror(L, 1, "valid CreatureEntry expected"); -#ifdef CATA +#if defined(CATA) || defined(MISTS) eObjectMgr->RemoveVendorItem(entry, item, 1); #else eObjectMgr->RemoveVendorItem(entry, item); @@ -1867,7 +1867,7 @@ namespace LuaGlobalFunctions auto const & itemlist = items->m_items; for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr) -#ifdef CATA +#if defined(CATA) || defined(MISTS) eObjectMgr->RemoveVendorItem(entry, (*itr)->item, 1); #else #ifdef TRINITY diff --git a/GuildMethods.h b/GuildMethods.h index cfc43cb..5cdc857 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -152,7 +152,7 @@ namespace LuaGuild return 1; } -#ifndef CATA +#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) /** * Sets the leader of this [Guild] * diff --git a/ItemMethods.h b/ItemMethods.h index a9af6be..fa4b1ef 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -195,7 +195,7 @@ namespace LuaItem return 1; } -#ifndef CATA +#if defined CLASSIC || defined(TBC) || defined(WOTLK) /** * Returns 'true' if the [Item] is a weapon vellum, 'false' otherwise * @@ -271,7 +271,7 @@ namespace LuaItem #ifndef CLASSIC if (int32 itemRandPropId = item->GetItemRandomPropertyId()) { -#ifdef CATA +#if defined(CATA) || defined (MISTS) char* suffix = NULL; #else char* const* suffix = NULL; diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 2316332..b267d78 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -450,11 +450,9 @@ ElunaRegister PlayerMethods[] = { "GetGuild", &LuaPlayer::GetGuild }, { "GetAccountId", &LuaPlayer::GetAccountId }, { "GetAccountName", &LuaPlayer::GetAccountName }, -#ifndef CATA -#ifndef CLASSIC +#if defined (TBC) || defined (WOTLK) { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, -#endif #endif { "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, { "GetPlayerIP", &LuaPlayer::GetPlayerIP }, @@ -514,7 +512,7 @@ ElunaRegister PlayerMethods[] = { "GetCorpse", &LuaPlayer::GetCorpse }, { "GetGossipTextId", &LuaPlayer::GetGossipTextId }, { "GetQuestRewardStatus", &LuaPlayer::GetQuestRewardStatus }, -#ifndef CATA +#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, #endif #ifdef CLASSIC @@ -534,12 +532,10 @@ ElunaRegister PlayerMethods[] = { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, #endif { "SetBindPoint", &LuaPlayer::SetBindPoint }, -#ifndef CATA -#ifndef CLASSIC +#if defined(TBC) || defined(WOTLK) { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, #endif -#endif #ifdef CLASSIC { "SetHonorStoredKills", &LuaPlayer::SetHonorStoredKills }, { "SetRankPoints", &LuaPlayer::SetRankPoints }, @@ -708,11 +704,9 @@ ElunaRegister PlayerMethods[] = { "DurabilityPointLossForEquipSlot", &LuaPlayer::DurabilityPointLossForEquipSlot }, { "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, { "DurabilityRepair", &LuaPlayer::DurabilityRepair }, -#ifndef CATA -#ifndef CLASSIC +#if defined(TBC) || defined(WOTLK) { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, -#endif #endif { "LeaveBattleground", &LuaPlayer::LeaveBattleground }, // {"BindToInstance", &LuaPlayer::BindToInstance}, // :BindToInstance() - UNDOCUMENTED - Binds the player to the current instance @@ -784,7 +778,7 @@ ElunaRegister CreatureMethods[] = { "GetLootRecipient", &LuaCreature::GetLootRecipient }, { "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, { "GetNPCFlags", &LuaCreature::GetNPCFlags }, -#ifndef CATA +#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, #endif { "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow }, @@ -956,7 +950,7 @@ ElunaRegister ItemMethods[] = { "IsEquipped", &LuaItem::IsEquipped }, { "HasQuest", &LuaItem::HasQuest }, { "IsPotion", &LuaItem::IsPotion }, -#ifndef CATA +#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "IsWeaponVellum", &LuaItem::IsWeaponVellum }, { "IsArmorVellum", &LuaItem::IsArmorVellum }, #endif @@ -1097,7 +1091,7 @@ ElunaRegister GuildMethods[] = { "SetBankTabText", &LuaGuild::SetBankTabText }, #endif { "SetMemberRank", &LuaGuild::SetMemberRank }, -#ifndef CATA +#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "SetLeader", &LuaGuild::SetLeader }, #endif diff --git a/PlayerMethods.h b/PlayerMethods.h index c1270fc..8c62ea3 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -780,8 +780,7 @@ namespace LuaPlayer } #endif -#ifndef CATA -#ifndef CLASSIC +#if defined(TBC) || defined (WOTLK) /** * Returns the [Player]s current amount of Arena Points * @@ -803,7 +802,6 @@ namespace LuaPlayer Eluna::Push(L, player->GetHonorPoints()); return 1; } -#endif /** * Returns the [Player]s current shield block value @@ -1900,8 +1898,7 @@ namespace LuaPlayer return 0; } -#ifndef CATA -#ifndef CLASSIC +#if defined(TBC) || defined(WOTLK) /** * Sets the [Player]s Arena Points to the amount specified * @@ -1926,7 +1923,6 @@ namespace LuaPlayer return 0; } #endif -#endif #ifdef CLASSIC /** @@ -2111,8 +2107,7 @@ namespace LuaPlayer return 0; } -#ifndef CATA -#ifndef CLASSIC +#if defined(TBC) || defined(WOTLK) /** * Adds or detracts from the [Player]s current Arena Points * @@ -2138,7 +2133,6 @@ namespace LuaPlayer player->ModifyHonorPoints(amount); return 0; } -#endif #endif /**