Skip to content

Commit

Permalink
Script for quest 10218
Browse files Browse the repository at this point in the history
Thanks to @Grz3s for providing the data

Close scriptdev2/scriptdev2#180

ToDo: add combat spells to the main quest characters
  • Loading branch information
xfurry committed Sep 20, 2015
1 parent c2599f9 commit f39bef6
Show file tree
Hide file tree
Showing 2 changed files with 350 additions and 3 deletions.
73 changes: 72 additions & 1 deletion sql/scriptdev2/scriptdev2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ UPDATE creature_template SET ScriptName='npc_feero_ironhand' WHERE entry=4484;
/* MANA TOMBS */
UPDATE creature_template SET ScriptName='boss_pandemonius' WHERE entry=18341;
UPDATE creature_template SET ScriptName='boss_nexusprince_shaffar' WHERE entry=18344;
UPDATE creature_template SET ScriptName='npc_shaheen' WHERE entry=19671;

/* AUCHENAI CRYPTS */
UPDATE creature_template SET ScriptName='boss_exarch_maladaar' WHERE entry=18373;
Expand Down Expand Up @@ -4346,7 +4347,29 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1557011,'Yes! I am... empowered!',10564,1,0,0,'pandemonius SAY_KILL_1'),
(-1557012,'More... I must have more!',10565,1,0,0,'pandemonius SAY_KILL_2'),
(-1557013,'To the void... once... more..',10566,1,0,0,'pandemonius SAY_DEATH'),
(-1557014,'%s shifts into the void...',0,3,0,0,'pandemonius EMOTE_DARK_SHELL');
(-1557014,'%s shifts into the void...',0,3,0,0,'pandemonius EMOTE_DARK_SHELL'),

(-1557015,'This should\'t take very long. Just watch my back as I empty these nether collectors.',0,0,0,0,'sha\'heen SAY_ESCORT_START'),
(-1557016,'Fantastic! let\'s move on, shall we?',0,0,0,0,'sha\'heen SAY_START'),
(-1557017,'Looking at these energy levels, Shaffar was set to make a killing!',0,0,0,28,'sha\'heen SAY_FIRST_STOP'),
(-1557018,'That should do it...',0,0,0,0,'sha\'heen SAY_FIRST_STOP_COMPLETE'),
(-1557019,'Hmm, now where is the next collector?',0,0,0,0,'sha\'heen SAY_COLLECTOR_SEARCH'),
(-1557020,'Ah, there it is. Follow me, fleshling.',0,0,0,0,'sha\'heen SAY_COLLECTOR_FOUND'),
(-1557021,'There can\'t be too many more of these collectors. Just keep me safe as I do my job.',0,0,0,28,'sha\'heen SAY_SECOND_STOP'),
(-1557022,'What do we have here? I thought you said the area was secure? This is now the third attack? If we make it out of here, I will definitely be deducting this from your reward. Now don\'t just stand here, destroy them so I can get to that collector.',0,0,0,0,'sha\'heen SAY_THIRD_STOP'),
(-1557023,'We\'re close to the exit. I\'ll let you rest for about thirty seconds, but then we\'re out of here.',0,0,0,0,'sha\'heen SAY_REST'),
(-1557024,'Are you ready to go?',0,0,0,0,'sha\'heen SAY_READY_GO'),
(-1557025,'Ok break time is OVER. Let\'s go!',0,0,0,0,'sha\'heen SAY_BREAK_OVER'),
(-1557026,'Shadow Lord Xiraxis yells: Bravo! Bravo! Good show... I couldn\'t convince you to work for me, could I? No, I suppose the needless slaughter of my employees might negatively impact your employment application.',0,1,0,0,'xiraxis SAY_SPAWN'),
(-1557027,'Your plan was a good one, Sha\'heen, and you would have gotten away with it if not for one thing...',0,0,0,1,'xiraxis SAY_FINAL_STOP_1'),
(-1557028,'Oh really? And what might that be?',0,0,0,1,'sha\'heen SAY_FINAL_STOP_2'),
(-1557029,'Never underestimate the other ethereal\'s greed!',0,0,0,0,'xiraxis SAY_FINAL_STOP_3'),
(-1557030,'He was right, you know. I\'ll have to take that tag-line for my own... It\'s not like he\'ll have a use for it anymore!',0,0,0,1,'sha\'heen SAY_XIRAXIS_DEAD'),
(-1557031,'Thanks and good luck!',0,0,0,1,'sha\'heen SAY_COMPLETE'),
(-1557032,'%s checks to make sure his body is intact.',0,2,0,0,'sha\'heen EMOTE_TELEPORT'),
(-1557033,'You made it! Well done, $r. Now if you\'ll excuse me, I have to get the rest of our crew inside.',0,0,0,1,'sha\'heen SAY_SPAWN'),
(-1557034,'%s expertly manipulates the control panel.',0,2,0,28,'sha\'heen EMOTE_PANEL'),
(-1557035,'Let\'s not waste any time! Take anything that isn\'t nailed down to the floor and teleport directly to Stormspire! Chop chop!',0,0,0,1,'sha\'heen SAY_ESCORT_READY');

