diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp | 166 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 6 |
2 files changed, 84 insertions, 88 deletions
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp index 707f6c34a90..ade6c13aafe 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp @@ -18,7 +18,7 @@ /* Name: Boss_Anzu %Complete: 80% -Comment: +Comment: Category: Auchindoun, Sethekk Halls */ @@ -57,113 +57,109 @@ Position const PosSummonBrood[7] = { -69.25543f, 303.0768f, 97.84479f, 5.532694f }, { -87.59662f, 263.5181f, 92.70478f, 1.658063f }, { -73.54323f, 276.6267f, 94.25807f, 2.802979f }, - { -81.70527f, 280.8776f, 44.58830f, 0.526849f }, + { -81.70527f, 280.8776f, 44.58830f, 0.526849f } }; class boss_anzu : public CreatureScript { -public: - boss_anzu() : CreatureScript("boss_anzu") { } + public: + boss_anzu() : CreatureScript("boss_anzu") { } - struct boss_anzuAI : public BossAI - { - boss_anzuAI(Creature* creature) : BossAI(creature, DATA_ANZU) { } - - void Reset() OVERRIDE + struct boss_anzuAI : public BossAI { - summon66 = false; - summon33 = false; - } + boss_anzuAI(Creature* creature) : BossAI(creature, DATA_ANZU) { } - void EnterCombat(Unit* /*who*/) OVERRIDE - { - events.ScheduleEvent(EVENT_PARALYZING_SCREECH, 14000); - events.ScheduleEvent(EVENT_CYCLONE_OF_FEATHERS, 5000); - } + void Reset() OVERRIDE + { + _under33Percent = false; + _under66Percent = false; + } - void JustDied(Unit* /*killer*/) OVERRIDE - { - if (instance) - instance->SetData(DATA_ANZU, DONE); - } + void EnterCombat(Unit* /*who*/) OVERRIDE + { + events.ScheduleEvent(EVENT_PARALYZING_SCREECH, 14000); + events.ScheduleEvent(EVENT_CYCLONE_OF_FEATHERS, 5000); + } - void KilledUnit(Unit* /*victim*/) OVERRIDE {} + void JustDied(Unit* /*killer*/) OVERRIDE + { + if (instance) + instance->SetData(DATA_ANZU, DONE); + } - void UpdateAI(uint32 diff) OVERRIDE - { - if (!UpdateVictim()) - return; + void DamageTaken(Unit* /*killer*/, uint32 &damage) OVERRIDE + { + if (me->HealthBelowPctDamaged(33, damage) && !_under33Percent) + { + _under33Percent = true; + Talk(SAY_SUMMON_BROOD); + events.ScheduleEvent(EVENT_SUMMON, 3000); + } - events.Update(diff); + if (me->HealthBelowPctDamaged(66, damage) && !_under66Percent) + { + _under66Percent = true; + Talk(SAY_SUMMON_BROOD); + events.ScheduleEvent(EVENT_SUMMON, 3000); + } + } - while (uint32 eventId = events.ExecuteEvent()) + void UpdateAI(uint32 diff) OVERRIDE { - switch (eventId) + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - case EVENT_PARALYZING_SCREECH: + switch (eventId) + { + case EVENT_PARALYZING_SCREECH: DoCastVictim(SPELL_PARALYZING_SCREECH); - events.ScheduleEvent(EVENT_PARALYZING_SCREECH, 26000); - break; - - case EVENT_CYCLONE_OF_FEATHERS: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CYCLONE_OF_FEATHERS); - events.ScheduleEvent(EVENT_CYCLONE_OF_FEATHERS, 21000); - break; - case EVENT_SUMMON: - // TODO: Add pathing for Brood of Anzu - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[5], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[6], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); - DoCast(me, SPELL_BANISH_SELF); - events.ScheduleEvent(EVENT_SPELL_BOMB, 12000); - break; - case EVENT_SPELL_BOMB: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - if (target->getPowerType() == POWER_MANA) + events.ScheduleEvent(EVENT_PARALYZING_SCREECH, 26000); + break; + case EVENT_CYCLONE_OF_FEATHERS: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CYCLONE_OF_FEATHERS); + events.ScheduleEvent(EVENT_CYCLONE_OF_FEATHERS, 21000); + break; + case EVENT_SUMMON: + // TODO: Add pathing for Brood of Anzu + for (uint8 i = 0; i < 7; i++) + me->SummonCreature(NPC_BROOD_OF_ANZU, PosSummonBrood[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 46000); + + DoCast(me, SPELL_BANISH_SELF); + events.ScheduleEvent(EVENT_SPELL_BOMB, 12000); + break; + case EVENT_SPELL_BOMB: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - DoCast(target, SPELL_SPELL_BOMB); - Talk(SAY_SPELL_BOMB, target->GetGUID()); + if (target->getPowerType() == POWER_MANA) + { + DoCast(target, SPELL_SPELL_BOMB); + Talk(SAY_SPELL_BOMB, target->GetGUID()); + } } - } - break; - default: - break; + break; + default: + break; + } } - } - if (HealthBelowPct(66) && !summon66) - { - summon66 = true; - Talk(SAY_SUMMON_BROOD); - events.ScheduleEvent(EVENT_SUMMON, 3000); + DoMeleeAttackIfReady(); } - if (HealthBelowPct(33) && !summon33) - { - summon33 = true; - Talk(SAY_SUMMON_BROOD); - events.ScheduleEvent(EVENT_SUMMON, 3000); - } - - DoMeleeAttackIfReady(); - } + private: + bool _under33Percent; + bool _under66Percent; - private: - bool summon66; - bool summon33; + }; - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new boss_anzuAI(creature); - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_anzuAI(creature); + } }; void AddSC_boss_anzu() diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index b1152c311dc..b8f29f276ae 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -119,8 +119,8 @@ class spell_hun_ascpect_of_the_viper : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE) || - !sSpellMgr->GetSpellInfo(SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER) || - !sSpellMgr->GetSpellInfo(SPELL_HUNTER_VIPER_ATTACK_SPEED) || + !sSpellMgr->GetSpellInfo(SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER) || + !sSpellMgr->GetSpellInfo(SPELL_HUNTER_VIPER_ATTACK_SPEED) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_VICIOUS_VIPER)) return false; return true; @@ -871,7 +871,7 @@ class spell_hun_viper_attack_speed : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_VIPER) || + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_VIPER) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_VICIOUS_VIPER)) return false; return true; |