aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-05-01 22:17:48 +0200
committerclick <none@none>2010-05-01 22:17:48 +0200
commit3683de3f8032a05eb584964c044b9f2d3857706e (patch)
treed1d3ed304b86536176d27227fa83a92a45dbcb6a
parent0803f644a58c6340e2086bf48abcd181f617912a (diff)
Add support for quest 12688 (Engineering a Disaster) - patch by supabad
Closes issue #982 --HG-- branch : trunk
-rw-r--r--sql/updates/8062_world_creature_template.sql1
-rw-r--r--sql/updates/8062_world_script_texts.sql9
-rw-r--r--sql/updates/8062_world_script_waypoint.sql16
-rw-r--r--src/scripts/northrend/sholazar_basin.cpp123
4 files changed, 149 insertions, 0 deletions
diff --git a/sql/updates/8062_world_creature_template.sql b/sql/updates/8062_world_creature_template.sql
new file mode 100644
index 00000000000..a08d1c10c79
--- /dev/null
+++ b/sql/updates/8062_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `MovementType` = '2', `ScriptName` = 'npc_engineer_helice' WHERE `creature_template`.`entry` = 28787;
diff --git a/sql/updates/8062_world_script_texts.sql b/sql/updates/8062_world_script_texts.sql
new file mode 100644
index 00000000000..e9c90834a61
--- /dev/null
+++ b/sql/updates/8062_world_script_texts.sql
@@ -0,0 +1,9 @@
+DELETE FROM `script_texts` WHERE `npc_entry`=28787;
+INSERT INTO `script_texts` (`npc_entry`, `entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
+(28787, -1800047, 'Let''s get the hell out of here', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(28787, -1800048, 'Listen up, Venture Company goons! Rule #1: Never keep the prisoner near the explosives.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(28787, -1800049, 'Or THIS is what you get. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(28787, -1800050, 'It''s getting a little hot over here. Shall we move on? ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(28787, -1800051, 'Oh, look, it''s another cartload of explosives! Let''s help them dispose of it. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(28787, -1800052, 'You really shouldn''t play with this stuff. Someone could get hurt.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(28787, -1800053, 'We made it! Thank you for getting me out of that hell hole. Tell Hemet to expect me! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL);
diff --git a/sql/updates/8062_world_script_waypoint.sql b/sql/updates/8062_world_script_waypoint.sql
new file mode 100644
index 00000000000..3381af774cf
--- /dev/null
+++ b/sql/updates/8062_world_script_waypoint.sql
@@ -0,0 +1,16 @@
+DELETE FROM `script_waypoint` WHERE `entry` =28787;
+INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
+(28787, 0, 5919.43, 5374.88, -98.8816, 5000, '0'),
+(28787, 1, 5919.43, 5374.88, -98.8816, 5000, '0'),
+(28787, 2, 5925.17, 5372.37, -98.8815, 0, '0'),
+(28787, 3, 5928.32, 5377, -99.0266, 0, '0'),
+(28787, 4, 5917.24, 5383.36, -106.31, 0, '0'),
+(28787, 5, 5907.49, 5389.62, -106.31, 0, '0'),
+(28787, 6, 5899.66, 5405.25, -96.5535, 0, '0'),
+(28787, 7, 5890.27, 5395.42, -95.5519, 0, '0'),
+(28787, 8, 5887.57, 5384.4, -95.4326, 5000, '0'),
+(28787, 9, 5878.52, 5384.61, -93.3333, 0, '0'),
+(28787, 10, 5873.17, 5360.43, -98.4124, 0, '0'),
+(28787, 11, 5859.23, 5353.29, -98.8777, 0, '0'),
+(28787, 12, 5841.27, 5334.14, -100.446, 0, '0'),
+(28787, 13, 5819.81, 5300.27, -96.8567, 0, '0');
diff --git a/src/scripts/northrend/sholazar_basin.cpp b/src/scripts/northrend/sholazar_basin.cpp
index b503766d60f..f81a6004fde 100644
--- a/src/scripts/northrend/sholazar_basin.cpp
+++ b/src/scripts/northrend/sholazar_basin.cpp
@@ -298,6 +298,123 @@ CreatureAI* GetAI_npc_bushwhacker(Creature* pCreature)
return new npc_bushwhackerAI(pCreature);
}
+/*######
+## npc_engineer_helice
+######*/
+
+enum eEnums
+{
+ SPELL_EXPLODE_CRYSTAL = 62487,
+ SPELL_FLAMES = 64561,
+
+ SAY_WP_7 = -1800047,
+ SAY_WP_6 = -1800048,
+ SAY_WP_5 = -1800049,
+ SAY_WP_4 = -1800050,
+ SAY_WP_3 = -1800051,
+ SAY_WP_2 = -1800052,
+ SAY_WP_1 = -1800053,
+
+ QUEST_DISASTER = 12688
+};
+
+struct npc_engineer_heliceAI : public npc_escortAI
+{
+ npc_engineer_heliceAI(Creature* pCreature) : npc_escortAI(pCreature) { }
+
+ uint32 m_uiChatTimer;
+
+ void WaypointReached(uint32 i)
+ {
+ Player* pPlayer = GetPlayerForEscort();
+ switch (i)
+ {
+ case 0:
+ DoScriptText(SAY_WP_2, me);
+ break;
+ case 1:
+ DoScriptText(SAY_WP_3, me);
+ me->CastSpell(5918.33, 5372.91, -98.770, SPELL_EXPLODE_CRYSTAL, true);
+ me->SummonGameObject(184743, 5918.33, 5372.91, -98.770, 0, 0, 0, 0, 0, TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
+ break;
+ case 2:
+ DoScriptText(SAY_WP_4, me);
+ break;
+ case 7:
+ DoScriptText(SAY_WP_5, me);
+ break;
+ case 8:
+ me->CastSpell(5887.37, 5379.39, -91.289, SPELL_EXPLODE_CRYSTAL, true);
+ me->SummonGameObject(184743, 5887.37, 5379.39, -91.289, 0, 0, 0, 0, 0, TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
+ break;
+ case 9:
+ DoScriptText(SAY_WP_6, me);
+ break;
+ case 13:
+ if (pPlayer)
+ {
+ pPlayer->GroupEventHappens(QUEST_DISASTER, me);
+ DoScriptText(SAY_WP_7, me);
+ }
+ break;
+ }
+ }
+
+ void Reset()
+ {
+ m_uiChatTimer = 4000;
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ Player* pPlayer = GetPlayerForEscort();
+
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ {
+ if (pPlayer)
+ pPlayer->FailQuest(QUEST_DISASTER);
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ {
+ if (m_uiChatTimer <= uiDiff)
+ {
+ m_uiChatTimer = 12000;
+ }
+ else
+ m_uiChatTimer -= uiDiff;
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_engineer_helice(Creature* pCreature)
+{
+ return new npc_engineer_heliceAI(pCreature);
+}
+
+bool QuestAccept_npc_engineer_helice(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
+{
+ if (pQuest->GetQuestId() == QUEST_DISASTER)
+ {
+ if (npc_engineer_heliceAI* pEscortAI = CAST_AI(npc_engineer_heliceAI, pCreature->AI()))
+ {
+ pCreature->GetMotionMaster()->MoveJumpTo(0, 0.4, 0.4);
+ pCreature->setFaction(113);
+
+ pEscortAI->Start(false, false, pPlayer->GetGUID());
+ DoScriptText(SAY_WP_1, pCreature);
+ }
+ }
+ return true;
+}
+
void AddSC_sholazar_basin()
{
Script *newscript;
@@ -325,4 +442,10 @@ void AddSC_sholazar_basin()
newscript->Name = "npc_bushwhacker";
newscript->GetAI = &GetAI_npc_bushwhacker;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_engineer_helice";
+ newscript->GetAI = &GetAI_npc_engineer_helice;
+ newscript->pQuestAccept = &QuestAccept_npc_engineer_helice;
+ newscript->RegisterSelf();
}