-- -1 558 000 AUCHENAI CRYPTS
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
Expand Down Expand Up @@ -10382,4 +10405,52 @@ INSERT INTO script_waypoint VALUES
(26499, 78, 2308.582, 1460.863, 127.839, 0, ''),
(26499, 79, 2326.608, 1420.555, 127.780, 0, '');

DELETE FROM script_waypoint WHERE entry=19671;
INSERT INTO script_waypoint VALUES
(19671, 0, -362.876, -71.333, -0.960, 5000, 'SAY_ESCORT_START'),
(19671, 1, -372.647, -88.728, -0.958, 0, ''),
(19671, 2, -373.163, -114.959, -0.958, 0, ''),
(19671, 3, -373.137, -138.439, -0.958, 0, ''),
(19671, 4, -373.687, -152.964, -0.958, 0, ''),
(19671, 5, -379.091, -158.089, -0.958, 0, ''),
(19671, 6, -381.149, -164.796, -0.958, 0, ''),
(19671, 7, -375.292, -164.111, 0.715, 0, 'SAY_FIRST_STOP - escort paused'),
(19671, 8, -375.292, -164.111, 0.715, 1000, 'SAY_FIRST_STOP_COMPLETE'),
(19671, 9, -381.149, -164.796, -0.958, 0, ''),
(19671, 10, -374.292, -193.614, -0.967, 0, ''),
(19671, 11, -370.799, -217.796, -0.959, 0, ''),
(19671, 12, -344.132, -222.647, -0.959, 0, ''),
(19671, 13, -310.880, -219.357, -0.945, 9000, 'SAY_COLLECTOR_SEARCH'),
(19671, 14, -299.879, -201.809, -1.181, 0, ''),
(19671, 15, -285.874, -187.791, -0.694, 0, ''),
(19671, 16, -271.884, -164.856, -1.912, 0, ''),
(19671, 17, -260.729, -159.094, -1.190, 0, 'SAY_SECOND_STOP - escort paused'),
(19671, 18, -244.372, -163.136, -0.924, 0, ''),
(19671, 19, -236.428, -185.952, -0.953, 0, ''),
(19671, 20, -210.659, -206.710, 0.906, 0, ''),
(19671, 21, -193.375, -219.378, -0.518, 0, ''),
(19671, 22, -171.121, -223.043, -0.955, 0, ''),
(19671, 23, -148.658, -221.031, -0.770, 0, ''),
(19671, 24, -128.150, -215.657, -0.187, 0, ''),
(19671, 25, -93.429, -219.264, -1.320, 0, ''),
(19671, 26, -72.886, -222.278, -0.184, 0, 'SAY_THIRD_STOP - escort paused'),
(19671, 27, -42.343, -224.004, -0.268, 0, ''),
(19671, 28, -15.603, -223.780, 0.793, 0, ''),
(19671, 29, -12.975, -223.157, 1.811, 42000, 'SAY_REST'),
(19671, 30, -12.975, -223.157, 1.811, 5000, 'SAY_BREAK_OVER'),
(19671, 31, -14.898, -222.906, 0.786, 0, ''),
(19671, 32, -44.684, -221.592, -0.146, 0, ''),
(19671, 33, -59.746, -211.847, 0.216, 0, ''),
(19671, 34, -63.100, -195.288, -0.615, 0, ''),
(19671, 35, -63.218, -191.959, -1.725, 0, ''),
(19671, 36, -67.063, -160.281, -0.955, 0, ''),
(19671, 37, -67.888, -128.704, -1.226, 0, ''),
(19671, 38, -68.226, -107.766, -0.289, 0, ''),
(19671, 39, -68.251, -105.624, -1.631, 0, ''),
(19671, 40, -66.342, -88.147, -1.167, 0, 'SAY_XIRAXIS_SPAWN - escort paused'),
(19671, 41, -67.831, -78.571, -2.114, 0, ''),
(19671, 42, -67.692, -76.665, -0.941, 0, ''),
(19671, 43, -67.624, -56.025, -0.844, 0, 'quest complete'),
(19671, 44, -64.493, -15.776, -0.943, 0, '');

