From 9a3c16daf4790296a08526f3171c2dec59bef384 Mon Sep 17 00:00:00 2001
From: Ovalord <1Don7H4v3@m41L.com>
Date: Wed, 14 Feb 2018 11:34:28 +0100
Subject: [PATCH] Scripts/Deadmines: * dropped outdated deadmines instance
script * implement Glubtok encounter
---
.../4.3.4/custom_2018_02_14_00_world.sql | 105 +++++
src/server/game/Spells/SpellMgr.cpp | 28 ++
.../Deadmines/boss_glubtok.cpp | 419 ++++++++++++++++++
.../Deadmines/boss_mr_smite.cpp | 233 ----------
.../EasternKingdoms/Deadmines/deadmines.h | 79 ++--
.../Deadmines/instance_deadmines.cpp | 247 +++--------
.../eastern_kingdoms_script_loader.cpp | 4 +-
7 files changed, 675 insertions(+), 440 deletions(-)
create mode 100644 sql/updates/world/4.3.4/custom_2018_02_14_00_world.sql
create mode 100644 src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp
delete mode 100644 src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
diff --git a/sql/updates/world/4.3.4/custom_2018_02_14_00_world.sql b/sql/updates/world/4.3.4/custom_2018_02_14_00_world.sql
new file mode 100644
index 00000000000..15a9f0c02bc
--- /dev/null
+++ b/sql/updates/world/4.3.4/custom_2018_02_14_00_world.sql
@@ -0,0 +1,105 @@
+-- Template Updates
+-- Glubtok
+UPDATE `creature_template` SET `scriptname`= 'boss_glubtok' WHERE `entry`= 47162;
+UPDATE `creature_template` SET `minlevel`=87, `maxlevel`=87 WHERE `entry`=48936;
+-- General Purpose Bunny JMF Look 2
+UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry`= 47242;
+-- General Purpose Bunny JMF
+UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry`= 45979;
+-- Glubtok Firewall Platter
+UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry`= 48974;
+
+-- Texts
+DELETE FROM `creature_text` WHERE `CreatureID`= 47162;
+INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `Comment`) VALUES
+(47162, 0, 0, 'Glubtok show you da power of de arcane!', 14, 0, 100, 0, 0, 21151, 47256, 'Glubtok to Player'),
+(47162, 1, 0, 'Fists of flame!', 14, 0, 100, 0, 0, 21153, 47239, 'Glubtok'),
+(47162, 2, 0, 'Fists of frost!', 14, 0, 100, 0, 0, 21156, 47238, 'Glubtok'),
+(47162, 3, 0, 'Glubtok ready?', 14, 0, 100, 1, 0, 21154, 47361, 'Glubtok'),
+(47162, 4, 0, 'Let''s do it!', 14, 0, 100, 15, 0, 21157, 47362, 'Glubtok'),
+(47162, 5, 0, 'ARCANE POWER!!!', 14, 0, 100, 15, 0, 21146, 47363, 'Glubtok'),
+(47162, 6, 0, '|TInterface\\Icons\\spell_holy_innerfire.blp:20|t Glubtok creates a moving |cFFFF0000|Hspell:91398|h[Fire Wall]|h|r!', 41, 0, 100, 0, 0, 0, 49155, 'Glubtok'),
+(47162, 7, 0, 'TOO...MUCH...POWER!!!', 14, 0, 100, 15, 0, 21145, 47422, 'Glubtok');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceEntry` IN (88072, 88093) AND `SourceTypeOrReferenceId`= 13;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES
+(13, 1, 88072, 0, 0, 31, 0, 3, 47162, 0, 0, 0, '', 'Arcane Fire Beam - Target Glubtok'),
+(13, 1, 88093, 0, 0, 31, 0, 3, 47162, 0, 0, 0, '', 'Arcane Frost Beam - Target Glubtok');
+
+-- Spells
+DELETE FROM `spell_proc` WHERE `SpellId` IN (87900, 87897);
+INSERT INTO `spell_proc` (`SpellId`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `Cooldown`) VALUES
+(87900, 0x00000004, 1, 0, 4000),
+(87897, 0x00000004, 1, 0, 4000);
+
+-- Spellclick spells
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (48974, 48975, 49039, 49040);
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES
+(48974, 46598, 1, 1),
+(48975, 47020, 1, 1),
+(49039, 47020, 1, 1),
+(49040, 47020, 1, 1);
+
+-- Vehicle Accessory
+DELETE FROM `vehicle_template_accessory` WHERE `entry` IN (48974, 48975, 49039, 49040);
+INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES
+(48974, 48975, 0, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 49039, 1, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 49040, 2, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 49040, 3, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 48975, 4, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 49039, 5, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 49040, 6, 1, 'Glubtok Firewall Platter', 5, 0),
+(48974, 49040, 7, 1, 'Glubtok Firewall Platter', 5, 0),
+(49040, 49042, 5, 1, 'Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c', 5, 0), -- Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c
+(49040, 49042, 4, 1, 'Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c', 5, 0), -- Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c
+(49040, 49042, 1, 1, 'Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c', 5, 0), -- Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c
+(49040, 49042, 0, 1, 'Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c', 5, 0), -- Glubtok Firewall Platter Creature Level 1c - Glubtok Firewall Platter Creature Level 2c
+(49039, 49041, 5, 1, 'Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b', 5, 0), -- Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b
+(49039, 49041, 4, 1, 'Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b', 5, 0), -- Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b
+(49039, 49041, 1, 1, 'Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b', 5, 0), -- Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b
+(49039, 49041, 0, 1, 'Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b', 5, 0), -- Glubtok Firewall Platter Creature Level 1b - Glubtok Firewall Platter Creature Level 2b
+(48975, 48976, 5, 1, 'Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a', 5, 0), -- Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a
+(48975, 48976, 4, 1, 'Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a', 5, 0), -- Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a
+(48975, 48976, 1, 1, 'Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a', 5, 0), -- Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a
+(48975, 48976, 0, 1, 'Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a', 5, 0); -- Glubtok Firewall Platter Creature Level 1a - Glubtok Firewall Platter Creature Level 2a
+
+DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_glubtok_blossom_targeting';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(88140, 'spell_glubtok_blossom_targeting');
+
+-- Creature Fire Blossom 48957 SAI
+SET @ENTRY := 48957;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 18, 30, 0, 0, 0, 0, 0, 0, "On just summoned - Self: Attack Players in 30 yards // ");
+
+-- Creature Frost Blossom 48957 SAI
+SET @ENTRY := 48958;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 18, 30, 0, 0, 0, 0, 0, 0, "On just summoned - Self: Attack Players in 30 yards // ");
+
+-- Currency Loot
+DELETE FROM `creature_onkill_reward` WHERE `creature_id`= 48936;
+INSERT INTO `creature_onkill_reward` (`creature_id`, `CurrencyId1`, `CurrencyCount1`) VALUES
+(48936, 395, 7000);
+
+-- Loot
+UPDATE creature_template SET `lootid`= 47162 WHERE `entry`= 47162;
+DELETE FROM creature_loot_template WHERE `entry` IN (47162, 48936);
+INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
+(47162, 5195, 0, 1, 1, 1, 1),
+(47162, 2169, 0, 1, 1, 1, 1),
+(47162, 5194, 0, 1, 1, 1, 1);
+
+UPDATE creature_template SET `lootid`= 48936 WHERE `entry`= 48936;
+INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
+(48936, 63467, 0, 1, 1, 1, 1),
+(48936, 63468, 0, 1, 1, 1, 1),
+(48936, 63471, 0, 1, 1, 1, 1),
+(48936, 63470, 0, 1, 1, 1, 1),
+(48936, 65163, 0, 1, 1, 1, 1);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 421ed9d4ca3..6873cedb619 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -4118,6 +4118,34 @@ void SpellMgr::LoadSpellInfoCorrections()
});
// ENDOF THE VORTEX PINNACLE SPELLS
+ //
+ // DEADMINES SPELLS
+ //
+ // Glubtok
+ // Fists of Flame
+ ApplySpellFix({
+ 87874,
+ 91268,
+ 87896,
+ 91269
+ }, [](SpellInfo* spellInfo)
+ {
+ spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(2); // Combat Range
+ });
+
+ // Fists of Frost
+ ApplySpellFix({
+ 87899,
+ 91272,
+ 87901,
+ 91273,
+ }, [](SpellInfo* spellInfo)
+ {
+ spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(2); // Combat Range
+ });
+
+ // END OF DEADMINES SPELLS
+
//
// GRIM BATOL SPELLS
//
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp
new file mode 100644
index 00000000000..a18472c2537
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp
@@ -0,0 +1,419 @@
+/*
+* Copyright (C) 2008-2017 TrinityCore
+*
+* 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 .
+*/
+
+#include "ObjectMgr.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
+#include "Player.h"
+#include "Vehicle.h"
+#include "deadmines.h"
+
+enum Spells
+{
+ // Glubtok
+ SPELL_BLINK = 87925,
+ SPELL_FISTS_OF_FROST = 87861,
+ SPELL_FISTS_OF_FLAME = 87859,
+ SPELL_TELEPORT = 88002,
+ SPELL_EMOTE_TALK = 79506,
+ SPELL_EMOTE_ROAR = 48350,
+ SPELL_ARCANE_POWER = 88009,
+ SPELL_ARCANE_FIRE_BEAM = 88072,
+ SPELL_ARCANE_FROST_BEAM = 88093,
+ SPELL_STUN_SELF = 88040,
+ SPELL_BLOSSOM_TARGETING = 88140,
+ SPELL_FROST_BLOSSOM = 88169,
+ SPELL_FROST_BLOSSOM_VISUAL = 88165,
+ SPELL_FIRE_BLOSSOM = 88129,
+ SPELL_FIRE_BLOSSOM_VISUAL = 88164,
+ SPELL_ARCANE_OVERLOAD = 88183,
+ SPELL_TRANSITION_INVISIBILITY = 90424,
+ SPELL_ARCANE_OVERLOAD_INSTAKILL = 88185,
+
+ // Fire Wall Platter
+ SPELL_FIRE_WALL = 91398,
+
+ // General Purpose Bunny JMF
+ SPELL_ARCANE_OVERLOAD_EXPLOSION = 90520
+};
+
+enum Events
+{
+ EVENT_BLINK = 1,
+ EVENT_ELEMENTAL_FISTS,
+ EVENT_PHASE_TWO_INTRO_1,
+ EVENT_PHASE_TWO_INTRO_2,
+ EVENT_ARCANE_POWER,
+ EVENT_STUN_SELF,
+ EVENT_ANNOUNCE_FIRE_WALL,
+ EVENT_FIRE_WALL,
+ EVENT_BLOSSOM_TARGETING,
+ EVENT_ARCANE_OVERLOAD,
+};
+
+enum Phases
+{
+ PHASE_1 = 1,
+ PHASE_2 = 2
+};
+
+enum Texts
+{
+ SAY_AGGRO = 0,
+ SAY_FISTS_OF_FLAME = 1,
+ SAY_FISTS_OF_FROST = 2,
+ SAY_PHASE_TWO_INTRO_1 = 3,
+ SAY_PHASE_TWO_INTRO_2 = 4,
+ SAY_ARCANE_POWER = 5,
+ SAY_ANNOUNCE_FIRE_WALL = 6,
+ SAY_DEATH = 7
+};
+
+enum Fists
+{
+ FISTS_OF_FLAME = 0,
+ FISTS_OF_FROST = 1
+};
+
+enum Data
+{
+ DATA_CURRENT_BLOSSOM = 1
+};
+
+Position const firewallPlatterPos = { -193.4054f, -441.5011f, 54.57029f, 1.833041f };
+Position const firewallPlatterSplineEndpoint = { -193.4514f, -441.0169f, 55.70924f };
+Position const leftSideDistanceCheck = { -206.59f, -444.86f, 53.95f };
+
+class boss_glubtok : public CreatureScript
+{
+public:
+ boss_glubtok() : CreatureScript("boss_glubtok") { }
+
+ struct boss_glubtokAI : public BossAI
+ {
+ boss_glubtokAI(Creature* creature) : BossAI(creature, DATA_GLUBTOK)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ _killed = false;
+ _allowKill = false;
+ _nextBlossomBunny = NPC_FIRE_BLOSSOM_BUNNY;
+ _lastFists = FISTS_OF_FLAME;
+
+ }
+
+ void Reset() override
+ {
+ _Reset();
+ Initialize();
+ DoSummon(NPC_GLUBTOK_FIREWALL_PLATTER, firewallPlatterSplineEndpoint, 0, TEMPSUMMON_MANUAL_DESPAWN);
+ me->SetHover(false);
+ }
+
+ void JustEngagedWith(Unit* /*who*/) override
+ {
+ _JustEngagedWith();
+ Talk(SAY_AGGRO);
+ instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
+ events.SetPhase(PHASE_1);
+ events.ScheduleEvent(EVENT_BLINK, Seconds(18), 0, PHASE_1);
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ _JustDied();
+ instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ _EnterEvadeMode();
+ summons.DespawnAll();
+ instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
+ _DespawnAtEvade();
+ }
+
+ void JustSummoned(Creature* summon) override
+ {
+ switch (summon->GetEntry())
+ {
+ case NPC_GLUBTOK_FIREWALL_PLATTER:
+ {
+ summon->SetSpeed(MOVE_RUN, 0.2f);
+ float distance = summon->GetPosition().GetExactDist2d(firewallPlatterPos);
+ summon->GetMotionMaster()->MoveCirclePath(firewallPlatterPos.GetPositionX(), firewallPlatterPos.GetPositionY(),
+ firewallPlatterSplineEndpoint.GetPositionZ(), distance, true, 11);
+ break;
+ }
+ case NPC_FIREWALL_PLATTER_1A:
+ case NPC_FIREWALL_PLATTER_1B:
+ case NPC_FIREWALL_PLATTER_1C:
+ case NPC_FIREWALL_PLATTER_2A:
+ case NPC_FIREWALL_PLATTER_2B:
+ case NPC_FIREWALL_PLATTER_2C:
+ _firewallDummyGUIDList.insert(summon->GetGUID());
+ break;
+ default:
+ break;
+ }
+ summons.Summon(summon);
+ }
+
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
+ {
+ if (spell->Id == SPELL_BLOSSOM_TARGETING)
+ {
+ DoCast(target, target->GetEntry() == NPC_FIRE_BLOSSOM_BUNNY ? SPELL_FIRE_BLOSSOM : SPELL_FROST_BLOSSOM, true);
+ target->CastSpell(target, target->GetEntry() == NPC_FIRE_BLOSSOM_BUNNY ? SPELL_FIRE_BLOSSOM_VISUAL : SPELL_FROST_BLOSSOM_VISUAL, true);
+ }
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& damage) override
+ {
+ if (damage >= me->GetHealth() && !_allowKill)
+ {
+ damage = me->GetHealth() - 1;
+ if (!_killed)
+ {
+ _killed = true;
+ Talk(SAY_DEATH);
+ events.CancelEvent(EVENT_BLOSSOM_TARGETING);
+ DoCastSelf(SPELL_ARCANE_OVERLOAD, true);
+ events.ScheduleEvent(EVENT_ARCANE_OVERLOAD, Seconds(6));
+ // We really need this here because there are more of those triggers in the instance...
+ std::list units;
+ GetCreatureListWithEntryInGrid(units, me, NPC_GENERAL_PURPOSE_BUNNY_L2, 30.0f);
+ if (!units.empty())
+ {
+ for (auto itr = units.begin(); itr != units.end(); ++itr)
+ {
+ if ((*itr)->GetHomePosition().GetExactDist2d(leftSideDistanceCheck) <= 14.0f)
+ (*itr)->CastSpell((*itr), SPELL_ARCANE_FROST_BEAM);
+ else
+ (*itr)->CastSpell((*itr), SPELL_ARCANE_FIRE_BEAM);
+ }
+ }
+ }
+ }
+ }
+
+ uint32 GetData(uint32 type) const override
+ {
+ if (type == DATA_CURRENT_BLOSSOM)
+ return _nextBlossomBunny;
+ return 0;
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->GetHealthPct() <= 50.0f && !events.IsInPhase(PHASE_2))
+ {
+ events.SetPhase(PHASE_2);
+ me->SetReactState(REACT_PASSIVE);
+ me->AttackStop();
+ me->CastStop();
+ DoCastSelf(SPELL_TELEPORT, true);
+ me->StopMoving();
+ me->NearTeleportTo(me->GetHomePosition());
+ events.ScheduleEvent(EVENT_PHASE_TWO_INTRO_1, Seconds(3) + Milliseconds(600));
+ }
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_BLINK:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
+ {
+ DoCast(target, SPELL_BLINK);
+ if (IsHeroic())
+ me->getThreatManager().resetAllAggro();
+
+ events.ScheduleEvent(EVENT_ELEMENTAL_FISTS, Milliseconds(800), 0, PHASE_1);
+ events.Repeat(Seconds(13) + Milliseconds(300));
+ }
+ break;
+ case EVENT_ELEMENTAL_FISTS:
+ switch (_lastFists)
+ {
+ case FISTS_OF_FLAME:
+ Talk(SAY_FISTS_OF_FROST);
+ DoCastSelf(SPELL_FISTS_OF_FROST);
+ _lastFists = FISTS_OF_FROST;
+ break;
+ case FISTS_OF_FROST:
+ Talk(SAY_FISTS_OF_FLAME);
+ DoCastSelf(SPELL_FISTS_OF_FLAME);
+ _lastFists = FISTS_OF_FLAME;
+ break;
+ default:
+ break;
+ }
+ break;
+ case EVENT_PHASE_TWO_INTRO_1:
+ Talk(SAY_PHASE_TWO_INTRO_1);
+ DoCastSelf(SPELL_EMOTE_TALK, true);
+ events.ScheduleEvent(EVENT_PHASE_TWO_INTRO_2, Seconds(2) + Milliseconds(400));
+ break;
+ case EVENT_PHASE_TWO_INTRO_2:
+ Talk(SAY_PHASE_TWO_INTRO_2);
+ DoCastSelf(SPELL_EMOTE_ROAR, true);
+ events.ScheduleEvent(EVENT_ARCANE_POWER, Seconds(2) + Milliseconds(400));
+ break;
+ case EVENT_ARCANE_POWER:
+ {
+ Talk(SAY_ARCANE_POWER);
+ DoCastSelf(SPELL_ARCANE_POWER);
+ me->SetHover(true);
+
+ // We really need this here because there are more of those triggers in other rooms...
+ std::list units;
+ GetCreatureListWithEntryInGrid(units, me, NPC_GENERAL_PURPOSE_BUNNY_L2, 30.0f);
+ if (!units.empty())
+ {
+ for (auto itr = units.begin(); itr != units.end(); ++itr)
+ {
+ if ((*itr)->GetHomePosition().GetExactDist2d(leftSideDistanceCheck) <= 14.0f)
+ (*itr)->CastSpell((*itr), SPELL_ARCANE_FROST_BEAM);
+ else
+ (*itr)->CastSpell((*itr), SPELL_ARCANE_FIRE_BEAM);
+ }
+ }
+ events.ScheduleEvent(EVENT_STUN_SELF, Seconds(2) + Milliseconds(500));
+ events.ScheduleEvent(EVENT_BLOSSOM_TARGETING, Seconds(6));
+ break;
+ }
+ case EVENT_STUN_SELF:
+ DoCastSelf(SPELL_STUN_SELF, true);
+ if (IsHeroic())
+ events.ScheduleEvent(EVENT_ANNOUNCE_FIRE_WALL, Seconds(1) + Milliseconds(500));
+ break;
+ case EVENT_ANNOUNCE_FIRE_WALL:
+ Talk(SAY_ANNOUNCE_FIRE_WALL);
+ events.ScheduleEvent(EVENT_FIRE_WALL, Seconds(1) + Milliseconds(400));
+ break;
+ case EVENT_FIRE_WALL:
+ for (auto itr = _firewallDummyGUIDList.begin(); itr != _firewallDummyGUIDList.end(); itr++)
+ if (Creature* firewallDummy = ObjectAccessor::GetCreature(*me, (*itr)))
+ firewallDummy->CastSpell(firewallDummy, SPELL_FIRE_WALL);
+ break;
+ case EVENT_ARCANE_OVERLOAD:
+ me->SetHover(false);
+ _allowKill = true;
+ DoCastSelf(SPELL_TRANSITION_INVISIBILITY, true);
+ DoCastSelf(SPELL_ARCANE_OVERLOAD_INSTAKILL, true);
+ if (Creature* bunny = me->FindNearestCreature(NPC_GENERAL_PURPOSE_DUMMY_JMF, 5.0f, true))
+ bunny->CastSpell(bunny, SPELL_ARCANE_OVERLOAD_EXPLOSION);
+ break;
+ case EVENT_BLOSSOM_TARGETING:
+ if (_nextBlossomBunny == NPC_FIRE_BLOSSOM_BUNNY)
+ _nextBlossomBunny = NPC_FROST_BLOSSOM_BUNNY;
+ else
+ _nextBlossomBunny = NPC_FIRE_BLOSSOM_BUNNY;
+
+ DoCastAOE(SPELL_BLOSSOM_TARGETING, true);
+ events.Repeat(Seconds(2) + Milliseconds(400));
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ private:
+ bool _killed;
+ bool _allowKill;
+ uint8 _lastFists;
+ uint32 _nextBlossomBunny;
+ GuidSet _firewallDummyGUIDList;
+ };
+
+ CreatureAI* GetAI(Creature *creature) const override
+ {
+ return GetDeadminesAI(creature);
+ }
+};
+
+class CreatureEntryCheck
+{
+ public:
+ CreatureEntryCheck(uint32 entry) : _entry(entry) { }
+
+ bool operator()(WorldObject* object)
+ {
+ return (object->GetEntry() != _entry);
+ }
+ private:
+ uint32 _entry;
+};
+
+class spell_glubtok_blossom_targeting : public SpellScriptLoader
+{
+ public:
+ spell_glubtok_blossom_targeting() : SpellScriptLoader("spell_glubtok_blossom_targeting") { }
+
+ class spell_glubtok_blossom_targeting_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_glubtok_blossom_targeting_SpellScript);
+
+ void FilterTargets(std::list& targets)
+ {
+ if (targets.empty())
+ return;
+
+ if (Unit* caster = GetCaster())
+ if (Creature* creature = caster->ToCreature())
+ if (creature->IsAIEnabled)
+ targets.remove_if(CreatureEntryCheck(creature->GetAI()->GetData(DATA_CURRENT_BLOSSOM)));
+
+ if (targets.empty())
+ return;
+
+ Trinity::Containers::RandomResize(targets, 1);
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_glubtok_blossom_targeting_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_glubtok_blossom_targeting_SpellScript();
+ }
+};
+
+void AddSC_boss_glubtok()
+{
+ new boss_glubtok();
+ new spell_glubtok_blossom_targeting();
+}
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
deleted file mode 100644
index 896c48be763..00000000000
--- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2008-2018 TrinityCore
- *
- * 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 .
- */
-
-/* ScriptData
-SDName: Boss Mr.Smite
-SD%Complete:
-SDComment: Timers and say taken from acid script
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "deadmines.h"
-
-enum Spells
-{
- SPELL_TRASH = 3391,
- SPELL_SMITE_STOMP = 6432,
- SPELL_SMITE_SLAM = 6435,
- SPELL_NIMBLE_REFLEXES = 6264
-};
-
-enum Equips
-{
- EQUIP_SWORD = 5191,
- EQUIP_AXE = 5196,
- EQUIP_MACE = 7230
-};
-
-enum Texts
-{
- SAY_PHASE_1 = 2,
- SAY_PHASE_2 = 3
-};
-
-class boss_mr_smite : public CreatureScript
-{
-public:
- boss_mr_smite() : CreatureScript("boss_mr_smite") { }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetInstanceAI(creature);
- }
-
- struct boss_mr_smiteAI : public ScriptedAI
- {
- boss_mr_smiteAI(Creature* creature) : ScriptedAI(creature)
- {
- Initialize();
- instance = creature->GetInstanceScript();
- }
-
- void Initialize()
- {
- uiTrashTimer = urand(5000, 9000);
- uiSlamTimer = 9000;
- uiNimbleReflexesTimer = urand(15500, 31600);
-
- uiHealth = 0;
-
- uiPhase = 0;
- uiTimer = 0;
-
- uiIsMoving = false;
- }
-
- InstanceScript* instance;
-
- uint32 uiTrashTimer;
- uint32 uiSlamTimer;
- uint32 uiNimbleReflexesTimer;
-
- uint8 uiHealth;
-
- uint32 uiPhase;
- uint32 uiTimer;
-
- bool uiIsMoving;
-
- void Reset() override
- {
- Initialize();
-
- SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- me->SetStandState(UNIT_STAND_STATE_STAND);
- me->SetReactState(REACT_AGGRESSIVE);
- }
-
- void JustEngagedWith(Unit* /*who*/) override
- {
- }
-
- bool bCheckChances()
- {
- uint32 uiChances = urand(0, 99);
- if (uiChances <= 15)
- return false;
- else
- return true;
- }
-
- void UpdateAI(uint32 uiDiff) override
- {
- if (!UpdateVictim())
- return;
-
- if (!uiIsMoving) // halt abilities in between phases
- {
- if (uiTrashTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCast(me, SPELL_TRASH);
- uiTrashTimer = urand(6000, 15500);
- }
- else uiTrashTimer -= uiDiff;
-
- if (uiSlamTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCastVictim(SPELL_SMITE_SLAM);
- uiSlamTimer = 11000;
- }
- else uiSlamTimer -= uiDiff;
-
- if (uiNimbleReflexesTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCast(me, SPELL_NIMBLE_REFLEXES);
- uiNimbleReflexesTimer = urand(27300, 60100);
- }
- else uiNimbleReflexesTimer -= uiDiff;
- }
-
- if ((uiHealth == 0 && !HealthAbovePct(66)) || (uiHealth == 1 && !HealthAbovePct(33)))
- {
- ++uiHealth;
- DoCastAOE(SPELL_SMITE_STOMP, false);
- SetCombatMovement(false);
- me->AttackStop();
- me->InterruptNonMeleeSpells(false);
- me->SetReactState(REACT_PASSIVE);
- uiTimer = 2500;
- uiPhase = 1;
-
- switch (uiHealth)
- {
- case 1:
- Talk(SAY_PHASE_1);
- break;
- case 2:
- Talk(SAY_PHASE_2);
- break;
- }
- }
-
- if (uiPhase)
- {
- if (uiTimer <= uiDiff)
- {
- switch (uiPhase)
- {
- case 1:
- {
- if (uiIsMoving)
- break;
-
- if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SMITE_CHEST)))
- {
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 1.5f, go->GetPositionY() + 1.4f, go->GetPositionZ());
- uiIsMoving = true;
- }
- break;
- }
- case 2:
- if (uiHealth == 1)
- SetEquipmentSlots(false, EQUIP_AXE, EQUIP_AXE, EQUIP_NO_CHANGE);
- else
- SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- uiTimer = 500;
- uiPhase = 3;
- break;
- case 3:
- me->SetStandState(UNIT_STAND_STATE_STAND);
- uiTimer = 750;
- uiPhase = 4;
- break;
- case 4:
- me->SetReactState(REACT_AGGRESSIVE);
- SetCombatMovement(true);
- me->GetMotionMaster()->MoveChase(me->GetVictim(), me->m_CombatDistance);
- uiIsMoving = false;
- uiPhase = 0;
- break;
- }
- } else uiTimer -= uiDiff;
- }
-
- DoMeleeAttackIfReady();
- }
-
- void MovementInform(uint32 uiType, uint32 /*uiId*/) override
- {
- if (uiType != POINT_MOTION_TYPE)
- return;
-
- me->SetFacingTo(5.47f);
- me->SetStandState(UNIT_STAND_STATE_KNEEL);
-
- uiTimer = 2000;
- uiPhase = 2;
- }
- };
-};
-
-void AddSC_boss_mr_smite()
-{
- new boss_mr_smite();
-}
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index a55645a0187..d1f49fe28d5 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -19,46 +19,71 @@
#define DEF_DEADMINES_H
#define DataHeader "DM"
+#define DMScriptName "instance_deadmines"
-enum DMCannonState
+uint32 const EncounterCount = 6;
+
+enum DMDataTypes
{
- CANNON_NOT_USED,
- CANNON_GUNPOWDER_USED,
- CANNON_BLAST_INITIATED,
- PIRATES_ATTACK,
- SMITE_ALARMED,
- EVENT_DONE
+ // Encounters
+ DATA_GLUBTOK = 0,
+ DATA_HELUX_GEARBREAKER = 1,
+ DATA_FOE_REAPER_5000 = 2,
+ DATA_ADMIRAL_RIPSNARL = 3,
+ DATA_CAPTAIN_COOKIE = 4,
+ DATA_VANESSA_VAN_CLEEF = 5,
+
+ DATA_TEAM_IN_INSTANCE = 6,
+ DATA_FIREWALL_PLATTER = 7,
};
-enum DMData
+enum DMCreatures
{
- EVENT_STATE,
- EVENT_RHAHKZOR
-};
+ // Bosses
+ BOSS_GLUBTOK = 47162,
-enum DMData64
-{
- DATA_SMITE_CHEST
+ // Horde Creatures
+ NPC_SLINKY_SHARPSHIV = 46906,
+ NPC_KAGTHA = 46889,
+ NPC_MISS_MAYHEM = 46902,
+ NPC_SHATTERED_HAND_ASSASSIN = 46890,
+ NPC_MAYHEM_REAPER_PROTOTYPE = 46903,
+
+ // Alliance Creatures
+ NPC_STORMWIND_INVESTIGATOR = 46614,
+ NPC_CRIME_SCENE_ALARM_O_BOT = 46613,
+ NPC_STORMWIND_DEFENDER = 50595,
+ NPC_LIEUTENANT_HORATIO_LAINE = 46612,
+ NPC_QUARTERMASTER_LEWIS = 491,
+
+ // Encounter Related
+ NPC_GENERAL_PURPOSE_DUMMY_JMF = 45979,
+ NPC_GLUBTOK_FIREWALL_PLATTER = 48974,
+ NPC_FIREWALL_PLATTER_1A = 48975,
+ NPC_FIREWALL_PLATTER_1B = 49039,
+ NPC_FIREWALL_PLATTER_1C = 49040,
+ NPC_FIREWALL_PLATTER_2A = 48976,
+ NPC_FIREWALL_PLATTER_2B = 49041,
+ NPC_FIREWALL_PLATTER_2C = 49042,
+ NPC_GENERAL_PURPOSE_BUNNY_L2 = 47242,
+ NPC_FIRE_BLOSSOM_BUNNY = 47282,
+ NPC_FROST_BLOSSOM_BUNNY = 47284,
};
enum DMGameObjects
{
- GO_FACTORY_DOOR = 13965,
- GO_IRONCLAD_DOOR = 16397,
- GO_DEFIAS_CANNON = 16398,
- GO_DOOR_LEVER = 101833,
- GO_MR_SMITE_CHEST = 144111
+ GO_FACTORY_DOOR = 13965,
+ GO_IRONCLAD_DOOR = 16397,
+ GO_DEFIAS_CANNON = 16398,
+ GO_DOOR_LEVER = 101833,
+ GO_MR_SMITE_CHEST = 144111
};
-enum DMCreaturesIds
-{
- NPC_MR_SMITE = 646
-};
-enum DMInstanceTexts
+template
+AI* GetDeadminesAI(Creature* creature)
{
- SAY_ALARM1 = 0,
- SAY_ALARM2 = 1
-};
+ return GetInstanceAI(creature, DMScriptName);
+}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 6f11785abaf..aa848eea3c1 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2018 TrinityCore
- * Copyright (C) 2006-2008 ScriptDev2
*
* 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
@@ -16,12 +15,6 @@
* with this program. If not, see .
*/
-/* ScriptData
-SDName: Instance_Deadmines
-SD%Complete: 100
-SDComment:
-SDCategory: Deadmines
-EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
@@ -29,199 +22,93 @@ EndScriptData */
#include "TemporarySummon.h"
#include "WorldPacket.h"
-enum Sounds
+ObjectData const creatureData[] =
{
- SOUND_CANNONFIRE = 1400,
- SOUND_DESTROYDOOR = 3079
+ { BOSS_GLUBTOK, DATA_GLUBTOK },
+ { 0, 0 }, // END
};
-enum Misc
+ObjectData const gameobjectData[] =
{
- DATA_CANNON_BLAST_TIMER = 3000,
- DATA_PIRATES_DELAY_TIMER = 1000,
- DATA_SMITE_ALARM_DELAY_TIMER = 5000
+ { 0, 0 }, // END
+};
+
+DoorData const doorData[] =
+{
+ { GO_FACTORY_DOOR, DATA_GLUBTOK, DOOR_TYPE_PASSAGE },
+ { 0, 0, DOOR_TYPE_ROOM }, // END
};
class instance_deadmines : public InstanceMapScript
{
public:
- instance_deadmines()
- : InstanceMapScript("instance_deadmines", 36)
- {
- }
+ instance_deadmines() : InstanceMapScript(DMScriptName, 36) { }
struct instance_deadmines_InstanceMapScript : public InstanceScript
{
instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
-
- State = CANNON_NOT_USED;
- CannonBlast_Timer = 0;
- PiratesDelay_Timer = 0;
- SmiteAlarmDelay_Timer = 0;
+ SetBossNumber(map->IsHeroic() ? EncounterCount : EncounterCount - 1); // Vanessa van Cleef only in heroic mode
+ LoadDoorData(doorData);
+ LoadObjectData(creatureData, gameobjectData);
+ _teamInInstance = 0;
}
- ObjectGuid FactoryDoorGUID;
- ObjectGuid IronCladDoorGUID;
- ObjectGuid DefiasCannonGUID;
- ObjectGuid DoorLeverGUID;
- ObjectGuid DefiasPirate1GUID;
- ObjectGuid DefiasPirate2GUID;
- ObjectGuid DefiasCompanionGUID;
- ObjectGuid MrSmiteGUID;
-
- uint32 State;
- uint32 CannonBlast_Timer =0;
- uint32 PiratesDelay_Timer =0;
- uint32 SmiteAlarmDelay_Timer;
- ObjectGuid uiSmiteChestGUID;
-
- virtual void Update(uint32 diff) override
+ void OnPlayerEnter(Player* player) override
{
- if (!IronCladDoorGUID || !DefiasCannonGUID || !DoorLeverGUID)
- return;
-
- GameObject* pIronCladDoor = instance->GetGameObject(IronCladDoorGUID);
- if (!pIronCladDoor)
- return;
-
- switch (State)
- {
- case CANNON_GUNPOWDER_USED:
- CannonBlast_Timer = DATA_CANNON_BLAST_TIMER;
- State = CANNON_BLAST_INITIATED;
- break;
- case CANNON_BLAST_INITIATED:
- PiratesDelay_Timer = DATA_PIRATES_DELAY_TIMER;
- SmiteAlarmDelay_Timer = DATA_SMITE_ALARM_DELAY_TIMER;
- if (CannonBlast_Timer <= diff)
- {
- SummonCreatures();
- ShootCannon();
- BlastOutDoor();
- LeverStucked();
- instance->LoadGrid(-22.8f, -797.24f); // Loads Mr. Smite's grid.
- if (Creature* smite = instance->GetCreature(MrSmiteGUID)) // goes off when door blows up
- smite->AI()->Talk(SAY_ALARM1);
- State = PIRATES_ATTACK;
- } else CannonBlast_Timer -= diff;
- break;
- case PIRATES_ATTACK:
- if (PiratesDelay_Timer <= diff)
- {
- MoveCreaturesInside();
- State = SMITE_ALARMED;
- } else PiratesDelay_Timer -= diff;
- break;
- case SMITE_ALARMED:
- if (SmiteAlarmDelay_Timer <= diff)
- {
- if (Creature* smite = instance->GetCreature(MrSmiteGUID))
- smite->AI()->Talk(SAY_ALARM2);
- State = EVENT_DONE;
- } else SmiteAlarmDelay_Timer -= diff;
- break;
- }
- }
-
- void SummonCreatures()
- {
- if (GameObject* pIronCladDoor = instance->GetGameObject(IronCladDoorGUID))
- {
- Creature* DefiasPirate1 = pIronCladDoor->SummonCreature(657, pIronCladDoor->GetPositionX() - 2, pIronCladDoor->GetPositionY()-7, pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
- Creature* DefiasPirate2 = pIronCladDoor->SummonCreature(657, pIronCladDoor->GetPositionX() + 3, pIronCladDoor->GetPositionY()-6, pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
- Creature* DefiasCompanion = pIronCladDoor->SummonCreature(3450, pIronCladDoor->GetPositionX() + 2, pIronCladDoor->GetPositionY()-6, pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
-
- DefiasPirate1GUID = DefiasPirate1->GetGUID();
- DefiasPirate2GUID = DefiasPirate2->GetGUID();
- DefiasCompanionGUID = DefiasCompanion->GetGUID();
- }
- }
-
- void MoveCreaturesInside()
- {
- if (!DefiasPirate1GUID || !DefiasPirate2GUID || !DefiasCompanionGUID)
- return;
-
- Creature* pDefiasPirate1 = instance->GetCreature(DefiasPirate1GUID);
- Creature* pDefiasPirate2 = instance->GetCreature(DefiasPirate2GUID);
- Creature* pDefiasCompanion = instance->GetCreature(DefiasCompanionGUID);
- if (!pDefiasPirate1 || !pDefiasPirate2 || !pDefiasCompanion)
- return;
-
- MoveCreatureInside(pDefiasPirate1);
- MoveCreatureInside(pDefiasPirate2);
- MoveCreatureInside(pDefiasCompanion);
- }
-
- void MoveCreatureInside(Creature* creature)
- {
- creature->SetWalk(false);
- creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ());
- }
-
- void ShootCannon()
- {
- if (GameObject* pDefiasCannon = instance->GetGameObject(DefiasCannonGUID))
- {
- pDefiasCannon->SetGoState(GO_STATE_ACTIVE);
- pDefiasCannon->PlayDirectSound(SOUND_CANNONFIRE);
- }
- }
-
- void BlastOutDoor()
- {
- if (GameObject* pIronCladDoor = instance->GetGameObject(IronCladDoorGUID))
- {
- pIronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
- pIronCladDoor->PlayDirectSound(SOUND_DESTROYDOOR);
- }
- }
-
- void LeverStucked()
- {
- if (GameObject* pDoorLever = instance->GetGameObject(DoorLeverGUID))
- pDoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
+ if (!_teamInInstance)
+ _teamInInstance = player->GetTeam();
}
void OnCreatureCreate(Creature* creature) override
{
+ InstanceScript::OnCreatureCreate(creature);
+
switch (creature->GetEntry())
{
- case NPC_MR_SMITE:
- MrSmiteGUID = creature->GetGUID();
+ // Horde restricted creatures
+ case NPC_SLINKY_SHARPSHIV:
+ case NPC_KAGTHA:
+ case NPC_MISS_MAYHEM:
+ case NPC_SHATTERED_HAND_ASSASSIN:
+ case NPC_MAYHEM_REAPER_PROTOTYPE:
+ if (_teamInInstance != HORDE)
+ creature->SetVisible(false);
+ break;
+ // Alliance restricted creatures
+ case NPC_STORMWIND_INVESTIGATOR:
+ case NPC_CRIME_SCENE_ALARM_O_BOT:
+ case NPC_STORMWIND_DEFENDER:
+ case NPC_LIEUTENANT_HORATIO_LAINE:
+ case NPC_QUARTERMASTER_LEWIS:
+ if (_teamInInstance != ALLIANCE)
+ creature->SetVisible(false);
+ break;
+ case NPC_FIREWALL_PLATTER_1A:
+ case NPC_FIREWALL_PLATTER_1B:
+ case NPC_FIREWALL_PLATTER_1C:
+ case NPC_FIREWALL_PLATTER_2A:
+ case NPC_FIREWALL_PLATTER_2B:
+ case NPC_FIREWALL_PLATTER_2C:
+ if (Creature* glubtok = GetCreature(DATA_GLUBTOK))
+ glubtok->AI()->JustSummoned(creature);
break;
default:
break;
}
}
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_FACTORY_DOOR: FactoryDoorGUID = go->GetGUID(); break;
- case GO_IRONCLAD_DOOR: IronCladDoorGUID = go->GetGUID(); break;
- case GO_DEFIAS_CANNON: DefiasCannonGUID = go->GetGUID(); break;
- case GO_DOOR_LEVER: DoorLeverGUID = go->GetGUID(); break;
- case GO_MR_SMITE_CHEST: uiSmiteChestGUID = go->GetGUID(); break;
- }
- }
-
void SetData(uint32 type, uint32 data) override
{
switch (type)
{
- case EVENT_STATE:
- if (DefiasCannonGUID && IronCladDoorGUID)
- State=data;
- break;
- case EVENT_RHAHKZOR:
- if (data == DONE)
- if (GameObject* go = instance->GetGameObject(FactoryDoorGUID))
- go->SetGoState(GO_STATE_ACTIVE);
- break;
+ case DATA_TEAM_IN_INSTANCE:
+ _teamInInstance = data;
+ SaveToDB();
+ break;
+ default:
+ break;
}
}
@@ -229,25 +116,29 @@ class instance_deadmines : public InstanceMapScript
{
switch (type)
{
- case EVENT_STATE:
- return State;
+ case DATA_TEAM_IN_INSTANCE:
+ return _teamInInstance;
+ default:
+ return 0;
}
-
- return 0;
}
- ObjectGuid GetGuidData(uint32 data) const override
+ void WriteSaveDataMore(std::ostringstream& data) override
{
- switch (data)
- {
- case DATA_SMITE_CHEST:
- return uiSmiteChestGUID;
- }
-
- return ObjectGuid::Empty;
+ data << _teamInInstance;
}
+
+ void ReadSaveDataMore(std::istringstream& data) override
+ {
+ data >> _teamInInstance;
+ }
+
+ protected:
+ uint32 _teamInInstance;
+ GuidSet _arcaneBeamBunnyGUIDList;
};
+
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_deadmines_InstanceMapScript(map);
diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
index 51b2e93761c..5c8857e1e39 100644
--- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
@@ -69,7 +69,7 @@ void AddSC_boss_nefarian();
void AddSC_instance_blackwing_lair();
void AddSC_deadmines(); //Deadmines
void AddSC_instance_deadmines();
-void AddSC_boss_mr_smite();
+void AddSC_boss_glubtok();
void AddSC_gilneas_c1(); //Gilneas
void AddSC_gnomeregan(); //Gnomeregan
void AddSC_instance_gnomeregan();
@@ -270,8 +270,8 @@ void AddEasternKingdomsScripts()
AddSC_boss_nefarian();
AddSC_instance_blackwing_lair();
AddSC_deadmines(); //Deadmines
- AddSC_boss_mr_smite();
AddSC_instance_deadmines();
+ AddSC_boss_glubtok();
AddSC_gilneas_c1(); //Gilneas
AddSC_gnomeregan(); //Gnomeregan
AddSC_instance_gnomeregan();