feat(Core/Scripting): Implement OnBeforeSetBossState (#14891)

This commit is contained in:
55Honey
2023-02-07 17:15:17 +01:00
committed by GitHub
parent e7e119283f
commit a1fb48391b
3 changed files with 25 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#include "Opcodes.h"
#include "Pet.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "Spell.h"
#include "WorldSession.h"
@@ -307,6 +308,7 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
if (id < bosses.size())
{
BossInfo* bossInfo = &bosses[id];
sScriptMgr->OnBeforeSetBossState(id, state, bossInfo->state, instance);
if (bossInfo->state == TO_BE_DECIDED) // loading
{
bossInfo->state = state;