diff --git a/LuaEngine.cpp b/LuaEngine.cpp index aea9eea100..ef82577cf7 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -989,13 +989,13 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc void Eluna::UpdateEluna(uint32 diff) { if (reload && sElunaLoader->GetCacheState() == SCRIPT_CACHE_READY) -#if defined ELUNA_TRINITY && ELUNA_EXPANSION == WOTLK +#if defined ELUNA_TRINITY && ELUNA_EXPANSION != EXP_RETAIL if(!GetQueryProcessor().HasPendingCallbacks()) #endif _ReloadEluna(); eventMgr->globalProcessor->Update(diff); -#if defined ELUNA_TRINITY && ELUNA_EXPANSION == WOTLK +#if defined ELUNA_TRINITY && ELUNA_EXPANSION != EXP_RETAIL GetQueryProcessor().ProcessReadyCallbacks(); #endif } diff --git a/hooks/ItemHooks.cpp b/hooks/ItemHooks.cpp index 402088ad75..d8b2dd8179 100644 --- a/hooks/ItemHooks.cpp +++ b/hooks/ItemHooks.cpp @@ -103,13 +103,13 @@ bool Eluna::OnItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targ bool Eluna::OnExpire(Player* pPlayer, ItemTemplate const* pProto) { -#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= CATA +#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= EXP_CATA START_HOOK_WITH_RETVAL(ITEM_EVENT_ON_EXPIRE, pProto->BasicData->ID, false); #else START_HOOK_WITH_RETVAL(ITEM_EVENT_ON_EXPIRE, pProto->ItemId, false); #endif HookPush(pPlayer); -#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= CATA +#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= EXP_CATA HookPush(pProto->BasicData->ID); #else HookPush(pProto->ItemId); diff --git a/methods/TrinityCore/BattleGroundMethods.h b/methods/TrinityCore/BattleGroundMethods.h index 91571303c0..b05e6aa92f 100644 --- a/methods/TrinityCore/BattleGroundMethods.h +++ b/methods/TrinityCore/BattleGroundMethods.h @@ -82,7 +82,7 @@ namespace LuaBattleGround */ int GetEndTime(Eluna* E, BattleGround* bg) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(bg->GetRemainingTime()); #else E->Push(bg->GetEndTime()); diff --git a/methods/TrinityCore/GlobalMethods.h b/methods/TrinityCore/GlobalMethods.h index 3f2c9f72a2..3a835134bd 100644 --- a/methods/TrinityCore/GlobalMethods.h +++ b/methods/TrinityCore/GlobalMethods.h @@ -73,7 +73,7 @@ namespace LuaGlobalFunctions /** * Returns emulator's supported expansion. * - * Expansion is 0 for pre-TBC, 1 for TBC, 2 for WotLK, 3 for Cataclysm, 9 for Dragonflight. + * Expansion is 0 for pre-TBC, 1 for TBC, 2 for WotLK, 3 for Cataclysm, 9 for Retail. * * @return int32 expansion */ @@ -1830,7 +1830,7 @@ namespace LuaGlobalFunctions uint32 incrtime = E->CHECKVAL(4); uint32 extendedcost = E->CHECKVAL(5); -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA VendorItem vItem; vItem.item = item; vItem.maxcount = maxcount; @@ -1863,7 +1863,7 @@ namespace LuaGlobalFunctions if (!eObjectMgr->GetCreatureTemplate(entry)) return luaL_argerror(E->L, 1, "valid CreatureEntry expected"); -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA eObjectMgr->RemoveVendorItem(entry, item, 1); #else eObjectMgr->RemoveVendorItem(entry, item); @@ -1887,7 +1887,7 @@ namespace LuaGlobalFunctions auto const itemlist = items->m_items; for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr) -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA eObjectMgr->RemoveVendorItem(entry, itr->item, 1); #else eObjectMgr->RemoveVendorItem(entry, itr->item); @@ -2295,7 +2295,6 @@ namespace LuaGlobalFunctions return 1; } #endif - /** * Returns `true` if Eluna is in compatibility mode, `false` if in multistate. * @@ -3161,21 +3160,26 @@ namespace LuaGlobalFunctions { "GetGuildByName", &LuaGlobalFunctions::GetGuildByName }, { "GetGuildByLeaderGUID", &LuaGlobalFunctions::GetGuildByLeaderGUID }, { "GetPlayerCount", &LuaGlobalFunctions::GetPlayerCount }, - { "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow }, - { "GetGUIDType", &LuaGlobalFunctions::GetGUIDType }, - { "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry }, #if ELUNA_EXPANSION < EXP_RETAIL { "GetPlayerGUID", &LuaGlobalFunctions::GetPlayerGUID }, { "GetItemGUID", &LuaGlobalFunctions::GetItemGUID }, { "GetObjectGUID", &LuaGlobalFunctions::GetObjectGUID }, { "GetUnitGUID", &LuaGlobalFunctions::GetUnitGUID }, + { "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow }, + { "GetGUIDType", &LuaGlobalFunctions::GetGUIDType }, + { "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry }, { "GetAreaName", &LuaGlobalFunctions::GetAreaName }, + { "GetItemLink", &LuaGlobalFunctions::GetItemLink }, #else { "GetPlayerGUID", METHOD_REG_NONE }, { "GetItemGUID", METHOD_REG_NONE }, { "GetObjectGUID", METHOD_REG_NONE }, { "GetUnitGUID", METHOD_REG_NONE }, + { "GetGUIDLow", METHOD_REG_NONE }, + { "GetGUIDType", METHOD_REG_NONE }, + { "GetGUIDEntry", METHOD_REG_NONE }, { "GetAreaName", METHOD_REG_NONE }, + { "GetItemLink", METHOD_REG_NONE }, #endif { "bit_not", &LuaGlobalFunctions::bit_not }, { "bit_xor", &LuaGlobalFunctions::bit_xor }, @@ -3183,11 +3187,6 @@ namespace LuaGlobalFunctions { "bit_lshift", &LuaGlobalFunctions::bit_lshift }, { "bit_or", &LuaGlobalFunctions::bit_or }, { "bit_and", &LuaGlobalFunctions::bit_and }, -#if ELUNA_EXPANSION < EXP_RETAIL - { "GetItemLink", &LuaGlobalFunctions::GetItemLink }, -#else - { "GetItemLink", METHOD_REG_NONE }, -#endif { "GetMapById", &LuaGlobalFunctions::GetMapById, METHOD_REG_WORLD }, // World state method only in multistate { "GetCurrTime", &LuaGlobalFunctions::GetCurrTime }, { "GetTimeDiff", &LuaGlobalFunctions::GetTimeDiff }, @@ -3223,9 +3222,13 @@ namespace LuaGlobalFunctions #if ELUNA_EXPANSION < EXP_RETAIL { "PerformIngameSpawn", &LuaGlobalFunctions::PerformIngameSpawn }, { "CreatePacket", &LuaGlobalFunctions::CreatePacket }, + { "SendMail", &LuaGlobalFunctions::SendMail }, + { "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath }, #else { "PerformIngameSpawn", METHOD_REG_NONE }, { "CreatePacket", METHOD_REG_NONE }, + { "SendMail", METHOD_REG_NONE }, + { "AddTaxiPath", METHOD_REG_NONE }, #endif { "AddVendorItem", &LuaGlobalFunctions::AddVendorItem }, { "VendorRemoveItem", &LuaGlobalFunctions::VendorRemoveItem }, @@ -3233,13 +3236,6 @@ namespace LuaGlobalFunctions { "Kick", &LuaGlobalFunctions::Kick }, { "Ban", &LuaGlobalFunctions::Ban }, { "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers }, -#if ELUNA_EXPANSION < EXP_RETAIL - { "SendMail", &LuaGlobalFunctions::SendMail }, - { "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath }, -#else - { "SendMail", METHOD_REG_NONE }, - { "AddTaxiPath", METHOD_REG_NONE }, -#endif { "CreateInt64", &LuaGlobalFunctions::CreateLongLong }, { "CreateUint64", &LuaGlobalFunctions::CreateULongLong }, { "StartGameEvent", &LuaGlobalFunctions::StartGameEvent }, diff --git a/methods/TrinityCore/GuildMethods.h b/methods/TrinityCore/GuildMethods.h index 71694fb85d..36385872e6 100644 --- a/methods/TrinityCore/GuildMethods.h +++ b/methods/TrinityCore/GuildMethods.h @@ -128,7 +128,7 @@ namespace LuaGuild return 1; } -#if ELUNA_EXPANSION < CATA +#if ELUNA_EXPANSION < EXP_CATA /** * Sets the leader of this [Guild] * @@ -293,7 +293,7 @@ namespace LuaGuild #if ELUNA_EXPANSION < CATA { "SetLeader", &LuaGuild::SetLeader, METHOD_REG_WORLD }, // World state method only in multistate #else - { "SetLeader", METHOD_REG_NONE }, // World state method only in multistate + { "SetLeader", METHOD_REG_NONE }, #endif // Other diff --git a/methods/TrinityCore/ItemMethods.h b/methods/TrinityCore/ItemMethods.h index 232f5ab7b9..7aaa5e09b7 100644 --- a/methods/TrinityCore/ItemMethods.h +++ b/methods/TrinityCore/ItemMethods.h @@ -426,7 +426,7 @@ namespace LuaItem */ int GetClass(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetClass()); #else E->Push(item->GetTemplate()->Class); @@ -441,7 +441,7 @@ namespace LuaItem */ int GetSubClass(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetSubClass()); #else E->Push(item->GetTemplate()->SubClass); @@ -471,7 +471,7 @@ namespace LuaItem */ int GetName(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetDefaultLocaleName()); #else E->Push(item->GetTemplate()->Name1); @@ -499,7 +499,7 @@ namespace LuaItem */ int GetQuality(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetQuality()); #else E->Push(item->GetTemplate()->Quality); @@ -549,7 +549,7 @@ namespace LuaItem */ int GetBuyCount(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetBuyCount()); #else E->Push(item->GetTemplate()->BuyCount); @@ -564,7 +564,7 @@ namespace LuaItem */ int GetBuyPrice(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetBuyPrice()); #else E->Push(item->GetTemplate()->BuyPrice); @@ -579,7 +579,7 @@ namespace LuaItem */ int GetSellPrice(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetSellPrice()); #else E->Push(item->GetTemplate()->SellPrice); @@ -594,7 +594,7 @@ namespace LuaItem */ int GetInventoryType(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetInventoryType()); #else E->Push(item->GetTemplate()->InventoryType); @@ -609,7 +609,7 @@ namespace LuaItem */ int GetAllowableClass(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetAllowableClass()); #else E->Push(item->GetTemplate()->AllowableClass); @@ -637,7 +637,7 @@ namespace LuaItem */ int GetItemLevel(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetBaseItemLevel()); #else E->Push(item->GetTemplate()->ItemLevel); @@ -704,7 +704,7 @@ namespace LuaItem */ int GetItemSet(Eluna* E, Item* item) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(item->GetTemplate()->GetItemSet()); #else E->Push(item->GetTemplate()->ItemSet); diff --git a/methods/TrinityCore/PlayerMethods.h b/methods/TrinityCore/PlayerMethods.h index a8040652e7..3161b0ebc5 100644 --- a/methods/TrinityCore/PlayerMethods.h +++ b/methods/TrinityCore/PlayerMethods.h @@ -1992,7 +1992,7 @@ namespace LuaPlayer return 0; } -#if ELUNA_EXPANSION < CATA +#if ELUNA_EXPANSION < EXP_CATA /** * Sets the [Player]s Arena Points to the amount specified * @@ -2123,7 +2123,7 @@ namespace LuaPlayer * * @param int32 movementType */ -#if ELUNA_EXPANSION < CATA +#if ELUNA_EXPANSION < EXP_CATA int SetMovement(Eluna* E, Player* player) { int32 pType = E->CHECKVAL(2); @@ -2182,7 +2182,7 @@ namespace LuaPlayer return 0; } -#if ELUNA_EXPANSION < CATA +#if ELUNA_EXPANSION < EXP_CATA /** * Adds or detracts from the [Player]s current Arena Points * @@ -2363,7 +2363,7 @@ namespace LuaPlayer { Creature* obj = E->CHECKOBJ(2); -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA player->GetSession()->SendTrainerList(obj, NULL); #else player->GetSession()->SendTrainerList(obj); @@ -2614,7 +2614,7 @@ namespace LuaPlayer */ int ResetTalentsCost(Eluna* E, Player* player) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(player->GetNextResetTalentsCost()); #else E->Push(player->ResetTalentsCost()); @@ -3719,7 +3719,7 @@ namespace LuaPlayer if (!quest) return 0; -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept, true); #else player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept); @@ -4362,10 +4362,13 @@ namespace LuaPlayer { "GetHonorStoredKills", METHOD_REG_NONE }, // classic only { "GetRankPoints", METHOD_REG_NONE }, // classic only { "GetHonorLastWeekStandingPos", METHOD_REG_NONE }, // classic only + { "SetHonorStoredKills", METHOD_REG_NONE }, // classic only { "SetRankPoints", METHOD_REG_NONE }, // classic only { "SetHonorLastWeekStandingPos", METHOD_REG_NONE }, // classic only + { "CanFlyInZone", METHOD_REG_NONE }, // not implemented + { "UpdateHonor", METHOD_REG_NONE }, // classic only { "ResetHonor", METHOD_REG_NONE }, // classic only { "ClearHonorInfo", METHOD_REG_NONE }, // classic only diff --git a/methods/TrinityCore/QuestMethods.h b/methods/TrinityCore/QuestMethods.h index 966d7b5ff6..3227f5b27f 100644 --- a/methods/TrinityCore/QuestMethods.h +++ b/methods/TrinityCore/QuestMethods.h @@ -165,7 +165,7 @@ namespace LuaQuest */ int GetType(Eluna* E, Quest* quest) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA E->Push(quest->GetQuestType()); #else E->Push(quest->GetType()); diff --git a/methods/TrinityCore/VehicleMethods.h b/methods/TrinityCore/VehicleMethods.h index d06a41403e..910e085c8b 100644 --- a/methods/TrinityCore/VehicleMethods.h +++ b/methods/TrinityCore/VehicleMethods.h @@ -61,7 +61,7 @@ namespace LuaVehicle return 1; } -#if ELUNA_EXPANSION < CATA +#if ELUNA_EXPANSION < EXP_CATA /** * Adds [Unit] passenger to a specified seat in the [Vehicle] * @@ -102,7 +102,7 @@ namespace LuaVehicle { "IsOnBoard", &LuaVehicle::IsOnBoard }, // Other -#if ELUNA_EXPANSION < CATA +#if ELUNA_EXPANSION < EXP_CATA { "AddPassenger", &LuaVehicle::AddPassenger }, #else { "AddPassenger", METHOD_REG_NONE }, diff --git a/methods/TrinityCore/WorldObjectMethods.h b/methods/TrinityCore/WorldObjectMethods.h index 671194b648..2fb5145181 100644 --- a/methods/TrinityCore/WorldObjectMethods.h +++ b/methods/TrinityCore/WorldObjectMethods.h @@ -43,7 +43,7 @@ namespace LuaWorldObject */ int GetPhaseMask(Eluna* E, WorldObject* obj) { -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA EventMap event; E->Push(event.GetPhaseMask()); #else @@ -62,7 +62,7 @@ namespace LuaWorldObject { uint32 phaseMask = E->CHECKVAL(2); -#if ELUNA_EXPANSION >= CATA +#if ELUNA_EXPANSION >= EXP_CATA EventMap event; event.SetPhase(phaseMask); #else @@ -1050,7 +1050,7 @@ namespace LuaWorldObject #if ELUNA_EXPANSION == EXP_RETAIL if (!sSoundKitStore.LookupEntry(musicid)) #else - if (!sSoundEntriesStore.LookupEntry(musicid)) + if (!sSoundEntriesStore.LookupEntry(musicid)) #endif musicid = 0; WorldPackets::Misc::PlayMusic playMusic(musicid);