diff options
| author | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-01-12 19:35:11 +0100 | 
|---|---|---|
| committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-01-12 19:35:32 +0100 | 
| commit | bf7f58365f5a2b2be24f27b328a66049cb03348e (patch) | |
| tree | c1edca7c9618f9431b27592266b21d591feba736 /src/server/scripts/Outland | |
| parent | 9d1e5a013eb5be9020b1fc9d92e736067576b749 (diff) | |
Scripts/Misc: Some cleanups
Diffstat (limited to 'src/server/scripts/Outland')
4 files changed, 32 insertions, 55 deletions
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp index 60d42c38c50..00cce1ecebc 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -16,7 +16,7 @@   */  /* ScriptData -SDName: Boss_Gatewatcher_Gyrokill +SDName: boss_gatewatcher_gyrokill  SD%Complete: 99%  SDComment:  SDCategory: Tempest Keep, The Mechanar @@ -50,13 +50,13 @@ enum Events      EVENT_SHADOW_POWER              = 2  }; -class Boss_Gatewatcher_Gyrokill : public CreatureScript +class boss_gatewatcher_gyrokill : public CreatureScript  { -    public: Boss_Gatewatcher_Gyrokill() : CreatureScript("Boss_Gatewatcher_Gyrokill") { } +    public: boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") { } -        struct Boss_Gatewatcher_GyrokillAI : public BossAI +        struct boss_gatewatcher_gyrokillAI : public BossAI          { -            Boss_Gatewatcher_GyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) {} +            boss_gatewatcher_gyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) {}              void JustDied(Unit* /*killer*/)              { @@ -116,11 +116,11 @@ class Boss_Gatewatcher_Gyrokill : public CreatureScript          CreatureAI* GetAI(Creature* creature) const          { -            return new Boss_Gatewatcher_GyrokillAI (creature); +            return new boss_gatewatcher_gyrokillAI (creature);          }  }; -void AddSC_Boss_Gatewatcher_Gyrokill() +void AddSC_boss_gatewatcher_gyrokill()  { -    new Boss_Gatewatcher_Gyrokill(); -}
\ No newline at end of file +    new boss_gatewatcher_gyrokill(); +} diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 4f71a020f83..0b2370e1b17 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -145,10 +145,7 @@ class boss_nethermancer_sepethrea : public CreatureScript  class mob_ragin_flames : public CreatureScript  {      public: -        mob_ragin_flames() -            : CreatureScript("mob_ragin_flames") -        { -        } +        mob_ragin_flames() : CreatureScript("mob_ragin_flames") { }              struct mob_ragin_flamesAI : public ScriptedAI              { @@ -235,4 +232,3 @@ void AddSC_boss_nethermancer_sepethrea()      new boss_nethermancer_sepethrea();      new mob_ragin_flames();  } - diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index 94daedfdc43..09b3403f5c2 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -61,25 +61,18 @@ enum Events      EVENT_ARCANE_EXPLOSION         = 4  }; +enum Creatures +{ +    NPC_NETHER_WRAITH               = 21062 +}; +  class boss_pathaleon_the_calculator : public CreatureScript  {      public: boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {}          struct boss_pathaleon_the_calculatorAI : public BossAI          { -            boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature,DATA_PATHALEON_THE_CALCULATOR), summons(me) {} - -            SummonList summons; -            bool Enraged; -            uint32 Counter; - -            void Reset() -            { -                _Reset(); -                Enraged = false; -                Counter = 0; -                summons.DespawnAll(); -            } +            boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }              void EnterCombat(Unit* /*who*/)              { @@ -101,17 +94,15 @@ class boss_pathaleon_the_calculator : public CreatureScript              {                  _JustDied();                  Talk(SAY_DEATH); -                summons.DespawnAll(); -            } - -            void JustSummoned(Creature* summon) -            { -                summons.Summon(summon);              } -            void SummonedCreatureDespawn(Creature* summon) +            void DamageTaken(Unit* /*attacker*/, uint32& damage)              { -                summons.Despawn(summon); +                if (me->HealthBelowPctDamaged(20, damage) && !me->HasAura(SPELL_FRENZY)) +                { +                    DoCast(me, SPELL_FRENZY); +                    Talk(SAY_ENRAGE); +                }              }              void UpdateAI(uint32 const diff) @@ -121,13 +112,6 @@ class boss_pathaleon_the_calculator : public CreatureScript                  events.Update(diff); -                if (!Enraged && HealthBelowPct(21)) -                { -                    DoCast(me, SPELL_FRENZY); -                    Talk(SAY_ENRAGE); -                    Enraged = true; -                } -                  if (me->HasUnitState(UNIT_STATE_CASTING))                      return; @@ -138,10 +122,11 @@ class boss_pathaleon_the_calculator : public CreatureScript                          case EVENT_SUMMON:                              for (uint8 i = 0; i < 3; ++i)                              { -                                Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); -                                Creature* Wraith = me->SummonCreature(21062, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); -                                if (target && Wraith) -                                    Wraith->AI()->AttackStart(target); +                                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) +                                { +                                    if (Creature* Wraith = me->SummonCreature(NPC_NETHER_WRAITH, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000)) +                                        Wraith->AI()->AttackStart(target); +                                }                              }                              Talk(SAY_SUMMON);                              events.ScheduleEvent(EVENT_SUMMON, urand(30000, 45000)); @@ -172,20 +157,17 @@ class boss_pathaleon_the_calculator : public CreatureScript              }          }; -            CreatureAI* GetAI(Creature* creature) const -            { -                return new boss_pathaleon_the_calculatorAI (creature); -            } +        CreatureAI* GetAI(Creature* creature) const +        { +            return new boss_pathaleon_the_calculatorAI (creature); +        }  };  class mob_nether_wraith : public CreatureScript  {      public: -        mob_nether_wraith() -            : CreatureScript("mob_nether_wraith") -        { -        } +        mob_nether_wraith() : CreatureScript("mob_nether_wraith") { }          struct mob_nether_wraithAI : public ScriptedAI          { diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index ac8efb83822..250959a1468 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -112,4 +112,3 @@ void AddSC_instance_mechanar()  {      new instance_mechanar();  } -  | 
