Implemented ObjectGuid support for AzerothCore.

This commit is contained in:
UltraNix
2021-04-21 19:55:37 +02:00
parent ca5f1bb59d
commit c4383324fb
19 changed files with 206 additions and 181 deletions

View File

@@ -140,19 +140,23 @@ void Eluna::OnChange(Weather* /*weather*/, uint32 zone, WeatherState state, floa
// Auction House
void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
{
#ifdef AZEROTHCORE
Player* owner = eObjectAccessor()FindPlayer(entry->owner);
#else
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
#endif
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
Item* item = eAuctionMgr->GetAItem(entry->item_guid);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
uint32 expiretime = entry->expireTime;
#endif
if (!owner || !item)
return;
@@ -170,12 +174,17 @@ void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
{
#ifdef AZEROTHCORE
Player* owner = eObjectAccessor()FindPlayer(entry->owner);
#else
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
#endif
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
Item* item = eAuctionMgr->GetAItem(entry->item_guid);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
@@ -200,12 +209,17 @@ void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
{
#ifdef AZEROTHCORE
Player* owner = eObjectAccessor()FindPlayer(entry->owner);
#else
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
#endif
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
Item* item = eAuctionMgr->GetAItem(entry->item_guid);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
@@ -230,12 +244,17 @@ void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
void Eluna::OnExpire(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
{
#ifdef AZEROTHCORE
Player* owner = eObjectAccessor()FindPlayer(entry->owner);
#else
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
#endif
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
Item* item = eAuctionMgr->GetAItem(entry->item_guid);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);