aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortartalo <none@none>2009-11-20 21:15:29 +0100
committertartalo <none@none>2009-11-20 21:15:29 +0100
commit0f2dc64a41f9aeb783cad5c696c1f5154d167bae (patch)
tree21bf8b5dee679d840b2400ef1c0af55c586c0414
parent3b1c6a7bedd5c3f51e3729f391abcec73de79dea (diff)
Blackfathom Deeps, Twilight Lord Kelris: implement script (needed for GO handling)
--HG-- branch : trunk
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_gelihast.cpp2
-rw-r--r--src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp108
3 files changed, 110 insertions, 1 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index ef7b959a4ae..1d3741f3007 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -207,6 +207,7 @@ SET(trinityscript_LIB_SRCS
scripts/examples/example_gossip_codebox.cpp
scripts/examples/example_misc.cpp
scripts/kalimdor/blackfathom_depths/boss_gelihast.cpp
+ scripts/kalimdor/blackfathom_depths/boss_kelris.cpp
scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp
scripts/kalimdor/blackfathom_depths/blackfathom_deeps.cpp
scripts/kalimdor/blackfathom_depths/blackfathom_deeps.h
diff --git a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_gelihast.cpp b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_gelihast.cpp
index 29d79314e83..3467f411ea2 100644
--- a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_gelihast.cpp
+++ b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_gelihast.cpp
@@ -82,4 +82,4 @@ void AddSC_boss_gelihast()
newscript->Name = "boss_gelihast";
newscript->GetAI = &GetAI_boss_gelihast;
newscript->RegisterSelf();
-} \ No newline at end of file
+}
diff --git a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp
new file mode 100644
index 00000000000..9cd4c8c9245
--- /dev/null
+++ b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/boss_kelris.cpp
@@ -0,0 +1,108 @@
+/*
+* Copyright (C) 2008-2009 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
+*/
+
+#include "precompiled.h"
+#include "blackfathom_deeps.h"
+
+enum Spells
+{
+ SPELL_MIND_BLAST = 15587,
+ SPELL_SLEEP = 8399,
+};
+
+//Id's from ACID
+enum Yells
+{
+ SAY_AGGRO = -566,
+ SAY_SLEEP = -567,
+ SAY_DEATH = -568
+};
+
+struct TRINITY_DLL_DECL boss_kelrisAI : public ScriptedAI
+{
+ boss_kelrisAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceData();
+ }
+
+ uint32 uiMindBlastTimer;
+ uint32 uiSleepTimer;
+
+ ScriptedInstance *pInstance;
+
+ void Reset()
+ {
+ uiMindBlastTimer = urand(2000,5000);
+ uiSleepTimer = urand(9000,12000);
+ if (pInstance)
+ pInstance->SetData(TYPE_KELRIS, NOT_STARTED);
+ }
+
+ void EnterCombat(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ if (pInstance)
+ pInstance->SetData(TYPE_KELRIS, IN_PROGRESS);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ if (pInstance)
+ pInstance->SetData(TYPE_KELRIS, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiMindBlastTimer < diff)
+ {
+ DoCastVictim(SPELL_MIND_BLAST);
+ uiMindBlastTimer = urand(7000,9000);
+ } else uiMindBlastTimer -= diff;
+
+ if (uiSleepTimer < diff)
+ {
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
+ {
+ DoScriptText(SAY_SLEEP, m_creature);
+ DoCast(pTarget, SPELL_SLEEP);
+ }
+ uiSleepTimer = urand(15000,20000);
+ } else uiSleepTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_kelris(Creature* pCreature)
+{
+ return new boss_kelrisAI (pCreature);
+}
+
+void AddSC_boss_kelris()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "boss_kelris";
+ newscript->GetAI = &GetAI_boss_kelris;
+ newscript->RegisterSelf();
+} \ No newline at end of file