mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Merge remote branch 'origin/master' into 330
This commit is contained in:
commit
3def8fa353
134 changed files with 1751 additions and 2300 deletions
|
|
@ -99,7 +99,7 @@ bool Group::Create(const uint64 &guid, const char * name)
|
|||
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
if(!isBGGroup())
|
||||
{
|
||||
Player *leader = objmgr.GetPlayer(guid);
|
||||
Player *leader = sObjectMgr.GetPlayer(guid);
|
||||
if(leader)
|
||||
{
|
||||
m_dungeonDifficulty = leader->GetDungeonDifficulty();
|
||||
|
|
@ -145,7 +145,7 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
|
|||
m_leaderGuid = leaderGuid;
|
||||
|
||||
// group leader not exist
|
||||
if(!objmgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
|
||||
if(!sObjectMgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName))
|
||||
{
|
||||
if(!external) delete result;
|
||||
return false;
|
||||
|
|
@ -202,7 +202,7 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 subgroup, bool assistant)
|
|||
member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER);
|
||||
|
||||
// skip non-existed member
|
||||
if(!objmgr.GetPlayerNameByGUID(member.guid, member.name))
|
||||
if(!sObjectMgr.GetPlayerNameByGUID(member.guid, member.name))
|
||||
return false;
|
||||
|
||||
member.group = subgroup;
|
||||
|
|
@ -226,7 +226,7 @@ void Group::ConvertToRaid()
|
|||
|
||||
// update quest related GO states (quest activity dependent from raid membership)
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
if(Player* player = objmgr.GetPlayer(citr->guid))
|
||||
if(Player* player = sObjectMgr.GetPlayer(citr->guid))
|
||||
player->UpdateForQuestWorldObjects();
|
||||
}
|
||||
|
||||
|
|
@ -301,7 +301,7 @@ bool Group::AddMember(const uint64 &guid, const char* name)
|
|||
return false;
|
||||
SendUpdate();
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
if(player)
|
||||
{
|
||||
if(!IsLeader(player->GetGUID()) && !isBGGroup())
|
||||
|
|
@ -343,7 +343,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
|
|||
{
|
||||
bool leaderChanged = _removeMember(guid);
|
||||
|
||||
if(Player *player = objmgr.GetPlayer( guid ))
|
||||
if(Player *player = sObjectMgr.GetPlayer( guid ))
|
||||
{
|
||||
// quest related GO state dependent from raid membership
|
||||
if(isRaidGroup())
|
||||
|
|
@ -409,7 +409,7 @@ void Group::Disband(bool hideDestroy)
|
|||
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
player = objmgr.GetPlayer(citr->guid);
|
||||
player = sObjectMgr.GetPlayer(citr->guid);
|
||||
if(!player)
|
||||
continue;
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
|
|||
|
||||
for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
|
|
@ -515,7 +515,7 @@ void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uin
|
|||
|
||||
for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid,
|
|||
|
||||
for( Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
|
|
@ -558,7 +558,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
|
|||
|
||||
for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
Player *p = sObjectMgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
continue;
|
||||
|
||||
|
|
@ -572,12 +572,12 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
|
|||
std::vector<LootItem>::iterator i;
|
||||
ItemPrototype const *item;
|
||||
uint8 itemSlot = 0;
|
||||
Player *player = objmgr.GetPlayer(playerGUID);
|
||||
Player *player = sObjectMgr.GetPlayer(playerGUID);
|
||||
Group *group = player->GetGroup();
|
||||
|
||||
for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
|
||||
{
|
||||
item = objmgr.GetItemPrototype(i->itemid);
|
||||
item = ObjectMgr::GetItemPrototype(i->itemid);
|
||||
if (!item)
|
||||
{
|
||||
//sLog.outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
|
||||
|
|
@ -587,7 +587,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
|
|||
//roll for over-threshold item if it's one-player loot
|
||||
if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
|
||||
{
|
||||
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
|
||||
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
|
|
@ -625,18 +625,18 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
|
|||
void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature)
|
||||
{
|
||||
ItemPrototype const *item;
|
||||
Player *player = objmgr.GetPlayer(playerGUID);
|
||||
Player *player = sObjectMgr.GetPlayer(playerGUID);
|
||||
Group *group = player->GetGroup();
|
||||
|
||||
uint8 itemSlot = 0;
|
||||
for(std::vector<LootItem>::iterator i=loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
|
||||
{
|
||||
item = objmgr.GetItemPrototype(i->itemid);
|
||||
item = ObjectMgr::GetItemPrototype(i->itemid);
|
||||
|
||||
//only roll for one-player items, not for ones everyone can get
|
||||
if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
|
||||
{
|
||||
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
|
||||
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
|
|
@ -678,7 +678,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
|
|||
|
||||
void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creature)
|
||||
{
|
||||
Player *player = objmgr.GetPlayer(playerGUID);
|
||||
Player *player = sObjectMgr.GetPlayer(playerGUID);
|
||||
if(!player)
|
||||
return;
|
||||
|
||||
|
|
@ -809,7 +809,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
|||
}
|
||||
}
|
||||
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
|
||||
player = objmgr.GetPlayer(maxguid);
|
||||
player = sObjectMgr.GetPlayer(maxguid);
|
||||
|
||||
if(player && player->GetSession())
|
||||
{
|
||||
|
|
@ -856,7 +856,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
|||
}
|
||||
}
|
||||
SendLootRollWon(0, maxguid, maxresul, ROLL_GREED, *roll);
|
||||
player = objmgr.GetPlayer(maxguid);
|
||||
player = sObjectMgr.GetPlayer(maxguid);
|
||||
|
||||
if(player && player->GetSession())
|
||||
{
|
||||
|
|
@ -992,7 +992,7 @@ void Group::SendUpdate()
|
|||
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
player = objmgr.GetPlayer(citr->guid);
|
||||
player = sObjectMgr.GetPlayer(citr->guid);
|
||||
if(!player || !player->GetSession() || player->GetGroup() != this )
|
||||
continue;
|
||||
// guess size
|
||||
|
|
@ -1007,7 +1007,7 @@ void Group::SendUpdate()
|
|||
{
|
||||
if(citr->guid == citr2->guid)
|
||||
continue;
|
||||
Player* member = objmgr.GetPlayer(citr2->guid);
|
||||
Player* member = sObjectMgr.GetPlayer(citr2->guid);
|
||||
uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
|
||||
onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
|
||||
|
||||
|
|
@ -1079,7 +1079,7 @@ void Group::OfflineReadyCheck()
|
|||
{
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
Player *pl = objmgr.GetPlayer(citr->guid);
|
||||
Player *pl = sObjectMgr.GetPlayer(citr->guid);
|
||||
if (!pl || !pl->GetSession())
|
||||
{
|
||||
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
|
||||
|
|
@ -1121,7 +1121,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
|
|||
if(!guid)
|
||||
return false;
|
||||
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
MemberSlot member;
|
||||
member.guid = guid;
|
||||
|
|
@ -1167,7 +1167,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
|
|||
|
||||
bool Group::_removeMember(const uint64 &guid)
|
||||
{
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
if (player)
|
||||
{
|
||||
//if we are removing player from battleground raid
|
||||
|
|
@ -1228,7 +1228,7 @@ void Group::_setLeader(const uint64 &guid)
|
|||
")", GUID_LOPART(m_leaderGuid), GUID_LOPART(slot->guid)
|
||||
);
|
||||
|
||||
Player *player = objmgr.GetPlayer(slot->guid);
|
||||
Player *player = sObjectMgr.GetPlayer(slot->guid);
|
||||
if(player)
|
||||
{
|
||||
for(uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||
|
|
@ -1361,7 +1361,7 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
|
|||
{
|
||||
if(!isRaidGroup())
|
||||
return;
|
||||
Player *player = objmgr.GetPlayer(guid);
|
||||
Player *player = sObjectMgr.GetPlayer(guid);
|
||||
|
||||
if (!player)
|
||||
{
|
||||
|
|
@ -1606,7 +1606,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
|
|||
|
||||
bool isEmpty = true;
|
||||
// if the map is loaded, reset it
|
||||
Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId());
|
||||
Map *map = sMapMgr.FindMap(p->GetMapId(), p->GetInstanceId());
|
||||
if(map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset()))
|
||||
isEmpty = ((InstanceMap*)map)->Reset(method);
|
||||
|
||||
|
|
@ -1725,7 +1725,7 @@ void Group::_homebindIfInstance(Player *player)
|
|||
{
|
||||
// leaving the group in an instance, the homebind timer is started
|
||||
// unless the player is permanently saved to the instance
|
||||
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(player->GetInstanceId());
|
||||
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(player->GetInstanceId());
|
||||
InstancePlayerBind *playerBind = save ? player->GetBoundInstance(save->GetMapId(), save->GetDifficulty()) : NULL;
|
||||
if(!playerBind || !playerBind->perm)
|
||||
player->m_InstanceValid = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue