mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
fix(Core/Loot): Fixed some chests inside dungeons not being bound only to participants. (#10995)
This commit is contained in:
@@ -739,14 +739,22 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_RENAME);
|
||||
break;
|
||||
case EVENT_OUTRO_2:
|
||||
{
|
||||
Player* lootRecipent = me->GetLootRecipient();
|
||||
_EnterEvadeMode();
|
||||
// LootRecipent is cleared in _EnterEvadeMode, restore it
|
||||
me->SetLootRecipient(lootRecipent);
|
||||
me->GetMotionMaster()->MovePoint(POINT_ALGALON_OUTRO, AlgalonOutroPos);
|
||||
break;
|
||||
}
|
||||
case EVENT_OUTRO_3:
|
||||
me->CastSpell((Unit*)nullptr, SPELL_KILL_CREDIT);
|
||||
// Summon Chest
|
||||
if (GameObject* go = me->SummonGameObject(RAID_MODE(GO_ALGALON_CHEST, GO_ALGALON_CHEST_HERO), 1632.1f, -306.561f, 417.321f, 4.69494f, 0, 0, 0, 1, 0))
|
||||
{
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
go->SetLootRecipient(me);
|
||||
}
|
||||
break;
|
||||
case EVENT_OUTRO_4:
|
||||
me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL);
|
||||
|
||||
@@ -370,7 +370,10 @@ public:
|
||||
|
||||
me->DespawnOrUnsummon(5000);
|
||||
if (GameObject* go = me->SummonGameObject(chestId, 2345.61f, -71.20f, 425.104f, 3.0f, 0, 0, 0, 0, 0))
|
||||
{
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
go->SetLootRecipient(me->GetMap());
|
||||
}
|
||||
|
||||
// Defeat credit
|
||||
if (m_pInstance)
|
||||
|
||||
@@ -310,6 +310,7 @@ public:
|
||||
me->RemoveGameObject(go, false);
|
||||
go->SetSpellId(1); // hack to make it despawn
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
go->SetLootRecipient(me);
|
||||
}
|
||||
if (Creature* arm = ObjectAccessor::GetCreature(*me, _left))
|
||||
arm->DespawnOrUnsummon(3000); // visual
|
||||
|
||||
@@ -818,9 +818,14 @@ public:
|
||||
me->Yell(TEXT_VOLTRON_DEATH, LANG_UNIVERSAL);
|
||||
me->PlayDirectSound(SOUND_VOLTRON_DEATH);
|
||||
// spawn chest
|
||||
if( uint32 chestId = (hardmode ? RAID_MODE(GO_MIMIRON_CHEST_HARD, GO_MIMIRON_CHEST_HERO_HARD) : RAID_MODE(GO_MIMIRON_CHEST, GO_MIMIRON_CHEST_HERO)) )
|
||||
if( GameObject* go = me->SummonGameObject(chestId, 2744.65f, 2569.46f, 364.397f, 0, 0, 0, 0, 0, 0) )
|
||||
if (uint32 chestId = (hardmode ? RAID_MODE(GO_MIMIRON_CHEST_HARD, GO_MIMIRON_CHEST_HERO_HARD) : RAID_MODE(GO_MIMIRON_CHEST, GO_MIMIRON_CHEST_HERO)))
|
||||
{
|
||||
if (GameObject* go = me->SummonGameObject(chestId, 2744.65f, 2569.46f, 364.397f, 0, 0, 0, 0, 0, 0))
|
||||
{
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
go->SetLootRecipient(me->GetMap());
|
||||
}
|
||||
}
|
||||
events.ScheduleEvent(EVENT_DISAPPEAR, 15000);
|
||||
break;
|
||||
case EVENT_DISAPPEAR:
|
||||
|
||||
@@ -592,7 +592,10 @@ public:
|
||||
chestId += 1; // hard mode offset
|
||||
|
||||
if ((go = me->SummonGameObject(chestId, 2134.73f, -286.32f, 419.51f, 0.0f, 0, 0, 0, 0, 0)))
|
||||
{
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
go->SetLootRecipient(me->GetMap());
|
||||
}
|
||||
|
||||
// Defeat credit
|
||||
if (m_pInstance)
|
||||
|
||||
@@ -634,10 +634,18 @@ public:
|
||||
{
|
||||
case TYPE_HODIR:
|
||||
if (hmHodir)
|
||||
{
|
||||
if (GameObject* go = instance->GetGameObject(m_hodirHardmodeChest))
|
||||
{
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetLootRecipient(instance);
|
||||
}
|
||||
}
|
||||
if (GameObject* go = instance->GetGameObject(m_hodirNormalChest))
|
||||
{
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetLootRecipient(instance);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user