diff options
author | Shocker <shocker@freakz.ro> | 2011-04-29 22:24:26 +0300 |
---|---|---|
committer | Shocker <shocker@freakz.ro> | 2011-04-29 22:24:26 +0300 |
commit | 0fb8f057974cdf3107084be65005956efb5191dc (patch) | |
tree | 8fe211ecee643625c01ec3970038e345ec44c5f0 /src/server/game/Groups/Group.cpp | |
parent | f96e1ce1d7b10074750da761ff9b219a24d0f09f (diff) | |
parent | 1b1d7507f1c3ea768f3fdaf4e1729b66fe590a68 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rwxr-xr-x | src/server/game/Groups/Group.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 098f2c19c17..0eb65395e91 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -123,8 +123,8 @@ bool Group::Create(Player *leader) sObjectMgr->RegisterGroupStorageId(m_storageId, this); // store group in database - CharacterDatabase.PExecute("INSERT INTO groups (guid,leaderGuid,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) " - "VALUES ('%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')", + CharacterDatabase.PExecute("INSERT INTO groups (guid, leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty) " + "VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '%u', '%u', '%u')", m_storageId, GUID_LOPART(m_leaderGuid), uint32(m_lootMethod), GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], uint8(m_groupType), uint32(m_dungeonDifficulty), m_raidDifficulty); @@ -355,8 +355,8 @@ bool Group::AddMember(Player *player) { // reset the new member's instances, unless he is currently in one of them // including raid/heroic instances that they are not permanently bound to! - player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,false); - player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,true); + player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, false); + player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, true); if (player->getLevel() >= LEVELREQUIREMENT_HEROIC) { @@ -756,8 +756,8 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); - Roll* r = new Roll(newitemGUID,*i); + 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 for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -767,7 +767,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) continue; if (i->AllowedForPlayer(member)) { - if (member->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (member->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { r->totalPlayersRolling++; @@ -844,8 +844,8 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); - Roll* r=new Roll(newitemGUID,*i); + 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()) { @@ -856,7 +856,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) bool allowedForPlayer = i->AllowedForPlayer(playerToRoll); if (playerToRoll->CanUseItem(item) == EQUIP_ERR_OK && allowedForPlayer) { - if (playerToRoll->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (playerToRoll->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { r->totalPlayersRolling++; @@ -931,19 +931,19 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) if (!looter->IsInWorld()) continue; - if (looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { data << uint64(looter->GetGUID()); ++real_count; } } - data.put<uint8>(0,real_count); + data.put<uint8>(0, real_count); for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player *looter = itr->getSource(); - if (looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) looter->GetSession()->SendPacket(&data); } } @@ -1401,7 +1401,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) { // not update if only update if need and ok Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid); - if (looter && looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter && looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) return; } ++guid_itr; @@ -1412,7 +1412,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr) { if (Player* pl = ObjectAccessor::FindPlayer(itr->guid)) - if (pl->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (pl->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { pNewLooter = pl; break; @@ -1425,7 +1425,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr) { if (Player* pl = ObjectAccessor::FindPlayer(itr->guid)) - if (pl->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (pl->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { pNewLooter = pl; break; @@ -1470,7 +1470,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (!reference) return ERR_BATTLEGROUND_JOIN_FAILED; - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(),reference->getLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->getLevel()); if (!bracketEntry) return ERR_BATTLEGROUND_JOIN_FAILED; @@ -1491,7 +1491,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId,member->getLevel()); + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->getLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match @@ -1663,7 +1663,7 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap) Difficulty difficulty = GetDifficulty(aMap->IsRaid()); // some instances only have one difficulty - GetDownscaledMapDifficultyData(aMap->GetId(),difficulty); + GetDownscaledMapDifficultyData(aMap->GetId(), difficulty); BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId()); if (itr != m_boundInstances[difficulty].end()) @@ -1680,7 +1680,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); // some instances only have one difficulty - GetDownscaledMapDifficultyData(mapEntry->MapID,difficulty); + GetDownscaledMapDifficultyData(mapEntry->MapID, difficulty); BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID); if (itr != m_boundInstances[difficulty].end()) @@ -1872,12 +1872,12 @@ bool Group::IsAssistant(uint64 guid) const return mslot->flags & MEMBER_FLAG_ASSISTANT; } -bool Group::SameSubGroup(uint64 guid1,const uint64& guid2) const +bool Group::SameSubGroup(uint64 guid1, const uint64& guid2) const { member_citerator mslot2 = _getMemberCSlot(guid2); if (mslot2 == m_memberSlots.end()) return false; - return SameSubGroup(guid1,&*mslot2); + return SameSubGroup(guid1, &*mslot2); } bool Group::SameSubGroup(uint64 guid1, MemberSlot const* slot2) const |