diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-02-15 22:07:40 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-02-15 22:07:40 +0100 |
commit | 45095bdffb066b231d253cd424ecc36f3764cde5 (patch) | |
tree | 78934ed44bbb71902c4c070cf550ac8237566649 /src | |
parent | 21179288a26f33c780f343d61a18ffb38ff9511f (diff) |
Scripts/Icecrown Citadel: Added Rotting Frost Giant script
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/SpellMgr.cpp | 18 | ||||
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp | 188 |
2 files changed, 197 insertions, 9 deletions
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(); } |