fix(Scripts/Karazhan): Barnes should respawn on wipe. (#13953)

* fix(Scripts/Karazhan): Barnes should respawn on wipe.

Fixes #4437

* Update.
This commit is contained in:
UltraNix
2023-01-06 00:51:08 +01:00
committed by GitHub
parent 96fa9c5c7b
commit 4b31a4dfc0
3 changed files with 49 additions and 1 deletions

View File

@@ -709,6 +709,13 @@ public:
DoZoneInCombat();
}
void EnterEvadeMode(EvadeReason reason) override
{
ScriptedAI::EnterEvadeMode(reason);
instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL);
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_CRONE_DEATH);
@@ -891,6 +898,13 @@ public:
me->DespawnOrUnsummon();
}
void EnterEvadeMode(EvadeReason reason) override
{
ScriptedAI::EnterEvadeMode(reason);
instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL);
}
void JustDied(Unit* /*killer*/) override
{
DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
@@ -1138,6 +1152,13 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override;
void EnterEvadeMode(EvadeReason reason) override
{
ScriptedAI::EnterEvadeMode(reason);
instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL);
}
void JustDied(Unit*) override
{
Talk(SAY_JULIANNE_DEATH02);
@@ -1287,6 +1308,13 @@ public:
ScriptedAI::MoveInLineOfSight(who);
}
void EnterEvadeMode(EvadeReason reason) override
{
ScriptedAI::EnterEvadeMode(reason);
instance->SetBossState(DATA_OPERA_PERFORMANCE, FAIL);
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_ROMULO_DEATH);

View File

@@ -73,7 +73,18 @@ public:
case NPC_RELAY:
m_uiRelayGUID = creature->GetGUID();
break;
case NPC_BARNES:
_barnesGUID = creature->GetGUID();
if (GetBossState(DATA_OPERA_PERFORMANCE) != DONE && !creature->IsAlive())
{
creature->Respawn(true);
}
break;
default:
break;
}
InstanceScript::OnCreatureCreate(creature);
}
void OnUnitDeath(Unit* unit) override
@@ -162,6 +173,13 @@ public:
sideEntrance->RemoveGameObjectFlag(GO_FLAG_LOCKED);
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, nullptr);
}
else if (state == FAIL)
{
HandleGameObject(m_uiStageDoorLeftGUID, false);
HandleGameObject(m_uiStageDoorRightGUID, false);
HandleGameObject(m_uiCurtainGUID, false);
DoRespawnCreature(_barnesGUID, true);
}
break;
case DATA_CHESS:
if (state == DONE)
@@ -336,6 +354,7 @@ public:
ObjectGuid ImageGUID;
ObjectGuid DustCoveredChest;
ObjectGuid m_uiRelayGUID;
ObjectGuid _barnesGUID;
GuidVector _operaDecorations[EVENT_RAJ];
};
};

View File

@@ -90,7 +90,8 @@ enum KZMiscCreatures
NPC_DREADBEAST = 16177,
NPC_SHADOWBEAST = 16176,
NPC_KILREK = 17229,
NPC_RELAY = 17645
NPC_RELAY = 17645,
NPC_BARNES = 16812
};
enum KZGameObjectIds