fix(Scripts/Karazhan): Opera left door should stay open in case of wipe (#17553)
This commit is contained in:
@@ -306,7 +306,7 @@ public:
|
|||||||
}
|
}
|
||||||
else if (state == FAIL)
|
else if (state == FAIL)
|
||||||
{
|
{
|
||||||
HandleGameObject(m_uiStageDoorLeftGUID, false);
|
HandleGameObject(m_uiStageDoorLeftGUID, true);
|
||||||
HandleGameObject(m_uiStageDoorRightGUID, false);
|
HandleGameObject(m_uiStageDoorRightGUID, false);
|
||||||
HandleGameObject(m_uiCurtainGUID, false);
|
HandleGameObject(m_uiCurtainGUID, false);
|
||||||
DoRespawnCreature(_barnesGUID, true);
|
DoRespawnCreature(_barnesGUID, true);
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ public:
|
|||||||
{
|
{
|
||||||
npc_barnesAI(Creature* creature) : npc_escortAI(creature)
|
npc_barnesAI(Creature* creature) : npc_escortAI(creature)
|
||||||
{
|
{
|
||||||
RaidWiped = false;
|
|
||||||
m_uiEventId = 0;
|
m_uiEventId = 0;
|
||||||
instance = creature->GetInstanceScript();
|
instance = creature->GetInstanceScript();
|
||||||
}
|
}
|
||||||
@@ -146,11 +145,9 @@ public:
|
|||||||
|
|
||||||
uint32 TalkCount;
|
uint32 TalkCount;
|
||||||
uint32 TalkTimer;
|
uint32 TalkTimer;
|
||||||
uint32 WipeTimer;
|
|
||||||
uint32 m_uiEventId;
|
uint32 m_uiEventId;
|
||||||
|
|
||||||
bool PerformanceReady;
|
bool PerformanceReady;
|
||||||
bool RaidWiped;
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
@@ -158,7 +155,6 @@ public:
|
|||||||
|
|
||||||
TalkCount = 0;
|
TalkCount = 0;
|
||||||
TalkTimer = 2000;
|
TalkTimer = 2000;
|
||||||
WipeTimer = 5000;
|
|
||||||
|
|
||||||
PerformanceReady = false;
|
PerformanceReady = false;
|
||||||
|
|
||||||
@@ -183,8 +179,8 @@ public:
|
|||||||
switch (waypointId)
|
switch (waypointId)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
DoCast(me, SPELL_TUXEDO, false);
|
DoCastSelf(SPELL_TUXEDO);
|
||||||
instance->DoUseDoorOrButton(instance->GetGuidData(DATA_GO_STAGEDOORLEFT));
|
instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORLEFT), true);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
TalkCount = 0;
|
TalkCount = 0;
|
||||||
@@ -276,8 +272,6 @@ public:
|
|||||||
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
RaidWiped = false;
|
|
||||||
|
|
||||||
instance->SetData(DATA_SPAWN_OPERA_DECORATIONS, m_uiEventId);
|
instance->SetData(DATA_SPAWN_OPERA_DECORATIONS, m_uiEventId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,43 +297,6 @@ public:
|
|||||||
}
|
}
|
||||||
else TalkTimer -= diff;
|
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);
|
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());
|
||||||
SendGossipMenuFor(player, BARNES_TEXT_IS_READY, creature->GetGUID());
|
|
||||||
else
|
|
||||||
SendGossipMenuFor(player, BARNES_TEXT_WIPED, creature->GetGUID());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendGossipMenuFor(player, BARNES_TEXT_WIPED, creature->GetGUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user