aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTeppic1 <32468801+Teppic1@users.noreply.github.com>2017-12-23 15:31:40 +0000
committerjackpoz <giacomopoz@gmail.com>2017-12-23 16:31:40 +0100
commitecc55c280c69c1f185df8f6365c7945165f0117f (patch)
tree126ab14cb805609c087cd9896bb4f6766b9dbe3e /src
parentcd88406de9467127e988e4b0f7e2ba0ec787636b (diff)
Scripts/Deadmines: New script for Edwin VanCleef (#20736)
* Scripts/Deadmines: New script for Edwin VanCleef - Blackguards are now summoned properly as part of the encounter - Blackguards will despawn on evade - Fixed scripted actions/speech on health - Removed Blackguards from world DB - Corrected VanCleef's damage
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/boss_vancleef.cpp128
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.h10
-rw-r--r--src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp2
3 files changed, 138 insertions, 2 deletions
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_vancleef.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_vancleef.cpp
new file mode 100644
index 00000000000..98c00b3108d
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_vancleef.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2008-2017 TrinityCore <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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "deadmines.h"
+#include "ScriptedCreature.h"
+
+enum VanCleefData
+{
+ SPELL_DUAL_WIELD = 674,
+ SPELL_THRASH = 12787,
+ SPELL_VANCLEEFS_ALLIES = 5200
+};
+
+enum Speech
+{
+ SAY_AGGRO = 0, // None may challenge the Brotherhood!
+ SAY_ONE = 1, // Lapdogs, all of you!
+ SAY_SUMMON = 2, // calls more of his allies out of the shadows.
+ SAY_TWO = 3, // Fools! Our cause is righteous!
+ SAY_KILL = 4, // And stay down!
+ SAY_THREE = 5 // The Brotherhood shall prevail!
+};
+
+// TDB coords
+Position const BlackguardPositions[] =
+{
+ { -78.2791f, -824.784f, 40.0007f, 2.93215f },
+ { -77.8071f, -815.097f, 40.0188f, 3.26377f }
+};
+
+struct boss_vancleef : public BossAI
+{
+ public:
+ boss_vancleef(Creature* creature) : BossAI(creature, DATA_VANCLEEF), _guardsCalled(false), _health25(false), _health33(false), _health66(false) { }
+
+ void Reset() override
+ {
+ BossAI::Reset();
+
+ _guardsCalled = false;
+ _health25 = false;
+ _health33 = false;
+ _health66 = false;
+
+ DoCastSelf(SPELL_DUAL_WIELD, true);
+ DoCastSelf(SPELL_THRASH, true);
+
+ SummonBlackguards();
+ }
+
+ void EnterCombat(Unit* victim) override
+ {
+ BossAI::EnterCombat(victim);
+ summons.DoZoneInCombat();
+
+ Talk(SAY_AGGRO);
+ }
+
+ void KilledUnit(Unit* victim) override
+ {
+ if (victim->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ summons.DespawnAll();
+ _DespawnAtEvade();
+ }
+
+ void SummonBlackguards()
+ {
+ for (Position BlackguardPosition : BlackguardPositions)
+ DoSummon(NPC_BLACKGUARD, BlackguardPosition, 60000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) override
+ {
+ if (!_guardsCalled && HealthBelowPct(50))
+ {
+ Talk(SAY_SUMMON);
+ DoCastSelf(SPELL_VANCLEEFS_ALLIES);
+ _guardsCalled = true;
+ }
+
+ if (!_health25 && HealthBelowPct(25))
+ {
+ Talk(SAY_THREE);
+ _health25 = true;
+ }
+ else if (!_health33 && HealthBelowPct(33))
+ {
+ Talk(SAY_TWO);
+ _health33 = true;
+ }
+ else if (!_health66 && HealthBelowPct(66))
+ {
+ Talk(SAY_ONE);
+ _health66 = true;
+ }
+ }
+
+ private:
+ bool _guardsCalled;
+ bool _health25;
+ bool _health33;
+ bool _health66;
+};
+
+void AddSC_boss_vancleef()
+{
+ RegisterDeadminesCreatureAI(boss_vancleef);
+}
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index a2778fb38c0..057362ad731 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -36,7 +36,10 @@ enum DMCannonState
enum DMData
{
EVENT_STATE,
- EVENT_RHAHKZOR
+ EVENT_RHAHKZOR,
+
+ DATA_MR_SMITE = 0, // not currently used
+ DATA_VANCLEEF = 1
};
enum DMData64
@@ -55,7 +58,8 @@ enum DMGameObjects
enum DMCreaturesIds
{
- NPC_MR_SMITE = 646
+ NPC_MR_SMITE = 646,
+ NPC_BLACKGUARD = 636
};
enum DMInstanceTexts
@@ -70,4 +74,6 @@ inline AI* GetDeadminesAI(T* obj)
return GetInstanceAI<AI>(obj, DMScriptName);
}
+#define RegisterDeadminesCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetDeadminesAI)
+
#endif
diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
index 047467d0338..d4cb983711b 100644
--- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
@@ -59,6 +59,7 @@ void AddSC_instance_blackwing_lair();
void AddSC_deadmines(); //Deadmines
void AddSC_instance_deadmines();
void AddSC_boss_mr_smite();
+void AddSC_boss_vancleef();
void AddSC_gnomeregan(); //Gnomeregan
void AddSC_instance_gnomeregan();
void AddSC_boss_attumen(); //Karazhan
@@ -234,6 +235,7 @@ void AddEasternKingdomsScripts()
AddSC_instance_blackwing_lair();
AddSC_deadmines(); //Deadmines
AddSC_boss_mr_smite();
+ AddSC_boss_vancleef();
AddSC_instance_deadmines();
AddSC_gnomeregan(); //Gnomeregan
AddSC_instance_gnomeregan();