-- EOF
280 changes: 278 additions & 2 deletions src/scriptdev2/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,289 @@

/* ScriptData
SDName: mana_tombs
SD%Complete: 0%
SDComment: Placeholder
SD%Complete: 95
SDComment: Quest 10218
SDCategory: Auchindoun, Mana Tombs
EndScriptData */

#include "precompiled.h"
#include "escort_ai.h"
#include "TemporarySummon.h"

/*#####
## npc_shaheen
#####*/

enum
{
SAY_ESCORT_START = -1557015,
SAY_START = -1557016,
SAY_FIRST_STOP = -1557017,
SAY_FIRST_STOP_COMPLETE = -1557018,
SAY_COLLECTOR_SEARCH = -1557019,
SAY_COLLECTOR_FOUND = -1557020,
SAY_SECOND_STOP = -1557021,
SAY_THIRD_STOP = -1557022,
SAY_REST = -1557023,
SAY_READY_GO = -1557024,
SAY_BREAK_OVER = -1557025,
SAY_XIRAXIS_SPAWN = -1557026,
SAY_FINAL_STOP_1 = -1557027,
SAY_FINAL_STOP_2 = -1557028,
SAY_FINAL_STOP_3 = -1557029,
SAY_XIRAXIS_DEAD = -1557030,
SAY_EVENT_COMPLETE = -1557031,

EMOTE_TELEPORT = -1557032,
SAY_SPAWN = -1557033,
EMOTE_PANEL = -1557034,
SAY_ESCORT_READY = -1557035,

SPELL_ETHEREAL_TELEPORT = 34427,

NPC_ETHEREAL_SPELLBINDER = 18312,
NPC_ETHEREAL_THEURGIST = 18315,
NPC_ETHEREAL_SORCERER = 18313,
NPC_ETHEREAL_CRYPT_RAIDER = 18311,
NPC_NEXUS_TERROR = 19307,
NPC_ENGINEER_SHAEEN = 19671,
NPC_SHADOW_LORD_XIRAXIS = 19666,

QUEST_ID_HARD_WORK_PAYS_OFF = 10218
};

