aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaymoira <none@none>2009-02-08 11:43:53 +0100
committerBlaymoira <none@none>2009-02-08 11:43:53 +0100
commitb37fd436a1e96cc52e07986ff72946b6d6d0fb44 (patch)
treef25e89a8fb6015717371dffaf2d02e343d355e51
parent00707886911773bbc79ed605734750a69781439d (diff)
*Add script for Black Stalker - by Iskander
--HG-- branch : trunk
-rw-r--r--sql/updates/1028_world_scripts.sql1
-rw-r--r--sql/updates/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp2
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp191
8 files changed, 208 insertions, 0 deletions
diff --git a/sql/updates/1028_world_scripts.sql b/sql/updates/1028_world_scripts.sql
new file mode 100644
index 00000000000..2023243b456
--- /dev/null
+++ b/sql/updates/1028_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='boss_the_black_stalker' WHERE `entry`='17882'; \ No newline at end of file
diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt
index b3ccd47eae5..64f51f192f2 100644
--- a/sql/updates/CMakeLists.txt
+++ b/sql/updates/CMakeLists.txt
@@ -164,4 +164,5 @@ INSTALL(FILES
973_world_scripts.sql
1018_world.sql
1026_world.sql
+1028_world_scripts.sql
DESTINATION share/trinity/sql/updates)
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index 5193297610d..d908064ca9b 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -139,6 +139,7 @@ SET(trinityscript_LIB_SRCS
scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
+ scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
scripts/zone/darkshore/darkshore.cpp
scripts/zone/deadmines/def_deadmines.h
scripts/zone/deadmines/deadmines.cpp
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 1dd7be1a8fb..34b43b14a92 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -254,6 +254,7 @@ extern void AddSC_instance_steam_vault();
//--Underbog
extern void AddSC_boss_hungarfen();
+extern void AddSC_boss_the_black_stalker();
//Darkshore
//Darnassus
@@ -1460,6 +1461,7 @@ void ScriptsInit()
//--Underbog
AddSC_boss_hungarfen();
+ AddSC_boss_the_black_stalker();
//Darkshore
//Darnassus
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index e75de4546bb..a309f585589 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -1843,6 +1843,10 @@
RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp"
+ >
+ </File>
</Filter>
</Filter>
<Filter
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index 1c84fabba2c..e4e20bbb129 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -2020,6 +2020,10 @@
RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp"
+ >
+ </File>
</Filter>
</Filter>
<Filter
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index d903219407e..e6d36179274 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -2013,6 +2013,10 @@
RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_hungarfen.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\coilfang_resevoir\underbog\boss_the_black_stalker.cpp"
+ >
+ </File>
</Filter>
</Filter>
<Filter
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
new file mode 100644
index 00000000000..0f773ac9754
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
@@ -0,0 +1,191 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * 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
+ */
+
+/* ScriptData
+SDName: Boss_the_black_stalker
+SD%Complete: 95
+SDComment: Timers may be incorrect
+SDCategory: Coilfang Resevoir, Underbog
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_LEVITATE 31704
+#define SPELL_SUSPENSION 31719
+#define SPELL_LEVITATION_PULSE 31701
+#define SPELL_MAGNETIC_PULL 31705
+#define SPELL_CHAIN_LIGHTNING 31717
+#define SPELL_STATIC_CHARGE 31715
+#define SPELL_SUMMON_SPORE_STRIDER 38755
+
+#define ENTRY_SPORE_STRIDER 22299
+
+struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI
+{
+ boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ uint32 SporeStriders_Timer;
+ uint32 Levitate_Timer;
+ uint32 ChainLightning_Timer;
+ uint32 StaticCharge_Timer;
+ uint64 LevitatedTarget;
+ uint32 LevitatedTarget_Timer;
+ bool InAir;
+ uint32 check_Timer;
+ std::list<uint64> Striders;
+
+ void Reset()
+ {
+ Levitate_Timer = 12000;
+ ChainLightning_Timer = 6000;
+ StaticCharge_Timer = 10000;
+ SporeStriders_Timer = 10000+rand()%5000;
+ check_Timer = 5000;
+ LevitatedTarget = 0;
+ LevitatedTarget_Timer = 0;
+ Striders.clear();
+ }
+
+ void Aggro(Unit *who) {}
+
+ void JustSummoned(Creature *summon)
+ {
+ if(summon && summon->GetEntry() == ENTRY_SPORE_STRIDER)
+ {
+ Striders.push_back(summon->GetGUID());
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1))
+ summon->AI()->AttackStart(target);
+ else
+ if(m_creature->getVictim())
+ summon->AI()->AttackStart(m_creature->getVictim());
+ }
+ }
+
+ void JustDied(Unit *who)
+ {
+ for(std::list<uint64>::iterator i = Striders.begin(); i != Striders.end(); ++i)
+ if(Creature *strider = (Creature*)Unit::GetUnit(*m_creature, *i))
+ {
+ strider->SetLootRecipient(NULL);
+ strider->DealDamage(strider,strider->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ strider->RemoveCorpse();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ // Evade if too far
+ if(check_Timer < diff)
+ {
+ float x,y,z,o;
+ m_creature->GetHomePosition(x,y,z,o);
+ if(m_creature->GetDistance(x,y,z) > 60)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ check_Timer = 1000;
+ }else check_Timer -= diff;
+
+ // Spore Striders
+ if(HeroicMode && SporeStriders_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_SUMMON_SPORE_STRIDER);
+ SporeStriders_Timer = 10000+rand()%5000;
+ }else SporeStriders_Timer -= diff;
+
+ // Levitate
+ if(LevitatedTarget)
+ {
+ if(LevitatedTarget_Timer < diff)
+ {
+ if(Unit* target = (Unit*)Unit::GetUnit(*m_creature, LevitatedTarget))
+ {
+ if(!target->HasAura(SPELL_LEVITATE,0))
+ {
+ LevitatedTarget = 0;
+ return;
+ }
+ if(InAir)
+ {
+ target->AddAura(SPELL_SUSPENSION, target);
+ LevitatedTarget = 0;
+ }
+ else
+ {
+ target->CastSpell(target, SPELL_MAGNETIC_PULL, true);
+ InAir = true;
+ LevitatedTarget_Timer = 1500;
+ }
+ }
+ else
+ LevitatedTarget = 0;
+ }else LevitatedTarget_Timer -= diff;
+ }
+ if(Levitate_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1))
+ {
+ DoCast(target, SPELL_LEVITATE);
+ LevitatedTarget = target->GetGUID();
+ LevitatedTarget_Timer = 2000;
+ InAir = false;
+ }
+ Levitate_Timer = 12000+rand()%3000;
+ }else Levitate_Timer -= diff;
+
+ // Chain Lightning
+ if(ChainLightning_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(target, SPELL_CHAIN_LIGHTNING);
+ ChainLightning_Timer = 7000;
+ }else ChainLightning_Timer -= diff;
+
+ // Static Charge
+ if(StaticCharge_Timer < diff)
+ {
+ if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0,30,true))
+ DoCast(target, SPELL_STATIC_CHARGE);
+ StaticCharge_Timer = 10000;
+ }else StaticCharge_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_the_black_stalker(Creature *_Creature)
+{
+ return new boss_the_black_stalkerAI (_Creature);
+}
+
+void AddSC_boss_the_black_stalker()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_the_black_stalker";
+ newscript->GetAI = &GetAI_boss_the_black_stalker;
+ newscript->RegisterSelf();
+}