Core/Auras: Implement SpellAuraInterruptFlags2::EndOfEncounter (#28939)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Teleqraph
2023-05-06 21:03:00 +02:00
committed by GitHub
parent 15135ce16f
commit 998ee363c5
3 changed files with 18 additions and 2 deletions

View File

@@ -912,6 +912,8 @@ void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
player->RemoveAura(SPELL_MERCENARY_SHAPESHIFT);
player->RemovePlayerFlagEx(PLAYER_FLAGS_EX_MERCENARY_MODE);
player->AtEndOfEncounter();
player->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::LeaveArenaOrBattleground);
if (!player->IsAlive()) // resurrect on exit

View File

@@ -414,10 +414,18 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
break;
}
case FAIL:
{
ResetCombatResurrections();
SendEncounterEnd();
instance->DoOnPlayers([](Player* player)
{
player->AtEndOfEncounter();
});
break;
}
case DONE:
{
ResetCombatResurrections();
SendEncounterEnd();
dungeonEncounter = bossInfo->GetDungeonEncounterForDifficulty(instance->GetDifficultyID());
@@ -426,7 +434,13 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
DoUpdateCriteria(CriteriaType::DefeatDungeonEncounter, dungeonEncounter->ID);
SendBossKillCredit(dungeonEncounter->ID);
}
instance->DoOnPlayers([](Player* player)
{
player->AtEndOfEncounter();
});
break;
}
default:
break;
}

View File

@@ -124,8 +124,8 @@ enum class SpellAuraInterruptFlags2 : uint32
Jump = 0x00000020,
ChangeSpec = 0x00000040,
AbandonVehicle = 0x00000080, // Implemented in Unit::_ExitVehicle
StartOfEncounter = 0x00000100, // Implemented in InstanceScript::SetBossState and Battleground::_ProcessJoin
EndOfEncounter = 0x00000200, // NYI
StartOfEncounter = 0x00000100, // Implemented in Unit::AtStartOfEncounter
EndOfEncounter = 0x00000200, // Implemented in Unit::AtEndOfEncounter
Disconnect = 0x00000400, // NYI
EnteringInstance = 0x00000800, // Implemented in Map::AddPlayerToMap
DuelEnd = 0x00001000, // Implemented in Player::DuelComplete