Core/Instances: Make achievements and loot rolls instance-wide

Make achievements, loot rolls, master loot at money loot instance-wide, removing the previous limit for 74.f yards
This commit is contained in:
jackpoz committed 2015-06-24 22:40:57 +02:00
1 parent 0cba5558cf
commit cb4d1574e0
3 files changed
+13 -10

No files matched your search

@@ -23657,6 +23657,9 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
if (player->GetMapId() != pRewardSource->GetMapId() || player->GetInstanceId() != pRewardSource->GetInstanceId())
return false;
if (player->GetMap()->IsDungeon())
return true;
return pRewardSource->GetDistance(player) <= sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE);
}
+9 -9
View File
@@ -936,7 +936,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->IsAtGroupRewardDistance(pLootedObject))
{
r->totalPlayersRolling++;
@@ -1021,7 +1021,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
if (i->AllowedForPlayer(member))
{
if (member->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (member->IsAtGroupRewardDistance(pLootedObject))
{
r->totalPlayersRolling++;
r->playerVote[member->GetGUID()] = NOT_EMITED_YET;
@@ -1080,7 +1080,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
continue;
bool allowedForPlayer = i->AllowedForPlayer(playerToRoll);
if (allowedForPlayer && playerToRoll->IsWithinDistInMap(lootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (allowedForPlayer && playerToRoll->IsAtGroupRewardDistance(lootedObject))
{
r->totalPlayersRolling++;
if (playerToRoll->GetPassOnGroupLoot())
@@ -1155,7 +1155,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
continue;
bool allowedForPlayer = i->AllowedForPlayer(playerToRoll);
if (allowedForPlayer && playerToRoll->IsWithinDistInMap(lootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (allowedForPlayer && playerToRoll->IsAtGroupRewardDistance(lootedObject))
{
r->totalPlayersRolling++;
r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET;
@@ -1231,7 +1231,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
if (!looter->IsInWorld())
continue;
if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (looter->IsAtGroupRewardDistance(pLootedObject))
{
data << uint64(looter->GetGUID());
++real_count;
@@ -1243,7 +1243,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
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->IsAtGroupRewardDistance(pLootedObject))
looter->GetSession()->SendPacket(&data);
}
}
@@ -1743,7 +1743,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->IsAtGroupRewardDistance(pLootedObject))
return;
}
++guid_itr;
@@ -1754,7 +1754,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->guid))
if (player->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (player->IsAtGroupRewardDistance(pLootedObject))
{
pNewLooter = player;
break;
@@ -1767,7 +1767,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->guid))
if (player->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (player->IsAtGroupRewardDistance(pLootedObject))
{
pNewLooter = player;
break;
+1 -1
View File
@@ -176,7 +176,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
if (!member)
continue;
if (player->IsWithinDistInMap(member, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
if (player->IsAtGroupRewardDistance(member))
playersNear.push_back(member);
}