Scripts/ICC: Fix chest loot exploit
Fix an exploit at chest loot bosses Valithria and Deathbringer that allowed the first played to hit them to leave party at low hp % and loot the whole chest alone, without the party being able to loot anything.
This commit is contained in:
1 parent
e3cd43f433
commit
71d4d34d33
3 files changed
+10
-6
No files matched your search
@@ -2245,7 +2245,7 @@ Group* GameObject::GetLootRecipientGroup() const
|
||||
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
|
||||
}
|
||||
|
||||
void GameObject::SetLootRecipient(Unit* unit)
|
||||
void GameObject::SetLootRecipient(Unit* unit, Group* group)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
@@ -2254,7 +2254,7 @@ void GameObject::SetLootRecipient(Unit* unit)
|
||||
if (!unit)
|
||||
{
|
||||
m_lootRecipient.Clear();
|
||||
m_lootRecipientGroup = 0;
|
||||
m_lootRecipientGroup = group ? group->GetLowGUID() : 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2266,8 +2266,12 @@ void GameObject::SetLootRecipient(Unit* unit)
|
||||
return;
|
||||
|
||||
m_lootRecipient = player->GetGUID();
|
||||
if (Group* group = player->GetGroup())
|
||||
|
||||
// either get the group from the passed parameter or from unit's one
|
||||
if (group)
|
||||
m_lootRecipientGroup = group->GetLowGUID();
|
||||
else if (Group* unitGroup = player->GetGroup())
|
||||
m_lootRecipientGroup = unitGroup->GetLowGUID();
|
||||
}
|
||||
|
||||
bool GameObject::IsLootAllowedFor(Player const* player) const
|
||||
|
||||
@@ -814,7 +814,7 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
|
||||
|
||||
Player* GetLootRecipient() const;
|
||||
Group* GetLootRecipientGroup() const;
|
||||
void SetLootRecipient(Unit* unit);
|
||||
void SetLootRecipient(Unit* unit, Group* group = nullptr);
|
||||
bool IsLootAllowedFor(Player const* player) const;
|
||||
bool HasLootRecipient() const { return !m_lootRecipient.IsEmpty() || m_lootRecipientGroup; }
|
||||
uint32 m_groupLootTimer; // (msecs)timer used for group loot
|
||||
|
||||
@@ -636,7 +636,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case GO_CACHE_OF_THE_DREAMWALKER_10H:
|
||||
case GO_CACHE_OF_THE_DREAMWALKER_25H:
|
||||
if (Creature* valithria = instance->GetCreature(ValithriaDreamwalkerGUID))
|
||||
go->SetLootRecipient(valithria->GetLootRecipient());
|
||||
go->SetLootRecipient(valithria->GetLootRecipient(), valithria->GetLootRecipientGroup());
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN);
|
||||
break;
|
||||
case GO_ARTHAS_PLATFORM:
|
||||
@@ -865,7 +865,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
if (GameObject* loot = instance->GetGameObject(DeathbringersCacheGUID))
|
||||
{
|
||||
if (Creature* deathbringer = instance->GetCreature(DeathbringerSaurfangGUID))
|
||||
loot->SetLootRecipient(deathbringer->GetLootRecipient());
|
||||
loot->SetLootRecipient(deathbringer->GetLootRecipient(), deathbringer->GetLootRecipientGroup());
|
||||
loot->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user