TrinityCore/TrinityCore — Issue #3864: [Script/ICC] Deathbound Ward
Author: Kapoeira
Created: 2011-11-06 19:48:15+00:00
State: open

Will be up to Shauren to determine if they are correct. Based myself on some videos where you had a group of three people grinding rep.
NOTE: Creature's damage may be incorrect, I can't get those values

```diff

diff --git a/sql/custom/npc_deathbound_ward.sql b/sql/custom/npc_deathbound_ward.sql
new file mode 100644
index 0000000..29689ec
--- /dev/null
+++ b/sql/custom/npc_deathbound_ward.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_deathbound_ward' WHERE `entry`=37007;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index ab30468..65ddee6 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -211,43 +211,46 @@ enum EventTypes
// Frost Freeze Trap
EVENT_ACTIVATE_TRAP = 28,

+ // Deathbound Ward
+ EVENT_DISRUPTING_SHOUT = 29,
+
// Crok Scourgebane
- EVENT_SCOURGE_STRIKE = 29,
- EVENT_DEATH_STRIKE = 30,
- EVENT_HEALTH_CHECK = 31,
- EVENT_CROK_INTRO_3 = 32,
- EVENT_START_PATHING = 33,
+ EVENT_SCOURGE_STRIKE = 30,
+ EVENT_DEATH_STRIKE = 31,
+ EVENT_HEALTH_CHECK = 32,
+ EVENT_CROK_INTRO_3 = 33,
+ EVENT_START_PATHING = 34,

// Sister Svalna
- EVENT_ARNATH_INTRO_2 = 34,
- EVENT_SVALNA_START = 35,
- EVENT_SVALNA_RESURRECT = 36,
- EVENT_SVALNA_COMBAT = 37,
- EVENT_IMPALING_SPEAR = 38,
- EVENT_AETHER_SHIELD = 39,
+ EVENT_ARNATH_INTRO_2 = 35,
+ EVENT_SVALNA_START = 36,
+ EVENT_SVALNA_RESURRECT = 37,
+ EVENT_SVALNA_COMBAT = 38,
+ EVENT_IMPALING_SPEAR = 39,
+ EVENT_AETHER_SHIELD = 40,

// Captain Arnath
- EVENT_ARNATH_FLASH_HEAL = 40,
- EVENT_ARNATH_PW_SHIELD = 41,
- EVENT_ARNATH_SMITE = 42,
- EVENT_ARNATH_DOMINATE_MIND = 43,
+ EVENT_ARNATH_FLASH_HEAL = 41,
+ EVENT_ARNATH_PW_SHIELD = 42,
+ EVENT_ARNATH_SMITE = 43,
+ EVENT_ARNATH_DOMINATE_MIND = 44,

// Captain Brandon
- EVENT_BRANDON_CRUSADER_STRIKE = 44,
- EVENT_BRANDON_DIVINE_SHIELD = 45,
- EVENT_BRANDON_JUDGEMENT_OF_COMMAND = 46,
- EVENT_BRANDON_HAMMER_OF_BETRAYAL = 47,
+ EVENT_BRANDON_CRUSADER_STRIKE = 45,
+ EVENT_BRANDON_DIVINE_SHIELD = 46,
+ EVENT_BRANDON_JUDGEMENT_OF_COMMAND = 47,
+ EVENT_BRANDON_HAMMER_OF_BETRAYAL = 48,

// Captain Grondel
- EVENT_GRONDEL_CHARGE_CHECK = 48,
- EVENT_GRONDEL_MORTAL_STRIKE = 49,
- EVENT_GRONDEL_SUNDER_ARMOR = 50,
- EVENT_GRONDEL_CONFLAGRATION = 51,
+ EVENT_GRONDEL_CHARGE_CHECK = 49,
+ EVENT_GRONDEL_MORTAL_STRIKE = 50,
+ EVENT_GRONDEL_SUNDER_ARMOR = 51,
+ EVENT_GRONDEL_CONFLAGRATION = 52,

// Captain Rupert
- EVENT_RUPERT_FEL_IRON_BOMB = 52,
- EVENT_RUPERT_MACHINE_GUN = 53,
- EVENT_RUPERT_ROCKET_LAUNCH = 54,
+ EVENT_RUPERT_FEL_IRON_BOMB = 53,
+ EVENT_RUPERT_MACHINE_GUN = 54,
+ EVENT_RUPERT_ROCKET_LAUNCH = 55,
};

enum DataTypesICC
@@ -580,6 +583,73 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
}
};

+class npc_deathbound_ward : public CreatureScript
+{
+ public:
+ npc_deathbound_ward() : CreatureScript("npc_deathbound_ward") { }
+
+ struct npc_deathbound_wardAI : public ScriptedAI
+ {
+ npc_deathbound_wardAI(Creature* creature) : ScriptedAI(creature)
+ {
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ events.Reset();
+ events.ScheduleEvent(EVENT_DISRUPTING_SHOUT, urand(17000, 23000));
+ }
+
+ void DoAction(uint32 id)
+ {
+ if (id != ACTION_AWAKEN)
+ return;
+
+ Talk(SAY_TRAP_ACTIVATE);
+ me->RemoveAurasDueToSpell(SPELL_STONEFORM);
+ if (Unit* target = me->SelectNearestTarget(30.0f))
+ AttackStart(target);
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_DISRUPTING_SHOUT:
+ DoCast(me, SPELL_DISRUPTING_SHOUT);
+ events.ScheduleEvent(EVENT_DISRUPTING_SHOUT, urand(17000, 23000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!me->GetCurrentSpell(CURRENT_MELEE_SPELL))
+ DoCastVictim(SPELL_SABERLASH);
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return GetIcecrownCitadelAI(creature);
+ }
+};
+
class npc_rotting_frost_giant : public CreatureScript
{
public:
@@ -1749,10 +1819,7 @@ class spell_icc_sprit_alarm : public SpellScriptLoader
{
if ((*itr)->isAlive() && (*itr)->HasAura(SPELL_STONEFORM))
{
- (*itr)->AI()->Talk(SAY_TRAP_ACTIVATE);
- (*itr)->RemoveAurasDueToSpell(SPELL_STONEFORM);
- if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
- (*itr)->AI()->AttackStart(target);
+ (*itr)->AI()->DoAction(ACTION_AWAKEN);
break;
}
}
@@ -2052,6 +2119,7 @@ void AddSC_icecrown_citadel()
new npc_highlord_tirion_fordring_lh();
new npc_rotting_frost_giant();
new npc_frost_freeze_trap();
+ new npc_deathbound_ward();
new npc_alchemist_adrianna();
new boss_sister_svalna();
new npc_crok_scourgebane();
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
index ece966f..00e250c 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
@@ -45,6 +45,8 @@ enum SharedSpells

// Deathbound Ward
SPELL_STONEFORM = 70733,
+ SPELL_SABERLASH = 71021,
+ SPELL_DISRUPTING_SHOUT = 71022,

// Residue Rendezvous
SPELL_ORANGE_BLIGHT_RESIDUE = 72144,
@@ -392,6 +394,9 @@ enum AchievementCriteriaIds

enum SharedActions
{
+ // Deathbound Ward
+ ACTION_AWAKEN = 370071,
+
// Festergut
ACTION_FESTERGUT_COMBAT = -366260,
ACTION_FESTERGUT_GAS = -366261,
```