mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Script/Ulduar): Freya spawning multiple chests (#11794)
This commit is contained in:
@@ -316,46 +316,49 @@ public:
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
damage = 0;
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
me->RemoveAllAuras();
|
||||
me->AttackStop();
|
||||
events.Reset();
|
||||
|
||||
summons.DespawnAll();
|
||||
events.Reset();
|
||||
|
||||
uint8 _elderCount = 0;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (m_pInstance->GetData(TYPE_FREYA) != DONE)
|
||||
{
|
||||
if (!_elderGUID[i])
|
||||
continue;
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (Creature* e = ObjectAccessor::GetCreature(*me, _elderGUID[i]))
|
||||
e->DespawnOrUnsummon();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
me->RemoveAllAuras();
|
||||
me->AttackStop();
|
||||
events.Reset();
|
||||
|
||||
++_elderCount;
|
||||
}
|
||||
summons.DespawnAll();
|
||||
events.Reset();
|
||||
|
||||
uint32 chestId = RAID_MODE(GO_FREYA_CHEST, GO_FREYA_CHEST_HERO);
|
||||
chestId -= 2 * _elderCount; // offset
|
||||
uint8 _elderCount = 0;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (!_elderGUID[i])
|
||||
continue;
|
||||
|
||||
me->DespawnOrUnsummon(5000);
|
||||
if (GameObject* go = me->SummonGameObject(chestId, 2345.61f, -71.20f, 425.104f, 3.0f, 0, 0, 0, 0, 0))
|
||||
{
|
||||
go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
|
||||
go->SetLootRecipient(me->GetMap());
|
||||
}
|
||||
if (Creature* e = ObjectAccessor::GetCreature(*me, _elderGUID[i]))
|
||||
e->DespawnOrUnsummon();
|
||||
|
||||
// Defeat credit
|
||||
if (m_pInstance)
|
||||
{
|
||||
me->CastSpell(me, 65074, true); // credit
|
||||
m_pInstance->SetData(TYPE_FREYA, DONE);
|
||||
++_elderCount;
|
||||
}
|
||||
|
||||
uint32 chestId = RAID_MODE(GO_FREYA_CHEST, GO_FREYA_CHEST_HERO);
|
||||
chestId -= 2 * _elderCount; // offset
|
||||
|
||||
me->DespawnOrUnsummon(5000);
|
||||
if (GameObject* go = me->SummonGameObject(chestId, 2345.61f, -71.20f, 425.104f, 3.0f, 0, 0, 0, 0, 0))
|
||||
{
|
||||
go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
|
||||
go->SetLootRecipient(me->GetMap());
|
||||
}
|
||||
|
||||
// Defeat credit
|
||||
if (m_pInstance)
|
||||
{
|
||||
me->CastSpell(me, 65074, true); // credit
|
||||
m_pInstance->SetData(TYPE_FREYA, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user