Updated to latest changes from core

This commit is contained in:
2024-08-22 19:09:14 -04:00
parent 382ba03e4f
commit a0096036ac
5 changed files with 31 additions and 29 deletions

View File

@@ -16,8 +16,9 @@
*/
#include "Chat.h"
#include "ElunaInstanceAI.h"
#include "ElunaEventMgr.h"
#include "Log.h"
#include "Logging/Log.h"
#include "LuaEngine.h"
#include "Pet.h"
#include "Player.h"
@@ -237,10 +238,10 @@ class Eluna_AllMapScript : public AllMapScript
public:
Eluna_AllMapScript() : AllMapScript("Eluna_AllMapScript") { }
void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override
void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript** instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override
{
if (instanceData)
*instanceData = sEluna->GetInstanceData(instanceMap);
*instanceData = static_cast<InstanceScript*>(sEluna->GetInstanceData(instanceMap));
}
void OnDestroyInstance(MapInstanced* /*mapInstanced*/, Map* map) override

View File

@@ -58,7 +58,7 @@ if( ${CMAKE_PROJECT_NAME} STREQUAL "MaNGOS" )
${CMAKE_SOURCE_DIR}/src/game/WorldHandlers
${CMAKE_SOURCE_DIR}/src/game/Object
)
if( WIN32 )
if ( MSVC )
add_custom_command(TARGET LuaEngine
@@ -74,7 +74,7 @@ if( ${CMAKE_PROJECT_NAME} STREQUAL "MaNGOS" )
)
endif()
endif()
install(DIRECTORY extensions DESTINATION "${BIN_DIR}/lua_scripts/")
endif()

View File

@@ -22,7 +22,7 @@
#endif
#else
#include "Database/QueryResult.h"
#include "Log.h"
#include "Logging/Log.h"
#endif
#if defined(TRINITY) || defined(AZEROTHCORE)

View File

@@ -135,7 +135,7 @@ void Eluna::_ReloadEluna()
ASSERT(IsInitialized());
if (eConfigMgr->GetOption<bool>("Eluna.PlayerAnnounceReload", false))
eWorld->SendServerMessage(SERVER_MSG_STRING, "Reloading Eluna...");
ChatHandler(nullptr).SendSysMessage("Reloading Eluna...");
else
ChatHandler(nullptr).SendGMText(SERVER_MSG_STRING, "Reloading Eluna...");

View File

@@ -176,7 +176,7 @@ namespace LuaPlayer
return 1;
}
#endif
/**
* Returns `true` if the [Player] has the given amount of item entry specified, `false` otherwise.
*
@@ -193,7 +193,7 @@ namespace LuaPlayer
Eluna::Push(L, player->HasItemCount(itemId, count, check_bank));
return 1;
}
/**
* Returns `true` if the [Player] has a quest for the item entry specified, `false` otherwise.
*
@@ -207,7 +207,7 @@ namespace LuaPlayer
Eluna::Push(L, player->HasQuestForItem(entry));
return 1;
}
/**
* Returns `true` if the [Player] can use the item or item entry specified, `false` otherwise.
*
@@ -417,7 +417,7 @@ namespace LuaPlayer
Eluna::Push(L, player->HasTankSpec());
return 1;
}
/**
* Returns `true` if the [Player] has a Melee Specialization, `false` otherwise.
*
@@ -428,7 +428,7 @@ namespace LuaPlayer
Eluna::Push(L, player->HasMeleeSpec());
return 1;
}
/**
* Returns `true` if the [Player] has a Caster Specialization, `false` otherwise.
*
@@ -439,7 +439,7 @@ namespace LuaPlayer
Eluna::Push(L, player->HasCasterSpec());
return 1;
}
/**
* Returns `true` if the [Player] has a Heal Specialization, `false` otherwise.
*
@@ -942,8 +942,8 @@ namespace LuaPlayer
{
AchievementEntry const* achievement = sAchievementStore.LookupEntry(pair.first);
if (achievement && (achievement->categoryId != 81 || countFeatsOfStrength))
{
count++;
{
count++;
}
}
@@ -1596,7 +1596,7 @@ namespace LuaPlayer
Eluna::Push(L, player->GetItemByEntry(entry));
return 1;
}
/**
* Returns the database textID of the [WorldObject]'s gossip header text for the [Player]
*
@@ -1668,7 +1668,7 @@ namespace LuaPlayer
Eluna::Push(L, player->GetTeamId());
return 1;
}
/**
* Returns amount of the specified [Item] the [Player] has.
*
@@ -1847,7 +1847,7 @@ namespace LuaPlayer
Eluna::Push(L, ChatHandler(player->GetSession()).GetNearbyGameObject());
return 1;
}*/
/**
* Locks the player controls and disallows all movement and casting.
*
@@ -2345,7 +2345,7 @@ namespace LuaPlayer
return 0;
}
#endif
/**
* Shows the mailbox window to the player from specified guid.
*
@@ -2550,7 +2550,7 @@ namespace LuaPlayer
player->GetSession()->SendShowBank(obj->GET_GUID());
return 0;
}
/**
* Sends a vendor window to the [Player] from the [WorldObject] specified.
*
@@ -3458,7 +3458,7 @@ namespace LuaPlayer
player->AutoUnequipOffhandIfNeed();
return 1;
}
/**
* Returns true if the player can equip the given [Item] or item entry to the given slot, false otherwise.
*
@@ -3631,7 +3631,7 @@ namespace LuaPlayer
player->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, currentKills + val);
return 0;
}
/**
* Adds the given amount of the specified item entry to the player.
*
@@ -3666,7 +3666,7 @@ namespace LuaPlayer
#endif
return 1;
}
/**
* Removes the given amount of the specified [Item] from the player.
*
@@ -3804,7 +3804,8 @@ namespace LuaPlayer
{
std::string msg = Eluna::CHECKVAL<std::string>(L, 2);
if (msg.length() > 0)
ChatHandler(player->GetSession()).SendNotification("{}", msg);
player->GetSession()->SendNotification("%s", msg.c_str());
// ChatHandler(player->GetSession()).SendNotification("{}", msg); --
return 0;
}
@@ -4015,9 +4016,9 @@ namespace LuaPlayer
/**
* Adds a new item to the gossip menu shown to the [Player] on next call to [Player:GossipSendMenu].
*
* sender and intid are numbers which are passed directly to the gossip selection handler. Internally they are partly used for the database gossip handling.
* code specifies whether to show a box to insert text to. The player inserted text is passed to the gossip selection handler.
* money specifies an amount of money the player needs to have to click the option. An error message is shown if the player doesn't have enough money.
* sender and intid are numbers which are passed directly to the gossip selection handler. Internally they are partly used for the database gossip handling.
* code specifies whether to show a box to insert text to. The player inserted text is passed to the gossip selection handler.
* money specifies an amount of money the player needs to have to click the option. An error message is shown if the player doesn't have enough money.
* Note that the money amount is only checked client side and is not removed from the player either. You will need to check again in your code before taking action.
*
* See also: [Player:GossipSendMenu], [Player:GossipAddQuests], [Player:GossipComplete], [Player:GossipClearMenu]
@@ -4105,7 +4106,7 @@ namespace LuaPlayer
* Clears the [Player]s current gossip item list.
*
* See also: [Player:GossipMenuAddItem], [Player:GossipSendMenu], [Player:GossipAddQuests], [Player:GossipComplete]
*
*
* Note: This is needed when you show a gossip menu without using gossip hello or select hooks which do this automatically.
* Usually this is needed when using [Player] is the sender of a Gossip Menu.
*/