aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-02-15 22:07:40 +0100
committerShauren <shauren.trinity@gmail.com>2011-02-15 22:07:40 +0100
commit45095bdffb066b231d253cd424ecc36f3764cde5 (patch)
tree78934ed44bbb71902c4c070cf550ac8237566649
parent21179288a26f33c780f343d61a18ffb38ff9511f (diff)
Scripts/Icecrown Citadel: Added Rotting Frost Giant script
-rw-r--r--sql/scripts/world_scripts_full.sql4
-rw-r--r--sql/updates/world/2011_02_12_0_world_script_name.sql2
-rw-r--r--sql/updates/world/2011_02_12_0_world_spell_script_names.sql3
-rw-r--r--sql/updates/world/2011_02_15_3_world_creature_template.sql1
-rw-r--r--sql/updates/world/2011_02_15_3_world_creature_text.sql4
-rw-r--r--sql/updates/world/2011_02_15_3_world_scriptname.sql1
-rw-r--r--sql/updates/world/2011_02_15_3_world_spell_script_names.sql3
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp18
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp188
9 files changed, 212 insertions, 12 deletions
diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql
index 83e7b601905..8bb02cc045b 100644
--- a/sql/scripts/world_scripts_full.sql
+++ b/sql/scripts/world_scripts_full.sql
@@ -843,6 +843,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_lady_deathwhisper' WHERE `entr
UPDATE `creature_template` SET `ScriptName`='npc_cult_fanatic' WHERE `entry` IN (37890,38009,38135);
UPDATE `creature_template` SET `ScriptName`='npc_cult_adherent' WHERE `entry` IN(37949,38010,38136);
UPDATE `creature_template` SET `ScriptName`='npc_vengeful_shade' WHERE `entry`=38222;
+UPDATE `creature_template` SET `ScriptName`='npc_rotting_frost_giant' WHERE `entry` IN (38490,38494);
UPDATE `creature_template` SET `ScriptName`='boss_deathbringer_saurfang' WHERE `entry`=37813;
UPDATE `creature_template` SET `ScriptName`='npc_high_overlord_saurfang_icc' WHERE `entry`=37187;
UPDATE `creature_template` SET `ScriptName`='npc_muradin_bronzebeard_icc' WHERE `entry`=37200;
@@ -1895,6 +1896,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 72495, 'spell_cultist_dark_martyrdom'),
( 72496, 'spell_cultist_dark_martyrdom'),
( 72497, 'spell_cultist_dark_martyrdom'),
+( 72864, 'spell_frost_giant_death_plague'),
( 72202, 'spell_deathbringer_blood_link'),
( 72178, 'spell_deathbringer_blood_link_aura'),
( 72371, 'spell_deathbringer_blood_power'),
@@ -2073,7 +2075,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 59640, 'spell_item_underbelly_elixir'),
( 71905, 'spell_item_shadowmourne'),
( 67533, 'spell_item_red_rider_air_rifle'),
-( 26678,'spell_item_create_heart_candy'),
+( 26678, 'spell_item_create_heart_candy'),
-- warrior
( 12975, 'spell_warr_last_stand'),
( 59725, 'spell_warr_improved_spell_reflection'),
diff --git a/sql/updates/world/2011_02_12_0_world_script_name.sql b/sql/updates/world/2011_02_12_0_world_script_name.sql
deleted file mode 100644
index e3861d13dbb..00000000000
--- a/sql/updates/world/2011_02_12_0_world_script_name.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-DELETE FROM `spell_script_names` WHERE `spell_id`=26678;
-INSERT INTO `spell_script_names` VALUES (26678,'spell_item_create_heart_candy'); \ No newline at end of file
diff --git a/sql/updates/world/2011_02_12_0_world_spell_script_names.sql b/sql/updates/world/2011_02_12_0_world_spell_script_names.sql
new file mode 100644
index 00000000000..39098e1c3de
--- /dev/null
+++ b/sql/updates/world/2011_02_12_0_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=26678;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(26678,'spell_item_create_heart_candy');
diff --git a/sql/updates/world/2011_02_15_3_world_creature_template.sql b/sql/updates/world/2011_02_15_3_world_creature_template.sql
new file mode 100644
index 00000000000..cc892b30bf9
--- /dev/null
+++ b/sql/updates/world/2011_02_15_3_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `minlevel`=82,`maxlevel`=82,`exp`=2,`unit_class`=1,`faction_A`=16,`faction_H`=16,`baseattacktime`=2000,`unit_flags`=33280,`speed_run`=0.9920629 WHERE `entry`=38494; -- Rotting Frost Giant
diff --git a/sql/updates/world/2011_02_15_3_world_creature_text.sql b/sql/updates/world/2011_02_15_3_world_creature_text.sql
new file mode 100644
index 00000000000..6642afba9b7
--- /dev/null
+++ b/sql/updates/world/2011_02_15_3_world_creature_text.sql
@@ -0,0 +1,4 @@
+DELETE FROM `creature_text` WHERE `entry` IN (38490,38494);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(38490,0,0, '$n is infected with the Death Plague!',3,0,100,25,0,0, 'Rotting Frost Giant - Death Plague'),
+(38494,0,0, '$n is infected with the Death Plague!',3,0,100,25,0,0, 'Rotting Frost Giant - Death Plague');
diff --git a/sql/updates/world/2011_02_15_3_world_scriptname.sql b/sql/updates/world/2011_02_15_3_world_scriptname.sql
new file mode 100644
index 00000000000..ec7c4f3d483
--- /dev/null
+++ b/sql/updates/world/2011_02_15_3_world_scriptname.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_rotting_frost_giant' WHERE `entry` IN (38490,38494);
diff --git a/sql/updates/world/2011_02_15_3_world_spell_script_names.sql b/sql/updates/world/2011_02_15_3_world_spell_script_names.sql
new file mode 100644
index 00000000000..85c9a11fd50
--- /dev/null
+++ b/sql/updates/world/2011_02_15_3_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_frost_giant_death_plague';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(72864,'spell_frost_giant_death_plague');
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 9a823ad68ce..d993e1e8b0e 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3946,13 +3946,6 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_MASTER;
count++;
break;
- case 71708: // Empowered Flare
- case 72785: // Empowered Flare
- case 72786: // Empowered Flare
- case 72787: // Empowered Flare
- spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS;
- count++;
- break;
// ICECROWN CITADEL SPELLS
// THESE SPELLS ARE WORKING CORRECTLY EVEN WITHOUT THIS HACK
// THE ONLY REASON ITS HERE IS THAT CURRENT GRID SYSTEM
@@ -3976,6 +3969,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 70834: // Bone Storm (Lord Marrowgar)
case 70835: // Bone Storm (Lord Marrowgar)
case 70836: // Bone Storm (Lord Marrowgar)
+ case 72864: // Death Plague (Rotting Frost Giant)
case 72378: // Blood Nova (Deathbringer Saurfang)
case 73058: // Blood Nova (Deathbringer Saurfang)
spellInfo->EffectRadiusIndex[0] = 12;
@@ -3989,8 +3983,9 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->EffectImplicitTargetB[0] = 0;
count++;
break;
- case 70460: // Coldflame Jets
+ case 70460: // Coldflame Jets (Traps after Saurfang)
spellInfo->DurationIndex = 1; // 10 seconds
+ count++;
break;
case 71413: // Green Ooze Summon (Professor Putricide)
case 71414: // Orange Ooze Summon (Professor Putricide)
@@ -4036,6 +4031,13 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->EffectRadiusIndex[0] = 28; // another missing radius
count++;
break;
+ case 71708: // Empowered Flare (Blood Prince Council)
+ case 72785: // Empowered Flare (Blood Prince Council)
+ case 72786: // Empowered Flare (Blood Prince Council)
+ case 72787: // Empowered Flare (Blood Prince Council)
+ spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS;
+ count++;
+ break;
case 71340: // Pact of the Darkfallen (Blood-Queen Lana'thel)
spellInfo->DurationIndex = 21;
count++;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index f7546d87529..7a0dfc76fd5 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -22,16 +22,114 @@
#include "SpellAuraEffects.h"
#include "icecrown_citadel.h"
+// Weekly quest support
+//* Deprogramming
+//* Securing the Ramparts (DONE)
+//* Residue Rendezvous
+//* Blood Quickening
+//* Respite for a Tormented Soul
+
+enum Texts
+{
+ // Rotting Frost Giant
+ EMOTE_DEATH_PLAGUE_WARNING = 0,
+};
+
enum Spells
{
+ // Rotting Frost Giant
+ SPELL_DEATH_PLAGUE = 72879,
+ SPELL_DEATH_PLAGUE_AURA = 72865,
+ SPELL_RECENTLY_INFECTED = 72884,
+ SPELL_DEATH_PLAGUE_KILL = 72867,
+ SPELL_STOMP = 64652,
+ SPELL_ARCTIC_BREATH = 72848,
+
// Frost Freeze Trap
SPELL_COLDFLAME_JETS = 70460,
};
enum Events
{
+ // Rotting Frost Giant
+ EVENT_DEATH_PLAGUE = 1,
+ EVENT_STOMP = 2,
+ EVENT_ARCTIC_BREATH = 3,
+
// Frost Freeze Trap
- EVENT_ACTIVATE_TRAP = 1,
+ EVENT_ACTIVATE_TRAP = 4,
+};
+
+class npc_rotting_frost_giant : public CreatureScript
+{
+ public:
+ npc_rotting_frost_giant() : CreatureScript("npc_rotting_frost_giant") { }
+
+ struct npc_rotting_frost_giantAI : public ScriptedAI
+ {
+ npc_rotting_frost_giantAI(Creature* creature) : ScriptedAI(creature)
+ {
+ }
+
+ void Reset()
+ {
+ events.Reset();
+ events.ScheduleEvent(EVENT_DEATH_PLAGUE, 15000);
+ events.ScheduleEvent(EVENT_STOMP, urand(5000, 8000));
+ events.ScheduleEvent(EVENT_ARCTIC_BREATH, urand(10000, 15000));
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ events.Reset();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_DEATH_PLAGUE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
+ {
+ Talk(EMOTE_DEATH_PLAGUE_WARNING, target->GetGUID());
+ DoCast(target, SPELL_DEATH_PLAGUE);
+ }
+ events.ScheduleEvent(EVENT_DEATH_PLAGUE, 15000);
+ break;
+ case EVENT_STOMP:
+ DoCastVictim(SPELL_STOMP);
+ events.ScheduleEvent(EVENT_STOMP, urand(15000, 18000));
+ break;
+ case EVENT_ARCTIC_BREATH:
+ DoCastVictim(SPELL_ARCTIC_BREATH);
+ events.ScheduleEvent(EVENT_ARCTIC_BREATH, urand(26000, 33000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_rotting_frost_giantAI(creature);
+ }
};
class npc_frost_freeze_trap : public CreatureScript
@@ -83,6 +181,92 @@ class npc_frost_freeze_trap : public CreatureScript
}
};
+class DeathPlagueTargetSelector
+{
+ public:
+ DeathPlagueTargetSelector(Unit* _caster) : caster(_caster) {}
+
+ bool operator()(Unit* unit)
+ {
+ if (unit == caster)
+ return true;
+
+ if (unit->GetTypeId() != TYPEID_PLAYER)
+ return true;
+
+ if (unit->HasAura(SPELL_RECENTLY_INFECTED) || unit->HasAura(SPELL_DEATH_PLAGUE_AURA))
+ return true;
+
+ return false;
+ }
+
+ Unit* caster;
+};
+
+class spell_frost_giant_death_plague : public SpellScriptLoader
+{
+ public:
+ spell_frost_giant_death_plague() : SpellScriptLoader("spell_frost_giant_death_plague") { }
+
+ class spell_frost_giant_death_plague_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_frost_giant_death_plague_SpellScript);
+
+ bool Load()
+ {
+ failed = false;
+ return true;
+ }
+
+ // First effect
+ void CountTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove(GetCaster());
+ failed = unitList.empty();
+ }
+
+ // Second effect
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ // Select valid targets for jump
+ unitList.remove_if(DeathPlagueTargetSelector(GetCaster()));
+ if (!unitList.empty())
+ {
+ std::list<Unit*>::iterator itr = unitList.begin();
+ std::advance(itr, urand(0, unitList.size()-1));
+ Unit* target = *itr;
+ unitList.clear();
+ unitList.push_back(target);
+ }
+
+ unitList.push_back(GetCaster());
+ }
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ if (GetHitUnit() != GetCaster())
+ GetCaster()->CastSpell(GetHitUnit(), SPELL_DEATH_PLAGUE_AURA, true);
+ else if (failed)
+ GetCaster()->CastSpell(GetCaster(), SPELL_DEATH_PLAGUE_KILL, true);
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_AREA_ALLY_SRC);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_frost_giant_death_plague_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_AREA_ALLY_SRC);
+ OnEffect += SpellEffectFn(spell_frost_giant_death_plague_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+
+ bool failed;
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_frost_giant_death_plague_SpellScript();
+ }
+};
+
class at_icc_saurfang_portal : public AreaTriggerScript
{
public:
@@ -132,7 +316,9 @@ class at_icc_shutdown_traps : public AreaTriggerScript
void AddSC_icecrown_citadel()
{
+ new npc_rotting_frost_giant();
new npc_frost_freeze_trap();
+ new spell_frost_giant_death_plague();
new at_icc_saurfang_portal();
new at_icc_shutdown_traps();
}