Map local guids 6.x -> 4.3.4

Ported the following commits:
ca83e14f8b
ee1c1b97be
18e4ab6911
bf37446b3c
cb854a2b7b
This commit is contained in:
ariel-
2016-01-10 19:19:19 -03:00
parent 694c89d76d
commit b3ea9fbbe5
163 changed files with 2448 additions and 2328 deletions

View File

@@ -93,7 +93,7 @@ bool Group::Create(Player* leader)
ObjectGuid leaderGuid = leader->GetGUID();
uint32 lowguid = sGroupMgr->GenerateGroupId();
m_guid = ObjectGuid(HIGHGUID_GROUP, lowguid);
m_guid = ObjectGuid(HighGuid::Group, lowguid);
m_leaderGuid = leaderGuid;
m_leaderName = leader->GetName();
leader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
@@ -162,15 +162,15 @@ bool Group::Create(Player* leader)
void Group::LoadGroupFromDB(Field* fields)
{
m_dbStoreId = fields[16].GetUInt32();
m_guid = ObjectGuid(HIGHGUID_GROUP, sGroupMgr->GenerateGroupId());
m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32());
m_guid = ObjectGuid(HighGuid::Group, sGroupMgr->GenerateGroupId());
m_leaderGuid = ObjectGuid(HighGuid::Player, fields[0].GetUInt32());
// group leader not exist
if (!sObjectMgr->GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
return;
m_lootMethod = LootMethod(fields[1].GetUInt8());
m_looterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt32());
m_looterGuid = ObjectGuid(HighGuid::Player, fields[2].GetUInt32());
m_lootThreshold = ItemQualities(fields[3].GetUInt8());
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
@@ -192,7 +192,7 @@ void Group::LoadGroupFromDB(Field* fields)
else
m_raidDifficulty = Difficulty(r_diff);
m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[15].GetUInt32());
m_masterLooterGuid = ObjectGuid(HighGuid::Player, fields[15].GetUInt32());
if (m_groupType & GROUPTYPE_LFG)
sLFGMgr->_LoadFromDB(fields, GetGUID());
@@ -201,7 +201,7 @@ void Group::LoadGroupFromDB(Field* fields)
void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles)
{
MemberSlot member;
member.guid = ObjectGuid(HIGHGUID_PLAYER, guidLow);
member.guid = ObjectGuid(HighGuid::Player, guidLow);
// skip non-existed member
if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name))
@@ -690,7 +690,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid)
// Update the group leader
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEADER);
stmt->setUInt32(0, newLeader->GetGUIDLow());
stmt->setUInt32(0, newLeader->GetGUID().GetCounter());
stmt->setUInt32(1, m_dbStoreId);
trans->Append(stmt);
@@ -958,7 +958,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
//roll for over-threshold item if it's one-player loot
if (item->Quality >= uint32(m_lootThreshold))
{
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM));
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>().Generate());
Roll* r = new Roll(newitemGUID, *i);
//a vector is filled with only near party members
@@ -1042,7 +1042,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
continue;
}
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM));
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>().Generate());
Roll* r = new Roll(newitemGUID, *i);
//a vector is filled with only near party members
@@ -1103,7 +1103,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
//roll for over-threshold item if it's one-player loot
if (item->Quality >= uint32(m_lootThreshold))
{
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM));
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>().Generate());
Roll* r = new Roll(newitemGUID, *i);
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
@@ -1178,7 +1178,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
continue;
item = sObjectMgr->GetItemTemplate(i->itemid);
ObjectGuid newitemGUID = ObjectGuid(HIGHGUID_ITEM, sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM));
ObjectGuid newitemGUID = ObjectGuid(HighGuid::Item, sObjectMgr->GetGenerator<HighGuid::Item>().Generate());
Roll* r = new Roll(newitemGUID, *i);
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())