From ac23f8f1d890c4c04fe8f7f1248940f016d48138 Mon Sep 17 00:00:00 2001 From: Niam5 Date: Fri, 12 Jul 2024 21:51:37 -0700 Subject: [PATCH] TC Retail Changes pt. 2 --- ElunaUtility.cpp | 6 +- ElunaUtility.h | 10 +- GossipHooks.cpp | 8 +- GuildHooks.cpp | 11 ++ LuaEngine.cpp | 7 +- LuaEngine.h | 4 + ServerHooks.cpp | 9 +- TrinityCore/BattleGroundMethods.h | 2 +- TrinityCore/CreatureMethods.h | 58 +++++--- TrinityCore/GameObjectMethods.h | 10 +- TrinityCore/GlobalMethods.h | 75 +++++++--- TrinityCore/GuildMethods.h | 12 +- TrinityCore/ItemMethods.h | 76 ++++++---- TrinityCore/MapMethods.h | 16 +- TrinityCore/ObjectMethods.h | 38 +++-- TrinityCore/PlayerMethods.h | 240 +++++++++++++++++++----------- TrinityCore/QuestMethods.h | 10 +- TrinityCore/UnitMethods.h | 50 ++++--- TrinityCore/VehicleMethods.h | 2 +- TrinityCore/WorldPacketMethods.h | 4 +- 20 files changed, 416 insertions(+), 232 deletions(-) diff --git a/ElunaUtility.cpp b/ElunaUtility.cpp index f28e8d1327..2bbae8d9d4 100644 --- a/ElunaUtility.cpp +++ b/ElunaUtility.cpp @@ -105,11 +105,7 @@ bool ElunaUtil::WorldObjectInRangeCheck::operator()(WorldObject* u) { if (i_obj_fact) { -#if (defined CATA || defined RETAIL) && defined TRINITY -#if ((defined TRINITY || AZEROTHCORE || CMANGOS || VMANGOS) && (defined !CATA || !RETAIL)) - if ((i_obj_fact->IsHostileTo(*target->GetFactionTemplateEntry())) != (i_hostile == 1)) - return false; -#elif ((defined CATA || RETAIL) && defined TRINITY) +#if ((defined CATA || RETAIL) && defined TRINITY) if ((i_obj_fact->IsHostileTo(target->GetFactionTemplateEntry())) != (i_hostile == 1)) return false; #elif ((defined TRINITY || AZEROTHCORE || CMANGOS || VMANGOS) && !defined CATA) diff --git a/ElunaUtility.h b/ElunaUtility.h index fb897547d1..24701260cc 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -37,22 +37,22 @@ typedef QueryResult ElunaQuery; #define GET_GUID GetGUID #define HIGHGUID_PLAYER HighGuid::Player -#define HIGHGUID_UNIT HighGuid::Unit +#define HIGHGUID_UNIT HighGuid::Creature #define HIGHGUID_ITEM HighGuid::Item #define HIGHGUID_GAMEOBJECT HighGuid::GameObject #define HIGHGUID_PET HighGuid::Pet #define HIGHGUID_TRANSPORT HighGuid::Transport #define HIGHGUID_VEHICLE HighGuid::Vehicle -#define HIGHGUID_CONTAINER HighGuid::Container +//#define HIGHGUID_CONTAINER HighGuid::Container #define HIGHGUID_DYNAMICOBJECT HighGuid::DynamicObject #define HIGHGUID_CORPSE HighGuid::Corpse -#define HIGHGUID_MO_TRANSPORT HighGuid::Mo_Transport +#define HIGHGUID_MO_TRANSPORT HighGuid::Transport #define HIGHGUID_INSTANCE HighGuid::Instance -#define HIGHGUID_GROUP HighGuid::Group +//#define HIGHGUID_GROUP HighGuid::Group #endif #ifdef TRINITY -#ifdef WOTLK +#if defined WOTLK || defined RETAIL #include "fmt/printf.h" #define ELUNA_LOG_TC_FMT(TC_LOG_MACRO, ...) \ try { \ diff --git a/GossipHooks.cpp b/GossipHooks.cpp index e74609375f..49307734b3 100644 --- a/GossipHooks.cpp +++ b/GossipHooks.cpp @@ -142,7 +142,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, auto original_menu = *pPlayer->GetPlayerMenu(); pPlayer->GetPlayerMenu()->ClearMenus(); #else - auto original_menu = *pPlayer->PlayerTalkClass; + auto original_menu = pPlayer->PlayerTalkClass->GetGossipMenu().GetMenuId(); pPlayer->PlayerTalkClass->ClearMenus(); #endif HookPush(pPlayer); @@ -154,7 +154,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, #if defined CMANGOS && !defined(CATA) *pPlayer->GetPlayerMenu() = original_menu; #else - *pPlayer->PlayerTalkClass = original_menu; + pPlayer->PlayerTalkClass->GetGossipMenu().SetMenuId(original_menu); #endif } return preventDefault; @@ -167,7 +167,7 @@ bool Eluna::OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 send auto original_menu = *pPlayer->GetPlayerMenu(); pPlayer->GetPlayerMenu()->ClearMenus(); #else - auto original_menu = *pPlayer->PlayerTalkClass; + auto original_menu = pPlayer->PlayerTalkClass->GetGossipMenu().GetMenuId(); pPlayer->PlayerTalkClass->ClearMenus(); #endif HookPush(pPlayer); @@ -180,7 +180,7 @@ bool Eluna::OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 send #if defined CMANGOS &&!defined(CATA) *pPlayer->GetPlayerMenu() = original_menu; #else - *pPlayer->PlayerTalkClass = original_menu; + pPlayer->PlayerTalkClass->GetGossipMenu().SetMenuId(original_menu); #endif } return preventDefault; diff --git a/GuildHooks.cpp b/GuildHooks.cpp index bda3dccec9..020ec1bbc3 100644 --- a/GuildHooks.cpp +++ b/GuildHooks.cpp @@ -26,6 +26,16 @@ void Eluna::OnAddMember(Guild* guild, Player* player, uint32 plRank) CallAllFunctions(GuildEventBindings, key); } +#ifdef RETAIL +void Eluna::OnRemoveMember(Guild* guild, ObjectGuid guid, bool isDisbanding) +{ + START_HOOK(GUILD_EVENT_ON_REMOVE_MEMBER); + HookPush(guild); + HookPush(guid); + HookPush(isDisbanding); + CallAllFunctions(GuildEventBindings, key); +} +#else void Eluna::OnRemoveMember(Guild* guild, Player* player, bool isDisbanding) { START_HOOK(GUILD_EVENT_ON_REMOVE_MEMBER); @@ -34,6 +44,7 @@ void Eluna::OnRemoveMember(Guild* guild, Player* player, bool isDisbanding) HookPush(isDisbanding); CallAllFunctions(GuildEventBindings, key); } +#endif void Eluna::OnMOTDChanged(Guild* guild, const std::string& newMotd) { diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 663e2c3f29..768526c530 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -805,7 +805,7 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc return 1; // Stack: callback } break; - +#ifndef RETAIL case Hooks::REGTYPE_PACKET: if (event_id < Hooks::PACKET_EVENT_COUNT) { @@ -822,6 +822,7 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc return 1; // Stack: callback } break; +#endif case Hooks::REGTYPE_CREATURE: if (event_id < Hooks::CREATURE_EVENT_COUNT) @@ -989,13 +990,13 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc void Eluna::UpdateEluna(uint32 diff) { if (reload) -#ifdef TRINITY +#if defined TRINITY && defined WOTLK if(!GetQueryProcessor().HasPendingCallbacks()) #endif _ReloadEluna(); eventMgr->globalProcessor->Update(diff); -#ifdef TRINITY +#if defined TRINITY && defined WOTLK GetQueryProcessor().ProcessReadyCallbacks(); #endif } diff --git a/LuaEngine.h b/LuaEngine.h index 1345a91e5a..edbaf240a1 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -555,7 +555,11 @@ class ELUNA_GAME_API Eluna /* Guild */ void OnAddMember(Guild* guild, Player* player, uint32 plRank); +#ifdef RETAIL + void OnRemoveMember(Guild* guild, ObjectGuid guid, bool isDisbanding); +#else void OnRemoveMember(Guild* guild, Player* player, bool isDisbanding); +#endif void OnMOTDChanged(Guild* guild, const std::string& newMotd); void OnInfoChanged(Guild* guild, const std::string& newInfo); void OnCreate(Guild* guild, Player* leader, const std::string& name); diff --git a/ServerHooks.cpp b/ServerHooks.cpp index 264faed3cc..ba7b1f6d5f 100644 --- a/ServerHooks.cpp +++ b/ServerHooks.cpp @@ -130,9 +130,10 @@ void Eluna::OnChange(Weather* /*weather*/, uint32 zone, WeatherState state, floa CallAllFunctions(ServerEventBindings, key); } +#ifndef RETAIL // Auction House -#ifdef RETAIL -void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionPosting* entry) +/* +void Eluna::OnAdd(AuctionHouseObject* ah, AuctionPosting* entry) { #ifdef AZEROTHCORE Player* owner = eObjectAccessor()FindPlayer(entry->owner); @@ -165,7 +166,8 @@ void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionPosting* entry) Push(entry->bidder); CallAllFunctions(ServerEventBindings, key); } -#else +*/ +#ifndef RETAIL void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry) { #ifdef AZEROTHCORE @@ -305,6 +307,7 @@ void Eluna::OnExpire(AuctionHouseObject* /*ah*/, AuctionEntry* entry) HookPush(entry->bidder); CallAllFunctions(ServerEventBindings, key); } +#endif void Eluna::OnOpenStateChange(bool open) { diff --git a/TrinityCore/BattleGroundMethods.h b/TrinityCore/BattleGroundMethods.h index f386f47148..116e135b85 100644 --- a/TrinityCore/BattleGroundMethods.h +++ b/TrinityCore/BattleGroundMethods.h @@ -82,7 +82,7 @@ namespace LuaBattleGround */ int GetEndTime(Eluna* E, BattleGround* bg) { -#ifdef CATA +#if defined CATA || defined RETAIL E->Push(bg->GetRemainingTime()); #else E->Push(bg->GetEndTime()); diff --git a/TrinityCore/CreatureMethods.h b/TrinityCore/CreatureMethods.h index f5f73c8dc8..1f6dd4c65c 100644 --- a/TrinityCore/CreatureMethods.h +++ b/TrinityCore/CreatureMethods.h @@ -142,6 +142,7 @@ namespace LuaCreature return 1; } +#ifndef RETAIL /** * Returns `true` if the [Creature] can start attacking nearby hostile [Unit]s, * and returns `false` otherwise. @@ -153,6 +154,7 @@ namespace LuaCreature E->Push(!creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)); return 1; } +#endif /** * Returns `true` if the [Creature] can move through deep water, @@ -166,6 +168,7 @@ namespace LuaCreature return 1; } +#ifndef RETAIL /** * Returns `true` if the [Creature] can move on land, * and returns `false` otherwise. @@ -177,6 +180,7 @@ namespace LuaCreature E->Push(creature->CanWalk()); return 1; } +#endif /** * Returns `true` if the [Creature] is returning to its spawn position from combat, @@ -198,7 +202,7 @@ namespace LuaCreature */ int IsElite(Eluna* E, Creature* creature) { - E->Push(creature->isElite()); + E->Push(creature->IsElite()); return 1; } @@ -274,7 +278,7 @@ namespace LuaCreature { uint32 spell = E->CHECKVAL(2); - if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell)) + if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell, DIFFICULTY_NONE)) E->Push(info->GetCategory() && creature->GetSpellHistory()->HasCooldown(spell)); else E->Push(false); @@ -351,6 +355,7 @@ namespace LuaCreature return 1; } +#ifndef RETAIL /** * Returns true if the [Creature] is damaged enough for looting * @@ -361,6 +366,7 @@ namespace LuaCreature E->Push(creature->IsDamageEnoughForLootingAndReward()); return 1; } +#endif /** * Returns true if the [Creature] can start attacking specified target @@ -419,6 +425,7 @@ namespace LuaCreature return 1; } +#ifndef RETAIL /** * Returns the current waypoint path ID of the [Creature]. * @@ -429,6 +436,7 @@ namespace LuaCreature E->Push(creature->GetWaypointPath()); return 1; } +#endif /** * Returns the current waypoint ID of the [Creature]. @@ -483,7 +491,7 @@ namespace LuaCreature return 1; } - +#ifndef RETAIL /** * Returns the [Group] that can loot this [Creature]. * @@ -505,6 +513,7 @@ namespace LuaCreature E->Push(creature->GetLootRecipient()); return 1; } +#endif /** * Returns the [Creature]'s script name. @@ -560,8 +569,11 @@ namespace LuaCreature { uint32 spell = E->CHECKVAL(2); - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell)) - E->Push(creature->GetSpellHistory()->GetRemainingCooldown(spellInfo)); + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell, DIFFICULTY_NONE)) + { + Milliseconds remainingCooldown = creature->GetSpellHistory()->GetRemainingCooldown(spellInfo); + E->Push(remainingCooldown.count()); + } else E->Push(0); @@ -794,7 +806,7 @@ namespace LuaCreature float threat = E->CHECKVAL(3, true); uint32 spell = E->CHECKVAL(4, 0); - creature->GetThreatManager().AddThreat(victim, threat, spell ? sSpellMgr->GetSpellInfo(spell) : NULL, true, true); + creature->GetThreatManager().AddThreat(victim, threat, spell ? sSpellMgr->GetSpellInfo(spell, DIFFICULTY_NONE) : NULL, true, true); return 0; } @@ -865,6 +877,7 @@ namespace LuaCreature return 0; } +#ifndef RETAIL /** * Returns the [Creature]'s NPC flags. * @@ -878,6 +891,7 @@ namespace LuaCreature E->Push(creature->GetUInt32Value(UNIT_NPC_FLAGS)); return 1; } +#endif /** * Returns the [Creature]'s Extra flags. @@ -893,7 +907,7 @@ namespace LuaCreature return 1; } -#ifndef CATA +#ifdef WOTLK /** * Returns the [Creature]'s shield block value. * @@ -937,6 +951,7 @@ namespace LuaCreature return 1; } +#ifndef RETAIL /** * Sets the [Creature]'s NPC flags to `flags`. * @@ -949,6 +964,7 @@ namespace LuaCreature creature->SetUInt32Value(UNIT_NPC_FLAGS, flags); return 0; } +#endif /** * Sets the [Creature]'s ReactState to `state`. @@ -1024,6 +1040,7 @@ namespace LuaCreature return 0; } +#ifndef RETAIL /** * Equips given [Item]s to the [Unit]. Using 0 removes the equipped [Item] * @@ -1059,6 +1076,7 @@ namespace LuaCreature return 0; } +#endif /** * Sets whether the [Creature] gives reputation or not. @@ -1196,6 +1214,7 @@ namespace LuaCreature return 0; } +#ifndef RETAIL /** * Make the [Creature] start following its waypoint path. */ @@ -1204,6 +1223,7 @@ namespace LuaCreature creature->GetMotionMaster()->MovePath(creature->GetWaypointPath(), true); return 0; } +#endif /** * Make the [Creature] call for assistance in combat from other nearby [Creature]s. @@ -1402,14 +1422,14 @@ namespace LuaCreature { "GetRespawnDelay", &LuaCreature::GetRespawnDelay }, { "GetWanderRadius", &LuaCreature::GetWanderRadius }, { "GetCurrentWaypointId", &LuaCreature::GetCurrentWaypointId }, - { "GetWaypointPath", &LuaCreature::GetWaypointPath }, + //{ "GetWaypointPath", &LuaCreature::GetWaypointPath }, { "GetLootMode", &LuaCreature::GetLootMode }, - { "GetLootRecipient", &LuaCreature::GetLootRecipient }, - { "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, - { "GetNPCFlags", &LuaCreature::GetNPCFlags }, + //{ "GetLootRecipient", &LuaCreature::GetLootRecipient }, + //{ "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, + //{ "GetNPCFlags", &LuaCreature::GetNPCFlags }, { "GetExtraFlags", &LuaCreature::GetExtraFlags }, #ifndef CATA - { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, + //{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, #endif { "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow }, { "GetCreatureFamily", &LuaCreature::GetCreatureFamily }, @@ -1419,7 +1439,7 @@ namespace LuaCreature { "SetRegeneratingHealth", &LuaCreature::SetRegeneratingHealth }, { "SetHover", &LuaCreature::SetHover }, { "SetDisableGravity", &LuaCreature::SetDisableGravity }, - { "SetAggroEnabled", &LuaCreature::SetAggroEnabled }, + //{ "SetAggroEnabled", &LuaCreature::SetAggroEnabled }, { "SetNoCallAssistance", &LuaCreature::SetNoCallAssistance }, { "SetNoSearchAssistance", &LuaCreature::SetNoSearchAssistance }, { "SetDefaultMovementType", &LuaCreature::SetDefaultMovementType }, @@ -1428,12 +1448,12 @@ namespace LuaCreature { "SetInCombatWithZone", &LuaCreature::SetInCombatWithZone }, { "SetDisableReputationGain", &LuaCreature::SetDisableReputationGain }, { "SetLootMode", &LuaCreature::SetLootMode }, - { "SetNPCFlags", &LuaCreature::SetNPCFlags }, + //{ "SetNPCFlags", &LuaCreature::SetNPCFlags }, { "SetReactState", &LuaCreature::SetReactState }, { "SetDeathState", &LuaCreature::SetDeathState }, { "SetWalk", &LuaCreature::SetWalk }, { "SetHomePosition", &LuaCreature::SetHomePosition }, - { "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots }, + //{ "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots }, // Boolean { "IsRegeneratingHealth", &LuaCreature::IsRegeneratingHealth }, @@ -1446,9 +1466,9 @@ namespace LuaCreature { "IsElite", &LuaCreature::IsElite }, { "IsInEvadeMode", &LuaCreature::IsInEvadeMode }, { "HasCategoryCooldown", &LuaCreature::HasCategoryCooldown }, - { "CanWalk", &LuaCreature::CanWalk }, + //{ "CanWalk", &LuaCreature::CanWalk }, { "CanSwim", &LuaCreature::CanSwim }, - { "CanAggro", &LuaCreature::CanAggro }, + //{ "CanAggro", &LuaCreature::CanAggro }, { "CanStartAttack", &LuaCreature::CanStartAttack }, { "HasSearchedAssistance", &LuaCreature::HasSearchedAssistance }, { "IsTappedBy", &LuaCreature::IsTappedBy }, @@ -1457,7 +1477,7 @@ namespace LuaCreature { "IsTargetableForAttack", &LuaCreature::IsTargetableForAttack }, { "CanCompleteQuest", &LuaCreature::CanCompleteQuest }, { "IsReputationGainDisabled", &LuaCreature::IsReputationGainDisabled }, - { "IsDamageEnoughForLootingAndReward", &LuaCreature::IsDamageEnoughForLootingAndReward }, + //{ "IsDamageEnoughForLootingAndReward", &LuaCreature::IsDamageEnoughForLootingAndReward }, { "HasLootMode", &LuaCreature::HasLootMode }, { "HasSpell", &LuaCreature::HasSpell }, { "HasQuest", &LuaCreature::HasQuest }, @@ -1477,7 +1497,7 @@ namespace LuaCreature { "RemoveLootMode", &LuaCreature::RemoveLootMode }, { "SaveToDB", &LuaCreature::SaveToDB }, { "SelectVictim", &LuaCreature::SelectVictim }, - { "MoveWaypoint", &LuaCreature::MoveWaypoint }, + //{ "MoveWaypoint", &LuaCreature::MoveWaypoint }, { "UpdateEntry", &LuaCreature::UpdateEntry }, { "AddThreat", &LuaCreature::AddThreat }, { "ClearThreat", &LuaCreature::ClearThreat }, diff --git a/TrinityCore/GameObjectMethods.h b/TrinityCore/GameObjectMethods.h index b5c85cf5e7..f4efb1ebc0 100644 --- a/TrinityCore/GameObjectMethods.h +++ b/TrinityCore/GameObjectMethods.h @@ -124,6 +124,7 @@ namespace LuaGameObject return 1; } +#ifndef RETAIL /** * Returns the [Player] that can loot the [GameObject] * @@ -149,6 +150,7 @@ namespace LuaGameObject E->Push(go->GetLootRecipientGroup()); return 1; } +#endif /** * Returns the guid of the [GameObject] that is used as the ID in the database @@ -237,6 +239,7 @@ namespace LuaGameObject return 0; } +#ifndef RETAIL /** * Removes [GameObject] from the world * @@ -268,6 +271,7 @@ namespace LuaGameObject E->CHECKOBJ(1)->Invalidate(); return 0; } +#endif /** * Activates a door or a button/lever @@ -323,8 +327,8 @@ namespace LuaGameObject { "GetDisplayId", &LuaGameObject::GetDisplayId }, { "GetGoState", &LuaGameObject::GetGoState }, { "GetLootState", &LuaGameObject::GetLootState }, - { "GetLootRecipient", &LuaGameObject::GetLootRecipient }, - { "GetLootRecipientGroup", &LuaGameObject::GetLootRecipientGroup }, + //{ "GetLootRecipient", &LuaGameObject::GetLootRecipient }, + //{ "GetLootRecipientGroup", &LuaGameObject::GetLootRecipientGroup }, { "GetDBTableGUIDLow", &LuaGameObject::GetDBTableGUIDLow }, // Setters @@ -340,7 +344,7 @@ namespace LuaGameObject { "IsSpawned", &LuaGameObject::IsSpawned }, // Other - { "RemoveFromWorld", &LuaGameObject::RemoveFromWorld }, + //{ "RemoveFromWorld", &LuaGameObject::RemoveFromWorld }, { "UseDoorOrButton", &LuaGameObject::UseDoorOrButton }, { "Despawn", &LuaGameObject::Despawn }, { "Respawn", &LuaGameObject::Respawn }, diff --git a/TrinityCore/GlobalMethods.h b/TrinityCore/GlobalMethods.h index 4eaed806a6..d65f6b549e 100644 --- a/TrinityCore/GlobalMethods.h +++ b/TrinityCore/GlobalMethods.h @@ -447,6 +447,9 @@ namespace LuaGlobalFunctions * @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the [Item] name in * @return string itemLink */ +#ifdef RETAIL + /* + #endif int GetItemLink(Eluna* E) { uint32 entry = E->CHECKVAL(1); @@ -465,6 +468,7 @@ namespace LuaGlobalFunctions #else std::string name = temp->Name1; #endif + if (ItemSparseEntry const* il = eObjectMgr->getitem) if (ItemLocale const* il = eObjectMgr->GetItemLocale(entry)) ObjectMgr::GetLocaleString(il->Name, static_cast(locale), name); @@ -481,6 +485,9 @@ namespace LuaGlobalFunctions E->Push(oss.str()); return 1; } +#ifdef RETAIL + */ +#endif /** * Returns the type ID from a GUID. @@ -514,6 +521,7 @@ namespace LuaGlobalFunctions return 1; } +#ifndef RETAIL /** * Returns the area or zone's name. * @@ -533,7 +541,7 @@ namespace LuaGlobalFunctions * @param uint32 areaOrZoneId : area ID or zone ID * @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the name in * @return string areaOrZoneName - + */ int GetAreaName(Eluna* E) { uint32 areaOrZoneId = E->CHECKVAL(1); @@ -547,7 +555,8 @@ namespace LuaGlobalFunctions E->Push(areaEntry->AreaName[locale]); return 1; - }*/ + } +#endif /** * Returns the currently active game events. @@ -1729,13 +1738,13 @@ namespace LuaGlobalFunctions float o = E->CHECKVAL(8); bool save = E->CHECKVAL(9, false); uint32 durorresptime = E->CHECKVAL(10, 0); - uint32 phase = E->CHECKVAL(11, PHASEMASK_NORMAL); + //uint32 phase = E->CHECKVAL(11, PHASEMASK_NORMAL); - if (!phase) - { - E->Push(); - return 1; - } + //if (!phase) + // { + // E->Push(); + // return 1; + // } Map* map = eMapMgr->FindMap(mapID, instanceID); if (!map) @@ -1752,7 +1761,7 @@ namespace LuaGlobalFunctions { Creature* creature = new Creature(); #if defined CATA || RETAIL - if (!creature->Create(map->GenerateLowGuid(), map, entry, pos)) + if (!creature->Create(map->GenerateLowGuid(), map, entry, pos, nullptr, NULL)) #else if (!creature->Create(map->GenerateLowGuid(), map, phase, entry, pos)) #endif @@ -1763,7 +1772,7 @@ namespace LuaGlobalFunctions } #if defined CATA || RETAIL - creature->SaveToDB(map->GetId(), (1 << map->getspa)); + creature->SaveToDB(map->GetId(), { map->GetDifficultyID() }); #else creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase); #endif @@ -1783,17 +1792,17 @@ namespace LuaGlobalFunctions return 1; } - eObjectMgr->AddCreatureToGrid(db_guid, eObjectMgr->GetCreatureData(db_guid)); + eObjectMgr->AddCreatureToGrid(eObjectMgr->GetCreatureData(db_guid)); E->Push(creature); } else { -#ifdef CATA +#if defined CATA SummonCreatureExtraArgs extraArgs; extraArgs.SummonDuration = durorresptime; TempSummon* creature = map->SummonCreature(entry, pos, extraArgs); #else - TempSummon* creature = map->SummonCreature(entry, pos, NULL, durorresptime); + TempSummon* creature = map->SummonCreature(entry, pos, NULL, Milliseconds(durorresptime)); #endif if (!creature) { @@ -1832,6 +1841,8 @@ namespace LuaGlobalFunctions QuaternionData rot = QuaternionData::fromEulerAnglesZYX(o, 0.f, 0.f); #ifdef CATA if (!object->Create(guidLow, objectInfo->entry, map, Position(x, y, z, o), rot, 0, GO_STATE_READY)) +#elif RETAIL + if (!object->CreateGameObject(guidLow, map, Position(x, y, z, o), rot, 0, GO_STATE_READY)) #else if (!object->Create(guidLow, objectInfo->entry, map, phase, Position(x, y, z, o), rot, 0, GO_STATE_READY)) #endif @@ -1850,7 +1861,7 @@ namespace LuaGlobalFunctions #ifdef CATA object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); #else - object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase); + object->SaveToDB(map->GetId(), { map->GetDifficultyID() }); #endif guidLow = object->GetSpawnId(); @@ -1866,7 +1877,7 @@ namespace LuaGlobalFunctions E->Push(); return 1; } - eObjectMgr->AddGameobjectToGrid(guidLow, eObjectMgr->GetGameObjectData(guidLow)); + eObjectMgr->AddGameobjectToGrid(eObjectMgr->GetGameObjectData(guidLow)); } else map->AddToMap(object); @@ -1878,6 +1889,7 @@ namespace LuaGlobalFunctions return 1; } +#ifndef RETAIL /** * Creates a [WorldPacket]. * @@ -1885,6 +1897,7 @@ namespace LuaGlobalFunctions * @param uint32 size : the size of the packet * @return [WorldPacket] packet */ + int CreatePacket(Eluna* E) { uint32 opcode = E->CHECKVAL(1); @@ -1896,6 +1909,8 @@ namespace LuaGlobalFunctions return 1; } +#endif + /** * Adds an [Item] to a vendor and updates the world database. * @@ -1913,7 +1928,7 @@ namespace LuaGlobalFunctions uint32 incrtime = E->CHECKVAL(4); uint32 extendedcost = E->CHECKVAL(5); -#ifdef CATA +#if defined CATA ||defined RETAIL VendorItem vItem; vItem.item = item; vItem.maxcount = maxcount; @@ -1945,7 +1960,7 @@ namespace LuaGlobalFunctions if (!eObjectMgr->GetCreatureTemplate(entry)) return luaL_argerror(E->L, 1, "valid CreatureEntry expected"); -#ifdef CATA +#if defined CATA || defined RETAIL eObjectMgr->RemoveVendorItem(entry, item, 1); #else eObjectMgr->RemoveVendorItem(entry, item); @@ -1969,7 +1984,7 @@ namespace LuaGlobalFunctions auto const itemlist = items->m_items; for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr) -#ifdef CATA +#if defined CATA || defined RETAIL eObjectMgr->RemoveVendorItem(entry, itr->item, 1); #else eObjectMgr->RemoveVendorItem(entry, itr->item); @@ -2076,6 +2091,7 @@ namespace LuaGlobalFunctions return 0; } +#ifndef RETAIL /** * Sends mail to a [Player]. * @@ -2139,7 +2155,7 @@ namespace LuaGlobalFunctions luaL_error(E->L, "Item entry %d does not exist", entry); continue; } -#ifdef CATA +#if defined CATA || defined RETAIL if (amount < 1 || (item_proto->ExtendedData->MaxCount > 0 && amount > uint32(item_proto->ExtendedData->MaxCount))) #else if (amount < 1 || (item_proto->MaxCount > 0 && amount > uint32(item_proto->MaxCount))) @@ -2163,6 +2179,7 @@ namespace LuaGlobalFunctions return addedItems; } +#endif /** * Performs a bitwise AND (a & b). @@ -2252,6 +2269,7 @@ namespace LuaGlobalFunctions return 1; } +#ifndef RETAIL /** * Adds a taxi path to a specified map, returns the used pathId. * @@ -2383,6 +2401,8 @@ namespace LuaGlobalFunctions E->Push(pathId); return 1; } +#endif + /** * Returns `true` if Eluna is in compatibility mode, `false` if in multistate. * @@ -3237,14 +3257,22 @@ namespace LuaGlobalFunctions { "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow }, { "GetGUIDType", &LuaGlobalFunctions::GetGUIDType }, { "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry }, +#ifndef RETAIL { "GetAreaName", &LuaGlobalFunctions::GetAreaName }, +#else + { "GetAreaName", nullptr, METHOD_REG_NONE }, +#endif { "bit_not", &LuaGlobalFunctions::bit_not }, { "bit_xor", &LuaGlobalFunctions::bit_xor }, { "bit_rshift", &LuaGlobalFunctions::bit_rshift }, { "bit_lshift", &LuaGlobalFunctions::bit_lshift }, { "bit_or", &LuaGlobalFunctions::bit_or }, { "bit_and", &LuaGlobalFunctions::bit_and }, +#ifndef RETAIL { "GetItemLink", &LuaGlobalFunctions::GetItemLink }, +#else + { "GetItemLink", nullptr, METHOD_REG_NONE }, +#endif { "GetMapById", &LuaGlobalFunctions::GetMapById, METHOD_REG_WORLD }, // World state method only in multistate { "GetCurrTime", &LuaGlobalFunctions::GetCurrTime }, { "GetTimeDiff", &LuaGlobalFunctions::GetTimeDiff }, @@ -3278,15 +3306,24 @@ namespace LuaGlobalFunctions { "RemoveEventById", &LuaGlobalFunctions::RemoveEventById }, { "RemoveEvents", &LuaGlobalFunctions::RemoveEvents }, { "PerformIngameSpawn", &LuaGlobalFunctions::PerformIngameSpawn }, +#ifndef RETAIL { "CreatePacket", &LuaGlobalFunctions::CreatePacket }, +#else + { "CreatePacket", nullptr, METHOD_REG_NONE }, +#endif { "AddVendorItem", &LuaGlobalFunctions::AddVendorItem }, { "VendorRemoveItem", &LuaGlobalFunctions::VendorRemoveItem }, { "VendorRemoveAllItems", &LuaGlobalFunctions::VendorRemoveAllItems }, { "Kick", &LuaGlobalFunctions::Kick }, { "Ban", &LuaGlobalFunctions::Ban }, { "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers }, +#ifndef RETAIL { "SendMail", &LuaGlobalFunctions::SendMail }, { "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath }, +#else + { "SendMail", nullptr, METHOD_REG_NONE }, + { "AddTaxiPath", nullptr, METHOD_REG_NONE }, +#endif { "CreateInt64", &LuaGlobalFunctions::CreateLongLong }, { "CreateUint64", &LuaGlobalFunctions::CreateULongLong }, { "StartGameEvent", &LuaGlobalFunctions::StartGameEvent }, diff --git a/TrinityCore/GuildMethods.h b/TrinityCore/GuildMethods.h index 533e289389..993bbd6af9 100644 --- a/TrinityCore/GuildMethods.h +++ b/TrinityCore/GuildMethods.h @@ -52,7 +52,7 @@ namespace LuaGuild */ int GetMemberCount(Eluna* E, Guild* guild) { - E->Push(guild->GetMemberCount()); + E->Push(guild->GetMembersCount()); return 1; } @@ -124,7 +124,7 @@ namespace LuaGuild return 1; } -#ifndef CATA +#ifdef WOTLK /** * Sets the leader of this [Guild] * @@ -180,7 +180,7 @@ namespace LuaGuild WorldPacket* data = E->CHECKOBJ(2); uint8 ranked = E->CHECKVAL(3); - guild->BroadcastPacketToRank(data, ranked); + guild->BroadcastPacketToRank(data, GuildRankId(ranked)); return 0; } @@ -208,7 +208,7 @@ namespace LuaGuild CharacterDatabaseTransaction trans(nullptr); - guild->AddMember(trans, player->GET_GUID(), rankId); + guild->AddMember(trans, player->GET_GUID(), GuildRankId(rankId)); return 0; } @@ -242,7 +242,7 @@ namespace LuaGuild CharacterDatabaseTransaction trans(nullptr); - guild->ChangeMemberRank(trans, player->GET_GUID(), newRank); + guild->ChangeMemberRank(trans, player->GET_GUID(), GuildRankId(newRank)); return 0; } @@ -261,7 +261,7 @@ namespace LuaGuild // Setters { "SetBankTabText", &LuaGuild::SetBankTabText }, { "SetMemberRank", &LuaGuild::SetMemberRank }, -#ifndef CATA +#ifdef WOTLK { "SetLeader", &LuaGuild::SetLeader }, #endif diff --git a/TrinityCore/ItemMethods.h b/TrinityCore/ItemMethods.h index 4af3887248..fe477c0a88 100644 --- a/TrinityCore/ItemMethods.h +++ b/TrinityCore/ItemMethods.h @@ -45,6 +45,7 @@ namespace LuaItem return 1; } +#ifndef RETAIL /** * Returns 'true' if the [Item] is not bound to the [Player] specified, 'false' otherwise * @@ -58,6 +59,7 @@ namespace LuaItem E->Push(item->IsBindedNotWith(player)); return 1; } +#endif /** * Returns 'true' if the [Item] is locked, 'false' otherwise @@ -233,6 +235,7 @@ namespace LuaItem } #endif +#ifndef RETAIL /** * Returns the chat link of the [Item] * @@ -319,6 +322,7 @@ namespace LuaItem E->Push(oss.str()); return 1; } +#endif /** * Returns GUID of the [Player] who currently owns the [Item] @@ -403,6 +407,7 @@ namespace LuaItem return 1; } +#ifndef RETAIL /** * Returns the spell ID tied to the [Item] by spell index * @@ -442,6 +447,7 @@ namespace LuaItem #endif return 1; } +#endif /** * Returns class of the [Item] @@ -450,7 +456,7 @@ namespace LuaItem */ int GetClass(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetClass()); #else E->Push(item->GetTemplate()->Class); @@ -465,7 +471,7 @@ namespace LuaItem */ int GetSubClass(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetSubClass()); #else E->Push(item->GetTemplate()->SubClass); @@ -480,7 +486,7 @@ namespace LuaItem */ int GetItemId(Eluna* E, Item* item) { - E->Push(item->GetTemplate()->ItemId); + E->Push(item->GetTemplate()->BasicData->ID); return 1; } @@ -491,7 +497,7 @@ namespace LuaItem */ int GetName(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetDefaultLocaleName()); #else E->Push(item->GetTemplate()->Name1); @@ -499,6 +505,7 @@ namespace LuaItem return 1; } +#ifndef RETAIL /** * Returns the display ID of the [Item] * @@ -506,13 +513,14 @@ namespace LuaItem */ int GetDisplayId(Eluna* E, Item* item) { -#ifdef CATA - E->Push(item->GetTemplate()->GetDisplayID()); +#ifndef WOTLK + E->Push(item->GetTemplate()->displ); #else E->Push(item->GetTemplate()->DisplayInfoID); #endif return 1; } +#endif /** * Returns the quality of the [Item] @@ -521,7 +529,7 @@ namespace LuaItem */ int GetQuality(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetQuality()); #else E->Push(item->GetTemplate()->Quality); @@ -529,6 +537,7 @@ namespace LuaItem return 1; } +#ifndef RETAIL /** * Returns the flags of the [Item] * @@ -550,6 +559,7 @@ namespace LuaItem E->Push(item->GetTemplate()->Flags2); return 1; } +#endif /** * Returns the default purchase count of the [Item] @@ -558,7 +568,7 @@ namespace LuaItem */ int GetBuyCount(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetBuyCount()); #else E->Push(item->GetTemplate()->BuyCount); @@ -573,7 +583,7 @@ namespace LuaItem */ int GetBuyPrice(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetBuyPrice()); #else E->Push(item->GetTemplate()->BuyPrice); @@ -588,7 +598,7 @@ namespace LuaItem */ int GetSellPrice(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetSellPrice()); #else E->Push(item->GetTemplate()->SellPrice); @@ -603,7 +613,7 @@ namespace LuaItem */ int GetInventoryType(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetInventoryType()); #else E->Push(item->GetTemplate()->InventoryType); @@ -618,7 +628,7 @@ namespace LuaItem */ int GetAllowableClass(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetAllowableClass()); #else E->Push(item->GetTemplate()->AllowableClass); @@ -626,6 +636,7 @@ namespace LuaItem return 1; } +#ifndef RETAIL /** * Returns the [Player] races allowed to use this [Item] * @@ -633,13 +644,14 @@ namespace LuaItem */ int GetAllowableRace(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetAllowableRace()); #else E->Push(item->GetTemplate()->AllowableRace); #endif return 1; } +#endif /** * Returns the [Item]s level @@ -648,7 +660,7 @@ namespace LuaItem */ int GetItemLevel(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetBaseItemLevel()); #else E->Push(item->GetTemplate()->ItemLevel); @@ -666,7 +678,7 @@ namespace LuaItem #ifdef CATA E->Push(item->GetTemplate()->GetRequiredLevel()); #elif RETAIL - E->Push(L, item->GetTemplate()->GetBaseRequiredLevel()); + E->Push(item->GetTemplate()->GetBaseRequiredLevel()); #else E->Push(item->GetTemplate()->RequiredLevel); #endif @@ -686,6 +698,7 @@ namespace LuaItem } #endif +#ifndef RETAIL /** * Returns the random property ID of this [Item] * @@ -693,7 +706,7 @@ namespace LuaItem */ int GetRandomProperty(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetRandomProperty()); #else E->Push(item->GetTemplate()->RandomProperty); @@ -708,13 +721,14 @@ namespace LuaItem */ int GetRandomSuffix(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetRandomSuffix()); #else E->Push(item->GetTemplate()->RandomSuffix); #endif return 1; } +#endif /** * Returns the item set ID of this [Item] @@ -723,7 +737,7 @@ namespace LuaItem */ int GetItemSet(Eluna* E, Item* item) { -#ifdef CATA +#ifndef WOTLK E->Push(item->GetTemplate()->GetItemSet()); #else E->Push(item->GetTemplate()->ItemSet); @@ -871,30 +885,30 @@ namespace LuaItem { "GetSlot", &LuaItem::GetSlot }, { "GetBagSlot", &LuaItem::GetBagSlot }, { "GetEnchantmentId", &LuaItem::GetEnchantmentId }, - { "GetSpellId", &LuaItem::GetSpellId }, - { "GetSpellTrigger", &LuaItem::GetSpellTrigger }, - { "GetItemLink", &LuaItem::GetItemLink }, + //{ "GetSpellId", &LuaItem::GetSpellId }, + //{ "GetSpellTrigger", &LuaItem::GetSpellTrigger }, + //{ "GetItemLink", &LuaItem::GetItemLink }, { "GetClass", &LuaItem::GetClass }, { "GetSubClass", &LuaItem::GetSubClass }, { "GetItemId", &LuaItem::GetItemId }, { "GetName", &LuaItem::GetName }, - { "GetDisplayId", &LuaItem::GetDisplayId }, + //{ "GetDisplayId", &LuaItem::GetDisplayId }, { "GetQuality", &LuaItem::GetQuality }, - { "GetFlags", &LuaItem::GetFlags }, - { "GetFlags2", &LuaItem::GetFlags2 }, + //{ "GetFlags", &LuaItem::GetFlags }, + //{ "GetFlags2", &LuaItem::GetFlags2 }, { "GetBuyCount", &LuaItem::GetBuyCount }, { "GetBuyPrice", &LuaItem::GetBuyPrice }, { "GetSellPrice", &LuaItem::GetSellPrice }, { "GetInventoryType", &LuaItem::GetInventoryType }, { "GetAllowableClass", &LuaItem::GetAllowableClass }, - { "GetAllowableRace", &LuaItem::GetAllowableRace }, + //{ "GetAllowableRace", &LuaItem::GetAllowableRace }, { "GetItemLevel", &LuaItem::GetItemLevel }, { "GetRequiredLevel", &LuaItem::GetRequiredLevel }, #ifndef CATA - { "GetStatsCount", &LuaItem::GetStatsCount }, + //{ "GetStatsCount", &LuaItem::GetStatsCount }, #endif - { "GetRandomProperty", &LuaItem::GetRandomProperty }, - { "GetRandomSuffix", &LuaItem::GetRandomSuffix }, + //{ "GetRandomProperty", &LuaItem::GetRandomProperty }, + //{ "GetRandomSuffix", &LuaItem::GetRandomSuffix }, { "GetItemSet", &LuaItem::GetItemSet }, { "GetBagSize", &LuaItem::GetBagSize }, @@ -907,7 +921,7 @@ namespace LuaItem { "IsSoulBound", &LuaItem::IsSoulBound }, { "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, { "IsBoundByEnchant", &LuaItem::IsBoundByEnchant }, - { "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, + //{ "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, { "IsLocked", &LuaItem::IsLocked }, { "IsBag", &LuaItem::IsBag }, { "IsCurrencyToken", &LuaItem::IsCurrencyToken }, @@ -920,8 +934,8 @@ namespace LuaItem { "HasQuest", &LuaItem::HasQuest }, { "IsPotion", &LuaItem::IsPotion }, #ifndef CATA - { "IsWeaponVellum", &LuaItem::IsWeaponVellum }, - { "IsArmorVellum", &LuaItem::IsArmorVellum }, + //{ "IsWeaponVellum", &LuaItem::IsWeaponVellum }, + //{ "IsArmorVellum", &LuaItem::IsArmorVellum }, { "IsRefundExpired", &LuaItem::IsRefundExpired }, #endif { "IsConjuredConsumable", &LuaItem::IsConjuredConsumable }, diff --git a/TrinityCore/MapMethods.h b/TrinityCore/MapMethods.h index 7032e844d6..d7ba23b148 100644 --- a/TrinityCore/MapMethods.h +++ b/TrinityCore/MapMethods.h @@ -95,6 +95,7 @@ namespace LuaMap return 1; } +#ifndef RETAIL /** * Returns the height of the [Map] at the given X and Y coordinates. * @@ -120,6 +121,7 @@ namespace LuaMap E->Push(z); return 1; } +#endif /** * Returns the difficulty of the [Map]. @@ -130,7 +132,7 @@ namespace LuaMap */ int GetDifficulty(Eluna* E, Map* map) { - E->Push(map->GetDifficulty()); + E->Push(map->GetMapDifficulty()); return 1; } @@ -167,6 +169,7 @@ namespace LuaMap return 1; } +#ifndef RETAIL /** * Returns the area ID of the [Map] at the specified X, Y, and Z coordinates. * @@ -191,6 +194,7 @@ namespace LuaMap #endif return 1; } +#endif /** * Returns a [WorldObject] by its GUID from the map if it is spawned. @@ -208,7 +212,7 @@ namespace LuaMap E->Push(eObjectAccessor()GetPlayer(map, guid)); break; case HIGHGUID_TRANSPORT: - case HIGHGUID_MO_TRANSPORT: + //case HIGHGUID_MO_TRANSPORT: case HIGHGUID_GAMEOBJECT: E->Push(map->GetGameObject(guid)); break; @@ -283,6 +287,7 @@ namespace LuaMap return 1; } +#ifndef RETAIL /** * Saves the [Map]'s instance data to the database. */ @@ -297,6 +302,7 @@ namespace LuaMap return 0; } +#endif /** * Returns a table with all the current [Player]s in the map @@ -373,8 +379,8 @@ namespace LuaMap { "GetPlayerCount", &LuaMap::GetPlayerCount }, { "GetPlayers", &LuaMap::GetPlayers }, { "GetMapId", &LuaMap::GetMapId }, - { "GetAreaId", &LuaMap::GetAreaId }, - { "GetHeight", &LuaMap::GetHeight }, + //{ "GetAreaId", &LuaMap::GetAreaId }, + //{ "GetHeight", &LuaMap::GetHeight }, { "GetWorldObject", &LuaMap::GetWorldObject }, // Setters @@ -389,7 +395,7 @@ namespace LuaMap { "IsRaid", &LuaMap::IsRaid }, // Other - { "SaveInstanceData", &LuaMap::SaveInstanceData }, + //{ "SaveInstanceData", &LuaMap::SaveInstanceData }, { "Data", &LuaMap::Data }, { NULL, NULL, METHOD_REG_NONE } diff --git a/TrinityCore/ObjectMethods.h b/TrinityCore/ObjectMethods.h index e9e63c57a3..95f533e76b 100644 --- a/TrinityCore/ObjectMethods.h +++ b/TrinityCore/ObjectMethods.h @@ -241,6 +241,7 @@ namespace LuaObject return 0; } +#ifndef RETAIL /** * Sets the data at the specified index to the given value, converted to a signed 32-bit integer. * @@ -346,19 +347,6 @@ namespace LuaObject return 0; } - /** - * Sets the [Object]'s scale/size to the given value. - * - * @param float scale - */ - int SetScale(Eluna* E, Object* obj) - { - float size = E->CHECKVAL(2); - - obj->SetObjectScale(size); - return 0; - } - /** * Sets the data at the specified index to the given value, converted to an unsigned 64-bit integer. * @@ -372,6 +360,19 @@ namespace LuaObject obj->SetUInt64Value(index, value); return 0; } +#endif + /** + * Sets the [Object]'s scale/size to the given value. + * + * @param float scale + */ + int SetScale(Eluna* E, Object* obj) + { + float size = E->CHECKVAL(2); + + obj->SetObjectScale(size); + return 0; + } /** * Removes a flag from the value at the specified index. @@ -469,6 +470,7 @@ namespace LuaObject { "GetTypeId", &LuaObject::GetTypeId }, // Setters +#ifndef RETAIL { "SetInt32Value", &LuaObject::SetInt32Value }, { "SetUInt32Value", &LuaObject::SetUInt32Value }, { "UpdateUInt32Value", &LuaObject::UpdateUInt32Value }, @@ -477,6 +479,16 @@ namespace LuaObject { "SetUInt16Value", &LuaObject::SetUInt16Value }, { "SetInt16Value", &LuaObject::SetInt16Value }, { "SetUInt64Value", &LuaObject::SetUInt64Value }, +#else + { "SetInt32Value", nullptr, METHOD_REG_NONE }, + { "SetUInt32Value", nullptr, METHOD_REG_NONE }, + { "UpdateUInt32Value", nullptr, METHOD_REG_NONE }, + { "SetFloatValue", nullptr, METHOD_REG_NONE }, + { "SetByteValue", nullptr, METHOD_REG_NONE }, + { "SetUInt16Value", nullptr, METHOD_REG_NONE }, + { "SetInt16Value", nullptr, METHOD_REG_NONE }, + { "SetUInt64Value", nullptr, METHOD_REG_NONE }, +#endif { "SetScale", &LuaObject::SetScale }, { "SetFlag", &LuaObject::SetFlag }, diff --git a/TrinityCore/PlayerMethods.h b/TrinityCore/PlayerMethods.h index c1b0fa377f..ca3ae924fa 100644 --- a/TrinityCore/PlayerMethods.h +++ b/TrinityCore/PlayerMethods.h @@ -35,7 +35,11 @@ namespace LuaPlayer int HasTalent(Eluna* E, Player* player) { uint32 spellId = E->CHECKVAL(2); +#ifndef RETAIL uint8 maxSpecs = MAX_TALENT_SPECS; +#else + uint8 maxSpecs = MAX_SPECIALIZATIONS; +#endif uint8 spec = E->CHECKVAL(3); if (spec >= maxSpecs) @@ -251,7 +255,7 @@ namespace LuaPlayer */ int CanUninviteFromGroup(Eluna* E, Player* player) { - E->Push(player->CanUninviteFromGroup() == ERR_PARTY_RESULT_OK); + E->Push(player->CanUninviteFromGroup(ObjectGuid::Empty, 0) == ERR_PARTY_RESULT_OK); return 1; } @@ -565,6 +569,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns 'true' if the [Player] is currently rested, 'false' otherwise. * @@ -575,6 +580,7 @@ namespace LuaPlayer E->Push(player->GetRestBonus() > 0.0f); return 1; } +#endif /** * Returns 'true' if the [Player] is currently in a [BattleGround] queue, 'false' otherwise. @@ -663,6 +669,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL int IsNeverVisible(Eluna* E, Player* player) { // Possibly add a bool var here @@ -673,6 +680,7 @@ namespace LuaPlayer #endif return 1; } +#endif /*int CanFlyInZone(Eluna* E, Player* player) { @@ -695,6 +703,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns the amount of available specs the [Player] currently has * @@ -716,8 +725,9 @@ namespace LuaPlayer E->Push(player->GetActiveSpec()); return 1; } +#endif -#ifndef CATA +#ifdef WOTLK /** * Returns the normal phase of the player instead of the actual phase possibly containing GM phase * @@ -736,7 +746,7 @@ namespace LuaPlayer */ int GetArenaPoints(Eluna* E, Player* player) { - E->Push(player->GetArenaPoints()); + E->Push(player->arena); return 1; } @@ -747,7 +757,7 @@ namespace LuaPlayer */ int GetHonorPoints(Eluna* E, Player* player) { - E->Push(player->GetHonorPoints()); + E->Push(player->GetHonorLevel()); return 1; } @@ -773,8 +783,11 @@ namespace LuaPlayer { uint32 spellId = E->CHECKVAL(2); - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) - E->Push(player->GetSpellHistory()->GetRemainingCooldown(spellInfo)); + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, DIFFICULTY_NONE)) + { + Milliseconds remainingCooldown = player->GetSpellHistory()->GetRemainingCooldown(spellInfo); + E->Push(remainingCooldown.count()); + } else E->Push(0); @@ -861,6 +874,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns rested experience bonus * @@ -874,6 +888,7 @@ namespace LuaPlayer E->Push(player->GetXPRestBonus(xp)); return 1; } +#endif /** * Returns the [Player]s current [BattleGround] type ID @@ -1020,6 +1035,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns mana bonus from amount of intellect * @@ -1030,6 +1046,7 @@ namespace LuaPlayer E->Push(player->GetManaBonusFromIntellect()); return 1; } +#endif /** * Returns health bonus from amount of stamina @@ -1042,6 +1059,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns raid or dungeon difficulty * @@ -1055,6 +1073,7 @@ namespace LuaPlayer E->Push(player->GetDifficulty(isRaid)); return 1; } +#endif /** * Returns the [Player]s current guild rank @@ -1063,7 +1082,7 @@ namespace LuaPlayer */ int GetGuildRank(Eluna* E, Player* player) // TODO: Move to Guild Methods { -#ifdef CATA +#if defined CATA || defined RETAIL E->Push(player->GetGuildRank()); #else E->Push(player->GetRank()); @@ -1071,6 +1090,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns the [Player]s free talent point amount * @@ -1081,6 +1101,7 @@ namespace LuaPlayer E->Push(player->GetFreeTalentPoints()); return 1; } +#endif /** * Returns the name of the [Player]s current [Guild] @@ -1109,6 +1130,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns [Unit] target combo points are on * @@ -1130,6 +1152,7 @@ namespace LuaPlayer E->Push(player->GetComboPoints()); return 1; } +#endif /** * Returns the amount of time the [Player] has spent ingame @@ -1217,6 +1240,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns the [Player]s current resting bonus * @@ -1238,6 +1262,7 @@ namespace LuaPlayer E->Push(player->GetChatTag()); return 1; } +#endif /** * Returns an item in given bag on given slot. @@ -1402,6 +1427,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL /** * Returns the [Player]s lifetime Honorable Kills * @@ -1412,6 +1438,7 @@ namespace LuaPlayer E->Push(player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); return 1; } +#endif /** * Returns the [Player]s IP address @@ -1596,12 +1623,12 @@ namespace LuaPlayer if (apply) { - player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_SILENCED); + //player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_SILENCED); player->SetClientControl(player, 0); } else { - player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_SILENCED); + //player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_SILENCED); player->SetClientControl(player, 1); } return 0; @@ -1692,7 +1719,7 @@ namespace LuaPlayer if (!player->GetGuildId()) return 0; -#ifdef CATA +#if defined CATA || defined RETAIL player->SetGuildRank(rank); #else player->SetRank(rank); @@ -1700,6 +1727,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Sets the [Player]s free talent points to the amount specified for the current spec * @@ -1713,6 +1741,7 @@ namespace LuaPlayer player->SendTalentsInfoData(false); return 0; } +#endif /** * Sets the [Player]s reputation amount for the faction specified @@ -1747,6 +1776,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Sets the [Player]s rest bonus to the amount specified * @@ -1759,6 +1789,7 @@ namespace LuaPlayer player->SetRestBonus(bonus); return 0; } +#endif /** * Toggles whether the [Player] accepts whispers or not @@ -1863,12 +1894,17 @@ namespace LuaPlayer return luaL_argerror(E->L, 2, "valid Gender expected"); } +#ifdef RETAIL + player->SetGender(gender); +#else player->SetByteValue(UNIT_FIELD_BYTES_0, 2, gender); player->SetByteValue(PLAYER_BYTES_3, 0, gender); +#endif player->InitDisplayIds(); return 0; } +#ifndef RETAIL #ifndef CATA /** * Sets the [Player]s Arena Points to the amount specified @@ -1906,6 +1942,7 @@ namespace LuaPlayer player->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, val); return 0; } +#endif /** * Sets the [Player]s amount of money to copper specified @@ -1994,7 +2031,7 @@ namespace LuaPlayer } -#ifndef CATA +#ifdef WOTLK int SetMovement(Eluna* E, Player* player) { int32 pType = E->CHECKVAL(2); @@ -2004,6 +2041,7 @@ namespace LuaPlayer } #endif +#ifndef RETAIL /** * Resets the [Player]s pets talent points */ @@ -2013,6 +2051,7 @@ namespace LuaPlayer player->SendTalentsInfoData(true); return 0; } +#endif /** * Reset the [Player]s completed achievements @@ -2036,7 +2075,7 @@ namespace LuaPlayer return 0; } -#ifndef CATA +#ifdef WOTLK /** * Adds or detracts from the [Player]s current Arena Points * @@ -2123,7 +2162,7 @@ namespace LuaPlayer if (!quest || player->GetQuestStatus(entry) != QUEST_STATUS_COMPLETE) return 0; - player->RewardQuest(quest, 0, player); + player->RewardQuest(quest, LootItemType::Item, 0, player, false); return 0; } @@ -2136,11 +2175,11 @@ namespace LuaPlayer { Unit* unit = E->CHECKOBJ(2); - AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction()); + AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction(), nullptr); if (!ahEntry) return 0; - WorldPacket data(MSG_AUCTION_HELLO, 12); + WorldPacket data(SMSG_AUCTION_HELLO_RESPONSE, 12); data << unit->GET_GUID(); data << uint32(ahEntry->ID); data << uint8(1); @@ -2180,7 +2219,7 @@ namespace LuaPlayer { WorldObject* obj = E->CHECKOBJ(2); - player->GetSession()->SendTabardVendorActivate(obj->GET_GUID()); + player->GetSession()->SendTabardVendorActivate(obj->GET_GUID(), TabardVendorType(0)); return 0; } @@ -2219,7 +2258,7 @@ namespace LuaPlayer { Creature* obj = E->CHECKOBJ(2); -#ifdef CATA +#if defined CATA || defined RETAIL player->GetSession()->SendTrainerList(obj, NULL); #else player->GetSession()->SendTrainerList(obj); @@ -2279,6 +2318,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Unbinds the [Player] from his instances except the one he currently is in. * @@ -2316,6 +2356,7 @@ namespace LuaPlayer } return 0; } +#endif /** * Forces the [Player] to leave a [BattleGround] @@ -2468,7 +2509,7 @@ namespace LuaPlayer */ int ResetTalentsCost(Eluna* E, Player* player) { -#ifdef CATA +#if defined CATA || defined RETAIL E->Push(player->GetNextResetTalentsCost()); #else E->Push(player->ResetTalentsCost()); @@ -2486,7 +2527,7 @@ namespace LuaPlayer bool no_cost = E->CHECKVAL(2, true); player->ResetTalents(no_cost); - player->SendTalentsInfoData(false); + player->SendTalentsInfoData(); return 0; } @@ -2503,6 +2544,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Clears the [Player]s combo points */ @@ -2526,6 +2568,7 @@ namespace LuaPlayer player->AddComboPoints(target, count); return 0; } +#endif /** * Gives [Quest] monster talked to credit @@ -2609,6 +2652,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Completes the given quest entry for the [Player] and tries to satisfy all quest requirements. * @@ -2703,6 +2747,7 @@ namespace LuaPlayer player->CompleteQuest(entry); return 0; } +#endif /** * Tries to add the given quest entry for the [Player]. @@ -2719,7 +2764,13 @@ namespace LuaPlayer return 0; // check item starting quest (it can work incorrectly if added without item in inventory) -#ifndef CATA +#ifdef RETAIL + ItemTemplateContainer const itc = sObjectMgr->GetItemTemplateStore(); + ItemTemplateContainer::const_iterator result = std::find_if(std::begin(itc), std::end(itc), [quest](ItemTemplateContainer::value_type const& value) + { + return value.second.ExtendedData->StartQuestID == quest->GetQuestId(); + }); +#elif WOTLK ItemTemplateContainer const& itc = sObjectMgr->GetItemTemplateStore(); auto itr = std::find_if(std::begin(itc), std::end(itc), [quest](ItemTemplateContainer::value_type const& value) { @@ -2728,8 +2779,7 @@ namespace LuaPlayer if (itr != std::end(itc)) return 0; - -#elif CATA +#else ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore(); ItemTemplateContainer::const_iterator result = std::find_if(itc->begin(), itc->end(), [quest](ItemTemplateContainer::value_type const& value) { @@ -2928,7 +2978,7 @@ namespace LuaPlayer if (!item) { uint32 entry = E->CHECKVAL(2); - item = Item::CreateItem(entry, 1, player); + item = Item::CreateItem(entry, 1, ItemContext::NONE, player); if (!item) return 1; @@ -2939,7 +2989,7 @@ namespace LuaPlayer return 1; } player->ItemAddedQuestCheck(entry, 1); - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, entry, 1); + //player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, entry, 1); } else { @@ -3013,7 +3063,7 @@ namespace LuaPlayer return 0; } -#ifndef CATA +#ifdef WOTLK /** * Advances all of the [Player]s weapon skills to the maximum amount available */ @@ -3024,6 +3074,7 @@ namespace LuaPlayer } #endif +#ifndef RETAIL /** * Advances all of the [Player]s skills to the amount specified * @@ -3068,6 +3119,7 @@ namespace LuaPlayer } return 0; } +#endif /** * Teleports a [Player] to the location specified @@ -3105,6 +3157,7 @@ namespace LuaPlayer return 1; } +#ifndef RETAIL int AddLifetimeKills(Eluna* E, Player* player) { uint32 val = E->CHECKVAL(2); @@ -3112,6 +3165,7 @@ namespace LuaPlayer player->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, currentKills + val); return 0; } +#endif /** * Adds the given amount of the specified item entry to the player. @@ -3134,7 +3188,7 @@ namespace LuaPlayer if (itemCount == 0 || dest.empty()) return 1; - Item* item = player->StoreNewItem(dest, itemId, true, GenerateItemRandomPropertyId(itemId)); + Item* item = player->StoreNewItem(dest, itemId, true, GenerateItemRandomBonusListId(itemId)); if (item) player->SendNewItem(item, itemCount, true, false); @@ -3171,6 +3225,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Removes specified amount of lifetime kills * @@ -3185,6 +3240,7 @@ namespace LuaPlayer player->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, currentKills - val); return 0; } +#endif /** * Resets cooldown of the specified spell @@ -3215,7 +3271,7 @@ namespace LuaPlayer player->GetSpellHistory()->ResetCooldowns([category](SpellHistory::CooldownStorageType::iterator itr) -> bool { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first, DIFFICULTY_NONE); return spellInfo && spellInfo->GetCategory() == category; }, update); @@ -3244,6 +3300,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Sends an Area Trigger Message to the [Player] * @@ -3256,6 +3313,7 @@ namespace LuaPlayer player->GetSession()->SendAreaTriggerMessage("%s", msg.c_str()); return 0; } +#endif /** * Sends a Notification to the [Player] @@ -3289,6 +3347,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Sends addon message to the [Player] receiver * @@ -3302,29 +3361,15 @@ namespace LuaPlayer { std::string prefix = E->CHECKVAL(2); std::string message = E->CHECKVAL(3); - uint8 channel = E->CHECKVAL(4); + ChatMsg channel = ChatMsg(E->CHECKVAL(4)); Player* receiver = E->CHECKOBJ(5); - - WorldPacket data(SMSG_MESSAGECHAT, 100); - data << uint8(channel); - data << int32(LANG_ADDON); - data << player->GET_GUID(); - data << uint32(0); - data << receiver->GET_GUID(); -#ifdef CATA - data << prefix; - data << uint32(message.length() + 1); - data << message; -#else std::string fullmsg = prefix + "\t" + message; - data << uint32(fullmsg.length() + 1); - data << fullmsg; -#endif - data << uint8(0); - + WorldPacket data; + ChatHandler::BuildChatPacket(data, channel, LANG_ADDON, player, receiver, fullmsg); receiver->GetSession()->SendPacket(&data); return 0; } +#endif /** * Kicks the [Player] from the server @@ -3365,6 +3410,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Learn the [Player] the talent specified by talent_id and talentRank * @@ -3377,9 +3423,10 @@ namespace LuaPlayer uint32 rank = E->CHECKVAL(3); player->LearnTalent(id, rank); - player->SendTalentsInfoData(false); + player->SendTalentsInfoData(); return 0; } +#endif /** * Remove cooldowns on spells that have less than 10 minutes of cooldown from the [Player], similarly to when you enter an arena. @@ -3405,6 +3452,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Adds a new item to the gossip menu shown to the [Player] on next call to [Player:GossipSendMenu]. * @@ -3433,9 +3481,11 @@ namespace LuaPlayer const char* _promptMsg = E->CHECKVAL(7, ""); uint32 _money = E->CHECKVAL(8, 0); + player->PlayerTalkClass->GetGossipMenu().AddMenuItem player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, GossipOptionIcon(_icon), msg, _sender, _intid, _promptMsg, _money, _code); return 0; } +#endif /** * Closes the [Player]s currently open Gossip Menu. @@ -3534,6 +3584,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL /** * Adds the gossip items to the [Player]'s gossip for the quests the given [WorldObject] can offer to the player. * @@ -3555,6 +3606,7 @@ namespace LuaPlayer } return 0; } +#endif /** * Shows a quest accepting window to the [Player] for the given quest. @@ -3571,7 +3623,7 @@ namespace LuaPlayer if (!quest) return 0; -#ifdef CATA +#if defined CATA || defined RETAIL player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept, true); #else player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept); @@ -3639,7 +3691,7 @@ namespace LuaPlayer if (success) { -#ifdef CATA +#if defined CATA || defined RETAIL WorldPacket data(SMSG_PARTY_INVITE, 10); // guess size #else WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size @@ -3726,6 +3778,7 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL int BindToInstance(Eluna* /*E*/, Player* player) { player->BindToInstance(); @@ -3745,6 +3798,7 @@ namespace LuaPlayer return 1; } +#endif /*int GainSpellComboPoints(Eluna* E, Player* player) { @@ -3763,11 +3817,13 @@ namespace LuaPlayer return 0; } +#ifndef RETAIL int KilledPlayerCredit(Eluna* /*E*/, Player* player) { player->KilledPlayerCredit(); return 0; } +#endif int RemoveRewardedQuest(Eluna* E, Player* player) { @@ -3798,7 +3854,7 @@ namespace LuaPlayer if (petType >= MAX_PET_TYPE) return 0; - player->SummonPet(entry, x, y, z, o, (PetType)petType, despwtime); + player->SummonPet(entry, PetSaveMode(PET_SAVE_AS_CURRENT), x, y, z, o, despwtime); return 0; } @@ -3827,11 +3883,13 @@ namespace LuaPlayer { "GetGuild", &LuaPlayer::GetGuild }, { "GetAccountId", &LuaPlayer::GetAccountId }, { "GetAccountName", &LuaPlayer::GetAccountName }, -#ifndef CATA +#ifdef WOTLK { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, #endif +#ifndef RETAIL { "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, +#endif { "GetPlayerIP", &LuaPlayer::GetPlayerIP }, { "GetLevelPlayedTime", &LuaPlayer::GetLevelPlayedTime }, { "GetTotalPlayedTime", &LuaPlayer::GetTotalPlayedTime }, @@ -3842,25 +3900,25 @@ namespace LuaPlayer { "GetReputation", &LuaPlayer::GetReputation }, { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot }, { "GetQuestLevel", &LuaPlayer::GetQuestLevel }, - { "GetChatTag", &LuaPlayer::GetChatTag }, - { "GetRestBonus", &LuaPlayer::GetRestBonus }, + //{ "GetChatTag", &LuaPlayer::GetChatTag }, + //{ "GetRestBonus", &LuaPlayer::GetRestBonus }, #ifndef CATA - { "GetPhaseMaskForSpawn", &LuaPlayer::GetPhaseMaskForSpawn }, + //{ "GetPhaseMaskForSpawn", &LuaPlayer::GetPhaseMaskForSpawn }, #endif { "GetReqKillOrCastCurrentCount", &LuaPlayer::GetReqKillOrCastCurrentCount }, { "GetQuestStatus", &LuaPlayer::GetQuestStatus }, { "GetInGameTime", &LuaPlayer::GetInGameTime }, - { "GetComboPoints", &LuaPlayer::GetComboPoints }, - { "GetComboTarget", &LuaPlayer::GetComboTarget }, + //{ "GetComboPoints", &LuaPlayer::GetComboPoints }, + //{ "GetComboTarget", &LuaPlayer::GetComboTarget }, { "GetGuildName", &LuaPlayer::GetGuildName }, - { "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, - { "GetActiveSpec", &LuaPlayer::GetActiveSpec }, - { "GetSpecsCount", &LuaPlayer::GetSpecsCount }, + //{ "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, + //{ "GetActiveSpec", &LuaPlayer::GetActiveSpec }, + //{ "GetSpecsCount", &LuaPlayer::GetSpecsCount }, { "GetSpellCooldownDelay", &LuaPlayer::GetSpellCooldownDelay }, { "GetGuildRank", &LuaPlayer::GetGuildRank }, - { "GetDifficulty", &LuaPlayer::GetDifficulty }, + //{ "GetDifficulty", &LuaPlayer::GetDifficulty }, { "GetHealthBonusFromStamina", &LuaPlayer::GetHealthBonusFromStamina }, - { "GetManaBonusFromIntellect", &LuaPlayer::GetManaBonusFromIntellect }, + //{ "GetManaBonusFromIntellect", &LuaPlayer::GetManaBonusFromIntellect }, { "GetMaxSkillValue", &LuaPlayer::GetMaxSkillValue }, { "GetPureMaxSkillValue", &LuaPlayer::GetPureMaxSkillValue }, { "GetSkillValue", &LuaPlayer::GetSkillValue }, @@ -3872,7 +3930,7 @@ namespace LuaPlayer { "GetDrunkValue", &LuaPlayer::GetDrunkValue }, { "GetBattlegroundId", &LuaPlayer::GetBattlegroundId }, { "GetBattlegroundTypeId", &LuaPlayer::GetBattlegroundTypeId }, - { "GetXPRestBonus", &LuaPlayer::GetXPRestBonus }, + //{ "GetXPRestBonus", &LuaPlayer::GetXPRestBonus }, { "GetGroupInvite", &LuaPlayer::GetGroupInvite }, { "GetSubGroup", &LuaPlayer::GetSubGroup }, { "GetNextRandomRaidMember", &LuaPlayer::GetNextRandomRaidMember }, @@ -3887,7 +3945,7 @@ namespace LuaPlayer { "GetGossipTextId", &LuaPlayer::GetGossipTextId }, { "GetQuestRewardStatus", &LuaPlayer::GetQuestRewardStatus }, #ifndef CATA - { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, + //{ "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, { "GetMailCount", &LuaPlayer::GetMailCount }, { "GetXP", &LuaPlayer::GetXP }, { "GetXPForNextLevel", &LuaPlayer::GetXPForNextLevel }, @@ -3895,33 +3953,33 @@ namespace LuaPlayer // Setters #ifndef CATA - { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax }, + //{ "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax }, #endif - { "AdvanceSkill", &LuaPlayer::AdvanceSkill }, - { "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, - { "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, + //{ "AdvanceSkill", &LuaPlayer::AdvanceSkill }, + //{ "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, + //{ "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, { "SetCoinage", &LuaPlayer::SetCoinage }, { "SetKnownTitle", &LuaPlayer::SetKnownTitle }, { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, { "SetBindPoint", &LuaPlayer::SetBindPoint }, #ifndef CATA - { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, - { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, + //{ "SetArenaPoints", &LuaPlayer::SetArenaPoints }, + //{ "SetHonorPoints", &LuaPlayer::SetHonorPoints }, #endif - { "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, + //{ "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, { "SetGameMaster", &LuaPlayer::SetGameMaster }, { "SetGMChat", &LuaPlayer::SetGMChat }, { "SetTaxiCheat", &LuaPlayer::SetTaxiCheat }, { "SetGMVisible", &LuaPlayer::SetGMVisible }, { "SetPvPDeath", &LuaPlayer::SetPvPDeath }, { "SetAcceptWhispers", &LuaPlayer::SetAcceptWhispers }, - { "SetRestBonus", &LuaPlayer::SetRestBonus }, + //{ "SetRestBonus", &LuaPlayer::SetRestBonus }, { "SetQuestStatus", &LuaPlayer::SetQuestStatus }, { "SetReputation", &LuaPlayer::SetReputation }, - { "SetFreeTalentPoints", &LuaPlayer::SetFreeTalentPoints }, + //{ "SetFreeTalentPoints", &LuaPlayer::SetFreeTalentPoints }, { "SetGuildRank", &LuaPlayer::SetGuildRank }, #ifndef CATA - { "SetMovement", &LuaPlayer::SetMovement }, + //{ "SetMovement", &LuaPlayer::SetMovement }, #endif { "SetSkill", &LuaPlayer::SetSkill }, { "SetFactionForRace", &LuaPlayer::SetFactionForRace }, @@ -3965,8 +4023,8 @@ namespace LuaPlayer { "HasAchieved", &LuaPlayer::HasAchieved }, { "SetAchievement", &LuaPlayer::SetAchievement }, { "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup }, - { "IsRested", &LuaPlayer::IsRested }, - { "IsNeverVisible", &LuaPlayer::IsNeverVisible }, + //{ "IsRested", &LuaPlayer::IsRested }, + //{ "IsNeverVisible", &LuaPlayer::IsNeverVisible }, { "IsVisibleForPlayer", &LuaPlayer::IsVisibleForPlayer }, { "IsUsingLfg", &LuaPlayer::IsUsingLfg }, { "HasQuestForItem", &LuaPlayer::HasQuestForItem }, @@ -3999,23 +4057,23 @@ namespace LuaPlayer #endif // Gossip - { "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, + //{ "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, { "GossipSendMenu", &LuaPlayer::GossipSendMenu }, { "GossipComplete", &LuaPlayer::GossipComplete }, { "GossipClearMenu", &LuaPlayer::GossipClearMenu }, // Other { "SendBroadcastMessage", &LuaPlayer::SendBroadcastMessage }, - { "SendAreaTriggerMessage", &LuaPlayer::SendAreaTriggerMessage }, + //{ "SendAreaTriggerMessage", &LuaPlayer::SendAreaTriggerMessage }, { "SendNotification", &LuaPlayer::SendNotification }, { "SendPacket", &LuaPlayer::SendPacket }, - { "SendAddonMessage", &LuaPlayer::SendAddonMessage }, + //{ "SendAddonMessage", &LuaPlayer::SendAddonMessage }, { "ModifyMoney", &LuaPlayer::ModifyMoney }, { "LearnSpell", &LuaPlayer::LearnSpell }, - { "LearnTalent", &LuaPlayer::LearnTalent }, + //{ "LearnTalent", &LuaPlayer::LearnTalent }, { "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns }, { "RemoveItem", &LuaPlayer::RemoveItem }, - { "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills }, + //{ "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills }, { "ResurrectPlayer", &LuaPlayer::ResurrectPlayer }, { "EquipItem", &LuaPlayer::EquipItem }, { "ResetSpellCooldown", &LuaPlayer::ResetSpellCooldown }, @@ -4028,7 +4086,7 @@ namespace LuaPlayer { "Yell", &LuaPlayer::Yell }, { "TextEmote", &LuaPlayer::TextEmote }, { "Whisper", &LuaPlayer::Whisper }, - { "CompleteQuest", &LuaPlayer::CompleteQuest }, + //{ "CompleteQuest", &LuaPlayer::CompleteQuest }, { "IncompleteQuest", &LuaPlayer::IncompleteQuest }, { "FailQuest", &LuaPlayer::FailQuest }, { "AddQuest", &LuaPlayer::AddQuest }, @@ -4038,16 +4096,16 @@ namespace LuaPlayer { "AreaExploredOrEventHappens", &LuaPlayer::AreaExploredOrEventHappens }, { "GroupEventHappens", &LuaPlayer::GroupEventHappens }, { "KilledMonsterCredit", &LuaPlayer::KilledMonsterCredit }, - { "KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit }, + //{ "KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit }, { "KillGOCredit", &LuaPlayer::KillGOCredit }, { "TalkedToCreature", &LuaPlayer::TalkedToCreature }, - { "ResetPetTalents", &LuaPlayer::ResetPetTalents }, - { "AddComboPoints", &LuaPlayer::AddComboPoints }, - { "ClearComboPoints", &LuaPlayer::ClearComboPoints }, + //{ "ResetPetTalents", &LuaPlayer::ResetPetTalents }, + //{ "AddComboPoints", &LuaPlayer::AddComboPoints }, + //{ "ClearComboPoints", &LuaPlayer::ClearComboPoints }, { "RemoveSpell", &LuaPlayer::RemoveSpell }, { "ResetTalents", &LuaPlayer::ResetTalents }, { "ResetTalentsCost", &LuaPlayer::ResetTalentsCost }, - { "AddTalent", &LuaPlayer::AddTalent }, + //{ "AddTalent", &LuaPlayer::AddTalent }, { "RemoveFromGroup", &LuaPlayer::RemoveFromGroup }, { "KillPlayer", &LuaPlayer::KillPlayer }, { "DurabilityLossAll", &LuaPlayer::DurabilityLossAll }, @@ -4058,13 +4116,13 @@ namespace LuaPlayer { "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, { "DurabilityRepair", &LuaPlayer::DurabilityRepair }, #ifndef CATA - { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, - { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, + //{ "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, + //{ "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, #endif { "LeaveBattleground", &LuaPlayer::LeaveBattleground }, - { "BindToInstance", &LuaPlayer::BindToInstance }, - { "UnbindInstance", &LuaPlayer::UnbindInstance }, - { "UnbindAllInstances", &LuaPlayer::UnbindAllInstances }, + //{ "BindToInstance", &LuaPlayer::BindToInstance }, + //{ "UnbindInstance", &LuaPlayer::UnbindInstance }, + //{ "UnbindAllInstances", &LuaPlayer::UnbindAllInstances }, { "RemoveFromBattlegroundRaid", &LuaPlayer::RemoveFromBattlegroundRaid }, { "ResetAchievements", &LuaPlayer::ResetAchievements }, { "KickPlayer", &LuaPlayer::KickPlayer }, @@ -4081,7 +4139,7 @@ namespace LuaPlayer { "SendShowMailBox", &LuaPlayer::SendShowMailBox }, { "StartTaxi", &LuaPlayer::StartTaxi }, { "GossipSendPOI", &LuaPlayer::GossipSendPOI }, - { "GossipAddQuests", &LuaPlayer::GossipAddQuests }, + //{ "GossipAddQuests", &LuaPlayer::GossipAddQuests }, { "SendQuestTemplate", &LuaPlayer::SendQuestTemplate }, { "SpawnBones", &LuaPlayer::SpawnBones }, { "RemovedInsignia", &LuaPlayer::RemovedInsignia }, diff --git a/TrinityCore/QuestMethods.h b/TrinityCore/QuestMethods.h index 0e2c24011e..a333cdf5b6 100644 --- a/TrinityCore/QuestMethods.h +++ b/TrinityCore/QuestMethods.h @@ -53,7 +53,7 @@ namespace LuaQuest { uint32 flag = E->CHECKVAL(2); - E->Push(quest->HasFlag(flag)); + E->Push(quest->HasFlag(QuestFlags(flag))); return 1; } @@ -90,6 +90,7 @@ namespace LuaQuest return 1; } +#ifndef RETAIL /** * Returns the [Quest]'s level. * @@ -111,6 +112,7 @@ namespace LuaQuest E->Push(quest->GetMinLevel()); return 1; } +#endif /** * Returns the next [Quest] entry ID. @@ -165,7 +167,7 @@ namespace LuaQuest */ int GetType(Eluna* E, Quest* quest) { -#ifdef CATA +#ifndef WOTLK E->Push(quest->GetQuestType()); #else E->Push(quest->GetType()); @@ -188,9 +190,9 @@ namespace LuaQuest { // Getters { "GetId", &LuaQuest::GetId }, - { "GetLevel", &LuaQuest::GetLevel }, + //{ "GetLevel", &LuaQuest::GetLevel }, { "GetMaxLevel", &LuaQuest::GetMaxLevel }, - { "GetMinLevel", &LuaQuest::GetMinLevel }, + //{ "GetMinLevel", &LuaQuest::GetMinLevel }, { "GetNextQuestId", &LuaQuest::GetNextQuestId }, { "GetPrevQuestId", &LuaQuest::GetPrevQuestId }, { "GetNextQuestInChain", &LuaQuest::GetNextQuestInChain }, diff --git a/TrinityCore/UnitMethods.h b/TrinityCore/UnitMethods.h index 0165b8eb03..57b6095346 100644 --- a/TrinityCore/UnitMethods.h +++ b/TrinityCore/UnitMethods.h @@ -58,7 +58,7 @@ namespace LuaUnit int32 immunity = E->CHECKVAL(2); bool apply = E->CHECKVAL(3, true); - unit->ApplySpellImmune(0, 5, immunity, apply); + unit->ApplySpellImmune(0, SpellImmunity(IMMUNITY_MECHANIC), immunity, apply); return 0; } /** @@ -117,7 +117,7 @@ namespace LuaUnit */ int IsRooted(Eluna* E, Unit* unit) { - E->Push(unit->IsRooted() || unit->HasUnitMovementFlag(MOVEMENTFLAG_ROOT)); + E->Push(unit->HasRootAura() || unit->HasUnitMovementFlag(MOVEMENTFLAG_ROOT)); return 1; } @@ -231,7 +231,7 @@ namespace LuaUnit */ int IsSpiritGuide(Eluna* E, Unit* unit) { - E->Push(unit->IsSpiritGuide()); + E->Push(unit->IsSpiritService()); return 1; } @@ -656,6 +656,7 @@ namespace LuaUnit return 1; } +#ifndef RETAIL /** * Returns the [Unit]'s base spell power * @@ -672,6 +673,7 @@ namespace LuaUnit E->Push(unit->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + spellschool)); return 1; } +#endif /** * Returns the [Unit]'s current victim target or nil. @@ -997,6 +999,7 @@ namespace LuaUnit return 1; } +#ifndef RETAIL /** * Returns the [Unit]'s class' name in given or default locale or nil. * @@ -1066,6 +1069,7 @@ namespace LuaUnit E->Push(entry->Name[locale]); return 1; } +#endif /** * Returns the [Unit]'s faction ID. @@ -1379,7 +1383,7 @@ namespace LuaUnit { player->GiveLevel(newlevel); player->InitTalentForLevel(); - player->SetUInt32Value(PLAYER_XP, 0); + // player->SetUInt32Value(PLAYER_XP, 0); } else unit->SetLevel(newlevel); @@ -1550,7 +1554,7 @@ namespace LuaUnit int SetNativeDisplayId(Eluna* E, Unit* unit) { uint32 model = E->CHECKVAL(2); -#ifndef CATA +#ifdef WOTLK unit->SetNativeDisplayId(model); #else unit->SetDisplayId(model, true); @@ -1646,6 +1650,7 @@ namespace LuaUnit return 0; } +#ifndef RETAIL /** * Sets the [Unit]'s FFA flag on or off. * @@ -1691,6 +1696,7 @@ namespace LuaUnit return 0; } +#endif int SetCritterGUID(Eluna* E, Unit* unit) { @@ -1801,6 +1807,7 @@ namespace LuaUnit return 0; } +#ifndef RETAIL /** * Makes the [Unit] perform the given emote continuously. * @@ -1813,6 +1820,7 @@ namespace LuaUnit unit->SetUInt32Value(UNIT_NPC_EMOTESTATE, emoteId); return 0; } +#endif /** * Returns calculated percentage from Health @@ -1836,6 +1844,7 @@ namespace LuaUnit return 1; } +#ifndef RETAIL /** * Sends chat message to [Player] * @@ -1862,6 +1871,7 @@ namespace LuaUnit target->GetSession()->SendPacket(&data); return 0; } +#endif /** * Stops the [Unit]'s movement @@ -1977,7 +1987,7 @@ namespace LuaUnit { Unit* target = E->CHECKOBJ(2); uint32 time = E->CHECKVAL(3, 0); - unit->GetMotionMaster()->MoveFleeing(target, time); + unit->GetMotionMaster()->MoveFleeing(target, Milliseconds(time)); return 0; } @@ -2124,7 +2134,7 @@ namespace LuaUnit uint32 spell = E->CHECKVAL(3); bool triggered = E->CHECKVAL(4, false); - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell); + SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell, DIFFICULTY_NONE); if (!spellEntry) return 0; @@ -2132,6 +2142,7 @@ namespace LuaUnit return 0; } +#ifndef RETAIL /** * Casts the [Spell] at target [Unit] with custom basepoints or casters. * See also [Unit:CastSpell]. @@ -2176,6 +2187,7 @@ namespace LuaUnit unit->CastSpell(target, spell, args); return 0; } +#endif /** * Makes the [Unit] cast the spell to the given coordinates, used for area effect spells. @@ -2269,7 +2281,7 @@ namespace LuaUnit uint32 spell = E->CHECKVAL(2); Unit* target = E->CHECKOBJ(3); - SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell); + SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell, DIFFICULTY_NONE); if (!spellEntry) return 1; @@ -2354,6 +2366,7 @@ namespace LuaUnit return 0; } +#ifndef RETAIL /** * Makes the [Unit] damage the target [Unit] * @@ -2434,6 +2447,7 @@ namespace LuaUnit unit->DealSpellDamage(&dmgInfo, true); return 0; } +#endif /** * Makes the [Unit] heal the target [Unit] with given spell @@ -2450,7 +2464,7 @@ namespace LuaUnit uint32 amount = E->CHECKVAL(4); bool critical = E->CHECKVAL(5, false); - if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell)) + if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell, DIFFICULTY_NONE)) { HealInfo healInfo(unit, target, amount, info, info->GetSchoolMask()); unit->HealBySpell(healInfo, critical); @@ -2568,8 +2582,8 @@ namespace LuaUnit { "GetClass", &LuaUnit::GetClass }, { "GetRaceMask", &LuaUnit::GetRaceMask }, { "GetClassMask", &LuaUnit::GetClassMask }, - { "GetRaceAsString", &LuaUnit::GetRaceAsString }, - { "GetClassAsString", &LuaUnit::GetClassAsString }, + //{ "GetRaceAsString", &LuaUnit::GetRaceAsString }, + //{ "GetClassAsString", &LuaUnit::GetClassAsString }, { "GetAura", &LuaUnit::GetAura }, { "GetFaction", &LuaUnit::GetFaction }, { "GetCurrentSpell", &LuaUnit::GetCurrentSpell }, @@ -2591,7 +2605,7 @@ namespace LuaUnit { "GetVictim", &LuaUnit::GetVictim }, { "GetSpeed", &LuaUnit::GetSpeed }, { "GetStat", &LuaUnit::GetStat }, - { "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, + //{ "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, { "GetVehicleKit", &LuaUnit::GetVehicleKit }, { "GetVehicle", &LuaUnit::GetVehicle }, { "GetMovementType", &LuaUnit::GetMovementType }, @@ -2614,8 +2628,8 @@ namespace LuaUnit { "SetConfused", &LuaUnit::SetConfused }, { "SetFeared", &LuaUnit::SetFeared }, { "SetPvP", &LuaUnit::SetPvP }, - { "SetFFA", &LuaUnit::SetFFA }, - { "SetSanctuary", &LuaUnit::SetSanctuary }, + //{ "SetFFA", &LuaUnit::SetFFA }, + //{ "SetSanctuary", &LuaUnit::SetSanctuary }, { "SetCanFly", &LuaUnit::SetCanFly }, { "SetVisible", &LuaUnit::SetVisible }, { "SetOwnerGUID", &LuaUnit::SetOwnerGUID }, @@ -2687,14 +2701,14 @@ namespace LuaUnit { "SendUnitSay", &LuaUnit::SendUnitSay }, { "SendUnitYell", &LuaUnit::SendUnitYell }, { "CastSpell", &LuaUnit::CastSpell }, - { "CastCustomSpell", &LuaUnit::CastCustomSpell }, + //{ "CastCustomSpell", &LuaUnit::CastCustomSpell }, { "CastSpellAoF", &LuaUnit::CastSpellAoF }, { "Kill", &LuaUnit::Kill }, { "StopSpellCast", &LuaUnit::StopSpellCast }, { "InterruptSpell", &LuaUnit::InterruptSpell }, - { "SendChatMessageToPlayer", &LuaUnit::SendChatMessageToPlayer }, + //{ "SendChatMessageToPlayer", &LuaUnit::SendChatMessageToPlayer }, { "PerformEmote", &LuaUnit::PerformEmote }, - { "EmoteState", &LuaUnit::EmoteState }, + //{ "EmoteState", &LuaUnit::EmoteState }, { "CountPctFromCurHealth", &LuaUnit::CountPctFromCurHealth }, { "CountPctFromMaxHealth", &LuaUnit::CountPctFromMaxHealth }, { "Dismount", &LuaUnit::Dismount }, @@ -2719,7 +2733,7 @@ namespace LuaUnit { "MoveStop", &LuaUnit::MoveStop }, { "MoveExpire", &LuaUnit::MoveExpire }, { "MoveClear", &LuaUnit::MoveClear }, - { "DealDamage", &LuaUnit::DealDamage }, + //{ "DealDamage", &LuaUnit::DealDamage }, { "DealHeal", &LuaUnit::DealHeal }, // Not implemented methods diff --git a/TrinityCore/VehicleMethods.h b/TrinityCore/VehicleMethods.h index 1fdeb6d29b..1fcee11a0c 100644 --- a/TrinityCore/VehicleMethods.h +++ b/TrinityCore/VehicleMethods.h @@ -72,7 +72,7 @@ namespace LuaVehicle Unit* passenger = E->CHECKOBJ(2); int8 seatId = E->CHECKVAL(3); -#ifndef CATA +#ifdef WOTLK vehicle->AddPassenger(passenger, seatId); #else vehicle->AddVehiclePassenger(passenger, seatId); diff --git a/TrinityCore/WorldPacketMethods.h b/TrinityCore/WorldPacketMethods.h index 86d3bbdb3f..4cd8850a05 100644 --- a/TrinityCore/WorldPacketMethods.h +++ b/TrinityCore/WorldPacketMethods.h @@ -42,6 +42,7 @@ namespace LuaPacket return 1; } +#ifndef RETAIL /** * Sets the opcode of the [WorldPacket] to the specified opcode. * @@ -56,6 +57,7 @@ namespace LuaPacket packet->SetOpcode((OpcodesList)opcode); return 0; } +#endif /** * Reads and returns a signed 8-bit integer value from the [WorldPacket]. @@ -314,7 +316,7 @@ namespace LuaPacket { "GetSize", &LuaPacket::GetSize }, // Setters - { "SetOpcode", &LuaPacket::SetOpcode }, + //{ "SetOpcode", &LuaPacket::SetOpcode }, // Readers { "ReadByte", &LuaPacket::ReadByte },