Skip to content

Commit

Permalink
Fix quest 8736
Browse files Browse the repository at this point in the history
* Fix quest 8736 (The Nightmare Manifests):
- Make Eranikus fly and land properly
- Fix waypoints following escort logic rework
- Fix several relation issues preventing NPC to enter combat and reseting the whole event
- Re-add Classic realm wide emotes
  • Loading branch information
cala committed Jul 1, 2021
1 parent 5f897e2 commit 09bc92a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 43 deletions.
10 changes: 5 additions & 5 deletions sql/scriptdev2/scriptdev2.sql
Expand Up @@ -9184,8 +9184,8 @@ INSERT INTO script_waypoint (entry, pathId, pointid, position_x, position_y, pos
(11016,0,110,4873.97,-394.919,349.844,0,1000,0,''),
(11016,0,111,4863.02,-394.521,350.65,0,0,0,''),
(11016,0,112,4848.7,-397.612,351.215,0,0,0,''),
(11832,0,1,7848.39,-2216.36,470.888,0,15000,0,'SAY_REMULOS_INTRO_1'),
(11832,0,2,7848.39,-2216.36,470.888,0,5000,0,'SAY_REMULOS_INTRO_2'),
(11832,0,1,7848.39,-2216.36,470.888,3.9095,15000,0,'SAY_REMULOS_INTRO_1'),
(11832,0,2,7848.39,-2216.36,470.888,3.9095,5000,0,'SAY_REMULOS_INTRO_2'),
(11832,0,3,7829.79,-2244.84,463.853,0,0,0,''),
(11832,0,4,7819.01,-2304.34,455.957,0,0,0,''),
(11832,0,5,7931.1,-2314.35,473.054,0,0,0,''),
Expand All @@ -9197,12 +9197,12 @@ INSERT INTO script_waypoint (entry, pathId, pointid, position_x, position_y, pos
(11832,0,11,7947.16,-2583.4,490.066,0,0,0,''),
(11832,0,12,7951.09,-2596.22,489.831,0,0,0,''),
(11832,0,13,7948.27,-2610.06,492.34,0,0,0,''),
(11832,0,14,7928.52,-2625.95,492.448,0,0,0,'escort paused - SAY_REMULOS_INTRO_3'),
(11832,0,14,7928.52,-2625.95,492.448,3.72,500,0,'escort paused - SAY_REMULOS_INTRO_3'),
(11832,0,15,7948.27,-2610.06,492.34,0,0,0,''),
(11832,0,16,7952.32,-2594.12,490.07,0,0,0,''),
(11832,0,17,7913.99,-2567,488.331,0,0,0,''),
(11832,0,18,7835.45,-2571.1,489.289,0,0,0,'escort paused - SAY_REMULOS_DEFEND_2'),
(11832,0,19,7897.28,-2560.65,487.461,0,0,0,'escort paused'),
(11832,0,18,7835.45,-2571.1,489.289,0,500,0,'escort paused - SAY_REMULOS_DEFEND_2'),
(11832,0,19,7897.28,-2560.65,487.461,0,500,0,'escort paused'),
(11856,0,1,113.91,-350.13,4.55,0,0,0,''),
(11856,0,2,109.54,-350.08,3.74,0,0,0,''),
(11856,0,3,106.95,-353.4,3.6,0,0,0,''),
Expand Down
85 changes: 47 additions & 38 deletions src/game/AI/ScriptDevAI/scripts/kalimdor/moonglade.cpp
Expand Up @@ -176,6 +176,7 @@ bool EffectDummyCreature_npc_clintar_dw_spirit(Unit* pCaster, uint32 spellId, Sp
enum
{
SPELL_CONJURE_RIFT = 25813, // summon Eranikus
SPELL_DRAGON_HOVER = 18430,
SPELL_HEALING_TOUCH = 23381,
SPELL_REGROWTH = 20665,
SPELL_REJUVENATION = 20664,
Expand All @@ -189,6 +190,8 @@ enum
NPC_TYRANDE_WHISPERWIND = 15633, // appears with the priestess during the event to help the players - should cast healing spells
NPC_ELUNE_PRIESTESS = 15634,

FACTION_CENARION_CIRCLE = 996,

QUEST_NIGHTMARE_MANIFESTS = 8736,

// yells -> in cronological order
Expand Down Expand Up @@ -337,42 +340,42 @@ struct npc_keeper_remulosAI : public npc_escortAI, private DialogueHelper
}
}

void JustSummoned(Creature* pSummoned) override
void JustSummoned(Creature* summoned) override
{
switch (pSummoned->GetEntry())
switch (summoned->GetEntry())
{
case NPC_ERANIKUS_TYRANT:
m_eranikusGuid = pSummoned->GetObjectGuid();
// Make Eranikus unattackable first
// ToDo: uncomment the fly effect when it will be possible to cancel it properly
// pSummoned->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2);
pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pSummoned->SetLevitate(true);
m_eranikusGuid = summoned->GetObjectGuid();
// Make Eranikus fly and unattackable
summoned->CastSpell(nullptr, SPELL_DRAGON_HOVER, TRIGGERED_OLD_TRIGGERED);
summoned->SetHover(true);
summoned->SetImmuneToNPC(true);
summoned->SetImmuneToPlayer(true);
break;
case NPC_NIGHTMARE_PHANTASM:
// ToDo: set faction to DB
pSummoned->setFaction(14);
pSummoned->AI()->AttackStart(m_creature);
summoned->setFaction(14);
summoned->AI()->AttackStart(m_creature);
break;
}
}

void SummonedMovementInform(Creature* pSummoned, uint32 uiType, uint32 uiPointId) override
void SummonedMovementInform(Creature* summoned, uint32 type, uint32 pointId) override
{
if (uiType != POINT_MOTION_TYPE || pSummoned->GetEntry() != NPC_ERANIKUS_TYRANT)
if (type != POINT_MOTION_TYPE || summoned->GetEntry() != NPC_ERANIKUS_TYRANT)
return;

switch (uiPointId)
switch (pointId)
{
case POINT_ID_ERANIKUS_FLIGHT:
// Set Eranikus to face Remulos
pSummoned->SetFacingToObject(m_creature);
summoned->SetFacingToObject(m_creature);
break;
case POINT_ID_ERANIKUS_COMBAT:
// Start attack
pSummoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pSummoned->AI()->AttackStart(m_creature);
DoScriptText(SAY_ERANIKUS_ATTACK_2, pSummoned);
summoned->SetImmuneToNPC(false);
summoned->SetImmuneToPlayer(false);
summoned->AI()->AttackStart(m_creature);
DoScriptText(SAY_ERANIKUS_ATTACK_2, summoned);
break;
}
}
Expand All @@ -397,15 +400,15 @@ struct npc_keeper_remulosAI : public npc_escortAI, private DialogueHelper
case 2:
DoScriptText(SAY_REMULOS_INTRO_2, m_creature);
break;
case 13:
case 14:
StartNextDialogueText(NPC_REMULOS);
SetEscortPaused(true);
break;
case 17:
case 18:
StartNextDialogueText(SAY_REMULOS_DEFEND_2);
SetEscortPaused(true);
break;
case 18:
case 19:
SetEscortPaused(true);
break;
}
Expand All @@ -423,35 +426,40 @@ struct npc_keeper_remulosAI : public npc_escortAI, private DialogueHelper
}
}

