diff options
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
7 files changed, 96 insertions, 281 deletions
| diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp index 4be139c2ee9..2bd43e7283c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -212,13 +212,12 @@ public:                              std::list<Creature*> creatureList;                              GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 35.0f);                              for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) -                                if (Creature* creatureList = *itr) +                                if (Creature* creature = *itr)                                  { -                                    if (!creatureList->IsAlive()) -                                    { -                                        creatureList->Respawn(); -                                    } -                                    creatureList->AI()->SetData(1, 1); +                                    if (!creature->IsAlive()) +                                        creature->Respawn(); + +                                    creature->AI()->SetData(1, 1);                                  }                              me->AddAura(SPELL_ENCAGED_EMBERSEER, me);                              instance->SetBossState(DATA_PYROGAURD_EMBERSEER, NOT_STARTED); @@ -231,8 +230,8 @@ public:                              GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 35.0f);                              for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)                              { -                                if (Creature* creatureList = *itr) -                                    creatureList->AI()->SetData(1, 1); +                                if (Creature* creature = *itr) +                                    creature->AI()->SetData(1, 1);                              }                              events.ScheduleEvent(EVENT_PRE_FIGHT_2, 32000);                              break; @@ -355,9 +354,7 @@ public:              }              if (data == 1 && value == 2) -            {                  _events.ScheduleEvent(EVENT_ENCAGED_EMBERSEER, 1000); -            }          }          void EnterCombat(Unit* /*who*/) override @@ -371,8 +368,8 @@ public:              GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLACKHAND_INCARCERATOR, 60.0f);              for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)              { -                if (Creature* creatureList = *itr) -                creatureList->SetInCombatWithZone();    // AI()->AttackStart(me->GetVictim()); +                if (Creature* creature = *itr) +                    creature->SetInCombatWithZone();    // AI()->AttackStart(me->GetVictim());              }              _events.ScheduleEvent(EVENT_STRIKE, urand(8000, 16000)); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp index b3a55e1fe4a..555eac21c43 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp @@ -410,24 +410,24 @@ public:          void Dragonspireroomstore()          { -            uint8 creaturecount; +            uint8 creatureCount;              for (uint8 i = 0; i < 7; ++i)              { -                creaturecount = 0; +                creatureCount = 0;                  if (GameObject* rune = instance->GetGameObject(go_roomrunes[i]))                  { -                    for (uint8 ii = 0; ii < 3; ++ii) +                    for (uint8 j = 0; j < 3; ++j)                      {                          std::list<Creature*> creatureList; -                        GetCreatureListWithEntryInGrid(creatureList, rune, DragonspireMobs[ii], 15.0f); +                        GetCreatureListWithEntryInGrid(creatureList, rune, DragonspireMobs[j], 15.0f);                          for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)                          { -                            if (Creature* creatureList = *itr) +                            if (Creature* creature = *itr)                              { -                                runecreaturelist[i] [creaturecount] = creatureList->GetGUID(); -                                ++creaturecount; +                                runecreaturelist[i][creatureCount] = creature->GetGUID(); +                                ++creatureCount;                              }                          }                      } diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 4adb087921b..ef2e9fceb21 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -85,7 +85,6 @@ set(scripts_STAT_SRCS    EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp    EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp    EasternKingdoms/zone_isle_of_queldanas.cpp -  EasternKingdoms/boss_kruul.cpp    EasternKingdoms/ZulGurub/boss_hakkar.cpp    EasternKingdoms/ZulGurub/boss_mandokir.cpp    EasternKingdoms/ZulGurub/boss_marli.cpp diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 3b499b649cf..256ab06a7b7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -84,29 +84,20 @@ public:          InstanceScript* instance; -        uint64 TerestianGUID; -          uint32 AmplifyTimer;          void Reset() override          { -            TerestianGUID = 0;              AmplifyTimer = 2000;          } -        void EnterCombat(Unit* /*who*/) override -        { -        } +        void EnterCombat(Unit* /*who*/) override { }          void JustDied(Unit* /*killer*/) override          { -            uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN); -            if (TerestianGUID) -            { -                Unit* Terestian = ObjectAccessor::GetUnit(*me, TerestianGUID); -                if (Terestian && Terestian->IsAlive()) -                    DoCast(Terestian, SPELL_BROKEN_PACT, true); -            } +            Creature* Terestian = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TERESTIAN)); +            if (Terestian && Terestian->IsAlive()) +                DoCast(Terestian, SPELL_BROKEN_PACT, true);          }          void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index 787bf7584e5..f18c0aac8bb 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -1,6 +1,5 @@  /*   * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>   *   * 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,15 +15,9 @@   * with this program. If not, see <http://www.gnu.org/licenses/>.   */ -/* ScriptData -SDName: Boss_Arcanist_Doan -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ -  #include "ScriptMgr.h"  #include "ScriptedCreature.h" +#include "scarlet_monastery.h"  enum Yells  { @@ -34,103 +27,100 @@ enum Yells  enum Spells  { -    SPELL_POLYMORPH             = 13323, -    SPELL_AOESILENCE            = 8988, -    SPELL_ARCANEEXPLOSION       = 9433, -    SPELL_FIREAOE               = 9435, -    SPELL_ARCANEBUBBLE          = 9438 +    SPELL_SILENCE               = 8988, +    SPELL_ARCANE_EXPLOSION      = 9433, +    SPELL_DETONATION            = 9435, +    SPELL_ARCANE_BUBBLE         = 9438, +    SPELL_POLYMORPH             = 13323  }; -class boss_arcanist_doan : public CreatureScript +enum Events  { -public: -    boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { } - -    CreatureAI* GetAI(Creature* creature) const override -    { -        return new boss_arcanist_doanAI(creature); -    } - -    struct boss_arcanist_doanAI : public ScriptedAI -    { -        boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) { } - -        uint32 Polymorph_Timer; -        uint32 AoESilence_Timer; -        uint32 ArcaneExplosion_Timer; -        bool bCanDetonate; -        bool bShielded; - -        void Reset() override -        { -            Polymorph_Timer = 20000; -            AoESilence_Timer = 15000; -            ArcaneExplosion_Timer = 3000; -            bCanDetonate = false; -            bShielded = false; -        } +    EVENT_SILENCE               = 1, +    EVENT_ARCANE_EXPLOSION      = 2, +    EVENT_ARCANE_BUBBLE         = 3, +    EVENT_POLYMORPH             = 4 +}; -        void EnterCombat(Unit* /*who*/) override -        { -            Talk(SAY_AGGRO); -        } +class boss_arcanist_doan : public CreatureScript +{ +    public: +        boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { } -        void UpdateAI(uint32 diff) override +        struct boss_arcanist_doanAI : public BossAI          { -            if (!UpdateVictim()) -                return; - -            if (bShielded && bCanDetonate) +            boss_arcanist_doanAI(Creature* creature) : BossAI(creature, DATA_ARCANIST_DOAN)              { -                DoCast(me, SPELL_FIREAOE); -                bCanDetonate = false; +                _healthAbove50Pct = true;              } -            if (me->HasAura(SPELL_ARCANEBUBBLE)) -                return; - -            //If we are <50% hp cast Arcane Bubble -            if (!bShielded && !HealthAbovePct(50)) +            void Reset() override              { -                //wait if we already casting -                if (me->IsNonMeleeSpellCast(false)) -                    return; - -                Talk(SAY_SPECIALAE); -                DoCast(me, SPELL_ARCANEBUBBLE); - -                bCanDetonate = true; -                bShielded = true; +                _Reset(); +                _healthAbove50Pct = true;              } -            if (Polymorph_Timer <= diff) +            void EnterCombat(Unit* /*who*/) override              { -                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) -                    DoCast(target, SPELL_POLYMORPH); +                _EnterCombat(); +                Talk(SAY_AGGRO); -                Polymorph_Timer = 20000; +                events.ScheduleEvent(EVENT_SILENCE,         15 * IN_MILLISECONDS); +                events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 3 * IN_MILLISECONDS); +                events.ScheduleEvent(EVENT_POLYMORPH,       30 * IN_MILLISECONDS);              } -            else Polymorph_Timer -= diff; -            //AoESilence_Timer -            if (AoESilence_Timer <= diff) +            void UpdateAI(uint32 diff) override              { -                DoCastVictim(SPELL_AOESILENCE); -                AoESilence_Timer = urand(15000, 20000); -            } -            else AoESilence_Timer -= diff; +                if (!UpdateVictim()) +                    return; -            //ArcaneExplosion_Timer -            if (ArcaneExplosion_Timer <= diff) -            { -                DoCastVictim(SPELL_ARCANEEXPLOSION); -                ArcaneExplosion_Timer = 8000; +                events.Update(diff); + +                if (me->HasUnitState(UNIT_STATE_CASTING)) +                    return; + +                while (uint32 eventId = events.ExecuteEvent()) +                { +                    switch (eventId) +                    { +                        case EVENT_SILENCE: +                            DoCastVictim(SPELL_SILENCE); +                            events.ScheduleEvent(EVENT_SILENCE, urand(15, 20) * IN_MILLISECONDS); +                            break; +                        case EVENT_ARCANE_EXPLOSION: +                            DoCastVictim(SPELL_ARCANE_EXPLOSION); +                            events.ScheduleEvent(EVENT_SILENCE, 8 * IN_MILLISECONDS); +                            break; +                        case EVENT_POLYMORPH: +                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 30.0f, true)) +                                DoCast(target, SPELL_POLYMORPH); +                            events.ScheduleEvent(EVENT_POLYMORPH, 20 * IN_MILLISECONDS); +                            break; +                        default: +                            break; +                    } +                } + +                if (_healthAbove50Pct && HealthBelowPct(50)) +                { +                    _healthAbove50Pct = false; +                    Talk(SAY_SPECIALAE); +                    DoCast(me, SPELL_ARCANE_BUBBLE); +                    DoCastAOE(SPELL_DETONATION); +                } + +                DoMeleeAttackIfReady();              } -            else ArcaneExplosion_Timer -= diff; -            DoMeleeAttackIfReady(); +        private: +            bool _healthAbove50Pct; +        }; + +        CreatureAI* GetAI(Creature* creature) const override +        { +            return new boss_arcanist_doanAI(creature);          } -    };  };  void AddSC_boss_arcanist_doan() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h index cd5a74ee478..bdac6b089fd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -30,7 +30,8 @@ enum DataTypes      DATA_HORSEMAN_EVENT             = 5,      GAMEOBJECT_PUMPKIN_SHRINE       = 6, -    DATA_VORREL                     = 7 +    DATA_VORREL                     = 7, +    DATA_ARCANIST_DOAN              = 8  };  #endif // SCARLET_M_ diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp deleted file mode 100644 index 13f9f76532e..00000000000 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * 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 <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Boss_Kruul -SD%Complete: 100 -SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back. -SDCategory: Bosses -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum Spells -{ -    SPELL_SHADOWVOLLEY          = 21341, -    SPELL_CLEAVE                = 20677, -    SPELL_THUNDERCLAP           = 23931, -    SPELL_TWISTEDREFLECTION     = 21063, -    SPELL_VOIDBOLT              = 21066, -    SPELL_RAGE                  = 21340, -    SPELL_CAPTURESOUL           = 21054 -}; - -class boss_kruul : public CreatureScript -{ -public: -    boss_kruul() : CreatureScript("boss_kruul") { } - -    CreatureAI* GetAI(Creature* creature) const override -    { -        return new boss_kruulAI(creature); -    } - -    struct boss_kruulAI : public ScriptedAI -    { -        boss_kruulAI(Creature* creature) : ScriptedAI(creature) { } - -        uint32 ShadowVolley_Timer; -        uint32 Cleave_Timer; -        uint32 ThunderClap_Timer; -        uint32 TwistedReflection_Timer; -        uint32 VoidBolt_Timer; -        uint32 Rage_Timer; -        uint32 Hound_Timer; - -        void Reset() override -        { -            ShadowVolley_Timer = 10000; -            Cleave_Timer = 14000; -            ThunderClap_Timer = 20000; -            TwistedReflection_Timer = 25000; -            VoidBolt_Timer = 30000; -            Rage_Timer = 60000;                                 //Cast rage after 1 minute -            Hound_Timer = 8000; -        } - -        void EnterCombat(Unit* /*who*/) override -        { -        } - -        void KilledUnit(Unit* /*victim*/) override -        { -            // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70, 000 health. -            DoCast(me, SPELL_CAPTURESOUL); -        } - -        void SummonHounds(Unit* victim) -        { -            if (Creature* Hound = DoSpawnCreature(19207, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) -                Hound->AI()->AttackStart(victim); -        } - -        void UpdateAI(uint32 diff) override -        { -            //Return since we have no target -            if (!UpdateVictim()) -                return; - -            //ShadowVolley_Timer -            if (ShadowVolley_Timer <= diff) -            { -                if (urand(0, 99) < 45) -                    DoCastVictim(SPELL_SHADOWVOLLEY); - -                ShadowVolley_Timer = 5000; -            } else ShadowVolley_Timer -= diff; - -            //Cleave_Timer -            if (Cleave_Timer <= diff) -            { -                if (urand(0, 1)) -                    DoCastVictim(SPELL_CLEAVE); - -                Cleave_Timer = 10000; -            } else Cleave_Timer -= diff; - -            //ThunderClap_Timer -            if (ThunderClap_Timer <= diff) -            { -                if (urand(0, 9) < 2) -                    DoCastVictim(SPELL_THUNDERCLAP); - -                ThunderClap_Timer = 12000; -            } else ThunderClap_Timer -= diff; - -            //TwistedReflection_Timer -            if (TwistedReflection_Timer <= diff) -            { -                DoCastVictim(SPELL_TWISTEDREFLECTION); -                TwistedReflection_Timer = 30000; -            } else TwistedReflection_Timer -= diff; - -            //VoidBolt_Timer -            if (VoidBolt_Timer <= diff) -            { -                if (urand(0, 9) < 4) -                    DoCastVictim(SPELL_VOIDBOLT); - -                VoidBolt_Timer = 18000; -            } else VoidBolt_Timer -= diff; - -            //Rage_Timer -            if (Rage_Timer <= diff) -            { -                DoCast(me, SPELL_RAGE); -                Rage_Timer = 70000; -            } else Rage_Timer -= diff; - -            //Hound_Timer -            if (Hound_Timer <= diff) -            { -                SummonHounds(me->GetVictim()); -                SummonHounds(me->GetVictim()); -                SummonHounds(me->GetVictim()); - -                Hound_Timer = 45000; -            } else Hound_Timer -= diff; - -            DoMeleeAttackIfReady(); -        } -    }; -}; - -void AddSC_boss_kruul() -{ -    new boss_kruul(); -} | 
