diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39b22bd --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# +# Copyright (C) 2010 - 2014 Eluna Lua Engine +# This program is free software licensed under GPL version 3 +# Please see the included DOCS/LICENSE.md for more information +# + +Includes.h diff --git a/GlobalMethods.h b/GlobalMethods.h index fd91afe..805e470 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -227,7 +227,11 @@ namespace LuaGlobalFunctions std::ostringstream oss; oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec << - "|Hitem:" << entry << ":0:0:0:0:0:0:0:0:0|h[" << name << "]|h|r"; + "|Hitem:" << entry << ":0:" << +#ifndef CLASSIC + "0:0:0:0:" << +#endif + "0:0:0:0|h[" << name << "]|h|r"; sEluna->Push(L, oss.str()); return 1; @@ -531,7 +535,7 @@ namespace LuaGlobalFunctions float o = sEluna->CHECKVAL(L, 8); bool save = sEluna->CHECKVAL(L, 9, false); uint32 durorresptime = sEluna->CHECKVAL(L, 10, 0); -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) uint32 phase = sEluna->CHECKVAL(L, 11, PHASEMASK_NORMAL); if (!phase) return 0; @@ -550,7 +554,7 @@ namespace LuaGlobalFunctions if (!cinfo) return 0; -#ifdef TBC +#if (defined(TBC) || defined(CLASSIC)) CreatureCreatePos pos(map, x, y, z, o); #else CreatureCreatePos pos(map, x, y, z, o, phase); @@ -569,6 +573,8 @@ namespace LuaGlobalFunctions #ifdef TBC pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); +#elif defined(CLASSIC) + pCreature->SaveToDB(map->GetId()); #else pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase); #endif @@ -592,7 +598,7 @@ namespace LuaGlobalFunctions return 0; TemporarySummon* pCreature = new TemporarySummon(GUID_TYPE(uint64(0))); -#ifdef TBC +#if (defined(TBC) || defined(CLASSIC)) CreatureCreatePos pos(map, x, y, z, o); #else CreatureCreatePos pos(map, x, y, z, o, phase); @@ -636,7 +642,7 @@ namespace LuaGlobalFunctions return 0; GameObject* pGameObj = new GameObject; -#ifdef TBC +#if (defined(TBC) || defined(CLASSIC)) if (!pGameObj->Create(db_lowGUID, gInfo->id, map, x, y, z, o)) #else if (!pGameObj->Create(db_lowGUID, gInfo->id, map, phase, x, y, z, o)) @@ -652,6 +658,8 @@ namespace LuaGlobalFunctions // fill the gameobject data and save to the db #ifdef TBC pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); +#elif defined(CLASSIC) + pGameObj->SaveToDB(map->GetId()); #else pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase); #endif @@ -675,7 +683,7 @@ namespace LuaGlobalFunctions { GameObject* pGameObj = new GameObject; -#ifdef TBC +#if (defined(TBC) || defined(CLASSIC)) if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, o)) #else if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, phase, x, y, z, o)) @@ -807,7 +815,11 @@ namespace LuaGlobalFunctions #ifdef MANGOS if (!sObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0)) return 0; +#ifndef CLASSIC sObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost); +#else + sObjectMgr->AddVendorItem(entry, item, maxcount, incrtime); +#endif #else #ifdef CATA if (!sObjectMgr->IsVendorItemValid(entry, item, maxcount, incrtime, extendedcost, 1)) @@ -1072,8 +1084,6 @@ namespace LuaGlobalFunctions // optional entry->actionFlag = sEluna->CHECKVAL(L, start + 4); entry->delay = sEluna->CHECKVAL(L, start + 5); - entry->arrivalEventID = sEluna->CHECKVAL(L, start + 6); - entry->departureEventID = sEluna->CHECKVAL(L, start + 7); nodes.push_back(*entry); diff --git a/GroupMethods.h b/GroupMethods.h index 3a531bb..09a7a3b 100644 --- a/GroupMethods.h +++ b/GroupMethods.h @@ -135,7 +135,11 @@ namespace LuaGroup int GetGUID(lua_State* L, Group* group) { +#ifdef CLASSIC + sEluna->Push(L, group->GetId()); +#else sEluna->Push(L, group->GET_GUID()); +#endif return 1; } diff --git a/GuildMethods.h b/GuildMethods.h index 8575414..7cc10d4 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -104,6 +104,7 @@ namespace LuaGuild } #endif +#ifndef CLASSIC int SetBankTabText(lua_State* L, Guild* guild) { uint8 tabId = sEluna->CHECKVAL(L, 2); @@ -115,6 +116,7 @@ namespace LuaGuild #endif return 0; } +#endif /* OTHER */ // SendPacketToGuild(packet) @@ -173,6 +175,7 @@ namespace LuaGuild return 0; } +#ifndef CLASSIC // Move to Player methods int WithdrawBankMoney(lua_State* L, Guild* guild) { @@ -201,5 +204,6 @@ namespace LuaGuild #endif return 0; } +#endif }; #endif diff --git a/HookMgr.h b/HookMgr.h index c79aa76..5aedcdb 100644 --- a/HookMgr.h +++ b/HookMgr.h @@ -29,14 +29,9 @@ #define SpellEffIndex SpellEffectIndex #define ItemTemplate ItemPrototype #define GetTemplate GetProto -//#include "Common.h" -//#include "Policies/Singleton.h" -//#include "ObjectGuid.h" -//#include "ace/Atomic_Op.h" -// -//enums -//#include "DBCEnums.h" -//#include "Includes.h" +#ifdef CLASSIC +#define Difficulty int +#endif #endif struct AreaTriggerEntry; diff --git a/ItemMethods.h b/ItemMethods.h index 86fc257..678d18b 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -16,7 +16,7 @@ namespace LuaItem return 1; } -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int IsBoundAccountWide(lua_State* L, Item* item) { sEluna->Push(L, item->IsBoundAccountWide()); @@ -50,11 +50,13 @@ namespace LuaItem return 1; } +#ifndef CLASSIC int IsCurrencyToken(lua_State* L, Item* item) { sEluna->Push(L, item->IsCurrencyToken()); return 1; } +#endif int IsNotEmptyBag(lua_State* L, Item* item) { @@ -70,7 +72,7 @@ namespace LuaItem int CanBeTraded(lua_State* L, Item* item) { -#ifdef TBC +#if (defined(TBC) || defined(CLASSIC)) sEluna->Push(L, item->CanBeTraded()); #else bool mail = sEluna->CHECKVAL(L, 2, false); @@ -163,6 +165,7 @@ namespace LuaItem if (ItemLocale const* il = sObjectMgr->GetItemLocale(temp->ItemId)) ObjectMgr::GetLocaleString(il->Name, loc_idx, name); +#ifndef CLASSIC if (int32 itemRandPropId = item->GetItemRandomPropertyId()) { #ifdef CATA @@ -192,15 +195,18 @@ namespace LuaItem /*}*/ } } +#endif std::ostringstream oss; oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec << "|Hitem:" << temp->ItemId << ":" << item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT) << ":" << +#ifndef CLASSIC item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT) << ":" << item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_2) << ":" << item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_3) << ":" << item->GetEnchantmentId(BONUS_ENCHANTMENT_SLOT) << ":" << +#endif item->GetItemRandomPropertyId() << ":" << item->GetItemSuffixFactor() << ":" << (uint32)item->GetOwner()->getLevel() << "|h[" << name << "]|h|r"; @@ -383,11 +389,13 @@ namespace LuaItem return 1; } +#ifndef CLASSIC int GetRandomSuffix(lua_State* L, Item* item) { sEluna->Push(L, item->GetTemplate()->RandomSuffix); return 1; } +#endif int GetItemSet(lua_State* L, Item* item) { diff --git a/LuaEngine.h b/LuaEngine.h index 5f598e6..39b3fac 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -19,7 +19,6 @@ extern "C" // Required #include "AccountMgr.h" -#include "ArenaTeam.h" #include "AuctionHouseMgr.h" #include "Cell.h" #include "CellImpl.h" @@ -58,9 +57,12 @@ extern "C" #include "SpellInfo.h" #include "WeatherMgr.h" #endif -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) #include "Vehicle.h" #endif +#ifndef CLASSIC +#include "ArenaTeam.h" +#endif typedef std::set LoadedScripts; @@ -95,7 +97,9 @@ typedef std::set LoadedScripts; #define OVERRIDE override #define DIALOG_STATUS_SCRIPTED_NO_STATUS DIALOG_STATUS_UNDEFINED #define TempSummon TemporarySummon +#ifndef CLASSIC #define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS +#endif #define MAX_TALENT_SPECS MAX_TALENT_SPEC_COUNT #define Vehicle VehicleInfo #define GUID_ENPART(guid) ObjectGuid(guid).GetEntry() @@ -112,6 +116,10 @@ enum SelectAggroTarget #ifdef TBC #define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT #endif +#ifdef CLASSIC +#undef Opcodes +#define Opcodes OpcodesList +#endif #else #define GUID_TYPE uint64 #define GET_GUID GetGUID diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index e342722..9f20942 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -149,7 +149,7 @@ ElunaRegister WorldObjectMethods[] = // Getters { "GetName", &LuaWorldObject::GetName }, // :GetName() { "GetMap", &LuaWorldObject::GetMap }, // :GetMap() - Returns the WorldObject's current map object -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, // :GetPhaseMask() #endif { "GetInstanceId", &LuaWorldObject::GetInstanceId }, // :GetInstanceId() @@ -214,7 +214,7 @@ ElunaRegister UnitMethods[] = { "GetCharmerGUID", &LuaUnit::GetCharmerGUID }, // :GetCharmerGUID() - Returns the UNIT_FIELD_CHARMEDBY charmer { "GetCharmGUID", &LuaUnit::GetCharmGUID }, // :GetCharmGUID() - Returns the unit's UNIT_FIELD_CHARM guid { "GetPetGUID", &LuaUnit::GetPetGUID }, // :GetPetGUID() - Returns the unit's pet GUID -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "GetCritterGUID", &LuaUnit::GetCritterGUID }, // :GetCritterGUID() - Returns the critter's GUID #endif { "GetControllerGUID", &LuaUnit::GetControllerGUID }, // :GetControllerGUID() - Returns the Charmer or Owner GUID @@ -223,7 +223,7 @@ ElunaRegister UnitMethods[] = { "GetVictim", &LuaUnit::GetVictim }, // :GetVictim() - Returns creature's current target { "GetStat", &LuaUnit::GetStat }, // :GetStat(stat) { "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, // :GetBaseSpellPower() -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "GetVehicleKit", &LuaUnit::GetVehicleKit }, // :GetVehicleKit() - Gets unit's Vehicle kit if the unit is a vehicle // {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - Gets the Vehicle kit of the vehicle the unit is on #endif @@ -239,7 +239,7 @@ ElunaRegister UnitMethods[] = { "SetNativeDisplayId", &LuaUnit::SetNativeDisplayId }, // :SetNativeDisplayId(id) { "SetFacing", &LuaUnit::SetFacing }, // :SetFacing(o) - Sets the Unit facing to arg { "SetFacingToObject", &LuaUnit::SetFacingToObject }, // :SetFacingToObject(worldObject) - Sets the Unit facing towards the WorldObject -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "SetPhaseMask", &LuaUnit::SetPhaseMask }, // :SetPhaseMask(Phase[, update]) - Sets the phase of the unit #endif { "SetSpeed", &LuaUnit::SetSpeed }, // :SetSpeed(type, speed[, forced]) - Sets speed for the movement type (0 = walk, 1 = run ..) @@ -248,7 +248,7 @@ ElunaRegister UnitMethods[] = // {"SetConfused", &LuaUnit::SetConfused}, // :SetConfused([enable]) - Sets confused or removes confusion // {"SetFeared", &LuaUnit::SetFeared}, // :SetFeared([enable]) - Fears or removes fear { "SetPvP", &LuaUnit::SetPvP }, // :SetPvP([apply]) - Sets the units PvP on or off -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "SetFFA", &LuaUnit::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off { "SetSanctuary", &LuaUnit::SetSanctuary }, // :SetSanctuary([apply]) - Enables or disables units sanctuary flag #endif @@ -261,7 +261,7 @@ ElunaRegister UnitMethods[] = { "SetMinionGUID", &LuaUnit::SetMinionGUID }, // :SetCreatorGUID(uint64 creatorGUID) - Sets the UNIT_FIELD_CREATEDBY creator's guid { "SetCharmerGUID", &LuaUnit::SetCharmerGUID }, // :SetCharmerGUID(uint64 ownerGUID) - Sets the UNIT_FIELD_CHARMEDBY charmer GUID { "SetPetGUID", &LuaUnit::SetPetGUID }, // :SetPetGUID(uint64 guid) - Sets the pet's guid -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "SetCritterGUID", &LuaUnit::SetCritterGUID }, // :SetCritterGUID(uint64 guid) - Sets the critter's guid #endif { "SetWaterWalk", &LuaUnit::SetWaterWalk }, // :SetWaterWalk([enable]) - Sets WaterWalk on or off @@ -310,7 +310,9 @@ ElunaRegister UnitMethods[] = { "IsFullHealth", &LuaUnit::IsFullHealth }, // :IsFullHealth() - Returns if the unit is full health { "HasAura", &LuaUnit::HasAura }, // :HasAura(spellId) - Returns true if the unit has the aura from the spell { "IsStandState", &LuaUnit::IsStandState }, // :IsStandState() - Returns true if the unit is standing +#ifndef CLASSIC { "IsOnVehicle", &LuaUnit::IsOnVehicle }, // :IsOnVehicle() - Checks if the unit is on a vehicle +#endif // Other { "RegisterEvent", &LuaUnit::RegisterEvent }, // :RegisterEvent(function, delay, calls) @@ -356,7 +358,7 @@ ElunaRegister UnitMethods[] = { "MoveConfused", &LuaUnit::MoveConfused }, // :MoveConfused() { "MoveFleeing", &LuaUnit::MoveFleeing }, // :MoveFleeing(enemy[, time]) { "MoveTo", &LuaUnit::MoveTo }, // :MoveTo(id, x, y, z[, genPath]) - Moves to point. id is sent to WP reach hook. genPath defaults to true -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "MoveJump", &LuaUnit::MoveJump }, // :MoveJump(x, y, z, zSpeed, maxHeight, id) #endif { "MoveStop", &LuaUnit::MoveStop }, // :MoveStop() @@ -380,8 +382,10 @@ ElunaRegister PlayerMethods[] = { "GetAccountId", &LuaPlayer::GetAccountId }, // :GetAccountId() { "GetAccountName", &LuaPlayer::GetAccountName }, // :GetAccountName() #ifndef CATA +#ifndef CLASSIC { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, // :GetArenaPoints() { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, // :GetHonorPoints() +#endif #endif { "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, // :GetLifetimeKills() - Returns the player's lifetime (honorable) kills { "GetPlayerIP", &LuaPlayer::GetPlayerIP }, // :GetPlayerIP() - Returns the player's IP Address @@ -405,7 +409,7 @@ ElunaRegister PlayerMethods[] = { "GetComboTarget", &LuaPlayer::GetComboTarget }, // :GetComboTarget() - Returns the player's combo target { "GetGuildName", &LuaPlayer::GetGuildName }, // :GetGuildName() - Returns player's guild's name or nil { "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, // :GetFreeTalentPoints() - Returns the amount of unused talent points -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "GetActiveSpec", &LuaPlayer::GetActiveSpec }, // :GetActiveSpec() - Returns the active specID { "GetSpecsCount", &LuaPlayer::GetSpecsCount }, // :GetSpecsCount() - Returns the player's spec count #endif @@ -453,12 +457,16 @@ ElunaRegister PlayerMethods[] = { "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, // :AdvanceAllSkills(value) - Advances all current skills to your input(value) { "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, // :AddLifetimeKills(val) - Adds lifetime (honorable) kills to your current lifetime kills { "SetCoinage", &LuaPlayer::SetCoinage }, // :SetCoinage(amount) - sets plr's coinage to this +#ifndef CLASSIC { "SetKnownTitle", &LuaPlayer::SetKnownTitle }, // :SetKnownTitle(id) { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, // :UnsetKnownTitle(id) +#endif { "SetBindPoint", &LuaPlayer::SetBindPoint }, // :SetBindPoint(x, y, z, map, areaid) - sets home for hearthstone #ifndef CATA +#ifndef CLASSIC { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, // :SetArenaPoints(amount) { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, // :SetHonorPoints(amount) +#endif #endif { "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, // :SetLifetimeKills(val) - Sets the overall lifetime (honorable) kills of the player { "SetGameMaster", &LuaPlayer::SetGameMaster }, // :SetGameMaster([on]) - Sets GM mode on or off @@ -492,11 +500,15 @@ ElunaRegister PlayerMethods[] = { "IsGM", &LuaPlayer::IsGM }, // :IsGM() { "IsAlliance", &LuaPlayer::IsAlliance }, // :IsAlliance() { "IsHorde", &LuaPlayer::IsHorde }, // :IsHorde() +#ifndef CLASSIC { "HasTitle", &LuaPlayer::HasTitle }, // :HasTitle(id) +#endif { "HasItem", &LuaPlayer::HasItem }, // :HasItem(itemId[, count, check_bank]) - Returns true if the player has the item(itemId) and specified count, else it will return false { "Teleport", &LuaPlayer::Teleport }, // :Teleport(Map, X, Y, Z, O) - Teleports player to specified co - ordinates. Returns true if success and false if not { "AddItem", &LuaPlayer::AddItem }, // :AddItem(id, amount) - Adds amount of item to player. Returns true if success and false if not +#ifndef CLASSIC { "IsInArenaTeam", &LuaPlayer::IsInArenaTeam }, // :IsInArenaTeam(type) - type : 0 = 2v2, 1 = 3v3, 2 = 5v5 +#endif { "CanEquipItem", &LuaPlayer::CanEquipItem }, // :CanEquipItem(entry/item, slot) - Returns true if the player can equip given item/item entry { "IsFalling", &LuaPlayer::IsFalling }, // :IsFalling() - Returns true if the unit is falling { "ToggleAFK", &LuaPlayer::ToggleAFK }, // :ToggleAFK() - Toggles AFK state for player @@ -514,7 +526,7 @@ ElunaRegister PlayerMethods[] = { "HasAtLoginFlag", &LuaPlayer::HasAtLoginFlag }, // :HasAtLoginFlag(flag) - returns true if the player has the login flag // {"InRandomLfgDungeon", &LuaPlayer::InRandomLfgDungeon}, // :InRandomLfgDungeon() - Returns true if the player is in a random LFG dungeon // {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - Returns true if the player has a pending instance bind -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "HasAchieved", &LuaPlayer::HasAchieved }, // :HasAchieved(achievementID) - Returns true if the player has achieved the achievement #endif { "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup }, // :CanUninviteFromGroup() - Returns true if the player can uninvite from group @@ -527,7 +539,7 @@ ElunaRegister PlayerMethods[] = { "HasQuestForGO", &LuaPlayer::HasQuestForGO }, // :HasQuestForGO(entry) - Returns true if the player has the quest for the gameobject { "CanShareQuest", &LuaPlayer::CanShareQuest }, // :CanShareQuest(entry) - Returns true if the quest entry is shareable by the player // {"HasReceivedQuestReward", &LuaPlayer::HasReceivedQuestReward}, // :HasReceivedQuestReward(entry) - Returns true if the player has recieved the quest's reward -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "HasTalent", &LuaPlayer::HasTalent }, // :HasTalent(talentId, spec) - Returns true if the player has the talent in given spec #endif { "IsInSameGroupWith", &LuaPlayer::IsInSameGroupWith }, // :IsInSameGroupWith(player) - Returns true if the players are in the same group @@ -537,20 +549,26 @@ ElunaRegister PlayerMethods[] = { "IsHonorOrXPTarget", &LuaPlayer::IsHonorOrXPTarget }, // :IsHonorOrXPTarget(victim) - Returns true if the victim gives honor or XP { "CanParry", &LuaPlayer::CanParry }, // :CanParry() - Returns true if the player can parry { "CanBlock", &LuaPlayer::CanBlock }, // :CanBlock() - Returns true if the player can block -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "CanTitanGrip", &LuaPlayer::CanTitanGrip }, // :CanTitanGrip() - Returns true if the player has titan grip #endif { "InBattleground", &LuaPlayer::InBattleground }, // :InBattleground() - Returns true if the player is in a battleground +#ifndef CLASSIC { "InArena", &LuaPlayer::InArena }, // :InArena() - Returns true if the player is in an arena +#endif // {"IsOutdoorPvPActive", &LuaPlayer::IsOutdoorPvPActive}, // :IsOutdoorPvPActive() - Returns true if the player is outdoor pvp active // {"IsARecruiter", &LuaPlayer::IsARecruiter}, // :IsARecruiter() - Returns true if the player is a recruiter { "CanUseItem", &LuaPlayer::CanUseItem }, // :CanUseItem(item/entry) - Returns true if the player can use the item or item entry { "HasSpell", &LuaPlayer::HasSpell }, // :HasSpell(id) { "HasSpellCooldown", &LuaPlayer::HasSpellCooldown }, // :HasSpellCooldown(spellId) - Returns true if the spell is on cooldown { "IsInWater", &LuaPlayer::IsInWater }, // :IsInWater() - Returns true if the player is in water +#ifndef CLASSIC { "CanFly", &LuaPlayer::CanFly }, // :CanFly() - Returns true if the player can fly +#endif { "IsMoving", &LuaPlayer::IsMoving }, // :IsMoving() +#ifndef CLASSIC { "IsFlying", &LuaPlayer::IsFlying }, // :IsFlying() +#endif // Gossip { "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, // :GossipMenuAddItem(icon, msg, sender, intid[, code, popup, money]) @@ -594,7 +612,7 @@ ElunaRegister PlayerMethods[] = // {"KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit}, // :KilledPlayerCredit() - Satisfies a player kill for the player // {"KillGOCredit", &LuaPlayer::KillGOCredit}, // :KillGOCredit(GOEntry[, GUID]) - Credits the player for destroying a GO, guid is optional { "TalkedToCreature", &LuaPlayer::TalkedToCreature }, // :TalkedToCreature(npcEntry, creature) - Satisfies creature talk objective for the player -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "ResetPetTalents", &LuaPlayer::ResetPetTalents }, // :ResetPetTalents() - Resets player's pet's talents #endif { "AddComboPoints", &LuaPlayer::AddComboPoints }, // :AddComboPoints(target, count[, spell]) - Adds combo points to the target for the player @@ -614,14 +632,16 @@ ElunaRegister PlayerMethods[] = { "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, // :DurabilityRepairAll([has_cost, discount, guildBank]) - Repairs all durability { "DurabilityRepair", &LuaPlayer::DurabilityRepair }, // :DurabilityRepair(position[, has_cost, discount, guildBank]) - Repairs item durability of item in given position #ifndef CATA +#ifndef CLASSIC { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, // :ModifyHonorPoints(amount) - Modifies the player's honor points { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, // :ModifyArenaPoints(amount) - Modifies the player's arena points +#endif #endif { "LeaveBattleground", &LuaPlayer::LeaveBattleground }, // :LeaveBattleground([teleToEntryPoint]) - The player leaves the battleground // {"BindToInstance", &LuaPlayer::BindToInstance}, // :BindToInstance() - Binds the player to the current instance { "UnbindInstance", &LuaPlayer::UnbindInstance }, // :UnbindInstance(map, difficulty) - Unbinds the player from an instance { "RemoveFromBattlegroundRaid", &LuaPlayer::RemoveFromBattlegroundRaid }, // :RemoveFromBattlegroundRaid() - Removes the player from a battleground or battlefield raid -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "ResetAchievements", &LuaPlayer::ResetAchievements }, // :ResetAchievements() - Resets playeräs achievements #endif { "KickPlayer", &LuaPlayer::KickPlayer }, // :KickPlayer() - Kicks player from server @@ -804,7 +824,9 @@ ElunaRegister ItemMethods[] = { "GetStatsCount", &LuaItem::GetStatsCount }, // :GetStatsCount() #endif { "GetRandomProperty", &LuaItem::GetRandomProperty }, // :GetRandomProperty() +#ifndef CLASSIC { "GetRandomSuffix", &LuaItem::GetRandomSuffix }, // :GetRandomSuffix() +#endif { "GetItemSet", &LuaItem::GetItemSet }, // :GetItemSet() { "GetBagSize", &LuaItem::GetBagSize }, // :GetBagSize() @@ -815,14 +837,16 @@ ElunaRegister ItemMethods[] = // Boolean { "IsSoulBound", &LuaItem::IsSoulBound }, // :IsSoulBound() - Returns true if the item is soulbound -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) { "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, // :IsBoundAccountWide() - Returns true if the item is account bound #endif { "IsBoundByEnchant", &LuaItem::IsBoundByEnchant }, // :IsBoundByEnchant() - Returns true if the item is bound with an enchant { "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, // :IsNotBoundToPlayer(player) - Returns true if the item is not bound with player { "IsLocked", &LuaItem::IsLocked }, // :IsLocked() - Returns true if the item is locked { "IsBag", &LuaItem::IsBag }, // :IsBag() - Returns true if the item is a bag +#ifndef CLASSIC { "IsCurrencyToken", &LuaItem::IsCurrencyToken }, // :IsCurrencyToken() - Returns true if the item is a currency token +#endif { "IsNotEmptyBag", &LuaItem::IsNotEmptyBag }, // :IsNotEmptyBag() - Returns true if the item is not an empty bag { "IsBroken", &LuaItem::IsBroken }, // :IsBroken() - Returns true if the item is broken { "CanBeTraded", &LuaItem::CanBeTraded }, // :CanBeTraded() - Returns true if the item can be traded @@ -910,7 +934,9 @@ ElunaRegister QuestMethods[] = // Boolean { "HasFlag", &LuaQuest::HasFlag }, // :HasFlag(flag) - Returns true or false if the quest has the specified flag +#ifndef CLASSIC { "IsDaily", &LuaQuest::IsDaily }, // :IsDaily() - Returns true or false if the quest is a daily +#endif { "IsRepeatable", &LuaQuest::IsRepeatable }, // :IsRepeatable() - Returns true or false if the quest is repeatable // Setters @@ -970,7 +996,9 @@ ElunaRegister GuildMethods[] = { "GetMemberCount", &LuaGuild::GetMemberCount }, // :GetMemberCount() - Returns the amount of players in the guild // Setters +#ifndef CLASSIC { "SetBankTabText", &LuaGuild::SetBankTabText }, // :SetBankTabText(tabId, text) +#endif { "SetMemberRank", &LuaGuild::ChangeMemberRank }, // :SetMemberRank(player, newRank) - Sets the player rank in the guild to the new rank #ifndef CATA { "SetLeader", &LuaGuild::SetLeader }, // :SetLeader() - Sets the guild's leader @@ -985,13 +1013,15 @@ ElunaRegister GuildMethods[] = { "Disband", &LuaGuild::Disband }, // :Disband() - Disbands the guild { "AddMember", &LuaGuild::AddMember }, // :AddMember(player, rank) - adds the player to the guild. Rank is optional { "DeleteMember", &LuaGuild::DeleteMember }, // :DeleteMember(player, disbanding, kicked) - Deletes the player from the guild. Disbanding and kicked are optional bools +#ifndef CLASSIC { "DepositBankMoney", &LuaGuild::DepositBankMoney }, // :DepositBankMoney(money) - Deposits money into the guild bank { "WithdrawBankMoney", &LuaGuild::WithdrawBankMoney }, // :WithdrawBankMoney(money) - Withdraws money from the guild bank +#endif { NULL, NULL }, }; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) ElunaRegister VehicleMethods[] = { // Getters @@ -1081,11 +1111,15 @@ ElunaRegister MapMethods[] = { "GetHeight", &LuaMap::GetHeight }, // :GetHeight(x, y[, phasemask]) - Returns ground Z coordinate. UNDOCUMENTED // Booleans +#ifndef CLASSIC { "IsArena", &LuaMap::IsArena }, // :IsArena() - Returns the true if the map is an arena, else false UNDOCUMENTED +#endif { "IsBattleground", &LuaMap::IsBattleground }, // :IsBattleground() - Returns the true if the map is a battleground, else false UNDOCUMENTED { "IsDungeon", &LuaMap::IsDungeon }, // :IsDungeon() - Returns the true if the map is a dungeon , else false UNDOCUMENTED { "IsEmpty", &LuaMap::IsEmpty }, // :IsEmpty() - Returns the true if the map is empty, else false UNDOCUMENTED +#ifndef CLASSIC { "IsHeroic", &LuaMap::IsHeroic }, // :IsHeroic() - Returns the true if the map is a heroic dungeon, else false UNDOCUMENTED +#endif { "IsRaid", &LuaMap::IsRaid }, // :IsRaid() - Returns the true if the map is a raid map, else false UNDOCUMENTED { NULL, NULL }, @@ -1128,7 +1162,7 @@ ElunaRegister AuctionMethods[] = template const char* ElunaTemplate::tname = NULL; template bool ElunaTemplate::manageMemory = false; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) // fix compile error about accessing vehicle destructor template<> int ElunaTemplate::gcT(lua_State* L) { return 0; } #endif @@ -1176,7 +1210,7 @@ void RegisterFunctions(lua_State* L) ElunaTemplate::SetMethods(L, ObjectMethods); ElunaTemplate::SetMethods(L, ItemMethods); -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) ElunaTemplate::Register(L, "Vehicle"); ElunaTemplate::SetMethods(L, VehicleMethods); #endif diff --git a/MapMethods.h b/MapMethods.h index b2f5635..a038dc2 100644 --- a/MapMethods.h +++ b/MapMethods.h @@ -10,11 +10,13 @@ namespace LuaMap { /* BOOLEAN */ +#ifndef CLASSIC int IsArena(lua_State* L, Map* map) { sEluna->Push(L, map->IsBattleArena()); return 1; } +#endif int IsBattleground(lua_State* L, Map* map) { @@ -38,11 +40,13 @@ namespace LuaMap return 1; } +#ifndef CLASSIC int IsHeroic(lua_State* L, Map* map) { sEluna->Push(L, map->IsHeroic()); return 1; } +#endif int IsRaid(lua_State* L, Map* map) { @@ -61,7 +65,7 @@ namespace LuaMap { float x = sEluna->CHECKVAL(L, 2); float y = sEluna->CHECKVAL(L, 3); -#ifdef TBC +#if (defined(TBC) || defined(CLASSIC)) float z = map->GetHeight(x, y, MAX_HEIGHT); #else uint32 phasemask = sEluna->CHECKVAL(L, 4, 1); @@ -75,7 +79,11 @@ namespace LuaMap int GetDifficulty(lua_State* L, Map* map) { +#ifndef CLASSIC sEluna->Push(L, map->GetDifficulty()); +#else + sEluna->Push(L, (Difficulty)0); +#endif return 1; } diff --git a/PlayerMethods.h b/PlayerMethods.h index 6ede225..a6cb73d 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -10,7 +10,7 @@ namespace LuaPlayer { /* BOOLEAN */ -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int CanTitanGrip(lua_State* L, Player* player) { sEluna->Push(L, player->CanTitanGrip()); @@ -80,6 +80,7 @@ namespace LuaPlayer return 1; } +#ifndef CLASSIC int HasTitle(lua_State* L, Player* player) { uint32 id = sEluna->CHECKVAL(L, 2); @@ -90,6 +91,7 @@ namespace LuaPlayer sEluna->Push(L, false); return 1; } +#endif int HasItem(lua_State* L, Player* player) { @@ -153,11 +155,13 @@ namespace LuaPlayer return 1; } +#ifndef CLASSIC int CanFly(lua_State* L, Player* player) { sEluna->Push(L, player->CanFly()); return 1; } +#endif int IsInWater(lua_State* L, Player* player) { @@ -171,11 +175,13 @@ namespace LuaPlayer return 1; } +#ifndef CLASSIC int IsFlying(lua_State* L, Player* player) // enable for unit when mangos support it { sEluna->Push(L, player->IsFlying()); return 1; } +#endif int IsInGroup(lua_State* L, Player* player) { @@ -199,6 +205,7 @@ namespace LuaPlayer return 1; } +#ifndef CLASSIC int IsInArenaTeam(lua_State* L, Player* player) { uint32 type = sEluna->CHECKVAL(L, 2); @@ -208,6 +215,7 @@ namespace LuaPlayer sEluna->Push(L, false); return 1; } +#endif int IsHorde(lua_State* L, Player* player) { @@ -324,11 +332,13 @@ namespace LuaPlayer return 1; } +#ifndef CLASSIC int InArena(lua_State* L, Player* player) { sEluna->Push(L, player->InArena()); return 1; } +#endif int InBattleground(lua_State* L, Player* player) { @@ -412,7 +422,7 @@ namespace LuaPlayer }*/ /* GETTERS */ -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int GetSpecsCount(lua_State* L, Player* player) { sEluna->Push(L, player->GetSpecsCount()); @@ -435,6 +445,7 @@ namespace LuaPlayer #endif #ifndef CATA +#ifndef CLASSIC int GetArenaPoints(lua_State* L, Player* player) { sEluna->Push(L, player->GetArenaPoints()); @@ -446,6 +457,7 @@ namespace LuaPlayer sEluna->Push(L, player->GetHonorPoints()); return 1; } +#endif int GetShieldBlockValue(lua_State* L, Player* player) { @@ -646,6 +658,8 @@ namespace LuaPlayer { #ifdef TBC sEluna->Push(L, player->GetDifficulty()); +#elif defined(CLASSIC) + sEluna->Push(L, (Difficulty)0); #else bool isRaid = sEluna->CHECKVAL(L, 2, true); sEluna->Push(L, player->GetDifficulty(isRaid)); @@ -1031,7 +1045,7 @@ namespace LuaPlayer uint32 points = sEluna->CHECKVAL(L, 2); player->SetFreeTalentPoints(points); -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) player->SendTalentsInfoData(false); #endif return 0; @@ -1146,6 +1160,7 @@ namespace LuaPlayer } #ifndef CATA +#ifndef CLASSIC int SetArenaPoints(lua_State* L, Player* player) { uint32 arenaP = sEluna->CHECKVAL(L, 2); @@ -1159,6 +1174,7 @@ namespace LuaPlayer player->SetHonorPoints(honorP); return 0; } +#endif #endif int SetLifetimeKills(lua_State* L, Player* player) @@ -1192,6 +1208,7 @@ namespace LuaPlayer return 0; } +#ifndef CLASSIC int SetKnownTitle(lua_State* L, Player* player) { uint32 id = sEluna->CHECKVAL(L, 2); @@ -1200,6 +1217,7 @@ namespace LuaPlayer player->SetTitle(t, false); return 0; } +#endif #ifdef MANGOS int SetFFA(lua_State* L, Player* player) @@ -1220,7 +1238,7 @@ namespace LuaPlayer }*/ /* OTHER */ -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int ResetPetTalents(lua_State* L, Player* player) { #ifdef MANGOS @@ -1259,6 +1277,7 @@ namespace LuaPlayer #endif #ifndef CATA +#ifndef CLASSIC int ModifyArenaPoints(lua_State* L, Player* player) { int32 amount = sEluna->CHECKVAL(L, 2); @@ -1274,6 +1293,7 @@ namespace LuaPlayer player->ModifyHonorPoints(amount); return 0; } +#endif #endif int SaveToDB(lua_State* L, Player* player) @@ -1431,10 +1451,14 @@ namespace LuaPlayer int UnbindInstance(lua_State* L, Player* player) { uint32 map = sEluna->CHECKVAL(L, 2); +#ifndef CLASSIC uint32 difficulty = sEluna->CHECKVAL(L, 3); if (difficulty < MAX_DIFFICULTY) player->UnbindInstance(map, (Difficulty)difficulty); +#else + player->UnbindInstance(map); +#endif return 0; } @@ -1453,7 +1477,11 @@ namespace LuaPlayer float discountMod = sEluna->CHECKVAL(L, 4); bool guildBank = sEluna->CHECKVAL(L, 5, false); +#ifdef CLASSIC + sEluna->Push(L, player->DurabilityRepair(position, cost, discountMod)); +#else sEluna->Push(L, player->DurabilityRepair(position, cost, discountMod, guildBank)); +#endif return 1; } @@ -1463,7 +1491,11 @@ namespace LuaPlayer float discountMod = sEluna->CHECKVAL(L, 3); bool guildBank = sEluna->CHECKVAL(L, 4, false); +#ifdef CLASSIC + sEluna->Push(L, player->DurabilityRepairAll(cost, discountMod)); +#else sEluna->Push(L, player->DurabilityRepairAll(cost, discountMod, guildBank)); +#endif return 1; } @@ -1546,7 +1578,7 @@ namespace LuaPlayer #else player->resetTalents(no_cost); #endif -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) player->SendTalentsInfoData(false); #endif return 0; @@ -1685,7 +1717,7 @@ namespace LuaPlayer if (!player->isAlive()) return 0; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED)) return 0; #endif @@ -1699,6 +1731,7 @@ namespace LuaPlayer if (level >= sWorld->getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) return 0; +#ifndef CLASSIC if (!pureXP) { if (victim) @@ -1718,6 +1751,7 @@ namespace LuaPlayer } #endif } +#endif // XP resting bonus for kill uint32 rested_bonus_xp = victim ? player->GetXPRestBonus(xp) : 0; @@ -1836,7 +1870,7 @@ namespace LuaPlayer return 0; } player->ItemAddedQuestCheck(entry, 1); -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, entry, 1); #endif } @@ -1887,6 +1921,7 @@ namespace LuaPlayer return 1; } +#ifndef CLASSIC int UnsetKnownTitle(lua_State* L, Player* player) { uint32 id = sEluna->CHECKVAL(L, 2); @@ -1895,6 +1930,7 @@ namespace LuaPlayer player->SetTitle(t, true); return 0; } +#endif int AdvanceSkillsToMax(lua_State* L, Player* player) { @@ -1911,9 +1947,12 @@ namespace LuaPlayer static const uint32 skillsArray[] = { SKILL_BOWS, SKILL_CROSSBOWS, SKILL_DAGGERS, SKILL_DEFENSE, SKILL_UNARMED, SKILL_GUNS, SKILL_AXES, SKILL_MACES, SKILL_SWORDS, SKILL_POLEARMS, SKILL_STAVES, SKILL_2H_AXES, SKILL_2H_MACES, SKILL_2H_SWORDS, SKILL_WANDS, SKILL_SHIELD, SKILL_FISHING, SKILL_MINING, SKILL_ENCHANTING, SKILL_BLACKSMITHING, - SKILL_ALCHEMY, SKILL_HERBALISM, SKILL_ENGINEERING, SKILL_JEWELCRAFTING, SKILL_LEATHERWORKING, SKILL_LOCKPICKING, SKILL_SKINNING, SKILL_TAILORING, -#ifndef TBC - SKILL_INSCRIPTION + SKILL_ALCHEMY, SKILL_HERBALISM, SKILL_ENGINEERING, SKILL_LEATHERWORKING, SKILL_LOCKPICKING, SKILL_SKINNING, SKILL_TAILORING, +#ifndef CLASSIC + SKILL_JEWELCRAFTING, +#endif +#if (!defined(TBC) && !defined(CLASSIC)) + SKILL_INSCRIPTION, #endif }; static const uint32 skillsSize = sizeof(skillsArray) / sizeof(*skillsArray); @@ -2122,7 +2161,11 @@ namespace LuaPlayer const char* _promptMsg = sEluna->CHECKVAL(L, 7, ""); uint32 _money = sEluna->CHECKVAL(L, 8, 0); #ifdef MANGOS +#ifndef CLASSIC player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code); +#else + player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _code); +#endif #else player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, _icon, msg, _sender, _intid, _promptMsg, _money, _code); #endif diff --git a/QuestMethods.h b/QuestMethods.h index 9fd7bb1..44753eb 100644 --- a/QuestMethods.h +++ b/QuestMethods.h @@ -21,11 +21,13 @@ namespace LuaQuest return 1; } +#ifndef CLASSIC int IsDaily(lua_State* L, Quest* quest) { sEluna->Push(L, quest->IsDaily()); return 1; } +#endif int IsRepeatable(lua_State* L, Quest* quest) { diff --git a/README.md b/README.md index 81fee9d..514e410 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you need help regarding methods, hooks and other wiki related documentation, ## Source -[![Build Status](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Wotlk.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Wotlk) [Eluna TrinityCore WOTLK](https://github.com/ElunaLuaEngine/Eluna-TC-Wotlk)
+[![Build Status](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Wotlk.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Wotlk) [Eluna TrinityCore WotLK](https://github.com/ElunaLuaEngine/Eluna-TC-Wotlk)
[![Build Status](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Cata.png?branch=master)](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Cata) [Eluna TrinityCore Cataclysm](https://github.com/ElunaLuaEngine/Eluna-TC-Cata) [![Build Status](https://travis-ci.org/eluna-dev-mangos/ElunaCoreClassic.png?branch=master)](https://travis-ci.org/eluna-dev-mangos/ElunaCoreClassic) [Eluna cMaNGOS Classic](https://github.com/eluna-dev-mangos/ElunaCoreClassic)
diff --git a/UnitMethods.h b/UnitMethods.h index 445b496..eb0c489 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -284,6 +284,7 @@ namespace LuaUnit return 1; } +#ifndef CLASSIC int IsOnVehicle(lua_State* L, Unit* unit) { #ifdef MANGOS @@ -293,6 +294,7 @@ namespace LuaUnit #endif return 1; } +#endif int IsInCombat(lua_State* L, Unit* unit) { @@ -581,7 +583,7 @@ namespace LuaUnit case 4: type = POWER_ENERGY; break; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) case 6: type = POWER_RUNIC_POWER; break; @@ -620,7 +622,7 @@ namespace LuaUnit case 4: type = POWER_ENERGY; break; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) case 6: type = POWER_RUNIC_POWER; break; @@ -829,7 +831,7 @@ namespace LuaUnit return 1; } -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int GetVehicleKit(lua_State* L, Unit* unit) { #ifdef MANGOS @@ -955,7 +957,7 @@ namespace LuaUnit case POWER_ENERGY: unit->SetPower(POWER_ENERGY, amt); break; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) case POWER_RUNIC_POWER: unit->SetMaxPower(POWER_RUNIC_POWER, amt); break; @@ -983,7 +985,7 @@ namespace LuaUnit case POWER_ENERGY: unit->SetMaxPower(POWER_ENERGY, amt); break; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) case POWER_RUNIC_POWER: unit->SetMaxPower(POWER_RUNIC_POWER, amt); break; @@ -1085,7 +1087,7 @@ namespace LuaUnit return 0; } -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int SetFFA(lua_State* L, Unit* unit) { bool apply = sEluna->CHECKVAL(L, 2, true); @@ -1358,7 +1360,7 @@ namespace LuaUnit return 0; } -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int MoveJump(lua_State* L, Unit* unit) { float x = sEluna->CHECKVAL(L, 2); diff --git a/VehicleMethods.h b/VehicleMethods.h index 796e93a..f235d6e 100644 --- a/VehicleMethods.h +++ b/VehicleMethods.h @@ -4,9 +4,9 @@ * Please see the included DOCS/LICENSE.md for more information */ -#ifndef TBC #ifndef VEHICLEMETHODS_H #define VEHICLEMETHODS_H +#if (!defined(TBC) && !defined(CLASSIC)) namespace LuaVehicle { diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index b749f6a..5f1c7ca 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -22,7 +22,7 @@ namespace LuaWorldObject return 1; } -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) int GetPhaseMask(lua_State* L, WorldObject* obj) { sEluna->Push(L, obj->GetPhaseMask()); @@ -297,7 +297,7 @@ namespace LuaWorldObject case HIGHGUID_TRANSPORT: case HIGHGUID_MO_TRANSPORT: case HIGHGUID_GAMEOBJECT: sEluna->Push(L, obj->GetMap()->GetGameObject(GUID_TYPE(guid))); break; -#ifndef TBC +#if (!defined(TBC) && !defined(CLASSIC)) case HIGHGUID_VEHICLE: #endif case HIGHGUID_UNIT: