Skip to content

Commit

Permalink
Script Aurius' Reckoning event in Stratholme
Browse files Browse the repository at this point in the history
* Aurius now leaves the Alonsius Chapell to help players defeating
Baron Rivendare if they previously gave him the Medallion of Faith
* He now change his gossip depending on the event progress
* The quest "Aurius' Reckoning" is no longer auto-completed
  • Loading branch information
cala committed May 15, 2016
1 parent 6fce965 commit 0519a1d
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 7 deletions.
5 changes: 4 additions & 1 deletion sql/scriptdev2/scriptdev2.sql
Expand Up @@ -454,6 +454,7 @@ UPDATE creature_template SET ScriptName='boss_dathrohan_balnazzar' WHERE entry=1
UPDATE creature_template SET ScriptName='boss_maleki_the_pallid' WHERE entry=10438;
UPDATE creature_template SET ScriptName='boss_cannon_master_willey' WHERE entry=10997;
UPDATE creature_template SET ScriptName='boss_baroness_anastari' WHERE entry=10436;
UPDATE creature_template SET ScriptName='npc_aurius' WHERE entry=10917;
UPDATE creature_template SET ScriptName='mobs_spectral_ghostly_citizen' WHERE entry IN (10384,10385);
UPDATE creature_template SET ScriptName='mob_restless_soul' WHERE entry=11122;
UPDATE gameobject_template SET ScriptName='go_gauntlet_gate' WHERE entry=175357;
Expand Down Expand Up @@ -2012,8 +2013,10 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1329017,'You fools think you can defeat me so easily? Face the true might of the Nathrezim!',0,1,0,0,'dathrohan SAY_TRANSFORM'),
(-1329018,'Damn you mortals! All my plans of revenge, all my hate... all burned to ash...',0,0,0,0,'dathrohan SAY_DEATH'),
(-1329019,'Don\'t worry about me! Slay this dreadful beast and cleanse this world of his foul taint!',0,6,0,0,'ysida YSIDA_SAY_RUN_5_MIN'),
(-1329020,'My death means nothing.... light... will... prevail!',0,6,0,0,'ysida YSIDA_SAY_RUN_FAIL');
(-1329020,'My death means nothing.... light... will... prevail!',0,6,0,0,'ysida YSIDA_SAY_RUN_FAIL'),

(-1329021,'Rivendare! I come for you!',0,1,0,0,'aurius YELL_AURIUS_AGGRO'),
(-1329022,'Argh!',0,0,0,0,'aurius SAY_AURIUS_DEATH');

-- -1 349 000 MARAUDON

Expand Down
Expand Up @@ -31,7 +31,8 @@ instance_stratholme::instance_stratholme(Map* pMap) : ScriptedInstance(pMap),
m_uiSlaugtherSquareTimer(0),
m_uiYellCounter(0),
m_uiMindlessCount(0),
m_uiPostboxesUsed(0)
m_uiPostboxesUsed(0),
m_uiAuriusSummonTimer(0)
{
Initialize();
}
Expand Down Expand Up @@ -66,6 +67,7 @@ void instance_stratholme::OnCreatureCreate(Creature* pCreature)
case NPC_YSIDA:
case NPC_YSIDA_TRIGGER:
case NPC_BARTHILAS:
case NPC_AURIUS:
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
break;

Expand Down Expand Up @@ -287,6 +289,10 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData)
// Close Slaughterhouse door if needed
if (m_auiEncounter[uiType] == FAIL)
DoUseDoorOrButton(GO_PORT_GAUNTLET);

// If Aurius was given the medaillon wait 5s before summoning him
if (m_auiEncounter[TYPE_AURIUS] == SPECIAL)
m_uiAuriusSummonTimer = 5000;
}
if (uiData == DONE)
{
Expand Down Expand Up @@ -322,6 +328,10 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData)
}
}

// If Aurius was spawned to help fight the Baron, mark that event as DONE
if (m_auiEncounter[TYPE_AURIUS] == IN_PROGRESS)
SetData(TYPE_AURIUS, DONE);

