diff options
| author | Supabad <none@none> | 2010-08-07 13:06:10 +0200 | 
|---|---|---|
| committer | Supabad <none@none> | 2010-08-07 13:06:10 +0200 | 
| commit | 9a592f44af3bb4110df6b5eb42720e79ffba0e26 (patch) | |
| tree | c0f943ba01ec9c0835fe9d21c28049e421e96048 /src/server/scripts/Outland | |
| parent | 10c4ef697cb0d6281eeeca9e99db440ceeaa5ffa (diff) | |
convert Mechanar to new format
--HG--
branch : trunk
Diffstat (limited to 'src/server/scripts/Outland')
4 files changed, 596 insertions, 517 deletions
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index 97dd2253081..a86412d3286 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -25,108 +25,126 @@ EndScriptData */  #include "ScriptPCH.h" -#define SAY_AGGRO_1                     -1554006 -#define SAY_HAMMER_1                    -1554007 -#define SAY_HAMMER_2                    -1554008 -#define SAY_SLAY_1                      -1554009 -#define SAY_SLAY_2                      -1554010 -#define SAY_DEATH_1                     -1554011 -#define EMOTE_HAMMER                    -1554012 - -// Spells to be casted -#define SPELL_SHADOW_POWER              35322 -#define H_SPELL_SHADOW_POWER            39193 -#define SPELL_HAMMER_PUNCH              35326 -#define SPELL_JACKHAMMER                35327 -#define H_SPELL_JACKHAMMER              39194 -#define SPELL_STREAM_OF_MACHINE_FLUID   35311 - -// Gatewatcher Iron-Hand AI -struct boss_gatewatcher_iron_handAI : public ScriptedAI +enum eSays  { -    boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) -    { -    } - -    uint32 Shadow_Power_Timer; -    uint32 Jackhammer_Timer; -    uint32 Stream_of_Machine_Fluid_Timer; - -    void Reset() -    { -        Shadow_Power_Timer = 25000; -        Jackhammer_Timer = 45000; -        Stream_of_Machine_Fluid_Timer = 55000; - -    } -    void EnterCombat(Unit * /*who*/) -    { -        DoScriptText(SAY_AGGRO_1, me); -    } - -    void KilledUnit(Unit* /*victim*/) -    { -        if (rand()%2) -            return; - -        DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); -    } - -    void JustDied(Unit* /*Killer*/) -    { -        DoScriptText(SAY_DEATH_1, me); -        //TODO: Add door check/open code -    } - -    void UpdateAI(const uint32 diff) -    { -        //Return since we have no target -        if (!UpdateVictim()) -            return; - -        //Shadow Power -        if (Shadow_Power_Timer <= diff) -        { -            DoCast(me, SPELL_SHADOW_POWER); -            Shadow_Power_Timer = 20000 + rand()%8000; -        } else Shadow_Power_Timer -= diff; - -        //Jack Hammer -        if (Jackhammer_Timer <= diff) -        { -            //TODO: expect cast this about 5 times in a row (?), announce it by emote only once -            DoScriptText(EMOTE_HAMMER, me); -            DoCast(me->getVictim(), SPELL_JACKHAMMER); +    SAY_AGGRO_1                    = -1554006, +    SAY_HAMMER_1                   = -1554007, +    SAY_HAMMER_2                   = -1554008, +    SAY_SLAY_1                     = -1554009, +    SAY_SLAY_2                     = -1554010, +    SAY_DEATH_1                    = -1554011, +    EMOTE_HAMMER                   = -1554012, +}; -            //chance to yell, but not same time as emote (after spell in fact casted) -            if (rand()%2) -                return; +enum eSpells +{ +    // Spells to be casted +    SPELL_SHADOW_POWER             = 35322, +    H_SPELL_SHADOW_POWER           = 39193, +    SPELL_HAMMER_PUNCH             = 35326, +    SPELL_JACKHAMMER               = 35327, +    H_SPELL_JACKHAMMER             = 39194, +    SPELL_STREAM_OF_MACHINE_FLUID  = 35311, +}; -            DoScriptText(RAND(SAY_HAMMER_1,SAY_HAMMER_2), me); -            Jackhammer_Timer = 30000; -        } else Jackhammer_Timer -= diff; +class boss_gatewatcher_iron_hand : public CreatureScript +{ +    public: -        //Stream of Machine Fluid -        if (Stream_of_Machine_Fluid_Timer <= diff) +        boss_gatewatcher_iron_hand() +            : CreatureScript("boss_gatewatcher_iron_hand")          { -            DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID); -            Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; -        } else Stream_of_Machine_Fluid_Timer -= diff; - -        DoMeleeAttackIfReady(); -    } +        } +            // Gatewatcher Iron-Hand AI +            struct boss_gatewatcher_iron_handAI : public ScriptedAI +            { +                boss_gatewatcher_iron_handAI(Creature* pCreature) : ScriptedAI(pCreature) +                { +                } + +                uint32 Shadow_Power_Timer; +                uint32 Jackhammer_Timer; +                uint32 Stream_of_Machine_Fluid_Timer; + +                void Reset() +                { +                    Shadow_Power_Timer = 25000; +                    Jackhammer_Timer = 45000; +                    Stream_of_Machine_Fluid_Timer = 55000; + +                } +                void EnterCombat(Unit * /*who*/) +                { +                    DoScriptText(SAY_AGGRO_1, me); +                } + +                void KilledUnit(Unit* /*victim*/) +                { +                    if (rand()%2) +                        return; + +                    DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); +                } + +                void JustDied(Unit* /*Killer*/) +                { +                    DoScriptText(SAY_DEATH_1, me); +                    //TODO: Add door check/open code +                } + +                void UpdateAI(const uint32 diff) +                { +                    //Return since we have no target +                    if (!UpdateVictim()) +                        return; + +                    //Shadow Power +                    if (Shadow_Power_Timer <= diff) +                    { +                        DoCast(me, SPELL_SHADOW_POWER); +                        Shadow_Power_Timer = 20000 + rand()%8000; +                    }  +                    else  +                        Shadow_Power_Timer -= diff; + +                    //Jack Hammer +                    if (Jackhammer_Timer <= diff) +                    { +                        //TODO: expect cast this about 5 times in a row (?), announce it by emote only once +                        DoScriptText(EMOTE_HAMMER, me); +                        DoCast(me->getVictim(), SPELL_JACKHAMMER); + +                        //chance to yell, but not same time as emote (after spell in fact casted) +                        if (rand()%2) +                                            return; + +                        DoScriptText(RAND(SAY_HAMMER_1,SAY_HAMMER_2), me); +                        Jackhammer_Timer = 30000; +                    }  +                    else  +                        Jackhammer_Timer -= diff; + +                    //Stream of Machine Fluid +                    if (Stream_of_Machine_Fluid_Timer <= diff) +                    { +                        DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID); +                        Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; +                    }  +                    else  +                        Stream_of_Machine_Fluid_Timer -= diff; + +                    DoMeleeAttackIfReady(); +                } +            }; + +            CreatureAI* OnGetAI(Creature* creature) const +            { +                return new boss_gatewatcher_iron_handAI(creature); +            }          }; -CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) -{ -    return new boss_gatewatcher_iron_handAI (pCreature); -}  void AddSC_boss_gatewatcher_iron_hand()  { -    Script *newscript; -    newscript = new Script; -    newscript->Name = "boss_gatewatcher_iron_hand"; -    newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; -    newscript->RegisterSelf(); +    new boss_gatewatcher_iron_hand();  } 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 9e3b35c2590..5f5872758f9 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -26,222 +26,244 @@ EndScriptData */  #include "ScriptPCH.h"  #include "mechanar.h" -#define SAY_AGGRO                       -1554013 -#define SAY_SUMMON                      -1554014 -#define SAY_DRAGONS_BREATH_1            -1554015 -#define SAY_DRAGONS_BREATH_2            -1554016 -#define SAY_SLAY1                       -1554017 -#define SAY_SLAY2                       -1554018 -#define SAY_DEATH                       -1554019 - -#define SPELL_SUMMON_RAGIN_FLAMES       35275 -#define H_SPELL_SUMMON_RAGIN_FLAMES     39084 - -#define SPELL_FROST_ATTACK              35263 -#define SPELL_ARCANE_BLAST              35314 -#define SPELL_DRAGONS_BREATH            35250 -#define SPELL_KNOCKBACK                 37317 -#define SPELL_SOLARBURN                 35267 - -struct boss_nethermancer_sepethreaAI : public ScriptedAI +enum eSays  { -    boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) -    { -        pInstance = c->GetInstanceData(); -    } - -    ScriptedInstance *pInstance; - -    uint32 frost_attack_Timer; -    uint32 arcane_blast_Timer; -    uint32 dragons_breath_Timer; -    uint32 knockback_Timer; -    uint32 solarburn_Timer; - -    void Reset() -    { -        frost_attack_Timer = 7000 + rand()%3000; -        arcane_blast_Timer = 12000 + rand()%6000; -        dragons_breath_Timer = 18000 + rand()%4000; -        knockback_Timer = 22000 + rand()%6000; -        solarburn_Timer = 30000; - -        if (pInstance) -            pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); -    } - -    void EnterCombat(Unit* who) -    { -        if (pInstance) -            pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); - -        DoScriptText(SAY_AGGRO, me); -        DoCast(who, SPELL_SUMMON_RAGIN_FLAMES); -        DoScriptText(SAY_SUMMON, me); -    } - -    void KilledUnit(Unit* /*victim*/) -    { -        DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); -    } - -    void JustDied(Unit* /*Killer*/) -    { -        DoScriptText(SAY_DEATH, me); - -        if (pInstance) -            pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); -    } - -    void UpdateAI(const uint32 diff) -    { -        //Return since we have no target -        if (!UpdateVictim()) -            return; - -        //Frost Attack -        if (frost_attack_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_FROST_ATTACK); -            frost_attack_Timer = 7000 + rand()%3000; -        } else frost_attack_Timer -= diff; +    SAY_AGGRO                      = -1554013, +    SAY_SUMMON                     = -1554014, +    SAY_DRAGONS_BREATH_1           = -1554015, +    SAY_DRAGONS_BREATH_2           = -1554016, +    SAY_SLAY1                      = -1554017, +    SAY_SLAY2                      = -1554018, +    SAY_DEATH                      = -1554019, +}; -        //Arcane Blast -        if (arcane_blast_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_ARCANE_BLAST); -            arcane_blast_Timer = 15000; -        } else arcane_blast_Timer -= diff; +enum eSpells +{ +    SPELL_SUMMON_RAGIN_FLAMES      = 35275, +    SPELL_FROST_ATTACK             = 35263, +    SPELL_ARCANE_BLAST             = 35314, +    SPELL_DRAGONS_BREATH           = 35250, +    SPELL_KNOCKBACK                = 37317, +    SPELL_SOLARBURN                = 35267, +    H_SPELL_SUMMON_RAGIN_FLAMES    = 39084,    +    SPELL_INFERNO                  = 35268, +    H_SPELL_INFERNO                = 39346, +    SPELL_FIRE_TAIL                = 35278, +}; + +class boss_nethermancer_sepethrea : public CreatureScript +{ +    public: -        //Dragons Breath -        if (dragons_breath_Timer <= diff) +        boss_nethermancer_sepethrea() +            : CreatureScript("boss_nethermancer_sepethrea")          { -            DoCast(me->getVictim(), SPELL_DRAGONS_BREATH); +        } +        struct boss_nethermancer_sepethreaAI : public ScriptedAI +        { +            boss_nethermancer_sepethreaAI(Creature* pCreature) : ScriptedAI(pCreature)              { -                if (rand()%2) -                    return; +                pInstance = pCreature->GetInstanceData(); +            } +             +            ScriptedInstance *pInstance; +             +            uint32 frost_attack_Timer; +            uint32 arcane_blast_Timer; +            uint32 dragons_breath_Timer; +            uint32 knockback_Timer; +            uint32 solarburn_Timer; +             +            void Reset() +            { +                frost_attack_Timer = 7000 + rand()%3000; +                arcane_blast_Timer = 12000 + rand()%6000; +                dragons_breath_Timer = 18000 + rand()%4000; +                knockback_Timer = 22000 + rand()%6000; +                solarburn_Timer = 30000; + +                if (pInstance) +                    pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); +            } + +            void EnterCombat(Unit* who) +            { +                if (pInstance) +                    pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); -                DoScriptText(RAND(SAY_DRAGONS_BREATH_1,SAY_DRAGONS_BREATH_2), me); +                DoScriptText(SAY_AGGRO, me); +                DoCast(who, SPELL_SUMMON_RAGIN_FLAMES); +                DoScriptText(SAY_SUMMON, me);              } -            dragons_breath_Timer = 12000 + rand()%10000; -        } else dragons_breath_Timer -= diff; -        //Knockback -        if (knockback_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_KNOCKBACK); -            knockback_Timer = 15000 + rand()%10000; -        } else knockback_Timer -= diff; +            void KilledUnit(Unit* /*victim*/) +            { +                DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); +            } -        //Solarburn -        if (solarburn_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_SOLARBURN); -            solarburn_Timer = 30000; -        } else solarburn_Timer -= diff; +            void JustDied(Unit* /*Killer*/) +            { +                DoScriptText(SAY_DEATH, me); +                if (pInstance) +                    pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); +            } -        DoMeleeAttackIfReady(); -    } -}; +            void UpdateAI(const uint32 diff) +            { +                //Return since we have no target +                if (!UpdateVictim()) +                    return; -CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) -{ -    return new boss_nethermancer_sepethreaAI (pCreature); -} -#define SPELL_INFERNO                   35268 -#define H_SPELL_INFERNO                 39346 -#define SPELL_FIRE_TAIL                 35278 +                //Frost Attack +                if (frost_attack_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_FROST_ATTACK); + +                    frost_attack_Timer = 7000 + rand()%3000; +                }  +                else  +                    frost_attack_Timer -= diff; -struct mob_ragin_flamesAI : public ScriptedAI +                //Arcane Blast        +                if (arcane_blast_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_ARCANE_BLAST); +                    arcane_blast_Timer = 15000; +                }  +                else  +                    arcane_blast_Timer -= diff; +                //Dragons Breath +                if (dragons_breath_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_DRAGONS_BREATH); +                    { +                        if (rand()%2) +                            return; +                        DoScriptText(RAND(SAY_DRAGONS_BREATH_1,SAY_DRAGONS_BREATH_2), me); +                    } +                    dragons_breath_Timer = 12000 + rand()%10000; +                }  +                else  +                    dragons_breath_Timer -= diff; + +                //Knockback +                if (knockback_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_KNOCKBACK); +                    knockback_Timer = 15000 + rand()%10000; +                }  +                else  +                    knockback_Timer -= diff; + +                //Solarburn +                if (solarburn_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_SOLARBURN); +                    solarburn_Timer = 30000; +                }  +                else  +                    solarburn_Timer -= diff; + +                DoMeleeAttackIfReady(); +            } +        };   + +        CreatureAI* OnGetAI(Creature* creature) const +        { +            return new boss_nethermancer_sepethreaAI(creature); +        } +}; +class mob_ragin_flames : public CreatureScript  { -    mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) -    { -        pInstance = c->GetInstanceData(); -    } - -    ScriptedInstance *pInstance; - -    uint32 inferno_Timer; -    uint32 flame_timer; -    uint32 Check_Timer; - -    bool onlyonce; - -    void Reset() -    { -        inferno_Timer = 10000; -        flame_timer = 500; -        Check_Timer = 2000; -        onlyonce = false; -        me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); -        me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); -        me->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f)); -    } - -    void EnterCombat(Unit* /*who*/) -    { -    } - -    void UpdateAI(const uint32 diff) -    { -         //Check_Timer -        if (Check_Timer <= diff) +    public: +        mob_ragin_flames() +            : CreatureScript("mob_ragin_flames")          { -            if (pInstance) +        } + +            struct mob_ragin_flamesAI : public ScriptedAI              { -                if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) +                mob_ragin_flamesAI(Creature* pCreature) : ScriptedAI(pCreature)                  { -                    //remove -                    me->setDeathState(JUST_DIED); -                    me->RemoveCorpse(); +                    pInstance = pCreature->GetInstanceData();                  } -            } -            Check_Timer = 1000; -        } else Check_Timer -= diff; -        if (!UpdateVictim()) -            return; +                ScriptedInstance *pInstance; -        if (!onlyonce) -        { -            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) -                me->GetMotionMaster()->MoveChase(pTarget); -            onlyonce = true; -        } +                uint32 inferno_Timer; +                uint32 flame_timer; +                uint32 Check_Timer; -        if (inferno_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_INFERNO); -            me->TauntApply(me->getVictim()); -            inferno_Timer = 10000; -        } else inferno_Timer -= diff; +                bool onlyonce; -        if (flame_timer <= diff) -        { -            DoCast(me, SPELL_FIRE_TAIL); -            flame_timer = 500; -        } else flame_timer -=diff; +                void Reset() +                { +                    inferno_Timer = 10000; +                    flame_timer = 500; +                    Check_Timer = 2000; +                    onlyonce = false; +                    me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); +                    me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); +                    me->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f)); +                } -        DoMeleeAttackIfReady(); -    } +                void EnterCombat(Unit* /*who*/) +                { +                } +                void UpdateAI(const uint32 diff) +                { +                    //Check_Timer +                    if (Check_Timer <= diff) +                    { +                        if (pInstance) +                        { +                            if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) +                            { +                                //remove +                                me->setDeathState(JUST_DIED); +                                me->RemoveCorpse(); +                            } +                        } +                        Check_Timer = 1000; +                    } else Check_Timer -= diff; + +                    if (!UpdateVictim()) +                        return; + +                    if (!onlyonce) +                    { +                        if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) +                            me->GetMotionMaster()->MoveChase(pTarget); +                        onlyonce = true; +                    } + +                    if (inferno_Timer <= diff) +                    { +                        DoCast(me->getVictim(), SPELL_INFERNO); +                        me->TauntApply(me->getVictim()); +                        inferno_Timer = 10000; +                    } else inferno_Timer -= diff; + +                    if (flame_timer <= diff) +                    { +                        DoCast(me, SPELL_FIRE_TAIL); +                        flame_timer = 500; +                    } else flame_timer -=diff; + +                    DoMeleeAttackIfReady(); +                } + +            }; +            CreatureAI* OnGetAI(Creature* creature) const +            { +                return new mob_ragin_flamesAI(creature); +            }          }; -CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) -{ -    return new mob_ragin_flamesAI (pCreature); -}  void AddSC_boss_nethermancer_sepethrea()  { -    Script *newscript; -    newscript = new Script; -    newscript->Name = "boss_nethermancer_sepethrea"; -    newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; -    newscript->RegisterSelf(); - -    newscript = new Script; -    newscript->Name = "mob_ragin_flames"; -    newscript->GetAI = &GetAI_mob_ragin_flames; -    newscript->RegisterSelf(); +    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 f6af93c9acc..2eaad3cd978 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 @@ -25,224 +25,257 @@ EndScriptData */  #include "ScriptPCH.h" -#define SAY_AGGRO                       -1554020 -#define SAY_DOMINATION_1                -1554021 -#define SAY_DOMINATION_2                -1554022 -#define SAY_SUMMON                      -1554023 -#define SAY_ENRAGE                      -1554024 -#define SAY_SLAY_1                      -1554025 -#define SAY_SLAY_2                      -1554026 -#define SAY_DEATH                       -1554027 - +enum eSays +{ +    SAY_AGGRO                      = -1554020, +    SAY_DOMINATION_1               = -1554021, +    SAY_DOMINATION_2               = -1554022, +    SAY_SUMMON                     = -1554023, +    SAY_ENRAGE                     = -1554024, +    SAY_SLAY_1                     = -1554025, +    SAY_SLAY_2                     = -1554026, +    SAY_DEATH                      = -1554027, +};  // Spells to be casted -#define SPELL_MANA_TAP                36021 -#define SPELL_ARCANE_TORRENT          36022 -#define SPELL_DOMINATION              35280 -#define H_SPELL_ARCANE_EXPLOSION        15453 -#define SPELL_FRENZY                    36992 - -#define SPELL_SUMMON_NETHER_WRAITH_1    35285               //Spells work, but not implemented -#define SPELL_SUMMON_NETHER_WRAITH_2    35286 -#define SPELL_SUMMON_NETHER_WRAITH_3    35287 -#define SPELL_SUMMON_NETHER_WRAITH_4    35288 - -// Add Spells -#define SPELL_DETONATION              35058 -#define SPELL_ARCANE_MISSILES         35034 - -struct boss_pathaleon_the_calculatorAI : public ScriptedAI +enum eSpells +{ +    SPELL_MANA_TAP                 = 36021, +    SPELL_ARCANE_TORRENT           = 36022, +    SPELL_DOMINATION               = 35280, +    H_SPELL_ARCANE_EXPLOSION       = 15453, +    SPELL_FRENZY                   = 36992, +    //Spells work, but not implemented +    SPELL_SUMMON_NETHER_WRAITH_1   = 35285,               +    SPELL_SUMMON_NETHER_WRAITH_2   = 35286, +    SPELL_SUMMON_NETHER_WRAITH_3   = 35287, +    SPELL_SUMMON_NETHER_WRAITH_4   = 35288, +    // Add Spells +    SPELL_DETONATION               = 35058, +    SPELL_ARCANE_MISSILES          = 35034, +}; + +class boss_pathaleon_the_calculator : public CreatureScript  { -    boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(me) -    { -    } - -    uint32 Summon_Timer; -    SummonList summons; -    uint32 ManaTap_Timer; -    uint32 ArcaneTorrent_Timer; -    uint32 Domination_Timer; -    uint32 ArcaneExplosion_Timer; - -    bool Enraged; - -    uint32 Counter; - -    void Reset() -    { -        Summon_Timer = 30000; -        ManaTap_Timer = 12000 + rand()%8000; -        ArcaneTorrent_Timer = 16000 + rand()%9000; -        Domination_Timer = 25000 + rand()%15000; -        ArcaneExplosion_Timer = 8000 + rand()%5000; - -        Enraged = false; - -        Counter = 0; -        summons.DespawnAll(); -    } -    void EnterCombat(Unit * /*who*/) -    { -        DoScriptText(SAY_AGGRO, me); -    } - -    void KilledUnit(Unit* /*victim*/) -    { -        DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); -    } - -    void JustDied(Unit* /*Killer*/) -    { -        DoScriptText(SAY_DEATH, me); - -        summons.DespawnAll(); -    } - -    void JustSummoned(Creature *summon) {summons.Summon(summon);} -    void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - -    void UpdateAI(const uint32 diff) -    { -        //Return since we have no target -        if (!UpdateVictim()) -            return; - -        if (Summon_Timer <= diff) +    public: + +        boss_pathaleon_the_calculator() +            : CreatureScript("boss_pathaleon_the_calculator") +        { +        } +         +        struct boss_pathaleon_the_calculatorAI : public ScriptedAI          { -            for (uint8 i = 0; i < 3; ++i) +            boss_pathaleon_the_calculatorAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)              { -                Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); -                Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); -                if (pTarget && Wraith) -                    Wraith->AI()->AttackStart(pTarget);              } -            DoScriptText(SAY_SUMMON, me); -            Summon_Timer = 30000 + rand()%15000; -        } else Summon_Timer -= diff; - -        if (ManaTap_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_MANA_TAP); -            ManaTap_Timer = 14000 + rand()%8000; -        } else ManaTap_Timer -= diff; +             +            uint32 Summon_Timer; +            SummonList summons; +            uint32 ManaTap_Timer; +            uint32 ArcaneTorrent_Timer; +            uint32 Domination_Timer; +            uint32 ArcaneExplosion_Timer; +             +            bool Enraged; +             +            uint32 Counter; + +            void Reset() +            { +                Summon_Timer = 30000; +                ManaTap_Timer = 12000 + rand()%8000; +                ArcaneTorrent_Timer = 16000 + rand()%9000; +                Domination_Timer = 25000 + rand()%15000; +                ArcaneExplosion_Timer = 8000 + rand()%5000; -        if (ArcaneTorrent_Timer <= diff) -        { -            DoCast(me->getVictim(), SPELL_ARCANE_TORRENT); -            ArcaneTorrent_Timer = 12000 + rand()%6000; -        } else ArcaneTorrent_Timer -= diff; +                Enraged = false; -        if (Domination_Timer <= diff) -        { -            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) +                Counter = 0; +                summons.DespawnAll(); +            } +            void EnterCombat(Unit * /*who*/)              { -                DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me); +                DoScriptText(SAY_AGGRO, me); +            } -                DoCast(pTarget, SPELL_DOMINATION); +            void KilledUnit(Unit* /*victim*/) +            { +                DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);              } -                Domination_Timer = 25000 + rand()%5000; -            } else Domination_Timer -= diff; -        //Only casting if Heroic Mode is used -        if (IsHeroic()) -        { -            if (ArcaneExplosion_Timer <= diff) +            void JustDied(Unit* /*Killer*/)              { -                DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION); -                ArcaneExplosion_Timer = 10000 + rand()%4000; -            } else ArcaneExplosion_Timer -= diff; -        } +                DoScriptText(SAY_DEATH, me); -        if (!Enraged && me->GetHealth()*100 / me->GetMaxHealth() < 21) -        { -            DoCast(me, SPELL_FRENZY); -            DoScriptText(SAY_ENRAGE, me); -            Enraged = true; +                summons.DespawnAll();     +            } +             +            void JustSummoned(Creature *summon)  +            { +                summons.Summon(summon); +            } +            void SummonedCreatureDespawn(Creature *summon)  +            { +                summons.Despawn(summon); +            } -        } +            void UpdateAI(const uint32 diff) +            {   +                //Return since we have no target +                if (!UpdateVictim()) +                    return; +                 +                if (Summon_Timer <= diff) +                { +                    for (uint8 i = 0; i < 3; ++i) +                    { +                        Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); +                        Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); +                        if (pTarget && Wraith) +                            Wraith->AI()->AttackStart(pTarget); +                    } +                    DoScriptText(SAY_SUMMON, me); +                    Summon_Timer = 30000 + rand()%15000; +                }  +                else +                    Summon_Timer -= diff; + +                if (ManaTap_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_MANA_TAP); +                    ManaTap_Timer = 14000 + rand()%8000; +                }  +                else +                    ManaTap_Timer -= diff; +                 +                if (ArcaneTorrent_Timer <= diff) +                { +                    DoCast(me->getVictim(), SPELL_ARCANE_TORRENT); +                    ArcaneTorrent_Timer = 12000 + rand()%6000; +                } +                else  +                    ArcaneTorrent_Timer -= diff; +                 +                if (Domination_Timer <= diff) +                { +                    if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) +                    { +                        DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me); +                        DoCast(pTarget, SPELL_DOMINATION); +                    } +                    Domination_Timer = 25000 + rand()%5000; +                }  +                else  +                    Domination_Timer -= diff; + +                //Only casting if Heroic Mode is used +                if (IsHeroic()) +                { +                    if (ArcaneExplosion_Timer <= diff) +                    { +                        DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION); +                        ArcaneExplosion_Timer = 10000 + rand()%4000; +                    } +                    else  +                        ArcaneExplosion_Timer -= diff;         +                } +                 +                if (!Enraged && me->GetHealth()*100 / me->GetMaxHealth() < 21) +                { +                    DoCast(me, SPELL_FRENZY); +                    DoScriptText(SAY_ENRAGE, me); +                    Enraged = true; + +                } +                 +                DoMeleeAttackIfReady(); +            } +        }; -        DoMeleeAttackIfReady(); -    } +            CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) +            { +                return new boss_pathaleon_the_calculatorAI (pCreature); +            }  }; -CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) -{ -    return new boss_pathaleon_the_calculatorAI (pCreature); -} -struct mob_nether_wraithAI : public ScriptedAI +class mob_nether_wraith : public CreatureScript  { -    mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} - -    uint32 ArcaneMissiles_Timer; -    uint32 Detonation_Timer; -    uint32 Die_Timer; -    bool Detonation; - -    void Reset() -    { -        ArcaneMissiles_Timer = 1000 + rand()%3000; -        Detonation_Timer = 20000; -        Die_Timer = 2200; -        Detonation = false; +    public: -    } - -    void EnterCombat(Unit* /*who*/) -    { -    } +        mob_nether_wraith() +            : CreatureScript("mob_nether_wraith") +        { +        } +         +        struct mob_nether_wraithAI : public ScriptedAI +        { +            mob_nether_wraithAI(Creature* pCreature) : ScriptedAI(pCreature) {} -    void UpdateAI(const uint32 diff) -    { -        if (!UpdateVictim()) -            return; +            uint32 ArcaneMissiles_Timer; +            uint32 Detonation_Timer; +            uint32 Die_Timer; +            bool Detonation; -        if (ArcaneMissiles_Timer <= diff) -        { -            if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) -                DoCast(pTarget, SPELL_ARCANE_MISSILES); -            else -                DoCast(me->getVictim(), SPELL_ARCANE_MISSILES); +            void Reset() +            { +                ArcaneMissiles_Timer = 1000 + rand()%3000; +                Detonation_Timer = 20000; +                Die_Timer = 2200; +                Detonation = false; +            } -            ArcaneMissiles_Timer = 5000 + rand()%5000; -        } else ArcaneMissiles_Timer -=diff; +            void EnterCombat(Unit* /*who*/) {} -        if (!Detonation) -        { -            if (Detonation_Timer <= diff) +            void UpdateAI(const uint32 diff)              { -                DoCast(me, SPELL_DETONATION); -                Detonation = true; -            } else Detonation_Timer -= diff; -        } +                if (!UpdateVictim()) +                    return; + +                if (ArcaneMissiles_Timer <= diff) +                { +                    if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) +                        DoCast(pTarget, SPELL_ARCANE_MISSILES); +                    else +                        DoCast(me->getVictim(), SPELL_ARCANE_MISSILES); +                    ArcaneMissiles_Timer = 5000 + rand()%5000; +                }  +                else  +                    ArcaneMissiles_Timer -=diff; + +                if (!Detonation) +                { +                    if (Detonation_Timer <= diff) +                    { +                        DoCast(me, SPELL_DETONATION); +                        Detonation = true; +                    } +                    else  +                        Detonation_Timer -= diff; +                } + +                if (Detonation) +                { +                    if (Die_Timer <= diff) +                    { +                        me->setDeathState(JUST_DIED); +                        me->RemoveCorpse(); +                    }  +                    else  +                        Die_Timer -= diff; +                } +                DoMeleeAttackIfReady(); +            } +        };     -        if (Detonation) +        CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature)          { -            if (Die_Timer <= diff) -            { -                me->setDeathState(JUST_DIED); -                me->RemoveCorpse(); -            } else Die_Timer -= diff; +            return new mob_nether_wraithAI (pCreature);          } - -        DoMeleeAttackIfReady(); -    } -  }; -CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) -{ -    return new mob_nether_wraithAI (pCreature); -}  void AddSC_boss_pathaleon_the_calculator()  { -    Script *newscript; -    newscript = new Script; -    newscript->Name = "boss_pathaleon_the_calculator"; -    newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; -    newscript->RegisterSelf(); - -    newscript = new Script; -    newscript->Name = "mob_nether_wraith"; -    newscript->GetAI = &GetAI_mob_nether_wraith; -    newscript->RegisterSelf(); +    new boss_pathaleon_the_calculator(); +    new mob_nether_wraith();  } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 38c30c52ae5..e67df357811 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -28,61 +28,67 @@ EndScriptData */  #define MAX_ENCOUNTER      1 -struct instance_mechanar : public ScriptedInstance +class instance_mechanar : public InstanceMapScript  { -    instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - -    uint32 m_auiEncounter[MAX_ENCOUNTER]; - -    void Initialize() -    { -        memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); -    } - -    bool IsEncounterInProgress() const -    { -        for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) -            if (m_auiEncounter[i] == IN_PROGRESS) -                return true; - -        return false; -    } - -    uint32 GetData(uint32 type) -    { -        switch(type) +    public: +        instance_mechanar() +            : InstanceMapScript("instance_mechanar")          { -        case DATA_NETHERMANCER_EVENT:   return m_auiEncounter[0];          } +         +        struct instance_mechanar_InstanceMapScript : public ScriptedInstance +        { +            instance_mechanar_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) { Initialize(); }; +             +            uint32 m_auiEncounter[MAX_ENCOUNTER]; +             +            void Initialize() +            { +                memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +            } +             +            bool IsEncounterInProgress() const +            { +                for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) +                    if (m_auiEncounter[i] == IN_PROGRESS) +                        return true; -        return false; -    } +                return false; +            } +             +            uint32 GetData(uint32 type) +            { +                switch(type) +                { +                case DATA_NETHERMANCER_EVENT:   return m_auiEncounter[0]; +                } -    uint64 GetData64 (uint32 /*identifier*/) -    { -        return 0; -    } +                return false; +            } -    void SetData(uint32 type, uint32 data) -    { -        switch(type) -        { -        case DATA_NETHERMANCER_EVENT:   m_auiEncounter[0] = data;   break; -        } -    } +            uint64 GetData64 (uint32 /*identifier*/) +            { +                return 0; +            } + +            void SetData(uint32 type, uint32 data) +            { +                switch(type) +                { +                case DATA_NETHERMANCER_EVENT:   m_auiEncounter[0] = data;   break; +                } +            } +        }; +            InstanceData* OnGetInstanceData(InstanceMap* pMap) +            { +                return new instance_mechanar_InstanceMapScript(pMap); +            } +          }; -InstanceData* GetInstanceData_instance_mechanar(Map* pMap) -{ -    return new instance_mechanar(pMap); -}  void AddSC_instance_mechanar()  { -    Script *newscript; -    newscript = new Script; -    newscript->Name = "instance_mechanar"; -    newscript->GetInstanceData = &GetInstanceData_instance_mechanar; -    newscript->RegisterSelf(); +    new instance_mechanar;  }  | 
