aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/scripts/eastern_kingdoms/redridge_mountains.cpp171
-rw-r--r--src/bindings/scripts/system/ScriptLoader.cpp2
4 files changed, 178 insertions, 0 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index 39b38dd6dac..89927d39228 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -192,6 +192,7 @@ SET(trinityscript_LIB_SRCS
scripts/eastern_kingdoms/ironforge.cpp
scripts/eastern_kingdoms/isle_of_queldanas.cpp
scripts/eastern_kingdoms/loch_modan.cpp
+ scripts/eastern_kingdoms/redridge_mountains.cpp
scripts/eastern_kingdoms/searing_gorge.cpp
scripts/eastern_kingdoms/silvermoon_city.cpp
scripts/eastern_kingdoms/silverpine_forest.cpp
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 315d1aa5cda..4a035d03b3b 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -459,6 +459,10 @@
RelativePath="..\scripts\eastern_kingdoms\loch_modan.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\eastern_kingdoms\redridge_mountains.cpp"
+ >
+ </File>
<File
RelativePath="..\scripts\eastern_kingdoms\searing_gorge.cpp"
>
diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/redridge_mountains.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/redridge_mountains.cpp
new file mode 100644
index 00000000000..8867106d425
--- /dev/null
+++ b/src/bindings/scripts/scripts/eastern_kingdoms/redridge_mountains.cpp
@@ -0,0 +1,171 @@
+/* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* Script Data Start
+SDName: Redridge Mountains
+SD%Complete: 100%
+SDComment: Support for quest 219.
+Script Data End */
+
+#include "precompiled.h"
+#include "escort_ai.h"
+
+enum eCorporalKeeshan
+{
+ QUEST_MISSING_IN_ACTION = 219,
+
+ SAY_CORPORAL_1 = -1000464,
+ SAY_CORPORAL_2 = -1000465,
+ SAY_CORPORAL_3 = -1000466,
+ SAY_CORPORAL_4 = -1000467,
+ SAY_CORPORAL_5 = -1000468,
+
+ SPELL_MOCKING_BLOW = 21008,
+ SPELL_SHIELD_BASH = 11972,
+};
+
+struct TRINITY_DLL_DECL npc_corporal_keeshanAI : public npc_escortAI
+{
+ npc_corporal_keeshanAI(Creature* pCreature) : npc_escortAI(pCreature) {}
+
+ uint32 uiPhase;
+ uint32 uiTimer;
+ uint32 uiMockingBlowTimer;
+ uint32 uiShieldBashTimer;
+
+ void Reset()
+ {
+ uiTimer = 0;
+ uiPhase = 0;
+ uiMockingBlowTimer = 5000;
+ uiShieldBashTimer = 8000;
+ }
+
+ void WaypointReached(uint32 uiI)
+ {
+ Player* pPlayer = GetPlayerForEscort();
+
+ if (!pPlayer)
+ return;
+
+ if (uiI >= 65 && m_creature->GetUnitMovementFlags() == MOVEMENTFLAG_WALK_MODE)
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+
+ switch(uiI)
+ {
+ case 39:
+ SetEscortPaused(true);
+ uiTimer = 2000;
+ uiPhase = 1;
+ break;
+ case 65:
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 115:
+ uiTimer = 2000;
+ uiPhase = 4;
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (HasEscortState(STATE_ESCORT_NONE))
+ return;
+
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (uiPhase)
+ {
+ if (uiTimer <= uiDiff)
+ {
+ switch(uiPhase)
+ {
+ case 1:
+ m_creature->SetStandState(UNIT_STAND_STATE_SIT);
+ uiTimer = 1000;
+ uiPhase = 2;
+ break;
+ case 2:
+ DoScriptText(SAY_CORPORAL_2,m_creature);
+ uiTimer = 15000;
+ uiPhase = 3;
+ break;
+ case 3:
+ DoScriptText(SAY_CORPORAL_3,m_creature);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ SetEscortPaused(false);
+ uiTimer = 0;
+ uiPhase = 0;
+ break;
+ case 4:
+ DoScriptText(SAY_CORPORAL_4, m_creature);
+ uiTimer = 2500;
+ uiPhase = 5;
+ case 5:
+ DoScriptText(SAY_CORPORAL_5, m_creature);
+ uiTimer = 0;
+ uiPhase = 0;
+ }
+ } else uiTimer -= uiDiff;
+ }
+
+ if (!UpdateVictim())
+ return;
+
+ if (uiMockingBlowTimer <= uiDiff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MOCKING_BLOW);
+ uiMockingBlowTimer = 5000;
+ } else uiMockingBlowTimer -= uiDiff;
+
+ if (uiShieldBashTimer <= uiDiff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_MOCKING_BLOW);
+ uiShieldBashTimer = 8000;
+ } else uiShieldBashTimer -= uiDiff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+bool QuestAccept_npc_corporal_keeshan(Player* pPlayer, Creature* pCreature, Quest const *pQuest)
+{
+ if (pQuest->GetQuestId() == QUEST_MISSING_IN_ACTION)
+ {
+ CAST_AI(npc_corporal_keeshanAI,pCreature->AI())->Start(true, false, pPlayer->GetGUID(),pQuest);
+ DoScriptText(SAY_CORPORAL_1, pCreature);
+ }
+
+ return false;
+}
+
+CreatureAI* GetAI_npc_corporal_keeshan(Creature* pCreature)
+{
+ return new npc_corporal_keeshanAI(pCreature);
+}
+
+void AddSC_redridge_mountains()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_corporal_keeshan";
+ newscript->GetAI = &GetAI_npc_corporal_keeshan;
+ newscript->pQuestAccept = &QuestAccept_npc_corporal_keeshan;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp
index 0981d64aae2..9ae99b6fc24 100644
--- a/src/bindings/scripts/system/ScriptLoader.cpp
+++ b/src/bindings/scripts/system/ScriptLoader.cpp
@@ -187,6 +187,7 @@ extern void AddSC_hinterlands();
extern void AddSC_ironforge();
extern void AddSC_isle_of_queldanas();
extern void AddSC_loch_modan();
+extern void AddSC_redridge_mountains();
extern void AddSC_searing_gorge();
extern void AddSC_silvermoon_city();
extern void AddSC_silverpine_forest();
@@ -644,6 +645,7 @@ void AddScripts()
AddSC_ironforge();
AddSC_isle_of_queldanas();
AddSC_loch_modan();
+ AddSC_redridge_mountains();
AddSC_searing_gorge();
AddSC_silvermoon_city();
AddSC_silverpine_forest();