static const DialogueEntry aIntroDialogue[] =
{
{SPELL_ETHEREAL_TELEPORT, 0, 1000},
{EMOTE_TELEPORT, NPC_ENGINEER_SHAEEN, 3000},
{NPC_ETHEREAL_SPELLBINDER, 0, 5000},
{EMOTE_PANEL, NPC_ENGINEER_SHAEEN, 3000},
{SAY_ESCORT_READY, NPC_ENGINEER_SHAEEN, 0},
{SAY_ESCORT_START, NPC_ENGINEER_SHAEEN, 5000},
{SAY_START, NPC_ENGINEER_SHAEEN, 0},
{SAY_COLLECTOR_SEARCH, NPC_ENGINEER_SHAEEN, 6000},
{SAY_COLLECTOR_FOUND, NPC_ENGINEER_SHAEEN, 0},
{NPC_ETHEREAL_THEURGIST, 0, 12000},
{SAY_REST, NPC_ENGINEER_SHAEEN, 20000},
{SAY_READY_GO, NPC_ENGINEER_SHAEEN, 0},
{SAY_FINAL_STOP_1, NPC_SHADOW_LORD_XIRAXIS, 6000},
{SAY_FINAL_STOP_2, NPC_ENGINEER_SHAEEN, 4000},
{SAY_FINAL_STOP_3, NPC_SHADOW_LORD_XIRAXIS, 3000},
{NPC_SHADOW_LORD_XIRAXIS, 0, 0},
{NPC_ENGINEER_SHAEEN, 0, 3000},
{SAY_XIRAXIS_DEAD, NPC_ENGINEER_SHAEEN, 7000},
{SAY_EVENT_COMPLETE, NPC_ENGINEER_SHAEEN, 0},
{0, 0, 0},
};

struct npc_shaheenAI : public npc_escortAI, private DialogueHelper
{
npc_shaheenAI(Creature* pCreature) : npc_escortAI(pCreature),
DialogueHelper(aIntroDialogue)
{
StartNextDialogueText(SPELL_ETHEREAL_TELEPORT);
SetCombatMovement(false);
Reset();
}

ObjectGuid m_xiraxisGuid;
uint32 m_uiSummonCount;

void Reset() override { }

void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override
{
if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER)
{
Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue));
StartNextDialogueText(SAY_ESCORT_START);
}
}

void JustSummoned(Creature* pSummoned) override
{
switch (pSummoned->GetEntry())
{
case NPC_SHADOW_LORD_XIRAXIS:
m_xiraxisGuid = pSummoned->GetObjectGuid();
DoScriptText(SAY_XIRAXIS_SPAWN, pSummoned);
pSummoned->SetWalk(false);
pSummoned->GetMotionMaster()->MovePoint(1, -67.49f, -74.55f, -0.86f);
break;
default:
pSummoned->AI()->AttackStart(m_creature);
// no break;
case NPC_NEXUS_TERROR:
++m_uiSummonCount;
break;
}
}

void SummonedMovementInform(Creature* pSummoned, uint32 uiMotionType, uint32 uiPointId) override
{
if (pSummoned->GetEntry() == NPC_SHADOW_LORD_XIRAXIS && uiMotionType == POINT_MOTION_TYPE && uiPointId == 1)
StartNextDialogueText(SAY_FINAL_STOP_1);
}

void SummonedCreatureJustDied(Creature* pSummoned) override
{
switch (pSummoned->GetEntry())
{
case NPC_SHADOW_LORD_XIRAXIS:
StartNextDialogueText(NPC_ENGINEER_SHAEEN);
m_creature->HandleEmote(EMOTE_ONESHOT_ROAR);
break;
default:
--m_uiSummonCount;
if (!m_uiSummonCount)
{
SetEscortPaused(false);
m_creature->HandleEmote(EMOTE_STATE_NONE);
}
break;
}
}