void JustDidDialogueStep(int32 iEntry) override
void JustDidDialogueStep(int32 entry) override
{
switch (iEntry)
switch (entry)
{
case NPC_REMULOS:
if (Player* pPlayer = GetPlayerForEscort())
DoScriptText(SAY_REMULOS_INTRO_3, m_creature, pPlayer);
if (Player* player = GetPlayerForEscort())
DoScriptText(SAY_REMULOS_INTRO_3, m_creature, player);
break;
case SPELL_CONJURE_RIFT:
DoCastSpellIfCan(m_creature, SPELL_CONJURE_RIFT);
break;
case SAY_ERANIKUS_SPAWN:
// This big yellow emote was removed at some point in WotLK
// DoScriptText(EMOTE_SUMMON_ERANIKUS, pEranikus);
if (Creature* eranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(EMOTE_SUMMON_ERANIKUS, eranikus);
break;
case NPC_ERANIKUS_TYRANT:
if (Player* pPlayer = GetPlayerForEscort())
DoScriptText(SAY_REMULOS_DEFEND_1, m_creature, pPlayer);
if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_FLIGHT, aEranikusLocations[1].m_fX, aEranikusLocations[1].m_fY, aEranikusLocations[1].m_fZ);
if (Player* player = GetPlayerForEscort())
DoScriptText(SAY_REMULOS_DEFEND_1, m_creature, player);
if (Creature* eranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
{
eranikus->RemoveAurasDueToSpell(SPELL_DRAGON_HOVER);
eranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_FLIGHT, aEranikusLocations[1].m_fX, aEranikusLocations[1].m_fY, aEranikusLocations[1].m_fZ, FORCED_MOVEMENT_FLIGHT);
}
SetEscortPaused(false);
break;
case SAY_REMULOS_DEFEND_2:
if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
m_creature->SetFacingToObject(pEranikus);
if (Creature* eranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
m_creature->SetFacingToObject(eranikus);
break;
case SAY_REMULOS_DEFEND_3:
SetEscortPaused(true);
m_uiShadesummonTimer = 5000;
m_creature->SetFactionTemporary(996, TEMPFACTION_RESTORE_RESPAWN);
m_uiShadesummonTimer = 5 * IN_MILLISECONDS;
break;
}
}
Expand Down Expand Up @@ -508,7 +516,6 @@ struct npc_keeper_remulosAI : public npc_escortAI, private DialogueHelper
DoScriptText(SAY_ERANIKUS_ATTACK_1, pEranikus);

++m_uiSummonCount;
SetEscortPaused(false);
m_bIsFirstWave = false;
}

Expand All @@ -534,11 +541,13 @@ struct npc_keeper_remulosAI : public npc_escortAI, private DialogueHelper
{
m_uiShadesummonTimer = 0;

if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
if (Creature* eranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
{
pEranikus->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0);
pEranikus->SetLevitate(false);
pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_COMBAT, aEranikusLocations[2].m_fX, aEranikusLocations[2].m_fY, aEranikusLocations[2].m_fZ);
// Land and start attacking
eranikus->RemoveAurasDueToSpell(SPELL_DRAGON_HOVER);
eranikus->SetHover(false);
eranikus->HandleEmote(EMOTE_ONESHOT_LAND);
eranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_COMBAT, aEranikusLocations[2].m_fX, aEranikusLocations[2].m_fY, aEranikusLocations[2].m_fZ);
}
}
else
Expand Down

0 comments on commit 09bc92a

Please sign in to comment.