// Open Slaughterhouse door again
DoUseDoorOrButton(GO_PORT_GAUNTLET);
}
Expand Down Expand Up @@ -378,6 +388,71 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData)
}
// No need to save anything here, so return
return;
case TYPE_AURIUS:
m_auiEncounter[uiType] = uiData;
// Prevent further players to complete the quest in that instance
// or autocomplete the follow-up quest
// the flag will be set back if event is succeed
if (uiData == SPECIAL)
{
if (Creature* pAurius = GetSingleCreatureFromStorage(NPC_AURIUS))
pAurius->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
break;
}
// Baron killed and Aurius is alive: give him his NPC Flags back
// So players can complete the quest
// Fake his death
if (uiData == DONE)
{
if (Creature* pAurius = GetSingleCreatureFromStorage(NPC_AURIUS))
{
DoScriptText(SAY_AURIUS_DEATH, pAurius);
pAurius->StopMoving();
pAurius->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
pAurius->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pAurius->InterruptNonMeleeSpells(true);
pAurius->SetHealth(1);
pAurius->GetMotionMaster()->MovementExpired();
pAurius->GetMotionMaster()->MoveIdle();
pAurius->RemoveAllAurasOnDeath();
pAurius->SetStandState(UNIT_STAND_STATE_DEAD);
}
break;
}
if (uiData == IN_PROGRESS)
{
// Despawn Aurius in the Chapel and spawn it in the Slaughter House to engage Baron
if (Creature* pAurius_original = GetSingleCreatureFromStorage(NPC_AURIUS))
pAurius_original->ForcedDespawn();
if (Creature* pBaron = GetSingleCreatureFromStorage(NPC_BARON))
{
float fX, fY, fZ, fPosX, fPosY, fPosZ;
fX = pBaron->GetPositionX();
fY = pBaron->GetPositionY();
fZ = pBaron->GetPositionZ();
pBaron->GetRandomPoint(fX, fY, fZ, 4.0f, fPosX, fPosY, fPosZ);
if (Creature* pAurius = pBaron->SummonCreature(NPC_AURIUS, fPosX, fPosY, fPosZ, 0, TEMPSUMMON_DEAD_DESPAWN, 0))
{
DoScriptText(YELL_AURIUS_AGGRO, pAurius);
pAurius->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
pAurius->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pAurius->AI()->AttackStart(pBaron);
}
}
}
if (uiData == FAIL)
{
// Baron encounter failed and Aurius is spawned: kill him
if (Creature* pAurius = GetSingleCreatureFromStorage(NPC_AURIUS))
{
if (pAurius->isAlive())
{
DoScriptText(SAY_AURIUS_DEATH, pAurius);
pAurius->DealDamage(pAurius, pAurius->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false);
}
}
break;
}
}

if (uiData == DONE)
Expand All @@ -386,7 +461,8 @@ void instance_stratholme::SetData(uint32 uiType, uint32 uiData)

std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << m_auiEncounter[6];
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " "
<< m_auiEncounter[6] << " " << m_auiEncounter[7];

m_strInstData = saveStream.str();

Expand All @@ -407,7 +483,7 @@ void instance_stratholme::Load(const char* chrIn)

std::istringstream loadStream(chrIn);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
>> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6];
>> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7];

for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
Expand Down Expand Up @@ -450,6 +526,7 @@ uint32 instance_stratholme::GetData(uint32 uiType) const
case TYPE_PALLID:
case TYPE_RAMSTEIN:
case TYPE_BARON:
case TYPE_AURIUS:
case TYPE_BARTHILAS_RUN:
case TYPE_POSTMASTER:
return m_auiEncounter[uiType];
Expand Down Expand Up @@ -599,6 +676,7 @@ void instance_stratholme::OnCreatureDeath(Creature* pCreature)
case NPC_NERUBENKAN: SetData(TYPE_NERUB, DONE); break;
case NPC_RAMSTEIN: SetData(TYPE_RAMSTEIN, DONE); break;
case NPC_BARON: SetData(TYPE_BARON, DONE); break;
case NPC_AURIUS: SetData(TYPE_AURIUS, FAIL); break;

case NPC_THUZADIN_ACOLYTE:
ThazudinAcolyteJustDied(pCreature);
Expand Down Expand Up @@ -696,6 +774,18 @@ void instance_stratholme::Update(uint32 uiDiff)
m_uiBarthilasRunTimer -= uiDiff;
}

// Timer to summon Aurius into the Slaughter House once Baron is engaged
if (m_uiAuriusSummonTimer)
{
if (m_uiAuriusSummonTimer <= uiDiff)
{
SetData(TYPE_AURIUS, IN_PROGRESS);
m_uiAuriusSummonTimer = 0;
}
else
m_uiAuriusSummonTimer -= uiDiff;
}

// Check changes for Baron ultimatum timer only if Baron is not already in combat
if (m_uiBaronRunTimer && GetData(TYPE_BARON) != IN_PROGRESS)
{
Expand Down
66 changes: 66 additions & 0 deletions src/scriptdev2/scripts/eastern_kingdoms/stratholme/stratholme.cpp 100644 → 100755
Expand Up @@ -27,6 +27,7 @@ go_gauntlet_gate
go_stratholme_postbox
mob_restless_soul
mobs_spectral_ghostly_citizen
npc_aurius
EndContentData */

#include "precompiled.h"
Expand Down Expand Up @@ -307,6 +308,65 @@ CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature* pCreature)
return new mobs_spectral_ghostly_citizenAI(pCreature);
}

/*######
## npc_aurius
######*/

