mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Remove corpse methods (report if needing them) and made changes to objectaccessor required by TC
See 402a3c45ff for more
This commit is contained in:
@@ -91,7 +91,7 @@ typedef Opcodes OpcodesList;
|
||||
#define eObjectMgr (sObjectMgr)
|
||||
#define eAccountMgr (sAccountMgr)
|
||||
#define eAuctionMgr (sAuctionMgr)
|
||||
#define eObjectAccessor (sObjectAccessor)
|
||||
#define eObjectAccessor() ObjectAccessor::
|
||||
#define REGEN_TIME_FULL
|
||||
typedef ThreatContainer::StorageType ThreatList;
|
||||
|
||||
@@ -108,7 +108,7 @@ typedef ThreatContainer::StorageType ThreatList;
|
||||
#define eObjectMgr (&sObjectMgr)
|
||||
#define eAccountMgr (&sAccountMgr)
|
||||
#define eAuctionMgr (&sAuctionMgr)
|
||||
#define eObjectAccessor (&sObjectAccessor)
|
||||
#define eObjectAccessor() sObjectAccessor.
|
||||
#define SERVER_MSG_STRING SERVER_MSG_CUSTOM
|
||||
#define TOTAL_LOCALES MAX_LOCALE
|
||||
#define DIALOG_STATUS_SCRIPTED_NO_STATUS DIALOG_STATUS_UNDEFINED
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace LuaGlobalFunctions
|
||||
int GetPlayerByGUID(Eluna* /*E*/, lua_State* L)
|
||||
{
|
||||
uint64 guid = Eluna::CHECKVAL<uint64>(L, 1);
|
||||
Eluna::Push(L, eObjectAccessor->FindPlayer(ObjectGuid(guid)));
|
||||
Eluna::Push(L, eObjectAccessor()FindPlayer(ObjectGuid(guid)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace LuaGlobalFunctions
|
||||
int GetPlayerByName(Eluna* /*E*/, lua_State* L)
|
||||
{
|
||||
const char* name = Eluna::CHECKVAL<const char*>(L, 1);
|
||||
Eluna::Push(L, eObjectAccessor->FindPlayerByName(name));
|
||||
Eluna::Push(L, eObjectAccessor()FindPlayerByName(name));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace LuaGlobalFunctions
|
||||
#else
|
||||
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
|
||||
#endif
|
||||
const HashMapHolder<Player>::MapType& m = eObjectAccessor->GetPlayers();
|
||||
const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it)
|
||||
{
|
||||
if (Player* player = it->second)
|
||||
@@ -1900,7 +1900,7 @@ namespace LuaGlobalFunctions
|
||||
*/
|
||||
int SaveAllPlayers(Eluna* /*E*/, lua_State* /*L*/)
|
||||
{
|
||||
eObjectAccessor->SaveAllPlayers();
|
||||
eObjectAccessor()SaveAllPlayers();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2242,57 +2242,6 @@ namespace LuaGlobalFunctions
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a [Corpse] to the world.
|
||||
*
|
||||
* @param [Corpse] corpse : [Corpse] to add
|
||||
*/
|
||||
int AddCorpse(Eluna* /*E*/, lua_State* L)
|
||||
{
|
||||
Corpse* corpse = Eluna::CHECKOBJ<Corpse>(L, 1);
|
||||
|
||||
eObjectAccessor->AddCorpse(corpse);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a [Corpse] from the world.
|
||||
*
|
||||
* @param [Corpse] corpse : [Corpse] to remove
|
||||
*/
|
||||
int RemoveCorpse(Eluna* /*E*/, lua_State* L)
|
||||
{
|
||||
Corpse* corpse = Eluna::CHECKOBJ<Corpse>(L, 1);
|
||||
eObjectAccessor->RemoveCorpse(corpse);
|
||||
Eluna::CHECKOBJ<ElunaObject>(L, 1)->Invalidate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a [Corpse] by GUID, and optionally allows for insignia to be looted.
|
||||
*
|
||||
* @param uint64 playerGUID : GUID of the [Player]
|
||||
* @param bool insignia = false : if `true`, allow an insignia to be looted
|
||||
* @return [Corpse] corpse : returns converted [Corpse]
|
||||
*/
|
||||
int ConvertCorpseForPlayer(Eluna* /*E*/, lua_State* L)
|
||||
{
|
||||
uint64 guid = Eluna::CHECKVAL<uint64>(L, 1);
|
||||
bool insignia = Eluna::CHECKVAL<bool>(L, 2, false);
|
||||
|
||||
Eluna::Push(L, eObjectAccessor->ConvertCorpseForPlayer(ObjectGuid(guid), insignia));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes old [Corpse]s from the world.
|
||||
*/
|
||||
int RemoveOldCorpses(Eluna* /*E*/, lua_State* /*L*/)
|
||||
{
|
||||
eObjectAccessor->RemoveOldCorpses();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `true` if the bag and slot is a valid inventory position, otherwise `false`.
|
||||
*
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace LuaGuild
|
||||
#else
|
||||
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
|
||||
#endif
|
||||
const HashMapHolder<Player>::MapType& m = eObjectAccessor->GetPlayers();
|
||||
const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it)
|
||||
{
|
||||
if (Player* player = it->second)
|
||||
@@ -68,9 +68,9 @@ namespace LuaGuild
|
||||
int GetLeader(Eluna* /*E*/, lua_State* L, Guild* guild)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, eObjectAccessor->FindPlayer(guild->GetLeaderGuid()));
|
||||
Eluna::Push(L, eObjectAccessor()FindPlayer(guild->GetLeaderGuid()));
|
||||
#else
|
||||
Eluna::Push(L, eObjectAccessor->FindPlayer(guild->GetLeaderGUID()));
|
||||
Eluna::Push(L, eObjectAccessor()FindPlayer(guild->GetLeaderGUID()));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -138,10 +138,6 @@ ElunaGlobal::ElunaRegister GlobalMethods[] =
|
||||
{ "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers },
|
||||
{ "SendMail", &LuaGlobalFunctions::SendMail },
|
||||
{ "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath },
|
||||
{ "AddCorpse", &LuaGlobalFunctions::AddCorpse },
|
||||
{ "RemoveCorpse", &LuaGlobalFunctions::RemoveCorpse },
|
||||
{ "ConvertCorpseForPlayer", &LuaGlobalFunctions::ConvertCorpseForPlayer },
|
||||
{ "RemoveOldCorpses", &LuaGlobalFunctions::RemoveOldCorpses },
|
||||
{ "CreateInt64", &LuaGlobalFunctions::CreateLongLong },
|
||||
{ "CreateUint64", &LuaGlobalFunctions::CreateULongLong },
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace LuaMap
|
||||
switch (GUID_HIPART(guid))
|
||||
{
|
||||
case HIGHGUID_PLAYER:
|
||||
Eluna::Push(L, sObjectAccessor->GetPlayer(map, ObjectGuid(guid)));
|
||||
Eluna::Push(L, eObjectAccessor()GetPlayer(map, ObjectGuid(guid)));
|
||||
break;
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
|
||||
@@ -107,7 +107,7 @@ void Eluna::OnChange(Weather* weather, uint32 zone, WeatherState state, float gr
|
||||
// Auction House
|
||||
void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
{
|
||||
Player* owner = eObjectAccessor->FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
#ifdef TRINITY
|
||||
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
|
||||
uint32 expiretime = entry->expire_time;
|
||||
@@ -134,7 +134,7 @@ void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
|
||||
void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
{
|
||||
Player* owner = eObjectAccessor->FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
#ifdef TRINITY
|
||||
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
|
||||
uint32 expiretime = entry->expire_time;
|
||||
@@ -161,7 +161,7 @@ void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
|
||||
void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
{
|
||||
Player* owner = eObjectAccessor->FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
#ifdef TRINITY
|
||||
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
|
||||
uint32 expiretime = entry->expire_time;
|
||||
@@ -188,7 +188,7 @@ void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
|
||||
void Eluna::OnExpire(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
|
||||
{
|
||||
Player* owner = eObjectAccessor->FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
|
||||
#ifdef TRINITY
|
||||
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
|
||||
uint32 expiretime = entry->expire_time;
|
||||
|
||||
Reference in New Issue
Block a user