Skip to content

Commit

Permalink
Blackwing Lair updates
Browse files Browse the repository at this point in the history
* Add a missing emote when failing in Phase 1 of Razorgore encounter
* Close the main gate of the instance when at least one boss is pulled:
it was added in retail to prevent corpse runs during fight
Thanks @Tobschinski for reporting and detailing those
  • Loading branch information
cala committed Oct 15, 2017
1 parent 7bc5ebb commit 8ded0ae
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
Expand Up @@ -36,6 +36,7 @@ enum
NPC_BLACKWING_ORB_TRIGGER = 14449,
NPC_NEFARIANS_TROOPS = 14459,
NPC_MONSTER_GENERATOR = 12434,
NPC_ORB_DOMINATION = 14453,
NPC_BLACKWING_LEGIONNAIRE = 12416, // one spawn per turn
NPC_BLACKWING_MAGE = 12420, // one spawn per turn
NPC_DRAGONSPAWN = 12422, // two spawns per turn
Expand Down Expand Up @@ -125,6 +126,8 @@ class instance_blackwing_lair : public ScriptedInstance
uint32 m_uiDragonspawnCount;
uint32 m_uiBlackwingDefCount;

bool m_bIsMainGateOpen;

GuidList m_lDragonEggsGuids;
GuidList m_lDrakonidBonesGuids;
GuidList m_lDefendersGuids;
Expand Down
Expand Up @@ -187,7 +187,11 @@ struct npc_blackwing_orbAI : public ScriptedAI
{
// If hit by Razorgore's fireball: explodes everything in the room
if (pSpell->Id == SPELL_FIREBALL)
{
if (Creature* pTemp = m_creature->SummonCreature(NPC_ORB_DOMINATION, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSPAWN_TIMED_DESPAWN, 5 * IN_MILLISECONDS))
DoScriptText(EMOTE_ORB_SHUT_OFF, pTemp);
m_creature->CastSpell(m_creature, SPELL_EXPLODE_ORB, TRIGGERED_IGNORE_UNATTACKABLE_FLAG);
}
}

void UpdateAI(const uint32 uiDiff) override
Expand Down
Expand Up @@ -30,7 +30,8 @@ instance_blackwing_lair::instance_blackwing_lair(Map* pMap) : ScriptedInstance(p
m_uiScepterEpicTimer(0),
m_uiScepterQuestStep(0),
m_uiDragonspawnCount(0),
m_uiBlackwingDefCount(0)
m_uiBlackwingDefCount(0),
m_bIsMainGateOpen(true)
{
Initialize();
}
Expand Down Expand Up @@ -123,12 +124,33 @@ void instance_blackwing_lair::OnObjectCreate(GameObject* pGo)

void instance_blackwing_lair::SetData(uint32 uiType, uint32 uiData)
{
// Close de the main gate whenever an event starts (if it is not already open)
if (m_bIsMainGateOpen && (uiData == IN_PROGRESS || uiData == SPECIAL))
{
DoUseDoorOrButton(GO_DOOR_RAZORGORE_ENTER);
m_bIsMainGateOpen = false;
}
// If an encounter is failed or won, open the main gate only if it is currently closed and no other event is in progress
else if (!m_bIsMainGateOpen && (uiData == FAIL || uiData == DONE))
{
bool ShouldKeepGateClosed = false;
for (uint8 i = 0; i < TYPE_NEFARIAN; i++)
{
if (uiType != i && (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == SPECIAL))
ShouldKeepGateClosed = true;
}

if (!ShouldKeepGateClosed)
{
DoUseDoorOrButton(GO_DOOR_RAZORGORE_ENTER);
m_bIsMainGateOpen = true;
}
}

switch (uiType)
{
case TYPE_RAZORGORE:
m_auiEncounter[uiType] = uiData;
if (uiData != SPECIAL)
DoUseDoorOrButton(GO_DOOR_RAZORGORE_ENTER);
if (uiData == DONE)
DoUseDoorOrButton(GO_DOOR_RAZORGORE_EXIT);
else if (uiData == FAIL)
Expand Down Expand Up @@ -363,7 +385,11 @@ void instance_blackwing_lair::OnCreatureDeath(Creature* pCreature)
pRazorgore->ForcedDespawn();
}
if (Creature* pOrbTrigger = GetSingleCreatureFromStorage(NPC_BLACKWING_ORB_TRIGGER))
{
if (Creature* pTemp = pOrbTrigger->SummonCreature(NPC_ORB_DOMINATION, pOrbTrigger->GetPositionX(), pOrbTrigger->GetPositionY(), pOrbTrigger->GetPositionZ(), 0, TEMPSPAWN_TIMED_DESPAWN, 5 * IN_MILLISECONDS))
DoScriptText(EMOTE_ORB_SHUT_OFF, pTemp);
pOrbTrigger->CastSpell(pOrbTrigger, SPELL_EXPLODE_ORB, TRIGGERED_IGNORE_UNATTACKABLE_FLAG);
}
}
break;
case NPC_BLACKWING_LEGIONNAIRE:
Expand Down

0 comments on commit 8ded0ae

Please sign in to comment.