enum
{
GOSSIP_TEXT_AURIUS_1 = 3755,
GOSSIP_TEXT_AURIUS_2 = 3756,
GOSSIP_TEXT_AURIUS_3 = 3757,
};

bool QuestRewarded_npc_aurius(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData();

if (!pInstance)
return false;

if (pInstance->GetData(TYPE_BARON) == DONE || pInstance->GetData(TYPE_AURIUS) != NOT_STARTED)
return false;

if ((pQuest->GetQuestId() == QUEST_MEDALLION_FAITH))
pInstance->SetData(TYPE_AURIUS, SPECIAL);

return true;
}

bool GossipHello_npc_aurius(Player* pPlayer, Creature* pCreature)
{
ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData();

uint32 ui_GossipId;

if (pInstance)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid());

DEBUG_LOG("AURIUS TYPE: %u",pInstance->GetData(TYPE_AURIUS));
switch (pInstance->GetData(TYPE_AURIUS))
{
case SPECIAL:
ui_GossipId = GOSSIP_TEXT_AURIUS_2;
break;
case DONE:
ui_GossipId = GOSSIP_TEXT_AURIUS_3;
break;
default:
ui_GossipId = GOSSIP_TEXT_AURIUS_1;
break;
}
pPlayer->SEND_GOSSIP_MENU(ui_GossipId, pCreature->GetObjectGuid());

return true;
}

return false;
}

void AddSC_stratholme()
{
Script* pNewScript;
Expand Down Expand Up @@ -335,4 +395,10 @@ void AddSC_stratholme()
pNewScript->Name = "mobs_spectral_ghostly_citizen";
pNewScript->GetAI = &GetAI_mobs_spectral_ghostly_citizen;
pNewScript->RegisterSelf();

pNewScript = new Script;
pNewScript->Name = "npc_aurius";
pNewScript->pGossipHello = &GossipHello_npc_aurius;
pNewScript->pQuestRewardedNPC = &QuestRewarded_npc_aurius;
pNewScript->RegisterSelf();
}
13 changes: 10 additions & 3 deletions src/scriptdev2/scripts/eastern_kingdoms/stratholme/stratholme.h 100644 → 100755
Expand Up @@ -7,7 +7,7 @@

enum
{
MAX_ENCOUNTER = 9,
MAX_ENCOUNTER = 10,
MAX_SILVERHAND = 5,
MAX_ZIGGURATS = 3,

Expand All @@ -18,8 +18,9 @@ enum
TYPE_RAMSTEIN = 4,
TYPE_BARON = 5,
TYPE_BARTHILAS_RUN = 6,
TYPE_BLACK_GUARDS = 7,
TYPE_POSTMASTER = 8,
TYPE_AURIUS = 7,
TYPE_BLACK_GUARDS = 8,
TYPE_POSTMASTER = 9,

NPC_TIMMY_THE_CRUEL = 10808,
NPC_BARTHILAS = 10435,
Expand All @@ -40,6 +41,7 @@ enum
NPC_CRIMSON_GALLANT = 10424,
NPC_CRIMSON_GUARDSMAN = 10418,
NPC_CRIMSON_CONJURER = 10419,
NPC_AURIUS = 10917,
NPC_UNDEAD_POSTMAN = 11142,

GO_SERVICE_ENTRANCE = 175368,
Expand All @@ -56,6 +58,7 @@ enum
GO_YSIDA_CAGE = 181071, // Cage to open after baron event is done

QUEST_DEAD_MAN_PLEA = 8945,
QUEST_MEDALLION_FAITH = 5122,
SPELL_BARON_ULTIMATUM = 27861, // Aura for player during the run (visual icon)
SPELL_BARON_SOUL_DRAIN = 27640, // Used by the Baron to kill Ysida
SPELL_YSIDA_FREED = 27773, // Argent Dawn extra-reputation reward on successful Baron run
Expand All @@ -76,6 +79,9 @@ enum
SAY_ANNOUNCE_RAMSTEIN = -1329013,
SAY_UNDEAD_DEFEAT = -1329014,
SAY_EPILOGUE = -1329015,

YELL_AURIUS_AGGRO = -1329021,
SAY_AURIUS_DEATH = -1329022,
};

struct EventLocation
Expand Down Expand Up @@ -144,6 +150,7 @@ class instance_stratholme : public ScriptedInstance
uint32 m_uiBarthilasRunTimer;
uint32 m_uiMindlessSummonTimer;
uint32 m_uiSlaugtherSquareTimer;
uint32 m_uiAuriusSummonTimer;

uint32 m_uiYellCounter;
uint32 m_uiMindlessCount;
Expand Down

1 comment on commit 0519a1d

@WoWAnalogue
Copy link

@WoWAnalogue WoWAnalogue commented on 0519a1d May 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.