From f34e8987df9648fdc7c28867f970df54b7ee3e18 Mon Sep 17 00:00:00 2001 From: Niam5 Date: Thu, 8 Aug 2024 13:45:23 -0700 Subject: [PATCH] Fix CMaNGOS defines in line with new scheme --- ElunaIncludes.h | 3 +- methods/CMangos/AuraMethods.h | 6 +- methods/CMangos/BattleGroundMethods.h | 2 +- methods/CMangos/CreatureMethods.h | 18 ++-- methods/CMangos/GlobalMethods.h | 54 +++++----- methods/CMangos/GroupMethods.h | 8 +- methods/CMangos/GuildMethods.h | 8 +- methods/CMangos/ItemMethods.h | 30 +++--- methods/CMangos/MapMethods.h | 10 +- methods/CMangos/PlayerMethods.h | 142 ++++++++++++++------------ methods/CMangos/QuestMethods.h | 4 +- methods/CMangos/UnitMethods.h | 45 ++++---- methods/CMangos/VehicleMethods.h | 6 +- methods/CMangos/WorldObjectMethods.h | 8 +- methods/CMangos/WorldPacketMethods.h | 2 +- 15 files changed, 173 insertions(+), 173 deletions(-) diff --git a/ElunaIncludes.h b/ElunaIncludes.h index d285d25cb5..43aa7d82e1 100644 --- a/ElunaIncludes.h +++ b/ElunaIncludes.h @@ -93,7 +93,6 @@ #include "Spells/SpellAuras.h" #include "Spells/SpellMgr.h" #include "Tools/Language.h" -#include "AI/BaseAI/UnitAI.h" #include "Server/SQLStorages.h" #if ELUNA_EXPANSION > CLASSIC #include "Arena/ArenaTeam.h" @@ -103,6 +102,8 @@ #endif #if ELUNA_EXPANSION >= CATA #include "AI/BaseAI/AggressorAI.h" +#else +#include "AI/BaseAI/UnitAI.h" #endif #endif diff --git a/methods/CMangos/AuraMethods.h b/methods/CMangos/AuraMethods.h index c7ab629a29..82b255252e 100644 --- a/methods/CMangos/AuraMethods.h +++ b/methods/CMangos/AuraMethods.h @@ -123,7 +123,7 @@ namespace LuaAura { int32 duration = E->CHECKVAL(2); aura->GetHolder()->SetAuraDuration(duration); -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION < WOTLK aura->GetHolder()->UpdateAuraDuration(); #else aura->GetHolder()->SendAuraUpdate(false); @@ -143,7 +143,7 @@ namespace LuaAura { int32 duration = E->CHECKVAL(2); aura->GetHolder()->SetAuraMaxDuration(duration); -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION < WOTLK aura->GetHolder()->UpdateAuraDuration(); #else aura->GetHolder()->SendAuraUpdate(false); @@ -162,7 +162,7 @@ namespace LuaAura int SetStackAmount(Eluna* E, Aura* aura) { uint8 amount = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA aura->GetHolder()->SetStackAmount(amount, aura->GetTarget()); #else aura->GetHolder()->SetStackAmount(amount); diff --git a/methods/CMangos/BattleGroundMethods.h b/methods/CMangos/BattleGroundMethods.h index 42920985d3..5fdfa37c5a 100644 --- a/methods/CMangos/BattleGroundMethods.h +++ b/methods/CMangos/BattleGroundMethods.h @@ -107,7 +107,7 @@ namespace LuaBattleGround */ int GetInstanceId(Eluna* E, BattleGround* bg) { -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(bg->GetInstanceId()); #else E->Push(bg->GetInstanceID()); diff --git a/methods/CMangos/CreatureMethods.h b/methods/CMangos/CreatureMethods.h index f96db232e5..43c081013c 100644 --- a/methods/CMangos/CreatureMethods.h +++ b/methods/CMangos/CreatureMethods.h @@ -26,7 +26,7 @@ namespace LuaCreature return 1; } -#ifndef CATA +#if ELUNA_EXPANSION < CATA /** * Returns `true` if the [Creature] is set to not give reputation when killed, * and returns `false` otherwise. @@ -66,7 +66,7 @@ namespace LuaCreature { bool mustBeDead = E->CHECKVAL(2, false); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(creature->IsTargetableForAttack(mustBeDead)); #else E->Push(creature->isTargetableForAttack(mustBeDead)); @@ -715,7 +715,7 @@ namespace LuaCreature return 1; } -#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION < CATA /** * Returns the [Creature]'s shield block value. * @@ -827,7 +827,7 @@ namespace LuaCreature return 0; } -#ifndef CATA +#if ELUNA_EXPANSION < CATA /** * Sets whether the [Creature] gives reputation or not. * @@ -1056,7 +1056,7 @@ namespace LuaCreature uint32 entry = E->CHECKVAL(2); uint32 dataGuidLow = E->CHECKVAL(3, 0); -#ifndef CATA +#if ELUNA_EXPANSION < CATA creature->UpdateEntry(entry, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL); #else creature->UpdateEntry(entry, ALLIANCE, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL); @@ -1160,7 +1160,7 @@ namespace LuaCreature SpellEntry const* spellEntry = GetSpellStore()->LookupEntry(spell); creature->AddThreat(victim, threat, false, (SpellSchoolMask)schoolMask, spellEntry); -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC creature->AddThreat(victim, threat, false, spellEntry ? GetSchoolMask(spellEntry->School) : SPELL_SCHOOL_MASK_NONE, spellEntry); #else creature->AddThreat(victim, threat, false, spellEntry ? static_cast(spellEntry->SchoolMask) : SPELL_SCHOOL_MASK_NONE, spellEntry); @@ -1219,7 +1219,7 @@ namespace LuaCreature { "GetRank", &LuaCreature::GetRank }, { "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow }, { "GetCreatureFamily", &LuaCreature::GetCreatureFamily }, -#ifndef CATA +#if ELUNA_EXPANSION < CATA { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, #else { "GetShieldBlockValue", METHOD_REG_NONE }, @@ -1240,7 +1240,7 @@ namespace LuaCreature { "SetWalk", &LuaCreature::SetWalk }, { "SetHomePosition", &LuaCreature::SetHomePosition }, { "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots }, -#ifndef CATA +#if ELUNA_EXPANSION < CATA { "SetDisableReputationGain", &LuaCreature::SetDisableReputationGain }, #else { "SetDisableReputationGain", METHOD_REG_NONE }, @@ -1268,7 +1268,7 @@ namespace LuaCreature { "HasQuest", &LuaCreature::HasQuest }, { "HasSpellCooldown", &LuaCreature::HasSpellCooldown }, { "CanFly", &LuaCreature::CanFly }, -#ifndef CATA +#if ELUNA_EXPANSION < CATA { "IsReputationGainDisabled", &LuaCreature::IsReputationGainDisabled }, #else { "IsReputationGainDisabled", METHOD_REG_NONE }, diff --git a/methods/CMangos/GlobalMethods.h b/methods/CMangos/GlobalMethods.h index 10785a1fb9..b1bd5203b2 100644 --- a/methods/CMangos/GlobalMethods.h +++ b/methods/CMangos/GlobalMethods.h @@ -78,13 +78,13 @@ namespace LuaGlobalFunctions */ int GetCoreExpansion(Eluna* E) { -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC E->Push(0); -#elif defined(TBC) +#elif ELUNA_EXPANSION == TBC E->Push(1); -#elif defined(WOTLK) +#elif ELUNA_EXPANSION == WOTLK E->Push(2); -#elif defined(CATA) +#elif ELUNA_EXPANSION == CATA E->Push(3); #endif return 1; @@ -460,7 +460,7 @@ namespace LuaGlobalFunctions std::ostringstream oss; oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec << "|Hitem:" << entry << ":0:" << -#ifndef CLASSIC +#if ELUNA_EXPANSION > CLASSIC "0:0:0:0:" << #endif "0:0:0:0|h[" << name << "]|h|r"; @@ -1678,7 +1678,7 @@ namespace LuaGlobalFunctions float o = E->CHECKVAL(8); bool save = E->CHECKVAL(9, false); uint32 durorresptime = E->CHECKVAL(10, 0); -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK uint32 phase = E->CHECKVAL(11, PHASEMASK_NORMAL); if (!phase) { @@ -1705,7 +1705,7 @@ namespace LuaGlobalFunctions return 1; } -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION <= TBC CreatureCreatePos pos(map, x, y, z, o); #else CreatureCreatePos pos(map, x, y, z, o, phase); @@ -1718,7 +1718,7 @@ namespace LuaGlobalFunctions E->Push(); return 1; } -#ifndef CATA +#if ELUNA_EXPANSION < CATA if (!pCreature->Create(lowguid, lowguid, pos, cinfo)) #else if (!pCreature->Create(lowguid, pos, cinfo)) @@ -1729,9 +1729,9 @@ namespace LuaGlobalFunctions return 1; } -#ifdef TBC +#if ELUNA_EXPANSION == TBC pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); -#elif defined(CLASSIC) +#elif ELUNA_EXPANSION == CLASSIC pCreature->SaveToDB(map->GetId()); #else pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase); @@ -1740,7 +1740,7 @@ namespace LuaGlobalFunctions uint32 db_guid = pCreature->GetGUIDLow(); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); -#ifndef CATA +#if ELUNA_EXPANSION < CATA pCreature->LoadFromDB(db_guid, map, db_guid, 0); #else pCreature->LoadFromDB(db_guid, map); @@ -1764,12 +1764,12 @@ namespace LuaGlobalFunctions TemporarySpawn* pCreature = new TemporarySpawn(ObjectGuid(uint64(0))); -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION <= TBC CreatureCreatePos pos(map, x, y, z, o); #else CreatureCreatePos pos(map, x, y, z, o, phase); #endif -#ifdef CATA +#if ELUNA_EXPANSION == CATA if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo)) #else if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo)) @@ -1820,9 +1820,9 @@ namespace LuaGlobalFunctions } GameObject* pGameObj = new GameObject; -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION <= TBC if (!pGameObj->Create(db_lowGUID, db_lowGUID, gInfo->id, map, x, y, z, o)) -#elif defined CATA +#elif ELUNA_EXPANSION == CATA if (!pGameObj->Create(db_lowGUID, gInfo->id, map, phase, x, y, z, o)) #else if (!pGameObj->Create(db_lowGUID, db_lowGUID, gInfo->id, map, phase, x, y, z, o)) @@ -1837,16 +1837,16 @@ namespace LuaGlobalFunctions pGameObj->SetRespawnTime(durorresptime); // fill the gameobject data and save to the db -#ifdef TBC +#if ELUNA_EXPANSION == TBC pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); -#elif defined(CLASSIC) +#elif ELUNA_EXPANSION == CLASSIC pGameObj->SaveToDB(map->GetId()); #else pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase); #endif // this will generate a new guid if the object is in an instance -#ifndef CATA +#if ELUNA_EXPANSION < CATA if (!pGameObj->LoadFromDB(db_lowGUID, map, db_lowGUID, 0)) #else if (!pGameObj->LoadFromDB(db_lowGUID, map)) @@ -1869,9 +1869,9 @@ namespace LuaGlobalFunctions else { GameObject* pGameObj = new GameObject; -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION <= TBC if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, o)) -#elif !defined CATA +#elif ELUNA_EXPANSION == WOTLK 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)) @@ -1910,7 +1910,7 @@ namespace LuaGlobalFunctions if (opcode >= NUM_MSG_TYPES) return luaL_argerror(E->L, 1, "valid opcode expected"); -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC E->Push(new WorldPacket((Opcodes)opcode, size)); #else E->Push(new WorldPacket((OpcodesList)opcode, size)); @@ -1935,15 +1935,15 @@ namespace LuaGlobalFunctions uint32 incrtime = E->CHECKVAL(4); uint32 extendedcost = E->CHECKVAL(5); -#ifndef CATA +#if ELUNA_EXPANSION < CATA if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0)) #else if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, VENDOR_ITEM_TYPE_ITEM, maxcount, incrtime, extendedcost, 0)) #endif return 0; -#ifdef CATA +#if ELUNA_EXPANSION == CATA eObjectMgr->AddVendorItem(entry, item, VENDOR_ITEM_TYPE_ITEM, maxcount, incrtime, extendedcost); -#elif !defined CLASSIC +#elif ELUNA_EXPANSION > CLASSIC eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost); #else eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime); @@ -1964,7 +1964,7 @@ namespace LuaGlobalFunctions if (!eObjectMgr->GetCreatureTemplate(entry)) return luaL_argerror(E->L, 1, "valid CreatureEntry expected"); -#if defined(CATA) +#if ELUNA_EXPANSION == CATA eObjectMgr->RemoveVendorItem(entry, item, 1); #else eObjectMgr->RemoveVendorItem(entry, item); @@ -1987,7 +1987,7 @@ namespace LuaGlobalFunctions auto const itemlist = items->m_items; for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr) -#if defined(CATA) +#if ELUNA_EXPANSION == CATA eObjectMgr->RemoveVendorItem(entry, (*itr)->item, 1); #else eObjectMgr->RemoveVendorItem(entry, (*itr)->item); @@ -2370,7 +2370,7 @@ namespace LuaGlobalFunctions sTaxiNodesStore.InsertEntry(nodeEntry, nodeId++); -#ifdef CATA +#if ELUNA_EXPANSION == CATA sTaxiPathNodesByPath[pathId][index++] = new TaxiPathNodeEntry(entry); #else sTaxiPathNodesByPath[pathId].set(index++, new TaxiPathNodeEntry(entry)); diff --git a/methods/CMangos/GroupMethods.h b/methods/CMangos/GroupMethods.h index 088cf6ca92..be819ca119 100644 --- a/methods/CMangos/GroupMethods.h +++ b/methods/CMangos/GroupMethods.h @@ -36,7 +36,7 @@ namespace LuaGroup return 1; } -#if !(defined(CLASSIC) || defined(TBC)) +#if ELUNA_EXPANSION >= WOTLK /** * Returns 'true' if the [Group] is a LFG group * @@ -200,7 +200,7 @@ namespace LuaGroup */ int GetGUID(Eluna* E, Group* group) { -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC E->Push(group->GetId()); #else E->Push(group->GET_GUID()); @@ -361,7 +361,7 @@ namespace LuaGroup if (icon >= TARGETICONCOUNT) return luaL_argerror(E->L, 2, "valid target icon expected"); -#if (defined(CLASSIC) || defined(TBC)) +#if ELUNA_EXPANSION <= TBC group->SetTargetIcon(icon, target); #else group->SetTargetIcon(icon, setter, target); @@ -402,7 +402,7 @@ namespace LuaGroup { "IsAssistant", &LuaGroup::IsAssistant }, { "SameSubGroup", &LuaGroup::SameSubGroup }, { "HasFreeSlotSubGroup", &LuaGroup::HasFreeSlotSubGroup }, -#if defined WOTLK +#if ELUNA_EXPANSION == WOTLK { "IsLFGGroup", &LuaGroup::IsLFGGroup }, #else { "IsLFGGroup", METHOD_REG_NONE }, diff --git a/methods/CMangos/GuildMethods.h b/methods/CMangos/GuildMethods.h index 757ae5ca26..f7c5162f84 100644 --- a/methods/CMangos/GuildMethods.h +++ b/methods/CMangos/GuildMethods.h @@ -121,7 +121,7 @@ namespace LuaGuild return 1; } -#if defined(CLASSIC) || defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION <= WOTLK /** * Sets the leader of this [Guild] * @@ -136,7 +136,7 @@ namespace LuaGuild } #endif -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Sets the information of the bank tab specified * @@ -252,13 +252,13 @@ namespace LuaGuild { "GetMemberCount", &LuaGuild::GetMemberCount }, // Setters -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "SetBankTabText", &LuaGuild::SetBankTabText, METHOD_REG_WORLD }, // World state method only in multistate #else { "SetBankTabText", METHOD_REG_NONE }, #endif { "SetMemberRank", &LuaGuild::SetMemberRank, METHOD_REG_WORLD }, // World state method only in multistate -#ifndef CATA +#if ELUNA_EXPANSION < CATA { "SetLeader", &LuaGuild::SetLeader, METHOD_REG_WORLD }, // World state method only in multistate #else { "SetLeader", METHOD_REG_NONE }, diff --git a/methods/CMangos/ItemMethods.h b/methods/CMangos/ItemMethods.h index 1f771ac066..20e3d25cc7 100644 --- a/methods/CMangos/ItemMethods.h +++ b/methods/CMangos/ItemMethods.h @@ -23,7 +23,7 @@ namespace LuaItem return 1; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK /** * Returns 'true' if the [Item] is account bound, 'false' otherwise * @@ -83,7 +83,7 @@ namespace LuaItem return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Item] is a currency token, 'false' otherwise * @@ -125,7 +125,7 @@ namespace LuaItem */ int CanBeTraded(Eluna* E, Item* item) { -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION <= TBC E->Push(item->CanBeTraded()); #else bool mail = E->CHECKVAL(2, false); @@ -192,7 +192,7 @@ namespace LuaItem return 1; } -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK /** * Returns 'true' if the [Item] is a weapon vellum, 'false' otherwise * @@ -259,10 +259,10 @@ namespace LuaItem if (ItemLocale const* il = eObjectMgr->GetItemLocale(temp->ItemId)) ObjectMgr::GetLocaleString(il->Name, static_cast(locale), name); -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC if (int32 itemRandPropId = item->GetItemRandomPropertyId()) { -#if defined(CATA) +#if ELUNA_EXPANSION == CATA char* suffix = NULL; #else char* const* suffix = NULL; @@ -291,7 +291,7 @@ namespace LuaItem oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec << "|Hitem:" << temp->ItemId << ":" << item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT) << ":" << -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT) << ":" << item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_2) << ":" << item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_3) << ":" << @@ -491,7 +491,7 @@ namespace LuaItem return 1; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC /** * Returns the flags2 of the [Item] * @@ -603,7 +603,7 @@ namespace LuaItem return 1; } -#ifdef WOTLK +#if ELUNA_EXPANSION == WOTLK int GetStatsCount(Eluna* E, Item* item) { E->Push(item->GetTemplate()->StatsCount); @@ -622,7 +622,7 @@ namespace LuaItem return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC int GetRandomSuffix(Eluna* E, Item* item) { E->Push(item->GetTemplate()->RandomSuffix); @@ -790,7 +790,7 @@ namespace LuaItem { "GetDisplayId", &LuaItem::GetDisplayId }, { "GetQuality", &LuaItem::GetQuality }, { "GetFlags", &LuaItem::GetFlags }, -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC { "GetFlags2", &LuaItem::GetFlags2 }, #else { "GetFlags2", METHOD_REG_NONE }, @@ -807,12 +807,12 @@ namespace LuaItem { "GetRandomProperty", &LuaItem::GetRandomProperty }, { "GetItemSet", &LuaItem::GetItemSet }, { "GetBagSize", &LuaItem::GetBagSize }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "GetRandomSuffix", &LuaItem::GetRandomSuffix }, #else { "GetRandomSuffix", METHOD_REG_NONE }, #endif -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK { "GetStatsCount", &LuaItem::GetStatsCount }, #else { "GetStatsCount", METHOD_REG_NONE }, @@ -840,12 +840,12 @@ namespace LuaItem { "IsConjuredConsumable", &LuaItem::IsConjuredConsumable }, { "SetEnchantment", &LuaItem::SetEnchantment }, { "ClearEnchantment", &LuaItem::ClearEnchantment }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "IsCurrencyToken", &LuaItem::IsCurrencyToken }, #else { "IsCurrencyToken", METHOD_REG_NONE }, #endif -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK { "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, { "IsWeaponVellum", &LuaItem::IsWeaponVellum }, { "IsArmorVellum", &LuaItem::IsArmorVellum }, diff --git a/methods/CMangos/MapMethods.h b/methods/CMangos/MapMethods.h index 1ab68e7a5a..7fccda2af1 100644 --- a/methods/CMangos/MapMethods.h +++ b/methods/CMangos/MapMethods.h @@ -17,7 +17,7 @@ namespace LuaMap { -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns `true` if the [Map] is an arena [BattleGround], `false` otherwise. * @@ -63,7 +63,7 @@ namespace LuaMap return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns `true` if the [Map] is a heroic, `false` otherwise. * @@ -111,7 +111,7 @@ namespace LuaMap { float x = E->CHECKVAL(2); float y = E->CHECKVAL(3); -#if (defined(TBC) || defined(CLASSIC)) +#if ELUNA_EXPANSION <= TBC float z = map->GetHeight(x, y, MAX_HEIGHT); #else uint32 phasemask = E->CHECKVAL(4, 1); @@ -131,7 +131,7 @@ namespace LuaMap */ int GetDifficulty(Eluna* E, Map* map) { -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC E->Push(map->GetDifficulty()); #else E->Push((Difficulty)0); @@ -353,7 +353,7 @@ namespace LuaMap { "IsDungeon", &LuaMap::IsDungeon }, { "IsEmpty", &LuaMap::IsEmpty }, { "IsRaid", &LuaMap::IsRaid }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "IsArena", &LuaMap::IsArena }, { "IsHeroic", &LuaMap::IsHeroic }, #else diff --git a/methods/CMangos/PlayerMethods.h b/methods/CMangos/PlayerMethods.h index 602c424837..03a66c5cbd 100644 --- a/methods/CMangos/PlayerMethods.h +++ b/methods/CMangos/PlayerMethods.h @@ -12,7 +12,7 @@ */ namespace LuaPlayer { -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK /** * Returns 'true' if the [Player] can Titan Grip, 'false' otherwise. * @@ -127,7 +127,7 @@ namespace LuaPlayer return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Player] has a title by specific ID, 'false' otherwise. * @@ -251,7 +251,7 @@ namespace LuaPlayer return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Player] can fly, 'false' otherwise. * @@ -264,7 +264,7 @@ namespace LuaPlayer } #endif -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC /** * Returns [Player] kills * @@ -324,7 +324,7 @@ namespace LuaPlayer return 1; } -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC /** * Updates the [Player]s weekly honor status */ @@ -353,7 +353,7 @@ namespace LuaPlayer } #endif -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Player] is currently flying, 'false' otherwise. * @@ -401,7 +401,7 @@ namespace LuaPlayer return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Player] is in an arena team specified by type, 'false' otherwise. * @@ -654,7 +654,7 @@ namespace LuaPlayer return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Player] is currently in an arena, 'false' otherwise. * @@ -700,7 +700,7 @@ namespace LuaPlayer return 1; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK /** * Returns the amount of available specs the [Player] currently has * @@ -724,7 +724,7 @@ namespace LuaPlayer } #endif -#ifdef WOTLK +#if ELUNA_EXPANSION == WOTLK /** * Returns the normal phase of the player instead of the actual phase possibly containing GM phase * @@ -737,7 +737,7 @@ namespace LuaPlayer } #endif -#if defined(TBC) || defined (WOTLK) +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK /** * Returns the [Player]s current amount of Arena Points * @@ -760,7 +760,7 @@ namespace LuaPlayer return 1; } #endif -#if defined(CLASSIC) || defined(TBC) || defined (WOTLK) +#if ELUNA_EXPANSION <= WOTLK /** * Returns the [Player]s current shield block value * @@ -830,7 +830,7 @@ namespace LuaPlayer { float radius = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetNextRandomRaidMember(radius, SPELL_AURA_NONE)); #else E->Push(player->GetNextRandomRaidMember(radius)); @@ -930,7 +930,7 @@ namespace LuaPlayer int GetSkillTempBonusValue(Eluna* E, Player* player) { uint32 skill = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetSkillBonusTemporary(skill)); #else E->Push(player->GetSkillTempBonusValue(skill)); @@ -947,7 +947,7 @@ namespace LuaPlayer int GetSkillPermBonusValue(Eluna* E, Player* player) { uint32 skill = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetSkillBonusPermanent(skill)); #else E->Push(player->GetSkillPermBonusValue(skill)); @@ -964,7 +964,7 @@ namespace LuaPlayer int GetPureSkillValue(Eluna* E, Player* player) { uint32 skill = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetSkillValuePure(skill)); #else E->Push(player->GetPureSkillValue(skill)); @@ -981,7 +981,7 @@ namespace LuaPlayer int GetBaseSkillValue(Eluna* E, Player* player) { uint32 skill = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetSkillValueBase(skill)); #else E->Push(player->GetBaseSkillValue(skill)); @@ -1012,7 +1012,7 @@ namespace LuaPlayer int GetPureMaxSkillValue(Eluna* E, Player* player) { uint32 skill = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetSkillMaxPure(skill)); #else E->Push(player->GetPureMaxSkillValue(skill)); @@ -1029,7 +1029,7 @@ namespace LuaPlayer int GetMaxSkillValue(Eluna* E, Player* player) { uint32 skill = E->CHECKVAL(2); -#ifndef CATA +#if ELUNA_EXPANSION < CATA E->Push(player->GetSkillMax(skill)); #else E->Push(player->GetMaxSkillValue(skill)); @@ -1067,9 +1067,9 @@ namespace LuaPlayer */ int GetDifficulty(Eluna* E, Player* player) { -#ifdef TBC +#if ELUNA_EXPANSION == TBC E->Push(player->GetDifficulty()); -#elif defined(CLASSIC) +#elif ELUNA_EXPANSION == CLASSIC E->Push((Difficulty)0); #else bool isRaid = E->CHECKVAL(2, true); @@ -1566,7 +1566,7 @@ namespace LuaPlayer if (apply) { player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_SILENCED); -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->UpdateClientControl(player, 0); #else player->SetClientControl(player, 0); @@ -1575,7 +1575,7 @@ namespace LuaPlayer else { player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_SILENCED); -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->UpdateClientControl(player, 1); #else player->SetClientControl(player, 1); @@ -1683,7 +1683,7 @@ namespace LuaPlayer uint32 points = E->CHECKVAL(2); player->SetFreeTalentPoints(points); -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC player->SendTalentsInfoData(false); #endif return 0; @@ -1699,7 +1699,7 @@ namespace LuaPlayer { uint32 faction = E->CHECKVAL(2); int32 value = E->CHECKVAL(3); -#ifdef TBC +#if ELUNA_EXPANSION == TBC FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction); #else FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction); @@ -1847,7 +1847,7 @@ namespace LuaPlayer return 0; } -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK /** * Sets the [Player]s Arena Points to the amount specified * @@ -1873,7 +1873,7 @@ namespace LuaPlayer } #endif -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC /** * Sets kills * @@ -1962,7 +1962,7 @@ namespace LuaPlayer return 0; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Adds the specified title to the [Player]s list of known titles * @@ -1991,7 +1991,7 @@ namespace LuaPlayer return 0; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC /** * Resets the [Player]s pets talent points */ @@ -2023,7 +2023,7 @@ namespace LuaPlayer { ObjectGuid guid = E->CHECKVAL(2, player->GET_GUID()); -#if (defined(CLASSIC) || defined(TBC)) +#if ELUNA_EXPANSION <= TBC WorldPacket data(CMSG_GET_MAIL_LIST, 8); data << guid; player->GetSession()->HandleGetMailList(data); @@ -2033,7 +2033,7 @@ namespace LuaPlayer return 0; } -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK /** * Adds or detracts from the [Player]s current Arena Points * @@ -2081,7 +2081,7 @@ namespace LuaPlayer float x, y, z; summoner->GetPosition(x,y,z); -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->SetSummonPoint(summoner->GetMapId(), x, y, z, summoner->GetMasterGuid()); #else player->SetSummonPoint(summoner->GetMapId(), x, y, z); @@ -2265,7 +2265,7 @@ namespace LuaPlayer int LogoutPlayer(Eluna* E, Player* player) { bool save = E->CHECKVAL(2, true); -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->GetSession()->LogoutPlayer(); #else player->GetSession()->LogoutPlayer(save); @@ -2293,7 +2293,7 @@ namespace LuaPlayer int UnbindInstance(Eluna* E, Player* player) { uint32 map = E->CHECKVAL(2); -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC uint32 difficulty = E->CHECKVAL(3, 0); if (difficulty < MAX_DIFFICULTY) @@ -2309,7 +2309,7 @@ namespace LuaPlayer */ int UnbindAllInstances(Eluna* /*E*/, Player* player) { -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC Player::BoundInstancesMap& binds = player->GetBoundInstances(); for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) { @@ -2359,7 +2359,7 @@ namespace LuaPlayer bool takeCost = E->CHECKVAL(3, true); float discountMod = E->CHECKVAL(4, 1.0f); -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC player->DurabilityRepair(position, takeCost, discountMod); #else player->DurabilityRepair(position, takeCost, discountMod, false); @@ -2380,7 +2380,7 @@ namespace LuaPlayer float discountMod = E->CHECKVAL(3, 1.0f); bool guildBank = E->CHECKVAL(4, false); -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC player->DurabilityRepairAll(takeCost, discountMod); #else player->DurabilityRepairAll(takeCost, discountMod, guildBank); @@ -2506,7 +2506,7 @@ namespace LuaPlayer bool no_cost = E->CHECKVAL(2, true); player->resetTalents(no_cost); -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC player->SendTalentsInfoData(false); #endif return 0; @@ -2683,7 +2683,7 @@ namespace LuaPlayer { if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creature)) for (uint16 z = 0; z < creaturecount; ++z) -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->KilledMonster(cInfo, nullptr); #else player->KilledMonster(cInfo, ObjectGuid()); @@ -2703,7 +2703,7 @@ namespace LuaPlayer uint32 repValue = quest->GetRepObjectiveValue(); uint32 curRep = player->GetReputationMgr().GetReputation(repFaction); if (curRep < repValue) -#ifdef TBC +#if ELUNA_EXPANSION == TBC if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(repFaction)) #else if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(repFaction)) @@ -2949,7 +2949,7 @@ namespace LuaPlayer return 1; } player->ItemAddedQuestCheck(entry, 1); -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, entry, 1); #endif } @@ -3011,7 +3011,7 @@ namespace LuaPlayer return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Removes a title by ID from the [Player]s list of known titles * @@ -3098,7 +3098,7 @@ namespace LuaPlayer float z = E->CHECKVAL(5); float o = E->CHECKVAL(6); -#if !defined(CATA) +#if ELUNA_EXPANSION < CATA if (player->IsTaxiFlying()) player->TaxiFlightInterrupt(); else @@ -3300,7 +3300,7 @@ namespace LuaPlayer data << uint8(channel); data << int32(LANG_ADDON); data << player->GET_GUID(); -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC data << uint32(0); data << receiver->GET_GUID(); #endif @@ -3359,7 +3359,7 @@ namespace LuaPlayer uint32 rank = E->CHECKVAL(3); player->LearnTalent(id, rank); -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC player->SendTalentsInfoData(false); #endif @@ -3369,7 +3369,7 @@ namespace LuaPlayer return 0; } -#if !defined(CLASSIC) +#if ELUNA_EXPANSION >= TBC /** * Remove cooldowns on spells that have less than 10 minutes of cooldown from the [Player], similarly to when you enter an arena. */ @@ -3422,11 +3422,11 @@ namespace LuaPlayer bool _code = E->CHECKVAL(6, false); const char* _promptMsg = E->CHECKVAL(7, ""); uint32 _money = E->CHECKVAL(8, 0); -#if !defined(CLASSIC) && !defined(CATA) +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK player->GetPlayerMenu()->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code); -#elif defined(CLASSIC) +#elif ELUNA_EXPANSION == CLASSIC player->GetPlayerMenu()->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _code); -#elif defined(CATA) +#elif ELUNA_EXPANSION == CATA player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code); #endif return 0; @@ -3439,7 +3439,7 @@ namespace LuaPlayer */ int GossipComplete(Eluna* /*E*/, Player* player) { -#if !defined(CATA) +#if ELUNA_EXPANSION < CATA player->GetPlayerMenu()->CloseGossip(); #else player->PlayerTalkClass->CloseGossip(); @@ -3468,13 +3468,13 @@ namespace LuaPlayer if (sender->GetTypeId() == TYPEID_PLAYER) { uint32 menu_id = E->CHECKVAL(4); -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->GetPlayerMenu()->GetGossipMenu().SetMenuId(menu_id); #else player->PlayerTalkClass->GetGossipMenu().SetMenuId(menu_id); #endif } -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->GetPlayerMenu()->SendGossipMenu(npc_text, sender->GET_GUID()); #else player->PlayerTalkClass->SendGossipMenu(npc_text, sender->GET_GUID()); @@ -3492,7 +3492,7 @@ namespace LuaPlayer */ int GossipClearMenu(Eluna* /*E*/, Player* player) { -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->GetPlayerMenu()->ClearMenus(); #else player->PlayerTalkClass->ClearMenus(); @@ -3581,7 +3581,7 @@ namespace LuaPlayer if (!quest) return 0; -#ifndef CATA +#if ELUNA_EXPANSION < CATA player->GetPlayerMenu()->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept); #else player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept); @@ -3648,7 +3648,7 @@ namespace LuaPlayer if (success) { -#if defined(CLASSIC) || defined(TBC) +#if ELUNA_EXPANSION <= TBC WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size data << player->GetName(); invited->GetSession()->SendPacket(data); @@ -3722,7 +3722,7 @@ namespace LuaPlayer return 0; } -#if !defined(CLASSIC) && !defined(TBC) +#if ELUNA_EXPANSION > TBC /** * Starts a movie for the [Player] * @@ -3798,14 +3798,14 @@ namespace LuaPlayer { "GetCorpse", &LuaPlayer::GetCorpse }, { "GetGossipTextId", &LuaPlayer::GetGossipTextId }, { "GetQuestRewardStatus", &LuaPlayer::GetQuestRewardStatus }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, #else { "GetArenaPoints", METHOD_REG_NONE }, { "GetHonorPoints", METHOD_REG_NONE }, #endif -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK { "GetPhaseMaskForSpawn", &LuaPlayer::GetPhaseMaskForSpawn }, { "GetActiveSpec", &LuaPlayer::GetActiveSpec }, { "GetSpecsCount", &LuaPlayer::GetSpecsCount }, @@ -3814,7 +3814,7 @@ namespace LuaPlayer { "GetActiveSpec", METHOD_REG_NONE }, { "GetSpecsCount", METHOD_REG_NONE }, #endif -#ifndef CATA +#if ELUNA_EXPANSION < CATA { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, #else { "GetShieldBlockValue", METHOD_REG_NONE }, @@ -3847,14 +3847,17 @@ namespace LuaPlayer { "SetPlayerLock", &LuaPlayer::SetPlayerLock }, { "SetGender", &LuaPlayer::SetGender }, { "SetSheath", &LuaPlayer::SetSheath }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "SetKnownTitle", &LuaPlayer::SetKnownTitle }, { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, - { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, - { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, #else { "SetKnownTitle", METHOD_REG_NONE }, { "UnsetKnownTitle", METHOD_REG_NONE }, +#endif +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK + { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, + { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, +#else { "SetArenaPoints", METHOD_REG_NONE }, { "SetHonorPoints", METHOD_REG_NONE }, #endif @@ -3903,7 +3906,7 @@ namespace LuaPlayer { "HasSpellCooldown", &LuaPlayer::HasSpellCooldown }, { "IsInWater", &LuaPlayer::IsInWater }, { "IsMoving", &LuaPlayer::IsMoving }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "HasTitle", &LuaPlayer::HasTitle }, { "IsInArenaTeam", &LuaPlayer::IsInArenaTeam }, { "InArena", &LuaPlayer::InArena }, @@ -3916,7 +3919,7 @@ namespace LuaPlayer { "CanFly", METHOD_REG_NONE }, { "IsFlying", METHOD_REG_NONE }, #endif -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK { "HasAchieved", &LuaPlayer::HasAchieved }, { "HasTalent", &LuaPlayer::HasTalent }, { "CanTitanGrip", &LuaPlayer::CanTitanGrip }, @@ -4007,16 +4010,19 @@ namespace LuaPlayer { "GroupInvite", &LuaPlayer::GroupInvite, METHOD_REG_WORLD }, // World state method only in multistate { "GroupCreate", &LuaPlayer::GroupCreate, METHOD_REG_WORLD }, // World state method only in multistate { "SendCinematicStart", &LuaPlayer::SendCinematicStart }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns }, +#else + { "RemoveArenaSpellCooldowns", METHOD_REG_NONE }, +#endif +#if ELUNA_EXPANSION >= TBC && ELUNA_EXPANSION <= WOTLK { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, #else - { "RemoveArenaSpellCooldowns", METHOD_REG_NONE }, { "ModifyHonorPoints", METHOD_REG_NONE }, { "ModifyArenaPoints", METHOD_REG_NONE }, #endif -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK { "ResetPetTalents", &LuaPlayer::ResetPetTalents }, { "ResetAchievements", &LuaPlayer::ResetAchievements }, { "SendMovieStart", &LuaPlayer::SendMovieStart }, @@ -4036,7 +4042,7 @@ namespace LuaPlayer { "SetHonorLastWeekStandingPos", METHOD_REG_NONE }, // classic only { "SetMovement", METHOD_REG_NONE }, // not implemented { "SetFFA", METHOD_REG_NONE }, // not implemented - { "IsImmuneToEnvironmentalDamage", nullptr}, // not implemented + { "IsImmuneToEnvironmentalDamage", METHOD_REG_NONE }, // not implemented { "InRandomLfgDungeon", METHOD_REG_NONE }, // not implemented { "HasPendingBind", METHOD_REG_NONE }, //not implmented { "CanFlyInZone", METHOD_REG_NONE }, // not implemented diff --git a/methods/CMangos/QuestMethods.h b/methods/CMangos/QuestMethods.h index 8977e2f64d..3243faa175 100644 --- a/methods/CMangos/QuestMethods.h +++ b/methods/CMangos/QuestMethods.h @@ -57,7 +57,7 @@ namespace LuaQuest return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns 'true' if the [Quest] is a daily quest, false otherwise. * @@ -185,7 +185,7 @@ namespace LuaQuest // Boolean { "HasFlag", &LuaQuest::HasFlag }, -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "IsDaily", &LuaQuest::IsDaily }, #else { "IsDaily", METHOD_REG_NONE }, diff --git a/methods/CMangos/UnitMethods.h b/methods/CMangos/UnitMethods.h index 68cab3fa85..877264e044 100644 --- a/methods/CMangos/UnitMethods.h +++ b/methods/CMangos/UnitMethods.h @@ -58,7 +58,7 @@ namespace LuaUnit int32 immunity = E->CHECKVAL(2); bool apply = E->CHECKVAL(3, true); -#ifndef CATA +#if ELUNA_EXPANSION < CATA unit->ApplySpellImmune(nullptr, 5, immunity, apply); #else unit->ApplySpellImmune(0, 5, immunity, apply); @@ -383,7 +383,7 @@ namespace LuaUnit return 1; } -#ifndef CLASSIC +#if ELUNA_EXPANSION >= TBC /** * Returns true if the [Unit] is on a [Vehicle]. * @@ -1126,7 +1126,7 @@ namespace LuaUnit return 1; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK /** * Returns [Unit]'s [Vehicle] methods * @@ -1605,7 +1605,7 @@ namespace LuaUnit return 0; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK /** * Sets the [Unit]'s FFA flag on or off. * @@ -1922,7 +1922,7 @@ namespace LuaUnit float y = E->CHECKVAL(4); float z = E->CHECKVAL(5); bool genPath = E->CHECKVAL(6, true); -#ifndef CATA +#if ELUNA_EXPANSION < CATA unit->GetMotionMaster()->MovePoint(id, x, y, z, FORCED_MOVEMENT_NONE, genPath); #else unit->GetMotionMaster()->MovePoint(id, x, y, z, genPath); @@ -1930,7 +1930,7 @@ namespace LuaUnit return 0; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION >= WOTLK /** * Makes the [Unit] jump to the coordinates * @@ -1950,12 +1950,7 @@ namespace LuaUnit float maxHeight = E->CHECKVAL(6); uint32 id = E->CHECKVAL(7, 0); -#if (defined(WOTLK) || defined(CATA)) unit->GetMotionMaster()->MoveJump(x, y, z, zSpeed, maxHeight, id); -#else - Position pos(x, y, z); - unit->GetMotionMaster()->MoveJump(pos, zSpeed, maxHeight, id); -#endif return 0; } #endif @@ -2186,7 +2181,7 @@ namespace LuaUnit for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i) { -#ifdef CATA +#if ELUNA_EXPANSION == CATA SpellEffectEntry const* spellEffect = spellEntry->GetSpellEffect(SpellEffectIndex(i)); if (!spellEffect) continue; @@ -2194,7 +2189,7 @@ namespace LuaUnit #else uint8 eff = spellEntry->Effect[i]; #endif -#ifndef CATA +#if ELUNA_EXPANSION < CATA if (eff >= MAX_SPELL_EFFECTS) #else if (eff >= TOTAL_SPELL_EFFECTS) @@ -2204,7 +2199,7 @@ namespace LuaUnit eff == SPELL_EFFECT_APPLY_AURA || eff == SPELL_EFFECT_PERSISTENT_AREA_AURA) { -#ifndef CATA +#if ELUNA_EXPANSION < CATA Aura* aur = CreateAura(spellEntry, SpellEffIndex(i), NULL, NULL, holder, target); #else Aura* aur = CreateAura(spellEntry, SpellEffIndex(i), NULL, holder, target); @@ -2239,7 +2234,7 @@ namespace LuaUnit return 0; } -#if !defined(CLASSIC) +#if ELUNA_EXPANSION >= TBC /** * Removes all positive visible [Aura]'s from the [Unit]. */ @@ -2331,7 +2326,7 @@ namespace LuaUnit // flat melee damage without resistence/etc reduction if (school == MAX_SPELL_SCHOOL) { -#if !defined(CATA) +#if ELUNA_EXPANSION < CATA Unit::DealDamage(unit, target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durabilityloss); unit->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_NORMAL, 0); #else @@ -2344,7 +2339,7 @@ namespace LuaUnit SpellSchoolMask schoolmask = SpellSchoolMask(1 << school); if (schoolmask & SPELL_SCHOOL_MASK_NORMAL) -#ifndef CATA +#if ELUNA_EXPANSION < CATA damage = unit->CalcArmorReducedDamage(unit, target, damage); #else damage = unit->CalcArmorReducedDamage(target, damage); @@ -2354,7 +2349,7 @@ namespace LuaUnit if (!spell) { uint32 absorb = 0; -#ifndef CATA +#if ELUNA_EXPANSION < CATA int32 resist = 0; #else uint32 resist = 0; @@ -2366,7 +2361,7 @@ namespace LuaUnit else damage -= absorb + resist; -#ifndef CATA +#if ELUNA_EXPANSION < CATA unit->DealDamageMods(unit, target, damage, &absorb, DIRECT_DAMAGE); unit->DealDamage(unit, target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); #else @@ -2414,7 +2409,7 @@ namespace LuaUnit Unit* target = E->CHECKOBJ(2); bool durLoss = E->CHECKVAL(3, true); -#if !defined(CATA) +#if ELUNA_EXPANSION < CATA unit->DealDamage(unit, target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durLoss); #else unit->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durLoss); @@ -2478,9 +2473,9 @@ namespace LuaUnit { "SetFacing", &LuaUnit::SetFacing }, { "SetFacingToObject", &LuaUnit::SetFacingToObject }, { "SetSpeed", &LuaUnit::SetSpeed }, - {"SetRooted", &LuaUnit::SetRooted}, - {"SetConfused", &LuaUnit::SetConfused}, - {"SetFeared", &LuaUnit::SetFeared}, + { "SetRooted", &LuaUnit::SetRooted}, + { "SetConfused", &LuaUnit::SetConfused}, + { "SetFeared", &LuaUnit::SetFeared}, { "SetPvP", &LuaUnit::SetPvP }, { "SetOwnerGUID", &LuaUnit::SetOwnerGUID }, { "SetName", &LuaUnit::SetName }, @@ -2575,10 +2570,10 @@ namespace LuaUnit { "DealHeal", &LuaUnit::DealHeal }, // Expansion specific methods -#if defined(TBC) || defined(WOTLK) +#if ELUNA_EXPANSION >= TBC { "IsOnVehicle", &LuaUnit::IsOnVehicle }, { "RemoveArenaAuras", &LuaUnit::RemoveArenaAuras }, -#elif defined(WOTLK) +#elif ELUNA_EXPANSION >= WOTLK { "GetCritterGUID", &LuaUnit::GetCritterGUID }, { "GetVehicleKit", &LuaUnit::GetVehicleKit }, { "SetFFA", &LuaUnit::SetFFA }, diff --git a/methods/CMangos/VehicleMethods.h b/methods/CMangos/VehicleMethods.h index a615051400..7e3e67a4a2 100644 --- a/methods/CMangos/VehicleMethods.h +++ b/methods/CMangos/VehicleMethods.h @@ -6,8 +6,7 @@ #ifndef VEHICLEMETHODS_H #define VEHICLEMETHODS_H -#ifndef CLASSIC -#ifndef TBC +#if ELUNA_EXPANSION >= WOTLK /*** * Inherits all methods from: none @@ -108,6 +107,5 @@ namespace LuaVehicle }; } -#endif // CLASSIC -#endif // TBC +#endif // EXPANSION >= WOTLK #endif // VEHICLEMETHODS_H diff --git a/methods/CMangos/WorldObjectMethods.h b/methods/CMangos/WorldObjectMethods.h index d937dee798..79a1a7ef67 100644 --- a/methods/CMangos/WorldObjectMethods.h +++ b/methods/CMangos/WorldObjectMethods.h @@ -34,7 +34,7 @@ namespace LuaWorldObject return 1; } -#if (!defined(TBC) && !defined(CLASSIC)) +#if ELUNA_EXPANSION > TBC /** * Returns the current phase of the [WorldObject] * @@ -1060,7 +1060,7 @@ namespace LuaWorldObject return 0; if (player) -#ifdef CATA +#if ELUNA_EXPANSION == CATA obj->PlayDirectSound(soundId, player); #else obj->PlayDirectSound(soundId, PlayPacketParameters(PLAY_TARGET, (Player const*)player)); @@ -1090,7 +1090,7 @@ namespace LuaWorldObject return 0; if (player) -#ifdef CATA +#if ELUNA_EXPANSION == CATA obj->PlayDistanceSound(soundId, player); #else obj->PlayDistanceSound(soundId, PlayPacketParameters(PLAY_TARGET, (Player const*)player)); @@ -1154,7 +1154,7 @@ namespace LuaWorldObject { "GetExactDistance2d", &LuaWorldObject::GetExactDistance2d }, { "GetRelativePoint", &LuaWorldObject::GetRelativePoint }, { "GetAngle", &LuaWorldObject::GetAngle }, -#if defined(WOTLK) +#if ELUNA_EXPANSION == WOTLK { "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, { "SetPhaseMask", &LuaWorldObject::SetPhaseMask }, #else diff --git a/methods/CMangos/WorldPacketMethods.h b/methods/CMangos/WorldPacketMethods.h index 3155f8a571..8ce42b9f99 100644 --- a/methods/CMangos/WorldPacketMethods.h +++ b/methods/CMangos/WorldPacketMethods.h @@ -52,7 +52,7 @@ namespace LuaPacket uint32 opcode = E->CHECKVAL(2); if (opcode >= NUM_MSG_TYPES) return luaL_argerror(E->L, 2, "valid opcode expected"); -#ifdef CLASSIC +#if ELUNA_EXPANSION == CLASSIC packet->SetOpcode((Opcodes)opcode); #else packet->SetOpcode((OpcodesList)opcode);