void WaypointReached(uint32 uiPointId) override
{
switch (uiPointId)
{
case 7:
SetEscortPaused(true);
DoScriptText(SAY_FIRST_STOP, m_creature);
// summon first wave
m_creature->SummonCreature(NPC_ETHEREAL_THEURGIST, -375.86f, -129.16f, -0.95f, 4.82f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_ETHEREAL_THEURGIST, -370.67f, -199.79f, -0.95f, 1.52f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_ETHEREAL_SPELLBINDER, -371.12f, -129.07f, -0.95f, 4.82f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_ETHEREAL_SPELLBINDER, -375.18f, -199.58f, -0.95f, 1.52f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
break;
case 8:
DoScriptText(SAY_FIRST_STOP_COMPLETE, m_creature);
break;
case 13:
StartNextDialogueText(SAY_COLLECTOR_SEARCH);
break;
case 17:
SetEscortPaused(true);
DoScriptText(SAY_SECOND_STOP, m_creature);
// summon second wave
m_creature->SummonCreature(NPC_ETHEREAL_SORCERER, -278.17f, -195.50f, 0.68f, 1.22f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_ETHEREAL_SORCERER, -234.51f, -197.03f, -0.95f, 1.92f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_ETHEREAL_CRYPT_RAIDER, -282.28f, -194.44f, 0.44f, 1.22f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_ETHEREAL_CRYPT_RAIDER, -231.15f, -194.53f, -0.95f, 1.52f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
break;
case 24:
// summon third wave
m_creature->SummonCreature(NPC_NEXUS_TERROR, -37.30f, -222.44f, -0.33f, 3.01f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 240000);
m_creature->SummonCreature(NPC_NEXUS_TERROR, -15.76f, -225.36f, 0.79f, 2.93f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 240000);
break;
case 26:
SetEscortPaused(true);
DoScriptText(SAY_THIRD_STOP, m_creature);
break;
case 29:
StartNextDialogueText(NPC_ETHEREAL_THEURGIST);
m_creature->HandleEmote(EMOTE_STATE_WORK);
break;
case 30:
DoScriptText(SAY_BREAK_OVER, m_creature);
break;
case 40:
SetEscortPaused(true);
m_creature->SummonCreature(NPC_SHADOW_LORD_XIRAXIS, -47.10f, -0.49f, -0.95f, 3.45f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
break;
case 43:
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_ID_HARD_WORK_PAYS_OFF, m_creature);
break;
}
}

void JustDidDialogueStep(int32 iEntry) override
{
switch (iEntry)
{
case SPELL_ETHEREAL_TELEPORT:
DoCastSpellIfCan(m_creature, SPELL_ETHEREAL_TELEPORT);
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
break;
case NPC_ETHEREAL_SPELLBINDER:
if (m_creature->IsTemporarySummon())
{
TemporarySummon* pTemporary = (TemporarySummon*)m_creature;

if (Player* pSummoner = m_creature->GetMap()->GetPlayer(pTemporary->GetSummonerGuid()))
DoScriptText(SAY_SPAWN, m_creature, pSummoner);
}
break;
case SAY_ESCORT_READY:
m_creature->HandleEmote(EMOTE_STATE_NONE);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
break;
case SAY_REST:
m_creature->HandleEmote(EMOTE_STATE_NONE);
break;
case NPC_SHADOW_LORD_XIRAXIS:
if (Creature* pXiraxis = m_creature->GetMap()->GetCreature(m_xiraxisGuid))
{
pXiraxis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
pXiraxis->AI()->AttackStart(m_creature);
}
break;
case SAY_EVENT_COMPLETE:
SetRun();
SetEscortPaused(false);
break;
}
}

Creature* GetSpeakerByEntry(uint32 uiEntry) override
{
switch (uiEntry)
{
case NPC_ENGINEER_SHAEEN: return m_creature;
case NPC_SHADOW_LORD_XIRAXIS: return m_creature->GetMap()->GetCreature(m_xiraxisGuid);
default:
return NULL;
}
}

void UpdateEscortAI(const uint32 uiDiff) override
{
DialogueUpdate(uiDiff);

if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;

// ToDo: add combat spells

DoMeleeAttackIfReady();
}
};

CreatureAI* GetAI_npc_shaheen(Creature* pCreature)
{
return new npc_shaheenAI(pCreature);
}

bool QuestAccept_npc_shaheen(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_ID_HARD_WORK_PAYS_OFF)
{
pCreature->AI()->SendAIEvent(AI_EVENT_START_ESCORT, pPlayer, pCreature, pQuest->GetQuestId());
return true;
}

return false;
}

void AddSC_mana_tombs()
{
Script* pNewScript;

pNewScript = new Script;
pNewScript->Name = "npc_shaheen";
pNewScript->GetAI = &GetAI_npc_shaheen;
pNewScript->pQuestAcceptNPC = &QuestAccept_npc_shaheen;
pNewScript->RegisterSelf();
}

0 comments on commit f39bef6

Please sign in to comment.