mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 11:03:47 +00:00
fix(Core/Loot): (#7452)
- Players that did not participate in killing dungeon boss are not eligible to get loot. - Players that are too far away from the looted object are not eligible to get loot. - Players that released spirit and were outside the dungeon when the loot has been released are eligible to get loot. - Players that have pending bind are not eligible to get loot. - Properly get loot recipient for some chests in dungeons. - All above fixes should work in any loot mode (group loot, master loot, etc.) - Closes #2104.
This commit is contained in:
@@ -7560,7 +7560,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
if (groupRules)
|
||||
group->UpdateLooterGuid(go, true);
|
||||
|
||||
loot->FillLoot(lootid, LootTemplates_Gameobject, this, !groupRules, false, go->GetLootMode());
|
||||
loot->FillLoot(lootid, LootTemplates_Gameobject, this, !groupRules, false, go->GetLootMode(), go);
|
||||
go->SetLootGenerationTime();
|
||||
|
||||
// get next RR player (for next loot)
|
||||
@@ -11846,18 +11846,40 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
|
||||
|
||||
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
|
||||
{
|
||||
if (!pRewardSource || !IsInMap(pRewardSource))
|
||||
return false;
|
||||
const WorldObject* player = GetCorpse();
|
||||
WorldObject const* player = GetCorpse();
|
||||
if (!player || IsAlive())
|
||||
{
|
||||
player = this;
|
||||
}
|
||||
|
||||
if (!pRewardSource || !player->IsInMap(pRewardSource))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pRewardSource->GetMap()->IsDungeon())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return pRewardSource->GetDistance(player) <= sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE);
|
||||
}
|
||||
|
||||
bool Player::IsAtLootRewardDistance(WorldObject const* pRewardSource) const
|
||||
{
|
||||
if (!IsAtGroupRewardDistance(pRewardSource))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (HasPendingBind())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pRewardSource->HasAllowedLooter(GetGUID());
|
||||
}
|
||||
|
||||
bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
|
||||
{
|
||||
if (!pOther)
|
||||
|
||||
@@ -1996,6 +1996,7 @@ public:
|
||||
void InitDisplayIds();
|
||||
|
||||
bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const;
|
||||
bool IsAtLootRewardDistance(WorldObject const* pRewardSource) const;
|
||||
bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const;
|
||||
void RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround);
|
||||
void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource);
|
||||
|
||||
Reference in New Issue
Block a user