fix(Scripts/Karazhan): Opera left door should stay open in case of wipe (#17553)

This commit is contained in:
Andrew
2023-10-21 21:59:18 -03:00
committed by GitHub
parent a7822987f1
commit c5ac4789d8
2 changed files with 11 additions and 53 deletions

View File

@@ -306,7 +306,7 @@ public:
}
else if (state == FAIL)
{
HandleGameObject(m_uiStageDoorLeftGUID, false);
HandleGameObject(m_uiStageDoorLeftGUID, true);
HandleGameObject(m_uiStageDoorRightGUID, false);
HandleGameObject(m_uiCurtainGUID, false);
DoRespawnCreature(_barnesGUID, true);

View File

@@ -135,7 +135,6 @@ public:
{
npc_barnesAI(Creature* creature) : npc_escortAI(creature)
{
RaidWiped = false;
m_uiEventId = 0;
instance = creature->GetInstanceScript();
}
@@ -146,11 +145,9 @@ public:
uint32 TalkCount;
uint32 TalkTimer;
uint32 WipeTimer;
uint32 m_uiEventId;
bool PerformanceReady;
bool RaidWiped;
void Reset() override
{
@@ -158,7 +155,6 @@ public:
TalkCount = 0;
TalkTimer = 2000;
WipeTimer = 5000;
PerformanceReady = false;
@@ -183,8 +179,8 @@ public:
switch (waypointId)
{
case 0:
DoCast(me, SPELL_TUXEDO, false);
instance->DoUseDoorOrButton(instance->GetGuidData(DATA_GO_STAGEDOORLEFT));
DoCastSelf(SPELL_TUXEDO);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORLEFT), true);
break;
case 4:
TalkCount = 0;
@@ -276,8 +272,6 @@ public:
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
RaidWiped = false;
instance->SetData(DATA_SPAWN_OPERA_DECORATIONS, m_uiEventId);
}
@@ -303,43 +297,6 @@ public:
}
else TalkTimer -= diff;
}
if (PerformanceReady)
{
if (!RaidWiped)
{
if (WipeTimer <= diff)
{
Map* map = me->GetMap();
if (!map->IsDungeon())
return;
Map::PlayerList const& PlayerList = map->GetPlayers();
if (PlayerList.IsEmpty())
return;
RaidWiped = true;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource()->IsAlive() && !i->GetSource()->IsGameMaster())
{
RaidWiped = false;
break;
}
}
if (RaidWiped)
{
RaidWiped = true;
EnterEvadeMode();
return;
}
WipeTimer = 15000;
}
else WipeTimer -= diff;
}
}
}
};
@@ -391,15 +348,16 @@ public:
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
}
if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()))
if (instance->GetBossState(DATA_OPERA_PERFORMANCE) != FAIL)
{
if (!pBarnesAI->RaidWiped)
SendGossipMenuFor(player, BARNES_TEXT_IS_READY, creature->GetGUID());
else
SendGossipMenuFor(player, BARNES_TEXT_WIPED, creature->GetGUID());
return true;
SendGossipMenuFor(player, BARNES_TEXT_IS_READY, creature->GetGUID());
}
else
{
SendGossipMenuFor(player, BARNES_TEXT_WIPED, creature->GetGUID());
}
return true;
}
}