mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Auras: Implement SpellAuraInterruptFlags2::StartOfEncounter (#28938)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -481,6 +481,10 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
SetStatus(STATUS_IN_PROGRESS);
|
||||
SetStartDelayTime(StartDelayTimes[BG_STARTING_EVENT_FOURTH]);
|
||||
|
||||
for (auto const& [guid, _] : GetPlayers())
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->AtStartOfEncounter();
|
||||
|
||||
// Remove preparation
|
||||
if (isArena())
|
||||
{
|
||||
|
||||
@@ -536,6 +536,14 @@ void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed, bool gen
|
||||
GetMotionMaster()->LaunchMoveSpline(std::move(initializer), 0, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
}
|
||||
|
||||
void Unit::AtStartOfEncounter()
|
||||
{
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::StartOfEncounter);
|
||||
|
||||
if (IsAlive())
|
||||
Unit::ProcSkillsAndAuras(this, nullptr, PROC_FLAG_ENCOUNTER_START, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void Unit::UpdateSplineMovement(uint32 t_diff)
|
||||
{
|
||||
if (movespline->Finalized())
|
||||
|
||||
@@ -2017,6 +2017,9 @@ class TC_GAME_API Unit : public WorldObject
|
||||
virtual void AtEngage(Unit* /*target*/) {}
|
||||
virtual void AtDisengage() {}
|
||||
|
||||
public:
|
||||
void AtStartOfEncounter();
|
||||
|
||||
private:
|
||||
|
||||
void UpdateSplineMovement(uint32 t_diff);
|
||||
|
||||
@@ -409,8 +409,7 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
|
||||
|
||||
instance->DoOnPlayers([](Player* player)
|
||||
{
|
||||
if (player->IsAlive())
|
||||
Unit::ProcSkillsAndAuras(player, nullptr, PROC_FLAG_ENCOUNTER_START, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);
|
||||
player->AtStartOfEncounter();
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ enum class SpellAuraInterruptFlags2 : uint32
|
||||
Jump = 0x00000020,
|
||||
ChangeSpec = 0x00000040,
|
||||
AbandonVehicle = 0x00000080, // Implemented in Unit::_ExitVehicle
|
||||
StartOfEncounter = 0x00000100, // NYI
|
||||
StartOfEncounter = 0x00000100, // Implemented in InstanceScript::SetBossState and Battleground::_ProcessJoin
|
||||
EndOfEncounter = 0x00000200, // NYI
|
||||
Disconnect = 0x00000400, // NYI
|
||||
EnteringInstance = 0x00000800, // Implemented in Map::AddPlayerToMap
|
||||
|
||||
Reference in New Issue
Block a user