Advertisement
Guest User

Alysrazor

a guest
Jan 19th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 75.96 KB | None | 0 0
  1. /*
  2.  * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
  3.  * Copyright (C) 2011-2016 ArkCORE <http://www.arkania.net/>
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify it
  6.  * under the terms of the GNU General Public License as published by the
  7.  * Free Software Foundation; either version 2 of the License, or (at your
  8.  * option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful, but WITHOUT
  11.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12.  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13.  * more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License along
  16.  * with this program. If not, see <http://www.gnu.org/licenses/>.
  17.  */
  18.  
  19. #include "ObjectMgr.h"
  20. #include "ScriptMgr.h"
  21. #include "ScriptedCreature.h"
  22. #include "ScriptedEscortAI.h"
  23. #include "PassiveAI.h"
  24. #include "SpellScript.h"
  25. #include "MoveSplineInit.h"
  26. #include "Cell.h"
  27. #include "CellImpl.h"
  28. #include "GridNotifiers.h"
  29. #include "GridNotifiersImpl.h"
  30. #include "firelands.h"
  31.  
  32. #define GO_ALYSRAZOR_VOLCANO_GUID 447764
  33.  
  34. Position const SpawnPos[31] =
  35. {
  36.     // Position on summon
  37.     {110.404f, -376.861f, 30.465743f, 2.517f}, // startPos
  38.     {49.467f, -344.118f, 90.471171f, 2.517f}, // endPos
  39.  
  40.     // Starting Waypoints
  41.     {-0.617f, -306.765f, 70.330f, 2.517f},   // start center
  42.     {-66.545f, -246.700f, 60.082f, 2.354f},  // end center
  43.     {-94.406f, -251.076f, 111.694f, 4.390f}, // left 1
  44.     {-95.940f, -306.784f, 110.108f, 4.818f}, // left 2
  45.     {-84.214f, -328.750f, 108.429f, 5.780f}, // left 3
  46.     {-43.594f, -346.574f, 128.981f, 0.035f}, // left 4
  47.     {-3.449f, -337.038f, 122.448f, 0.188f},  // left 5
  48.     {14.184f, -243.657f, 142.407f, 1.779f},  // right 1
  49.     {17.443f, -273.178f, 136.369f, 2.156f},  // right 2
  50.     {17.748f, -236.526f, 139.634f, 1.884f},  // right 3
  51.     {-35.472f, -214.974f, 140.048f, 3.172f}, // right 4
  52.     {-47.900f, -219.760f, 135.246f, 3.401f}, // right 5
  53.     {-78.433f, -237.402f, 65.301f, 5.576f},  // end center 2
  54.     {5.627f, -314.356f, 65.871f, 5.812f},    // start center 2
  55.     {14.184f, -243.657f, 142.407f, 1.779f},  // left(n) 1
  56.     {17.443f, -273.178f, 136.369f, 2.156f},  // left(n) 2
  57.     {17.748f, -236.526f, 139.634f, 1.884f},  // left(n) 3
  58.     {-35.472f, -214.974f, 140.048f, 3.172f}, // left(n) 4
  59.     {-47.900f, -219.760f, 135.246f, 3.401f}, // left(n) 5
  60.     {-94.406f, -251.076f, 111.694f, 4.390f}, // right(n) 1
  61.     {-95.940f, -306.784f, 110.108f, 4.818f}, // right(n) 2
  62.     {-84.214f, -328.750f, 108.429f, 5.780f}, // right(n) 3
  63.     {-43.594f, -346.574f, 128.981f, 0.035f}, // right(n) 4
  64.     {-3.449f, -337.038f, 122.448f, 0.188f},  // right(n) 5
  65.     {-38.087f, -302.436f, 115.977f, 2.848f}, // wayPoints aly on tornados 1
  66.     {-60.484f, -278.438f, 115.977f, 1.265f}, // wayPoints aly on tornados 2
  67.     {-47.210f, -241.612f, 115.977f, 0.201f}, // wayPoints aly on tornados 3
  68.     {-24.410f, -266.740f, 115.977f, 4.980f}  // wayPoints aly on tornados 4
  69. };
  70.  
  71. Position const WormsPos[4] =
  72. {
  73.     {-24.179f, -311.185f, 56.000f, 1.0f},
  74.     {-75.952f, -296.170f, 58.000f, 4.0f},
  75.     {-71.017f, -255.195f, 58.000f, 0.2f},
  76.     {-17.180f, -257.636f, 56.000f, 2.0f}
  77. };
  78.  
  79. enum Guids
  80. {
  81.     uiFeatherGUID = 15441675
  82. };
  83.  
  84. Position const FallPos[2] =
  85. {
  86.     {-41.534f, -282.622f, 56.000f, 0.188f}, // fall pos ground
  87.     {-41.534f, -282.622f, 115.000f, 0.188f} // fall pos fly
  88. };
  89.  
  90. Position const BirdsPos[2] =
  91. {
  92.     {46.930f, -207.560f, 105.000f, 3.951f},
  93.     {-28.813f, -378.088f, 107.371f, 1.697f}
  94. };
  95.  
  96. Position const Talon[8] =
  97. {
  98.     {-6.561f,-376.156f,75.623f,2.017f},
  99.     {-27.041f,-329.757f,57.953f,2.402f},
  100.  
  101.     {-93.998f,-338.753f,67.583f,1.239f},
  102.     {-92.066f,-296.570f,59.674f,0.459f},
  103.  
  104.     {-85.828f,-218.517f,71.189f,5.014f},
  105.     {-82.602f,-254.543f,61.894f,5.922f},
  106.  
  107.     {35.679f,-260.996f,67.902f,3.880f},
  108.     {8.355f,-286.534f,56.162f,2.984f}
  109. };
  110.  
  111. Position const ClawTalon[2] =
  112. {
  113.     {-27.773f, -191.712f, 83.280f, 4.769f},
  114.     {-65.413f, -351.496f, 72.721f, 1.356f}
  115. };
  116.  
  117. Position const Feather[1] =
  118. {
  119.     {0.760f,-305.456f,53.5113f,5.597f}
  120. };
  121.  
  122. Position const Tornado[85] =
  123. {
  124.     {-35.268f,-272.739f,55.382f,4.191f},
  125.     {-32.955f,-289.301f,55.673f,3.386f},
  126.     {-49.435f,-291.899f,56.181f,1.705f},
  127.     {-49.891f,-276.776f,55.919f,6.064f},
  128.  
  129.     {-59.618f,-271.323f,56.323f,5.165f},
  130.     {-63.114f,-285.496f,56.309f,5.699f},
  131.     {-55.805f,-298.918f,56.146f,6.174f},
  132.     {-38.599f,-304.341f,55.907f,1.018f},
  133.     {-23.701f,-296.092f,54.847f,1.646f},
  134.     {-21.894f,-278.830f,54.687f,2.840f},
  135.  
  136.     {-12.605f,-304.404f,54.111f,3.453f},
  137.     {-37.279f,-314.646f,55.623f,2.773f},
  138.     {-61.806f,-308.852f,56.871f,2.259f},
  139.     {-75.187f,-287.070f,56.577f,1.324f},
  140.     {-69.767f,-265.741f,56.780f,0.574f},
  141.     {-50.085f,-253.181f,55.990f,5.919f},
  142.  
  143.     {-16.950f,-244.304f,55.931f,5.302f},
  144.     {0.441f,-273.298f,53.492f,4.435f},
  145.     {-2.772f,-312.061f,53.672f,3.524f},
  146.     {-36.467f,-326.278f,55.770f,2.361f},
  147.     {-67.491f,-317.809f,59.693f,1.976f},
  148.     {-87.615f,-290.200f,56.189f,1.430f},
  149.  
  150.     {-90.258f,-253.685f,58.907f,6.280f},
  151.     {-59.377f,-229.198f,56.394f,6.194f},
  152.     {-10.620f,-230.829f,55.906f,5.181f},
  153.     {11.433f,-272.349f,53.118f,4.101f},
  154.     {6.917f,-318.777f,52.964f,3.492f},
  155.     {-35.572f,-337.599f,55.996f,2.404f},
  156.  
  157.     {-49.891f,-276.776f,55.919f,6.064f},
  158.     {-49.435f,-291.899f,56.181f,1.705f},
  159.     {-32.955f,-289.301f,55.673f,3.386f},
  160.     {-35.268f,-272.739f,55.382f,4.191f},
  161.  
  162.     {-21.894f,-278.830f,54.687f,2.840f},
  163.     {-23.701f,-296.092f,54.847f,1.646f},
  164.     {-38.599f,-304.341f,55.907f,1.018f},
  165.     {-55.805f,-298.918f,56.146f,6.174f},
  166.     {-63.114f,-285.496f,56.309f,5.699f},
  167.     {-59.618f,-271.323f,56.323f,5.165f},
  168.  
  169.     {-50.085f,-253.181f,55.990f,5.919f},
  170.     {-69.767f,-265.741f,56.780f,0.574f},
  171.     {-75.187f,-287.070f,56.577f,1.324f},
  172.     {-61.806f,-308.852f,56.871f,2.259f},
  173.     {-37.279f,-314.646f,55.623f,2.773f},
  174.     {-12.605f,-304.404f,54.111f,3.453f},
  175.  
  176.     {-87.615f,-290.200f,56.189f,1.430f},
  177.     {-67.491f,-317.809f,59.693f,1.976f},
  178.     {-36.467f,-326.278f,55.770f,2.361f},
  179.     {-2.772f,-312.061f,53.672f,3.524f},
  180.     {0.441f,-273.298f,53.492f,4.435f},
  181.     {-16.950f,-244.304f,55.931f,5.302f},
  182.  
  183.     {-35.572f,-337.599f,55.996f,2.404f},
  184.     {6.917f,-318.777f,52.964f,3.492f},
  185.     {11.433f,-272.349f,53.118f,4.101f},
  186.     {-10.620f,-230.829f,55.906f,5.181f},
  187.     {-59.377f,-229.198f,56.394f,6.194f},
  188.     {-90.258f,-253.685f,58.907f,6.280f},
  189.  
  190.     {-49.435f,-291.899f,56.181f,1.705f},
  191.     {-49.891f,-276.776f,55.919f,6.064f},
  192.     {-35.268f,-272.739f,55.382f,4.191f},
  193.     {-32.955f,-289.301f,55.673f,3.386f},
  194.  
  195.     {-38.599f,-304.341f,55.907f,1.018f},
  196.     {-23.701f,-296.092f,54.847f,1.646f},
  197.     {-21.894f,-278.830f,54.687f,2.840f},
  198.     {-59.618f,-271.323f,56.323f,5.165f},
  199.     {-63.114f,-285.496f,56.309f,5.699f},
  200.     {-55.805f,-298.918f,56.146f,6.174f},
  201.  
  202.     {-75.187f,-287.070f,56.577f,1.324f},
  203.     {-69.767f,-265.741f,56.780f,0.574f},
  204.     {-50.085f,-253.181f,55.990f,5.919f},
  205.     {-12.605f,-304.404f,54.111f,3.453f},
  206.     {-37.279f,-314.646f,55.623f,2.773f},
  207.     {-61.806f,-308.852f,56.871f,2.259f},
  208.  
  209.     {-36.467f,-326.278f,55.770f,2.361f},
  210.     {-67.491f,-317.809f,59.693f,1.976f},
  211.     {-87.615f,-290.200f,56.189f,1.430f},
  212.     {-16.950f,-244.304f,55.931f,5.302f},
  213.     {0.441f,-273.298f,53.492f,4.435f},
  214.     {-2.772f,-312.061f,53.672f,3.524f},
  215.  
  216.     {11.433f,-272.349f,53.118f,4.101f},
  217.     {6.917f,-318.777f,52.964f,3.492f},
  218.     {-35.572f,-337.599f,55.996f,2.404f},
  219.     {-90.258f,-253.685f,58.907f,6.280f},
  220.     {-59.377f,-229.198f,56.394f,6.194f},
  221.     {-10.620f,-230.829f,55.906f,5.181f}
  222. };
  223.  
  224. Position const SpawnVolcanos[11] =
  225. {
  226.     {5.375f, -336.376f, 51.629f, 2.304f},
  227.     {9.478f, -331.562f, 51.387f, 2.304f},
  228.     {16.252f, -323.355f, 51.448f, 2.304f},
  229.     {19.871f, -320.852f, 51.960f, 2.304f},
  230.     {22.058f, -315.533f, 51.959f, 2.304f},
  231.     {28.059f, -307.899f, 51.958f, 2.304f},
  232.     {32.530f, -300.595f, 51.965f, 2.304f},
  233.  
  234.     {-103.034f, -294.838f, 56.158f, 2.304f},
  235.     {-103.872f, -286.840f, 56.507f, 2.304f},
  236.     {-103.593f, -280.863f, 56.531f, 2.304f},
  237.     {-104.593f, -274.393f, 56.534f, 2.304f}
  238. };
  239.  
  240. enum actions
  241. {
  242.     ACTION_MOVE_FROM_LEFT  = 0,
  243.     ACTION_MOVE_FROM_RIGHT = 1
  244. };
  245.  
  246. enum Spells
  247. {
  248.     SPELL_FIRESTORM            = 99605,
  249.  
  250.     // Volcanos
  251.     SPELL_VOLCANO_DUMMY        = 98402,
  252.     SPELL_VOLCANO_AURA         = 98462,
  253.  
  254.     // Tornados
  255.     SPELL_SUMMON_DMG           = 99793,
  256.  
  257.     // Feather
  258.     SPELL_COSMETIC             = 99507,
  259.     SPELL_CAST_ON_MOVE_VISUAL  = 97128,
  260.  
  261.     // Firehawk
  262.     SPELL_FIREHAWK_COSMETIC    = 100712,
  263.     SPELL_FIREHAWK_TRANSFORM_M = 99550,
  264.     SPELL_FIREHAWK_TRANSFORM_F = 100350,
  265.     SPELL_FIREHAWK_CLAWSHAPPER = 99923,
  266.     SPELL_FIREHAWK_REMOVE_FORM = 99924,
  267.     SPELL_IGNITION             = 99919,
  268.     SPELL_BRUSHFIRE            = 98868,
  269.     SPELL_FIEROBLAST           = 101223,
  270.     SPELL_FIREITUP             = 100093,
  271.     SPELL_BRUSHFIRE_VIS        = 98884,
  272.    
  273.     // Hatchling
  274.     SPELL_SATIATED             = 99359,
  275.     SPELL_HUNGRY               = 99361,
  276.     SPELL_TANTRUM              = 99362,
  277.     SPELL_IMPRINTED            = 99389,
  278.     SPELL_TAUNT                = 99390,
  279.     SPELL_DEBUFF               = 100024,
  280.  
  281.     // Worm
  282.     SPELL_LAVA_SPEW            = 99335,
  283.  
  284.     // Blazing power
  285.     SPELL_BLAZING_POWER        = 99462,
  286.  
  287.     // Cloud
  288.     SPELL_INCENDIARY_CLOUD     = 99426,
  289.  
  290.     // Alysrazor
  291.     SPELL_INDICATOR            = 101410,
  292.     SPELL_BLAZING_CLAW         = 99843,
  293.     SPELL_PASSIVE_BUF_FROM_FEATHER = 99461,
  294.     SPELL_BURNOUT              = 99432,
  295.     SPELL_IGNITED              = 99922,
  296.     SPELL_SPARK                = 99921,
  297.     SPELL_ZERO_POWER           = 72242,
  298.     SPELL_FULL_POWER           = 99504,
  299.     SPELL_SUMMON_FEATHER       = 99464,
  300.     SPELL_MOLTING              = 100698,
  301.  
  302.     SPELL_FLY                  = 98619,
  303.     SPELL_HARSH_WINDS          = 100640,
  304.  
  305.     //molten egg
  306.     SPELL_EGG_EXPLOSION        = 99943,
  307.     SPELL_SUMM_HATHING         = 99723,
  308.  
  309.     //broodmother
  310.     SPELL_BROODMOTHER_VIS      = 99734,
  311.     SPELL_BROODMOTHER_VIS1     = 100712
  312. };
  313.  
  314. enum Phase
  315. {
  316.     PHASE_NONE         = 0,
  317.  
  318.     PHASE_JUMP         = 1,
  319.     PHASE_START_MOVING = 2,
  320.     PHASE_AIR          = 3,
  321.     PHASE_GROUND       = 4,
  322.     PHASE_TORNADO      = 5
  323. };
  324.  
  325. enum Events
  326. {
  327.     EVENT_START_ENCOUNTER        = 1,
  328.  
  329.     // Moving
  330.     EVENT_MOVE_TO_START_OF_TOP   = 2,
  331.     EVENT_MOVE_TO_END_OF_TOP     = 3,
  332.     EVENT_MOVE_TO_LEFT_1         = 4,
  333.     EVENT_MOVE_TO_LEFT_2         = 5,
  334.     EVENT_MOVE_TO_LEFT_3         = 6,
  335.     EVENT_MOVE_TO_LEFT_4         = 7,
  336.     EVENT_MOVE_TO_LEFT_5         = 8,
  337.     EVENT_MOVE_TO_RIGHT_1        = 9,
  338.     EVENT_MOVE_TO_RIGHT_2        = 10,
  339.     EVENT_MOVE_TO_RIGHT_3        = 11,
  340.     EVENT_MOVE_TO_RIGHT_4        = 12,
  341.     EVENT_MOVE_TO_RIGHT_5        = 13,
  342.     EVENT_MOVE_TO_END_CENTER     = 14,
  343.     EVENT_MOVE_TO_END_START      = 15,
  344.     EVENT_MOVE_TO_LEFT_N_1       = 16,
  345.     EVENT_MOVE_TO_LEFT_N_2       = 17,
  346.     EVENT_MOVE_TO_LEFT_N_3       = 18,
  347.     EVENT_MOVE_TO_LEFT_N_4       = 19,
  348.     EVENT_MOVE_TO_LEFT_N_5       = 20,
  349.     EVENT_MOVE_TO_RIGHT_N_1      = 21,
  350.     EVENT_MOVE_TO_RIGHT_N_2      = 22,
  351.     EVENT_MOVE_TO_RIGHT_N_3      = 23,
  352.     EVENT_MOVE_TO_RIGHT_N_4      = 24,
  353.     EVENT_MOVE_TO_RIGHT_N_5      = 25,
  354.  
  355.     EVENT_MOVE_TORNADOS_1        = 26,
  356.     EVENT_MOVE_TORNADOS_2        = 27,
  357.     EVENT_MOVE_TORNADOS_3        = 28,
  358.     EVENT_MOVE_TORNADOS_4        = 29,
  359.  
  360.     EVENT_MOVE_TO_TORNADO        = 30,
  361.  
  362.     // Need for combat
  363.     EVENT_ZONE_COMBAT            = 31,
  364.  
  365.     // Phase
  366.     EVENT_PHASE_2_TORNADOS_START = 32,
  367.     EVENT_PHASE_2_TORNADOS_ENDS  = 33,
  368.  
  369.     EVENT_INCENDIARY_CLOUD       = 34,
  370.     EVENT_HARSH_WINDS            = 35,
  371.  
  372.     // Hatchling
  373.     EVENT_EAT_WORM               = 36,
  374.     EVENT_HUNGRY                 = 37,
  375.     EVENT_DEBUFF                 = 38,
  376.  
  377.     // Lava worm
  378.     EVENT_CALC_ORIENT            = 39,
  379.     EVENT_SUMMON_WORMS           = 40,
  380.  
  381.     EVENT_SUMMON_BROODMOTHER     = 41,
  382.  
  383.     // Egg
  384.     EVENT_EGG_EXPLOSION          = 42,
  385.     EVENT_SUMMON_HATCHING        = 43,
  386.     EVENT_DESPAWN                = 44,
  387.    
  388.     // Clawshaper
  389.     EVENT_SUMMON_DRUIDS          = 45,
  390.     EVENT_START_IGNITION         = 46,
  391.     EVENT_START_COMBAT           = 47,
  392.     EVENT_CHECK_ENERGY           = 48,
  393.  
  394.     EVENT_START_FIEROBLAST       = 49,
  395.     EVENT_START_BRUSHFIRE        = 50,
  396.  
  397.     EVENT_SUMMON_TALON           = 51
  398. };
  399.  
  400. // 53089
  401. class npc_molten_feather : public CreatureScript
  402. {
  403. public:
  404.     npc_molten_feather() : CreatureScript("npc_molten_feather") { }
  405.  
  406.     CreatureAI* GetAI(Creature* creature) const
  407.     {
  408.         return new npc_molten_featherAI(creature);
  409.     }
  410.  
  411.     bool OnGossipHello(Player* player, Creature* creature)
  412.     {
  413.         if (creature->FindNearestCreature(NPC_ALYSRAZOR, 5000.0f))
  414.             player->CastSpell(player,SPELL_CAST_ON_MOVE_VISUAL,true);
  415.         else
  416.             player->SummonCreature(NPC_ALYSRAZOR,SpawnPos[0]);
  417.  
  418.         creature->DespawnOrUnsummon();
  419.         return true;
  420.     }
  421.  
  422.     struct npc_molten_featherAI : public ScriptedAI
  423.     {
  424.         npc_molten_featherAI(Creature* creature) : ScriptedAI(creature)
  425.         {
  426.             DoCast(me, SPELL_COSMETIC);
  427.         }    
  428.     };
  429. };
  430.  
  431. // 53541
  432. class npc_incindiary_cloud_53541 : public CreatureScript
  433. {
  434. public:
  435.     npc_incindiary_cloud_53541() : CreatureScript("npc_incindiary_cloud_53541") { }
  436.  
  437.     struct npc_incindiary_cloud_53541AI : public ScriptedAI
  438.     {
  439.         npc_incindiary_cloud_53541AI(Creature* creature) : ScriptedAI(creature)
  440.         {
  441.             creature->SetDisplayId(11686);
  442.         }
  443.  
  444.         uint32 timer;
  445.  
  446.         void IsSummonedBy(Unit* /*summoner*/)
  447.         {
  448.             DoCast(me, SPELL_INCENDIARY_CLOUD);
  449.             timer = 10000;
  450.         }
  451.  
  452.         void UpdateAI(uint32 diff)
  453.         {
  454.             if (timer <= diff)
  455.                 me->DespawnOrUnsummon();
  456.             else timer -= diff;
  457.         }
  458.     };
  459.  
  460.     CreatureAI* GetAI(Creature* creature) const
  461.     {
  462.         return new npc_incindiary_cloud_53541AI(creature);
  463.     }
  464. };
  465.  
  466. // 53554
  467. class npc_blazing_power_53554 : public CreatureScript
  468. {
  469. public:
  470.     npc_blazing_power_53554() : CreatureScript("npc_blazing_power_53554") { }
  471.  
  472.     struct npc_blazing_power_53554AI : public ScriptedAI
  473.     {
  474.         npc_blazing_power_53554AI(Creature* creature) : ScriptedAI(creature)
  475.         {
  476.             creature->SetDisplayId(11686);
  477.         }
  478.  
  479.  
  480.         bool despawn;
  481.         uint32 timer;
  482.  
  483.         void IsSummonedBy(Unit* /*summoner*/)
  484.         {
  485.             DoCast(me, SPELL_BLAZING_POWER);
  486.             timer = 10000;
  487.         }
  488.  
  489.         void UpdateAI(uint32 diff)
  490.         {
  491.             me->GetMotionMaster()->MovePoint(0,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ());
  492.  
  493.             if (timer <= diff)
  494.                 me->DespawnOrUnsummon();
  495.             else timer -= diff;
  496.         }
  497.     };
  498.  
  499.     CreatureAI* GetAI(Creature* creature) const
  500.     {
  501.         return new npc_blazing_power_53554AI(creature);
  502.     }
  503. };
  504.  
  505. // 53158
  506. class npc_alysrazor_volcano : public CreatureScript
  507. {
  508. public:
  509.     npc_alysrazor_volcano() : CreatureScript("npc_alysrazor_volcano") { }
  510.  
  511.     CreatureAI* GetAI(Creature* creature) const
  512.     {
  513.         return new npc_alysrazor_volcanoAI(creature);
  514.     }
  515.  
  516.     struct npc_alysrazor_volcanoAI : public ScriptedAI
  517.     {
  518.         npc_alysrazor_volcanoAI(Creature* creature) : ScriptedAI(creature)
  519.         {
  520.             creature->SetDisplayId(11686);
  521.         }
  522.  
  523.         bool started;
  524.         uint32 timerAur;
  525.  
  526.         void Reset()
  527.         {
  528.             started = false;
  529.         }
  530.  
  531.         void IsSummonedBy(Unit* summoner)
  532.         {
  533.             summoner->CastSpell(me, SPELL_VOLCANO_DUMMY, false);
  534.             started = true;
  535.             timerAur = 2000;
  536.         }
  537.  
  538.         void UpdateAI(uint32 diff)
  539.         {
  540.             if (!started || me->HasUnitState(UNIT_STATE_CASTING))
  541.                 return;
  542.  
  543.             if (timerAur <= diff)
  544.             {
  545.                 if (!me->HasAura(SPELL_VOLCANO_AURA))
  546.                     me->CastSpell(me,SPELL_VOLCANO_AURA,true);
  547.             }
  548.             else timerAur -= diff;
  549.         }
  550.     };
  551. };
  552.  
  553. // 53509
  554. class npc_voracious_hatchling : public CreatureScript
  555. {
  556. public:
  557.     npc_voracious_hatchling() : CreatureScript("npc_voracious_hatchling") { }
  558.  
  559.     CreatureAI* GetAI(Creature* creature) const
  560.     {
  561.         return new npc_voracious_hatchlingAI (creature);
  562.     }
  563.  
  564.     struct npc_voracious_hatchlingAI : public ScriptedAI
  565.     {
  566.         npc_voracious_hatchlingAI(Creature* creature) : ScriptedAI(creature) { }
  567.  
  568.         EventMap events;
  569.  
  570.         void IsSummonedBy(Unit* /*summoner*/)
  571.         {
  572.             me->ModifyAuraState(AURA_STATE_UNKNOWN22, true);
  573.             if (Unit* FirstTarget = me->FindNearestPlayer(300.0f, true))
  574.             {
  575.                 me->AI()->AttackStart(FirstTarget);
  576.                 DoCast(FirstTarget, SPELL_IMPRINTED);
  577.                 FirstTarget->CastSpell(me,SPELL_TAUNT,false);
  578.                 events.ScheduleEvent(EVENT_EAT_WORM, 1000);
  579.                 events.ScheduleEvent(EVENT_HUNGRY, 9000);
  580.                 events.ScheduleEvent(EVENT_DEBUFF, 15000);
  581.                 me->AI()->AttackStart(FirstTarget);
  582.             }
  583.         }
  584.  
  585.         void UpdateAI(uint32 diff)
  586.         {
  587.             if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
  588.                 return;
  589.  
  590.             events.Update(diff);
  591.  
  592.             while (uint32 eventId = events.ExecuteEvent())
  593.             {
  594.                 switch (eventId)
  595.                 {
  596.                     case EVENT_DEBUFF:
  597.                     {
  598.                         DoCast(me,SPELL_DEBUFF);
  599.                         events.ScheduleEvent(EVENT_DEBUFF, 60000);
  600.                     }
  601.                     case EVENT_EAT_WORM:
  602.                     {
  603.                         if (Creature* worm = me->FindNearestCreature(53520, 5.0f, true))
  604.                         {
  605.                             worm->DespawnOrUnsummon();
  606.                             DoCast(me, SPELL_SATIATED);
  607.                             if (me->HasAura(SPELL_HUNGRY))
  608.                                 me->RemoveAura(SPELL_HUNGRY);
  609.                             if (me->HasAura(SPELL_TANTRUM))
  610.                                 me->RemoveAura(SPELL_TANTRUM);
  611.                         }
  612.                         events.ScheduleEvent(EVENT_EAT_WORM, 1000);
  613.                         break;
  614.                     }
  615.                     case EVENT_HUNGRY:
  616.                     {
  617.                         if (!me->HasAura(SPELL_SATIATED) && !me->HasAura(SPELL_HUNGRY))
  618.                         {
  619.                             DoCast(me,SPELL_HUNGRY);
  620.                             events.ScheduleEvent(EVENT_HUNGRY, 9000);
  621.                         }
  622.                         else
  623.                             events.ScheduleEvent(EVENT_HUNGRY, 2000);
  624.                         break;
  625.                     }
  626.                 }
  627.             }
  628.  
  629.             DoMeleeAttackIfReady();
  630.         }
  631.     };
  632. };
  633.  
  634. // 53520
  635. class npc_plumb_lava_worm : public CreatureScript
  636. {
  637. public:
  638.     npc_plumb_lava_worm() : CreatureScript("npc_plumb_lava_worm") { }
  639.  
  640.     CreatureAI* GetAI(Creature* creature) const
  641.     {
  642.         return new npc_plumb_lava_wormAI (creature);
  643.     }
  644.  
  645.     struct npc_plumb_lava_wormAI : public ScriptedAI
  646.     {
  647.         npc_plumb_lava_wormAI(Creature* creature) : ScriptedAI(creature)
  648.  
  649.         {
  650.             started = false;
  651.         }
  652.  
  653.         bool started;
  654.         uint32 timerAur,castTimer;
  655.  
  656.         void IsSummonedBy(Unit* /*summoner*/)
  657.         {
  658.             me->SetReactState(REACT_PASSIVE);
  659.             started = true;
  660.             timerAur = urand(1000,5000);
  661.             castTimer = timerAur + 4000;
  662.         }
  663.  
  664.         void UpdateAI(uint32 diff)
  665.         {
  666.             if (!started)
  667.                 return;
  668.  
  669.             if (castTimer <= diff)
  670.             {
  671.                 DoCast(me, SPELL_LAVA_SPEW);
  672.                 castTimer = urand (5000, 8000);
  673.             } else castTimer -= diff;
  674.  
  675.             if (timerAur <= diff)
  676.             {
  677.                 if(me->GetOrientation() >= 6.2f)
  678.                     me->SetFacingTo(0.0f);
  679.                 else
  680.                     me->SetFacingTo(me->GetOrientation() + 0.10f);
  681.                 timerAur = 200;
  682.  
  683.             } else timerAur -= diff;
  684.  
  685.         }
  686.     };
  687. };
  688.  
  689. // 53680
  690. class npc_blazing_broodmother : public CreatureScript
  691. {
  692. public:
  693.     npc_blazing_broodmother() : CreatureScript("npc_blazing_broodmother") { }
  694.  
  695.     CreatureAI* GetAI(Creature* creature) const
  696.     {
  697.         return new npc_blazing_broodmotherAI (creature);
  698.     }
  699.  
  700.     struct npc_blazing_broodmotherAI : public npc_escortAI
  701.     {
  702.         npc_blazing_broodmotherAI(Creature* creature) : npc_escortAI(creature) { }
  703.  
  704.         void IsSummonedBy(Unit* /*summoner*/)
  705.         {
  706.             me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  707.             me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  708.             DoCast(me, SPELL_BROODMOTHER_VIS);
  709.             me->SetReactState(REACT_PASSIVE);
  710.             //me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
  711.  
  712.             me->SetCanFly(true);
  713.             SetDespawnAtFar(false);
  714.             if (me->GetPositionX() > 0)
  715.                 InitLeftBirdWaypoints();
  716.             else
  717.                 InitRightBirdWaypoints();
  718.             Start();
  719.         }
  720.  
  721.         void InitLeftBirdWaypoints()
  722.         {
  723.             AddWaypoint(1, -32.901f, -272.019f, 105.0f, 1000); //left egg pos z+5
  724.             AddWaypoint(2, 46.930f, -207.560f, 90.000f); //left bird point to despawn
  725.         }
  726.  
  727.         void InitRightBirdWaypoints()
  728.         {
  729.             AddWaypoint(1, -44.463f, -285.802f, 105.0f, 1000); //right egg pos z+5
  730.             AddWaypoint(2, -28.813f, -378.088f, 90.371f); //right bird point to despawn
  731.         }
  732.  
  733.         void WaypointReached(uint32 point)
  734.         {
  735.             switch (point)
  736.             {
  737.                 case 1:
  738.                     me->SummonCreature(53681, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
  739.                     break;
  740.                 case 2:
  741.                     me->DisappearAndDie();
  742.                     break;
  743.             }
  744.         }
  745.  
  746.         void UpdateAI(uint32 diff)
  747.         {
  748.             npc_escortAI::UpdateAI(diff);
  749.         }
  750.     };
  751. };
  752.  
  753. // 53734
  754. class npc_blazing_talon_clawshaper : public CreatureScript
  755. {
  756. public:
  757.     npc_blazing_talon_clawshaper() : CreatureScript("npc_blazing_talon_clawshaper") { }
  758.  
  759.     CreatureAI* GetAI(Creature* creature) const
  760.     {
  761.         return new npc_blazing_talon_clawshaperAI (creature);
  762.     }
  763.  
  764.     struct npc_blazing_talon_clawshaperAI : public npc_escortAI
  765.     {
  766.         npc_blazing_talon_clawshaperAI(Creature* creature) : npc_escortAI(creature) { }
  767.  
  768.         EventMap events;
  769.  
  770.         void IsSummonedBy(Unit* /*summoner*/)
  771.         {
  772.             me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  773.             me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  774.             me->AttackStop();
  775.             me->SetReactState(REACT_PASSIVE);
  776.             me->InterruptNonMeleeSpells(false);
  777.  
  778.             me->SetCanFly(true);
  779.             SetDespawnAtFar(false);
  780.             if (me->GetPositionX() > -35)
  781.                 InitLeftBirdWaypoints();
  782.             else
  783.                 InitRightBirdWaypoints();
  784.             Start();
  785.         }
  786.  
  787.         void InitLeftBirdWaypoints()
  788.         {
  789.             AddWaypoint(1, -34.850f, -240.583f, 77.014f, 5000);
  790.         }
  791.  
  792.         void InitRightBirdWaypoints()
  793.         {
  794.             AddWaypoint(1, -55.794f, -325.271f, 77.766f, 5000);
  795.         }
  796.  
  797.         void WaypointReached(uint32 point)
  798.         {
  799.             switch (point)
  800.             {
  801.                 case 1:
  802.                     me->SetReactState(REACT_AGGRESSIVE);
  803.                     DoCast(me,SPELL_FIREHAWK_CLAWSHAPPER);
  804.                     me->GetMotionMaster()->MoveFall();
  805.                     events.ScheduleEvent(EVENT_START_COMBAT, 700);
  806.  
  807.                     me->SetCanFly(false);
  808.                     me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  809.                     me->RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  810.                     break;
  811.                 case 2:
  812.                     me->DespawnOrUnsummon();
  813.                     break;
  814.             }
  815.         }
  816.  
  817.         void UpdateAI(uint32 diff)
  818.         {
  819.             npc_escortAI::UpdateAI(diff);
  820.  
  821.             events.Update(diff);
  822.  
  823.             while (uint32 eventId = events.ExecuteEvent())
  824.             {
  825.                 switch (eventId)
  826.                 {
  827.                     case EVENT_START_COMBAT:
  828.                         if (Unit* nearTarget = me->SelectNearestTarget(5000.0f))
  829.                             me->AI()->AttackStart(nearTarget);
  830.  
  831.                         events.ScheduleEvent(EVENT_START_IGNITION, 500);
  832.                         events.ScheduleEvent(EVENT_CHECK_ENERGY, 1000);
  833.                         break;
  834.  
  835.                     case EVENT_START_IGNITION:
  836.                         if (Creature* alysrazor = me->FindNearestCreature(NPC_ALYSRAZOR, 5000.0f))
  837.                             if (alysrazor->GetPower(POWER_ENERGY) < 50 && !me->HasUnitState(UNIT_STATE_CASTING))
  838.                             {
  839.                                 me->StopMoving();
  840.                                 DoCast(alysrazor,SPELL_IGNITION);
  841.                             }
  842.  
  843.                         events.ScheduleEvent(EVENT_START_IGNITION, 7000);
  844.                         break;
  845.  
  846.                     case EVENT_CHECK_ENERGY:
  847.                         if (Creature* alysrazor = me->FindNearestCreature(NPC_ALYSRAZOR, 5000.0f))
  848.                         {
  849.                             if (alysrazor->GetPower(POWER_ENERGY) >= 50)
  850.                             {
  851.                                 DoCast(me, SPELL_FIREHAWK_REMOVE_FORM);
  852.                                 me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  853.                                 me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  854.                                 me->SetCanFly(true);
  855.                                 me->AttackStop();
  856.                                 me->SetReactState(REACT_PASSIVE);
  857.                                 me->InterruptNonMeleeSpells(false);
  858.                                 AddWaypoint(2, ClawTalon[me->GetPositionX() > -35 ? 0 : 1].GetPositionX(), ClawTalon[me->GetPositionX() > -35 ? 0 : 1].GetPositionY(), ClawTalon[me->GetPositionX() > -35 ? 0 : 1].GetPositionZ(), 2000);
  859.                             }
  860.                             else
  861.                                 events.ScheduleEvent(EVENT_CHECK_ENERGY, 1000);
  862.                         }
  863.                         else
  864.                             me->DespawnOrUnsummon();
  865.                         break;
  866.                 }
  867.             }
  868.         }
  869.     };
  870. };
  871.  
  872. // 53896
  873. class npc_blazing_talon : public CreatureScript
  874. {
  875. public:
  876.     npc_blazing_talon() : CreatureScript("npc_blazing_talon") { }
  877.  
  878.     CreatureAI* GetAI(Creature* creature) const
  879.     {
  880.         return new npc_blazing_talonAI (creature);
  881.     }
  882.  
  883.     struct npc_blazing_talonAI : public npc_escortAI
  884.     {
  885.         npc_blazing_talonAI(Creature* creature) : npc_escortAI(creature) { }
  886.  
  887.         EventMap events;
  888.         uint8 waypoint;
  889.  
  890.         void IsSummonedBy(Unit* /*summoner*/)
  891.         {
  892.             me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  893.             me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  894.             me->AttackStop();
  895.             me->SetReactState(REACT_PASSIVE);
  896.             me->InterruptNonMeleeSpells(false);
  897.  
  898.             me->SetCanFly(true);
  899.             SetDespawnAtFar(false);
  900.             for (uint8 i = 0; i < 4; ++i)
  901.             {
  902.                 uint8 tal = 0;
  903.  
  904.                      if (i == 0) tal = 0;
  905.                 else if (i == 1) tal = 2;
  906.                 else if (i == 2) tal = 4;
  907.                 else if (i == 3) tal = 6;
  908.  
  909.                 if (Talon[tal].GetPositionX() == me->GetPositionX())
  910.                     waypoint = ++tal;
  911.             }
  912.             InitBirdWaypoints();
  913.             Start();
  914.         }
  915.  
  916.         void InitBirdWaypoints()
  917.         {
  918.             AddWaypoint(1, Talon[waypoint].GetPositionX(), Talon[waypoint].GetPositionY(), Talon[waypoint].GetPositionZ(), 3000);
  919.         }
  920.  
  921.         void WaypointReached(uint32 point)
  922.         {
  923.             switch (point)
  924.             {
  925.                 case 1:
  926.                     me->SetReactState(REACT_AGGRESSIVE);
  927.                     DoCast(me,urand(0,1) == 0 ? SPELL_FIREHAWK_TRANSFORM_M : SPELL_FIREHAWK_TRANSFORM_F);
  928.                     me->GetMotionMaster()->MoveFall();
  929.  
  930.                     events.ScheduleEvent(EVENT_START_COMBAT, 500);
  931.  
  932.                     me->SetCanFly(false);
  933.                     me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  934.                     me->RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  935.                     me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
  936.                     break;
  937.             }
  938.         }
  939.  
  940.         void UpdateAI(uint32 diff)
  941.         {
  942.             npc_escortAI::UpdateAI(diff);
  943.  
  944.             if (me->HasUnitState(UNIT_STATE_CASTING))
  945.                 return;
  946.  
  947.             events.Update(diff);
  948.  
  949.             while (uint32 eventId = events.ExecuteEvent())
  950.             {
  951.                 switch (eventId)
  952.                 {
  953.                     case EVENT_START_COMBAT:
  954.                         if (Unit* nearTarget = me->SelectNearestTarget(5000.0f))
  955.                             me->AI()->AttackStart(nearTarget);
  956.  
  957.                         events.ScheduleEvent(urand(0,1) == 0 ? EVENT_START_FIEROBLAST : EVENT_START_BRUSHFIRE, 500);
  958.                         break;
  959.  
  960.                     case EVENT_START_FIEROBLAST:
  961.                         DoCast(me,SPELL_FIEROBLAST);
  962.  
  963.                         events.ScheduleEvent(EVENT_START_BRUSHFIRE, 3000);
  964.                         break;
  965.  
  966.                     case EVENT_START_BRUSHFIRE:
  967.                         if (Unit* tempTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 500.0f, true))
  968.                             DoCast(tempTarget,SPELL_BRUSHFIRE);
  969.  
  970.                         events.ScheduleEvent(urand(0,1) == 0 ? EVENT_START_FIEROBLAST : EVENT_START_BRUSHFIRE, 3000);
  971.                         break;
  972.                 }
  973.             }
  974.         }
  975.     };
  976. };
  977.  
  978. // 53372
  979. class npc_brushfire : public CreatureScript
  980. {
  981. public:
  982.     npc_brushfire() : CreatureScript("npc_brushfire") { }
  983.  
  984.     CreatureAI* GetAI(Creature* creature) const
  985.     {
  986.         return new npc_brushfireAI (creature);
  987.     }
  988.  
  989.     struct npc_brushfireAI : public ScriptedAI
  990.     {
  991.         npc_brushfireAI(Creature* creature) : ScriptedAI(creature)
  992.         {
  993.             started = false;
  994.             needJump = false;
  995.             creature->SetDisplayId(11686);
  996.         }
  997.  
  998.         bool started,needJump;
  999.         uint32 timerMove,jump,timerDespawn;
  1000.  
  1001.         void IsSummonedBy(Unit* /*summoner*/)
  1002.         {
  1003.             me->SetFacingTo(urand(0,6));
  1004.             DoCast(me,SPELL_BRUSHFIRE_VIS);
  1005.             me->SetReactState(REACT_PASSIVE);
  1006.             me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
  1007.             started = true;
  1008.             needJump = true;
  1009.             jump = 500;
  1010.             timerMove = 1000;
  1011.             timerDespawn = 20000;
  1012.         }
  1013.  
  1014.         void UpdateAI(uint32 diff)
  1015.         {
  1016.             if (!started)
  1017.                 return;
  1018.  
  1019.             if (jump <= diff && needJump)
  1020.             {
  1021.                 me->GetMotionMaster()->MoveJump(me->GetPositionX(),me->GetPositionY(),60.0f,200,8);
  1022.                 needJump = false;
  1023.             } else jump -= diff;
  1024.  
  1025.             if (timerMove <= diff) // move forward
  1026.             {
  1027.                 me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + std::cos(me->GetOrientation()) * 35, me->GetPositionY() + std::sin(me->GetOrientation()) * 35, 58.0f);
  1028.             } else timerMove -= diff;
  1029.  
  1030.             if (timerDespawn <= diff) // move forward
  1031.             {
  1032.                 me->DespawnOrUnsummon();
  1033.             } else timerDespawn -= diff;
  1034.         }
  1035.     };
  1036. };
  1037.  
  1038. class npc_fiery_tornado : public CreatureScript // 53698
  1039. {
  1040. public:
  1041.     npc_fiery_tornado() : CreatureScript("npc_fiery_tornado") { }
  1042.  
  1043.     CreatureAI* GetAI(Creature* creature) const
  1044.     {
  1045.         return new npc_fiery_tornadoAI (creature);
  1046.     }
  1047.  
  1048.     struct npc_fiery_tornadoAI : public npc_escortAI
  1049.     {
  1050.         npc_fiery_tornadoAI(Creature* creature) : npc_escortAI(creature)
  1051.         {
  1052.             creature->SetDisplayId(11686);
  1053.         }
  1054.  
  1055.  
  1056.         uint32 numb;
  1057.  
  1058.         void IsSummonedBy(Unit* /*summoner*/)
  1059.         {
  1060.             me->SetReactState(REACT_PASSIVE);
  1061.             me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
  1062.  
  1063.             me->SetCanFly(true);
  1064.             SetDespawnAtFar(false);
  1065.             for (uint8 i = 0;i<14;++i)
  1066.             {
  1067.                 uint8 tal = 0;
  1068.  
  1069.                      if (i == 0) tal = 0;
  1070.                 else if (i == 1) tal = 4;
  1071.                 else if (i == 2) tal = 10;
  1072.                 else if (i == 3) tal = 16;
  1073.                 else if (i == 4) tal = 22;
  1074.                 else if (i == 5) tal = 28;
  1075.                 else if (i == 6) tal = 34;
  1076.                 else if (i == 7) tal = 40;
  1077.                 else if (i == 8) tal = 46;
  1078.                 else if (i == 8) tal = 52;
  1079.                 else if (i == 9) tal = 58;
  1080.                 else if (i == 10) tal = 64;
  1081.                 else if (i == 11) tal = 70;
  1082.                 else if (i == 12) tal = 76;
  1083.                 else if (i == 13) tal = 82;
  1084.  
  1085.                 if (Tornado[tal].GetPositionX() == me->GetPositionX())
  1086.                 {
  1087.                     numb = tal;
  1088.                     break;
  1089.                 }
  1090.             }
  1091.             InitWaypoints();
  1092.             Start();
  1093.         }
  1094.  
  1095.         void InitWaypoints()
  1096.         {
  1097.             if (numb == 0)
  1098.             {
  1099.                 AddWaypoint(1, Tornado[1].GetPositionX(), Tornado[1].GetPositionY(), Tornado[1].GetPositionZ());
  1100.                 AddWaypoint(2, Tornado[2].GetPositionX(), Tornado[2].GetPositionY(), Tornado[2].GetPositionZ());
  1101.                 AddWaypoint(3, Tornado[3].GetPositionX(), Tornado[3].GetPositionY(), Tornado[3].GetPositionZ());
  1102.                 AddWaypoint(4, Tornado[0].GetPositionX(), Tornado[0].GetPositionY(), Tornado[0].GetPositionZ());
  1103.             }
  1104.             else if (numb == 4)
  1105.             {
  1106.                 AddWaypoint(1, Tornado[5].GetPositionX(), Tornado[5].GetPositionY(), Tornado[5].GetPositionZ());
  1107.                 AddWaypoint(2, Tornado[6].GetPositionX(), Tornado[6].GetPositionY(), Tornado[6].GetPositionZ());
  1108.                 AddWaypoint(3, Tornado[7].GetPositionX(), Tornado[7].GetPositionY(), Tornado[7].GetPositionZ());
  1109.                 AddWaypoint(4, Tornado[8].GetPositionX(), Tornado[8].GetPositionY(), Tornado[8].GetPositionZ());
  1110.                 AddWaypoint(5, Tornado[9].GetPositionX(), Tornado[9].GetPositionY(), Tornado[9].GetPositionZ());
  1111.                 AddWaypoint(6, Tornado[4].GetPositionX(), Tornado[4].GetPositionY(), Tornado[4].GetPositionZ());
  1112.             }
  1113.             else if (numb == 10)
  1114.             {
  1115.                 AddWaypoint(1, Tornado[11].GetPositionX(), Tornado[11].GetPositionY(), Tornado[11].GetPositionZ());
  1116.                 AddWaypoint(2, Tornado[12].GetPositionX(), Tornado[12].GetPositionY(), Tornado[12].GetPositionZ());
  1117.                 AddWaypoint(3, Tornado[13].GetPositionX(), Tornado[13].GetPositionY(), Tornado[13].GetPositionZ());
  1118.                 AddWaypoint(4, Tornado[14].GetPositionX(), Tornado[14].GetPositionY(), Tornado[14].GetPositionZ());
  1119.                 AddWaypoint(5, Tornado[15].GetPositionX(), Tornado[15].GetPositionY(), Tornado[15].GetPositionZ());
  1120.                 AddWaypoint(6, Tornado[10].GetPositionX(), Tornado[10].GetPositionY(), Tornado[10].GetPositionZ());
  1121.             }
  1122.             else if (numb == 16)
  1123.             {
  1124.                 AddWaypoint(1, Tornado[17].GetPositionX(), Tornado[17].GetPositionY(), Tornado[17].GetPositionZ());
  1125.                 AddWaypoint(2, Tornado[18].GetPositionX(), Tornado[18].GetPositionY(), Tornado[18].GetPositionZ());
  1126.                 AddWaypoint(3, Tornado[19].GetPositionX(), Tornado[19].GetPositionY(), Tornado[19].GetPositionZ());
  1127.                 AddWaypoint(4, Tornado[20].GetPositionX(), Tornado[20].GetPositionY(), Tornado[20].GetPositionZ());
  1128.                 AddWaypoint(5, Tornado[21].GetPositionX(), Tornado[21].GetPositionY(), Tornado[21].GetPositionZ());
  1129.                 AddWaypoint(6, Tornado[16].GetPositionX(), Tornado[16].GetPositionY(), Tornado[16].GetPositionZ());
  1130.             }
  1131.             else if (numb == 22)
  1132.             {
  1133.                 AddWaypoint(1, Tornado[23].GetPositionX(), Tornado[23].GetPositionY(), Tornado[23].GetPositionZ());
  1134.                 AddWaypoint(2, Tornado[24].GetPositionX(), Tornado[24].GetPositionY(), Tornado[24].GetPositionZ());
  1135.                 AddWaypoint(3, Tornado[25].GetPositionX(), Tornado[25].GetPositionY(), Tornado[25].GetPositionZ());
  1136.                 AddWaypoint(4, Tornado[26].GetPositionX(), Tornado[26].GetPositionY(), Tornado[26].GetPositionZ());
  1137.                 AddWaypoint(5, Tornado[27].GetPositionX(), Tornado[27].GetPositionY(), Tornado[27].GetPositionZ());
  1138.                 AddWaypoint(6, Tornado[22].GetPositionX(), Tornado[22].GetPositionY(), Tornado[22].GetPositionZ());
  1139.             }
  1140.             else if (numb == 28)
  1141.             {
  1142.                 AddWaypoint(1, Tornado[29].GetPositionX(), Tornado[29].GetPositionY(), Tornado[29].GetPositionZ());
  1143.                 AddWaypoint(2, Tornado[30].GetPositionX(), Tornado[30].GetPositionY(), Tornado[30].GetPositionZ());
  1144.                 AddWaypoint(3, Tornado[31].GetPositionX(), Tornado[31].GetPositionY(), Tornado[31].GetPositionZ());
  1145.                 AddWaypoint(4, Tornado[32].GetPositionX(), Tornado[32].GetPositionY(), Tornado[32].GetPositionZ());
  1146.                 AddWaypoint(5, Tornado[33].GetPositionX(), Tornado[33].GetPositionY(), Tornado[33].GetPositionZ());
  1147.                 AddWaypoint(6, Tornado[28].GetPositionX(), Tornado[28].GetPositionY(), Tornado[28].GetPositionZ());
  1148.             }
  1149.             else if (numb == 34)
  1150.             {
  1151.                 AddWaypoint(1, Tornado[35].GetPositionX(), Tornado[35].GetPositionY(), Tornado[35].GetPositionZ());
  1152.                 AddWaypoint(2, Tornado[36].GetPositionX(), Tornado[36].GetPositionY(), Tornado[36].GetPositionZ());
  1153.                 AddWaypoint(3, Tornado[37].GetPositionX(), Tornado[37].GetPositionY(), Tornado[37].GetPositionZ());
  1154.                 AddWaypoint(4, Tornado[38].GetPositionX(), Tornado[38].GetPositionY(), Tornado[38].GetPositionZ());
  1155.                 AddWaypoint(5, Tornado[39].GetPositionX(), Tornado[39].GetPositionY(), Tornado[39].GetPositionZ());
  1156.                 AddWaypoint(6, Tornado[34].GetPositionX(), Tornado[34].GetPositionY(), Tornado[34].GetPositionZ());
  1157.             }
  1158.             else if (numb == 40)
  1159.             {
  1160.                 AddWaypoint(1, Tornado[41].GetPositionX(), Tornado[41].GetPositionY(), Tornado[41].GetPositionZ());
  1161.                 AddWaypoint(2, Tornado[42].GetPositionX(), Tornado[42].GetPositionY(), Tornado[42].GetPositionZ());
  1162.                 AddWaypoint(3, Tornado[43].GetPositionX(), Tornado[43].GetPositionY(), Tornado[43].GetPositionZ());
  1163.                 AddWaypoint(4, Tornado[44].GetPositionX(), Tornado[44].GetPositionY(), Tornado[44].GetPositionZ());
  1164.                 AddWaypoint(5, Tornado[45].GetPositionX(), Tornado[45].GetPositionY(), Tornado[45].GetPositionZ());
  1165.                 AddWaypoint(6, Tornado[40].GetPositionX(), Tornado[40].GetPositionY(), Tornado[40].GetPositionZ());
  1166.             }
  1167.             else if (numb == 46)
  1168.             {
  1169.                 AddWaypoint(1, Tornado[47].GetPositionX(), Tornado[47].GetPositionY(), Tornado[47].GetPositionZ());
  1170.                 AddWaypoint(2, Tornado[48].GetPositionX(), Tornado[48].GetPositionY(), Tornado[48].GetPositionZ());
  1171.                 AddWaypoint(3, Tornado[49].GetPositionX(), Tornado[49].GetPositionY(), Tornado[49].GetPositionZ());
  1172.                 AddWaypoint(4, Tornado[50].GetPositionX(), Tornado[50].GetPositionY(), Tornado[50].GetPositionZ());
  1173.                 AddWaypoint(5, Tornado[51].GetPositionX(), Tornado[51].GetPositionY(), Tornado[51].GetPositionZ());
  1174.                 AddWaypoint(6, Tornado[46].GetPositionX(), Tornado[46].GetPositionY(), Tornado[46].GetPositionZ());
  1175.             }
  1176.             else if (numb == 52)
  1177.             {
  1178.                 AddWaypoint(1, Tornado[53].GetPositionX(), Tornado[53].GetPositionY(), Tornado[53].GetPositionZ());
  1179.                 AddWaypoint(2, Tornado[54].GetPositionX(), Tornado[54].GetPositionY(), Tornado[54].GetPositionZ());
  1180.                 AddWaypoint(3, Tornado[55].GetPositionX(), Tornado[55].GetPositionY(), Tornado[55].GetPositionZ());
  1181.                 AddWaypoint(4, Tornado[56].GetPositionX(), Tornado[56].GetPositionY(), Tornado[56].GetPositionZ());
  1182.                 AddWaypoint(5, Tornado[57].GetPositionX(), Tornado[57].GetPositionY(), Tornado[57].GetPositionZ());
  1183.                 AddWaypoint(6, Tornado[52].GetPositionX(), Tornado[52].GetPositionY(), Tornado[52].GetPositionZ());
  1184.             }
  1185.             else if (numb == 58)
  1186.             {
  1187.                 AddWaypoint(1, Tornado[59].GetPositionX(), Tornado[59].GetPositionY(), Tornado[59].GetPositionZ());
  1188.                 AddWaypoint(2, Tornado[60].GetPositionX(), Tornado[60].GetPositionY(), Tornado[60].GetPositionZ());
  1189.                 AddWaypoint(3, Tornado[61].GetPositionX(), Tornado[61].GetPositionY(), Tornado[61].GetPositionZ());
  1190.                 AddWaypoint(4, Tornado[62].GetPositionX(), Tornado[62].GetPositionY(), Tornado[62].GetPositionZ());
  1191.                 AddWaypoint(5, Tornado[63].GetPositionX(), Tornado[63].GetPositionY(), Tornado[63].GetPositionZ());
  1192.                 AddWaypoint(6, Tornado[58].GetPositionX(), Tornado[58].GetPositionY(), Tornado[58].GetPositionZ());
  1193.             }
  1194.             else if (numb == 58)
  1195.             {
  1196.                 AddWaypoint(1, Tornado[59].GetPositionX(), Tornado[59].GetPositionY(), Tornado[59].GetPositionZ());
  1197.                 AddWaypoint(2, Tornado[60].GetPositionX(), Tornado[60].GetPositionY(), Tornado[60].GetPositionZ());
  1198.                 AddWaypoint(3, Tornado[61].GetPositionX(), Tornado[61].GetPositionY(), Tornado[61].GetPositionZ());
  1199.                 AddWaypoint(4, Tornado[62].GetPositionX(), Tornado[62].GetPositionY(), Tornado[62].GetPositionZ());
  1200.                 AddWaypoint(5, Tornado[63].GetPositionX(), Tornado[63].GetPositionY(), Tornado[63].GetPositionZ());
  1201.                 AddWaypoint(6, Tornado[58].GetPositionX(), Tornado[58].GetPositionY(), Tornado[58].GetPositionZ());
  1202.             }
  1203.             else if (numb == 62)
  1204.             {
  1205.                 AddWaypoint(1, Tornado[63].GetPositionX(), Tornado[63].GetPositionY(), Tornado[63].GetPositionZ());
  1206.                 AddWaypoint(2, Tornado[64].GetPositionX(), Tornado[64].GetPositionY(), Tornado[64].GetPositionZ());
  1207.                 AddWaypoint(3, Tornado[65].GetPositionX(), Tornado[65].GetPositionY(), Tornado[65].GetPositionZ());
  1208.                 AddWaypoint(4, Tornado[66].GetPositionX(), Tornado[66].GetPositionY(), Tornado[66].GetPositionZ());
  1209.                 AddWaypoint(5, Tornado[67].GetPositionX(), Tornado[67].GetPositionY(), Tornado[67].GetPositionZ());
  1210.                 AddWaypoint(6, Tornado[62].GetPositionX(), Tornado[62].GetPositionY(), Tornado[72].GetPositionZ());
  1211.             }
  1212.             else if (numb == 68)
  1213.             {
  1214.                 AddWaypoint(1, Tornado[69].GetPositionX(), Tornado[69].GetPositionY(), Tornado[69].GetPositionZ());
  1215.                 AddWaypoint(2, Tornado[70].GetPositionX(), Tornado[70].GetPositionY(), Tornado[70].GetPositionZ());
  1216.                 AddWaypoint(3, Tornado[71].GetPositionX(), Tornado[71].GetPositionY(), Tornado[71].GetPositionZ());
  1217.                 AddWaypoint(4, Tornado[72].GetPositionX(), Tornado[72].GetPositionY(), Tornado[72].GetPositionZ());
  1218.                 AddWaypoint(5, Tornado[73].GetPositionX(), Tornado[73].GetPositionY(), Tornado[73].GetPositionZ());
  1219.                 AddWaypoint(6, Tornado[68].GetPositionX(), Tornado[68].GetPositionY(), Tornado[68].GetPositionZ());
  1220.             }
  1221.             else if (numb == 74)
  1222.             {
  1223.                 AddWaypoint(1, Tornado[75].GetPositionX(), Tornado[75].GetPositionY(), Tornado[75].GetPositionZ());
  1224.                 AddWaypoint(2, Tornado[76].GetPositionX(), Tornado[76].GetPositionY(), Tornado[76].GetPositionZ());
  1225.                 AddWaypoint(3, Tornado[77].GetPositionX(), Tornado[77].GetPositionY(), Tornado[77].GetPositionZ());
  1226.                 AddWaypoint(4, Tornado[78].GetPositionX(), Tornado[78].GetPositionY(), Tornado[78].GetPositionZ());
  1227.                 AddWaypoint(5, Tornado[79].GetPositionX(), Tornado[79].GetPositionY(), Tornado[79].GetPositionZ());
  1228.                 AddWaypoint(6, Tornado[74].GetPositionX(), Tornado[74].GetPositionY(), Tornado[74].GetPositionZ());
  1229.             }
  1230.             else if (numb == 80)
  1231.             {
  1232.                 AddWaypoint(1, Tornado[80].GetPositionX(), Tornado[80].GetPositionY(), Tornado[80].GetPositionZ());
  1233.                 AddWaypoint(2, Tornado[81].GetPositionX(), Tornado[81].GetPositionY(), Tornado[81].GetPositionZ());
  1234.                 AddWaypoint(3, Tornado[82].GetPositionX(), Tornado[82].GetPositionY(), Tornado[82].GetPositionZ());
  1235.                 AddWaypoint(4, Tornado[83].GetPositionX(), Tornado[83].GetPositionY(), Tornado[83].GetPositionZ());
  1236.                 AddWaypoint(5, Tornado[84].GetPositionX(), Tornado[84].GetPositionY(), Tornado[84].GetPositionZ());
  1237.                 AddWaypoint(6, Tornado[80].GetPositionX(), Tornado[80].GetPositionY(), Tornado[80].GetPositionZ());
  1238.             }
  1239.         }
  1240.  
  1241.         void WaypointReached(uint32 point)
  1242.         {
  1243.             if ((point == 4 && numb == 0) || (point == 6))
  1244.                 InitWaypoints();
  1245.         }
  1246.  
  1247.         void UpdateAI(uint32 diff)
  1248.         {
  1249.             npc_escortAI::UpdateAI(diff);
  1250.         }
  1251.     };
  1252. };
  1253.  
  1254. class npc_molten_egg : public CreatureScript // 53681
  1255. {
  1256. public:
  1257.     npc_molten_egg() : CreatureScript("npc_molten_egg") { }
  1258.  
  1259.     CreatureAI* GetAI(Creature* creature) const
  1260.     {
  1261.         return new npc_molten_eggAI (creature);
  1262.     }
  1263.  
  1264.     struct npc_molten_eggAI : public ScriptedAI
  1265.     {
  1266.         npc_molten_eggAI(Creature* creature) : ScriptedAI(creature)
  1267.         {
  1268.             started = false;
  1269.         }
  1270.  
  1271.         EventMap events;
  1272.         bool started;
  1273.  
  1274.         void IsSummonedBy(Unit* /*summoner*/)
  1275.         {
  1276.             me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 56.00f, me->GetOrientation());
  1277.             me->SetReactState(REACT_PASSIVE);
  1278.             me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
  1279.             events.ScheduleEvent(EVENT_EGG_EXPLOSION, 3500);
  1280.             started = true;
  1281.         }
  1282.  
  1283.         void UpdateAI(uint32 diff)
  1284.         {
  1285.             if (!started)
  1286.                 return;
  1287.  
  1288.             events.Update(diff);
  1289.  
  1290.             while (uint32 eventId = events.ExecuteEvent())
  1291.             {
  1292.                 switch (eventId)
  1293.                 {
  1294.                     case EVENT_EGG_EXPLOSION:
  1295.                         DoCast(me, SPELL_EGG_EXPLOSION);
  1296.                         events.ScheduleEvent(EVENT_SUMMON_HATCHING, 5000);
  1297.                         break;
  1298.  
  1299.                     case EVENT_SUMMON_HATCHING:
  1300.                         DoCast(me, SPELL_SUMM_HATHING);
  1301.                         events.ScheduleEvent(EVENT_DESPAWN, 600);
  1302.                         break;
  1303.  
  1304.                     case EVENT_DESPAWN:
  1305.                         me->DespawnOrUnsummon();
  1306.                         break;
  1307.                 }
  1308.             }
  1309.         }
  1310.     };
  1311. };
  1312.  
  1313. class boss_alysrazor : public CreatureScript
  1314. {
  1315. public:
  1316.     boss_alysrazor() : CreatureScript("boss_alysrazor") { }
  1317.  
  1318.     CreatureAI* GetAI(Creature* creature) const
  1319.     {
  1320.         return new boss_alysrazorAI (creature);
  1321.     }
  1322.  
  1323.     struct boss_alysrazorAI: public BossAI
  1324.     {
  1325.         boss_alysrazorAI(Creature* creature) : BossAI(creature, DATA_ALYSRAZAR)
  1326.         {
  1327.             instance = creature->GetInstanceScript();
  1328.  
  1329.             ASSERT(creature->GetVehicleKit()); // Power.
  1330.             me->SetMaxPower(POWER_ENERGY,100);
  1331.             me->SetPower(POWER_ENERGY,100);
  1332.             phase = PHASE_NONE;
  1333.         }
  1334.  
  1335.         InstanceScript* instance;
  1336.         EventMap events;
  1337.         uint8 waypoint, phase, LastTalon;
  1338.         bool isNeedJump;
  1339.  
  1340.         void Reset()
  1341.         {
  1342.             if (instance)
  1343.                 instance->SetBossState(DATA_ALYSRAZAR, NOT_STARTED);
  1344.  
  1345.             events.Reset();
  1346.             isNeedJump = false;
  1347.  
  1348.             me->SetReactState(REACT_AGGRESSIVE);
  1349.  
  1350.             _Reset();
  1351.         }
  1352.  
  1353.         void EnterEvadeMode()
  1354.         {
  1355.             Reset();
  1356.  
  1357.             if (instance)
  1358.             {
  1359.                 instance->SetBossState(DATA_ALYSRAZAR, FAIL);
  1360.                 instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); // Remove
  1361.  
  1362.                 if (GameObject* volcano = instance->instance->GetGameObject(instance->GetData64(DATA_ALYSRAZOR_VOLCANO)))
  1363.                     volcano->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING);
  1364.             }
  1365.  
  1366.             DespawnMinions();
  1367.             RemoveEncounterAuras();
  1368.  
  1369.             me->DespawnOrUnsummon();
  1370.  
  1371.             me->SummonCreature(53089, Feather[0]);
  1372.  
  1373.             _EnterEvadeMode();
  1374.         }
  1375.  
  1376.         inline void DespawnMinions()
  1377.         {
  1378.             DespawnCreatures(53158);
  1379.             DespawnCreatures(53681);
  1380.             DespawnCreatures(53680);
  1381.             DespawnCreatures(53509);
  1382.             DespawnCreatures(53693);
  1383.             DespawnCreatures(53698);
  1384.         }
  1385.  
  1386.         void DespawnCreatures(uint32 entry)
  1387.         {
  1388.             std::list<Creature*> creatures;
  1389.             GetCreatureListWithEntryInGrid(creatures, me, entry, 1000.0f);
  1390.  
  1391.             if (creatures.empty())
  1392.                return;
  1393.  
  1394.             for (std::list<Creature*>::iterator iter = creatures.begin(); iter != creatures.end(); ++iter)
  1395.                  (*iter)->DespawnOrUnsummon();
  1396.         }
  1397.  
  1398.         void EnterCombat(Unit* /*who*/)
  1399.         {
  1400.             EnterAir();
  1401.  
  1402.             if (instance)
  1403.             {
  1404.                 instance->SetBossState(DATA_ALYSRAZAR, IN_PROGRESS);
  1405.                 instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); // Add
  1406.  
  1407.                 if (GameObject* volcano = instance->instance->GetGameObject(instance->GetData64(DATA_ALYSRAZOR_VOLCANO)))
  1408.                     volcano->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED);
  1409.             }
  1410.  
  1411.             DoCast(me, SPELL_INDICATOR);
  1412.  
  1413.             _EnterCombat();
  1414.         }
  1415.  
  1416.         void EnterGround()
  1417.         {
  1418.             me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  1419.             me->RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  1420.         }
  1421.  
  1422.         void EnterAir()
  1423.         {
  1424.             me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
  1425.             me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
  1426.         }
  1427.  
  1428.         void IsSummonedBy(Unit* /*summoner*/)
  1429.         {
  1430.             phase = PHASE_JUMP;
  1431.             isNeedJump = true;
  1432.             me->SetReactState(REACT_PASSIVE);
  1433.             DoZoneInCombat();
  1434.             events.ScheduleEvent(EVENT_ZONE_COMBAT, 1000);
  1435.         }
  1436.  
  1437.         void CancelMove()
  1438.         {
  1439.             events.CancelEvent(EVENT_MOVE_TO_START_OF_TOP);
  1440.             events.CancelEvent(EVENT_MOVE_TO_END_OF_TOP);
  1441.             events.CancelEvent(EVENT_MOVE_TO_LEFT_1);
  1442.             events.CancelEvent(EVENT_MOVE_TO_LEFT_2);
  1443.             events.CancelEvent(EVENT_MOVE_TO_LEFT_3);
  1444.             events.CancelEvent(EVENT_MOVE_TO_LEFT_4);
  1445.             events.CancelEvent(EVENT_MOVE_TO_LEFT_5);
  1446.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_1);
  1447.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_2);
  1448.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_3);
  1449.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_4);
  1450.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_5);
  1451.             events.CancelEvent(EVENT_MOVE_TO_END_CENTER);
  1452.             events.CancelEvent(EVENT_MOVE_TO_END_START);
  1453.             events.CancelEvent(EVENT_MOVE_TO_LEFT_N_1);
  1454.             events.CancelEvent(EVENT_MOVE_TO_LEFT_N_2);
  1455.             events.CancelEvent(EVENT_MOVE_TO_LEFT_N_3);
  1456.             events.CancelEvent(EVENT_MOVE_TO_LEFT_N_4);
  1457.             events.CancelEvent(EVENT_MOVE_TO_LEFT_N_5);
  1458.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_N_1);
  1459.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_N_2);
  1460.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_N_3);
  1461.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_N_4);
  1462.             events.CancelEvent(EVENT_MOVE_TO_RIGHT_N_5);
  1463.             events.CancelEvent(EVENT_MOVE_TORNADOS_1);
  1464.             events.CancelEvent(EVENT_MOVE_TORNADOS_2);
  1465.             events.CancelEvent(EVENT_MOVE_TORNADOS_3);
  1466.             events.CancelEvent(EVENT_MOVE_TORNADOS_4);
  1467.         }
  1468.  
  1469.         void UpdateAI(uint32 diff)
  1470.         {
  1471.             if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
  1472.                 return;
  1473.  
  1474.             if (phase == PHASE_GROUND && me->GetPower(POWER_ENERGY) >= 50 && !me->HasAura(SPELL_IGNITED))
  1475.             {
  1476.                 if (me->HasAura(SPELL_BURNOUT))
  1477.                     me->RemoveAura(SPELL_BURNOUT);
  1478.                 if (me->HasAura(SPELL_SPARK))
  1479.                     me->RemoveAura(SPELL_SPARK);
  1480.                 DoCast(me,SPELL_IGNITED);
  1481.                 DoCast(me,SPELL_BLAZING_CLAW);
  1482.                 RemoveAllFeathers();
  1483.                 EnterAir();
  1484.                 me->GetMotionMaster()->MoveJump(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ()+10,200,2);
  1485.                 me->SetReactState(REACT_AGGRESSIVE);
  1486.                 me->AI()->AttackStart(me->SelectVictim());
  1487.             }
  1488.  
  1489.             if (phase == PHASE_GROUND && me->GetPower(POWER_ENERGY) >= 100 && me->HasAura(SPELL_IGNITED))
  1490.             {
  1491.                 phase = PHASE_JUMP;
  1492.                 LastTalon = 4;
  1493.                 me->RemoveAura(SPELL_IGNITED);
  1494.                 if (me->HasAura(SPELL_BLAZING_CLAW))
  1495.                     me->RemoveAura(SPELL_BLAZING_CLAW);
  1496.                 me->AttackStop();
  1497.                 me->SetReactState(REACT_PASSIVE);
  1498.                 me->InterruptNonMeleeSpells(false);
  1499.                 DoCast(me, SPELL_FULL_POWER);
  1500.                 events.ScheduleEvent(EVENT_PHASE_2_TORNADOS_START, 195000);
  1501.                 events.ScheduleEvent(EVENT_MOVE_TO_LEFT_1, 1000);
  1502.                 events.ScheduleEvent(EVENT_SUMMON_BROODMOTHER, 25000);
  1503.                 events.ScheduleEvent(EVENT_SUMMON_WORMS, 50000);
  1504.                 for (uint8 i = 0;i<2;++i)
  1505.                     events.ScheduleEvent(EVENT_SUMMON_TALON, i == 0 ? urand(5000,10000) : urand(8000,13000));
  1506.             }
  1507.  
  1508.             if (phase == PHASE_JUMP && isNeedJump)
  1509.             {
  1510.                 isNeedJump = false;
  1511.                 me->GetMotionMaster()->MoveJump(SpawnPos[1].GetPositionX(),SpawnPos[1].GetPositionY(),SpawnPos[1].GetPositionZ(),200,8);
  1512.                 EnterAir();
  1513.                 events.ScheduleEvent(EVENT_START_ENCOUNTER, 1000);
  1514.             }
  1515.  
  1516.             if (phase == PHASE_AIR || phase == PHASE_TORNADO)
  1517.                 me->GetMotionMaster()->MovePoint(0, SpawnPos[waypoint].GetPositionX(),SpawnPos[waypoint].GetPositionY(),SpawnPos[waypoint].GetPositionZ());
  1518.  
  1519.             events.Update(diff);
  1520.  
  1521.             while (uint32 eventId = events.ExecuteEvent())
  1522.             {
  1523.                 switch (eventId)
  1524.                 {
  1525.                     case EVENT_START_ENCOUNTER:
  1526.                         for (uint8 i = 0; i < 11; ++i)
  1527.                             me->SummonCreature(53158,SpawnVolcanos[i].GetPositionX(),SpawnVolcanos[i].GetPositionY(),SpawnVolcanos[i].GetPositionZ());
  1528.                         DoCast(me,SPELL_FIRESTORM);
  1529.                         events.ScheduleEvent(EVENT_PHASE_2_TORNADOS_START, 195000);
  1530.                         events.ScheduleEvent(EVENT_MOVE_TO_START_OF_TOP, 500);
  1531.                         events.ScheduleEvent(EVENT_INCENDIARY_CLOUD, 15000);
  1532.                         events.ScheduleEvent(EVENT_SUMMON_BROODMOTHER, 25000);
  1533.                         events.ScheduleEvent(EVENT_SUMMON_WORMS, 50000);
  1534.                         for (uint8 i = 0;i < 2; ++i)
  1535.                             events.ScheduleEvent(EVENT_SUMMON_TALON, i == 0 ? urand(5000,10000) : urand(8000,13000));
  1536.                         LastTalon = 4;
  1537.                         break;
  1538.  
  1539.                     case EVENT_ZONE_COMBAT:
  1540.                         SetPlayersInCombat();
  1541.                         events.ScheduleEvent(EVENT_ZONE_COMBAT, 1000);
  1542.                         break;
  1543.  
  1544.                     case EVENT_INCENDIARY_CLOUD:
  1545.                         if (phase == PHASE_AIR)
  1546.                         {
  1547.                             me->SummonCreature(53541,me->GetPositionX()-urand(5,15),me->GetPositionY()-urand(-5,-15),me->GetPositionZ() > 120.0f ? me->GetPositionZ() : 120.0f);
  1548.                             me->SummonCreature(53554,me->GetPositionX()+urand(25,35),me->GetPositionY()+urand(-25,-35),me->GetPositionZ() > 120.0f ? me->GetPositionZ() : 120.0f,me->GetOrientation());
  1549.                         }
  1550.                         events.ScheduleEvent(EVENT_INCENDIARY_CLOUD, 5000);
  1551.                         break;
  1552.  
  1553.                     case EVENT_MOVE_TO_START_OF_TOP:
  1554.                         waypoint = 2;
  1555.                         phase = PHASE_AIR;
  1556.                         events.ScheduleEvent(EVENT_MOVE_TO_END_OF_TOP, 9000);
  1557.                         break;
  1558.  
  1559.                     case EVENT_SUMMON_WORMS:
  1560.                         for(uint8 i = 0;i < 4; ++i)
  1561.                             me->SummonCreature(53520, WormsPos[i]);
  1562.                         events.ScheduleEvent(EVENT_SUMMON_WORMS, 60000);
  1563.                         break;
  1564.  
  1565.                     case EVENT_SUMMON_TALON:
  1566.                         me->SummonCreature(53896, Talon[SelectTalon()]);
  1567.                         events.ScheduleEvent(EVENT_SUMMON_TALON, urand(40000,45000));
  1568.                         break;
  1569.  
  1570.                     case EVENT_SUMMON_BROODMOTHER:
  1571.                         for (uint8 i = 0;i<2;++i)
  1572.                             me->SummonCreature(53680, BirdsPos[i]);
  1573.                         break;
  1574.  
  1575.                     case EVENT_MOVE_TO_END_OF_TOP:
  1576.                         DoCast(me,SPELL_BLAZING_CLAW);
  1577.                         DoCast(me,SPELL_MOLTING);
  1578.                         waypoint = 3;
  1579.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_1, 12000);
  1580.                         break;
  1581.  
  1582.                     case EVENT_MOVE_TO_LEFT_1:
  1583.                         if (me->HasAura(SPELL_BLAZING_CLAW))
  1584.                             me->RemoveAura(SPELL_BLAZING_CLAW);
  1585.                         phase = PHASE_AIR;
  1586.                         waypoint = 4;
  1587.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_2, 5200);
  1588.                         break;
  1589.  
  1590.                     case EVENT_MOVE_TO_LEFT_2:
  1591.                         waypoint = 5;
  1592.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_3, 5200);
  1593.                         break;
  1594.  
  1595.                     case EVENT_MOVE_TO_LEFT_3:
  1596.                         waypoint = 6;
  1597.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_4, 5200);
  1598.                         break;
  1599.  
  1600.                     case EVENT_MOVE_TO_LEFT_4:
  1601.                         waypoint = 7;
  1602.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_5, 5200);
  1603.                         break;
  1604.  
  1605.                     case EVENT_MOVE_TO_LEFT_5:
  1606.                         waypoint = 8;
  1607.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_1, 5200);
  1608.                         break;
  1609.  
  1610.                     case EVENT_MOVE_TO_RIGHT_1:
  1611.                         waypoint = 9;
  1612.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_2, 5200);
  1613.                         break;
  1614.  
  1615.                     case EVENT_MOVE_TO_RIGHT_2:
  1616.                         waypoint = 10;
  1617.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_3, 5200);
  1618.                         break;
  1619.  
  1620.                     case EVENT_MOVE_TO_RIGHT_3:
  1621.                         waypoint = 11;
  1622.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_4, 5000);
  1623.                         break;
  1624.  
  1625.                     case EVENT_MOVE_TO_RIGHT_4:
  1626.                         waypoint = 12;
  1627.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_5, 5000);
  1628.                         break;
  1629.  
  1630.                     case EVENT_MOVE_TO_RIGHT_5:
  1631.                         waypoint = 13;
  1632.                         events.ScheduleEvent(EVENT_MOVE_TO_END_CENTER, 5000);
  1633.                         break;
  1634.  
  1635.                     case EVENT_MOVE_TO_END_CENTER:
  1636.                         waypoint = 14;
  1637.                         events.ScheduleEvent(EVENT_MOVE_TO_END_START, 10000);
  1638.                         break;
  1639.  
  1640.                     case EVENT_MOVE_TO_END_START:
  1641.                         DoCast(me,SPELL_BLAZING_CLAW);
  1642.                         DoCast(me,SPELL_MOLTING);
  1643.                         waypoint = 15;
  1644.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_N_1, 15000);
  1645.                         break;
  1646.  
  1647.                     case EVENT_MOVE_TO_LEFT_N_1:
  1648.                         if (me->HasAura(SPELL_BLAZING_CLAW))
  1649.                             me->RemoveAura(SPELL_BLAZING_CLAW);
  1650.                         waypoint = 16;
  1651.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_N_2, 5000);
  1652.                         break;
  1653.  
  1654.                     case EVENT_MOVE_TO_LEFT_N_2:
  1655.                         waypoint = 17;
  1656.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_N_3, 5000);
  1657.                         break;
  1658.                     case EVENT_MOVE_TO_LEFT_N_3:
  1659.                         waypoint = 18;
  1660.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_N_4, 5000);
  1661.                         break;
  1662.  
  1663.                     case EVENT_MOVE_TO_LEFT_N_4:
  1664.                         waypoint = 19;
  1665.                         events.ScheduleEvent(EVENT_MOVE_TO_LEFT_N_5, 5000);
  1666.                         break;
  1667.  
  1668.                     case EVENT_MOVE_TO_LEFT_N_5:
  1669.                         waypoint = 20;
  1670.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_N_1, 5000);
  1671.                         break;
  1672.  
  1673.                     case EVENT_MOVE_TO_RIGHT_N_1:
  1674.                         waypoint = 21;
  1675.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_N_2, 5200);
  1676.                         break;
  1677.  
  1678.                     case EVENT_MOVE_TO_RIGHT_N_2:
  1679.                         waypoint = 22;
  1680.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_N_3, 5200);
  1681.                         break;
  1682.  
  1683.                     case EVENT_MOVE_TO_RIGHT_N_3:
  1684.                         waypoint = 23;
  1685.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_N_4, 5200);
  1686.                         break;
  1687.  
  1688.                     case EVENT_MOVE_TO_RIGHT_N_4:
  1689.                         waypoint = 24;
  1690.                         events.ScheduleEvent(EVENT_MOVE_TO_RIGHT_N_5, 5200);
  1691.                         break;
  1692.  
  1693.                     case EVENT_MOVE_TO_RIGHT_N_5:
  1694.                         waypoint = 25;
  1695.                         events.ScheduleEvent(EVENT_MOVE_TO_START_OF_TOP, 500);
  1696.                         break;
  1697.  
  1698.                     case EVENT_PHASE_2_TORNADOS_START:
  1699.                         events.CancelEvent(EVENT_SUMMON_WORMS);
  1700.                         events.CancelEvent(EVENT_SUMMON_TALON);
  1701.                         if (me->HasAura(SPELL_BLAZING_CLAW))
  1702.                             me->RemoveAura(SPELL_BLAZING_CLAW);
  1703.                         me->SummonCreature(53693,FallPos[0].GetPositionX(),FallPos[0].GetPositionY(),FallPos[0].GetPositionZ());
  1704.                         waypoint = 26;
  1705.                         phase = PHASE_TORNADO;
  1706.                         CancelMove();
  1707.                         events.ScheduleEvent(EVENT_MOVE_TORNADOS_1, 5000);
  1708.                         events.ScheduleEvent(EVENT_MOVE_TO_TORNADO, 18000);
  1709.                         events.ScheduleEvent(EVENT_PHASE_2_TORNADOS_ENDS, 22000);
  1710.                         break;
  1711.  
  1712.                     case EVENT_HARSH_WINDS:
  1713.                         CastHarshOnPlayers();
  1714.                         events.ScheduleEvent(EVENT_HARSH_WINDS, 2000);
  1715.                         break;
  1716.  
  1717.                     case EVENT_MOVE_TORNADOS_1:
  1718.                         DespawnCreatures(53089);
  1719.                         RemoveFly();
  1720.                         waypoint = 27;
  1721.                         events.ScheduleEvent(EVENT_HARSH_WINDS, 2000);
  1722.                         events.ScheduleEvent(EVENT_MOVE_TORNADOS_2, 4000);
  1723.                         break;
  1724.  
  1725.                     case EVENT_MOVE_TORNADOS_2:
  1726.                         waypoint = 28;
  1727.                         events.ScheduleEvent(EVENT_MOVE_TORNADOS_3, 4000);
  1728.                         break;
  1729.  
  1730.                     case EVENT_MOVE_TORNADOS_3:
  1731.                         waypoint = 29;
  1732.                         events.ScheduleEvent(EVENT_MOVE_TORNADOS_4, 4000);
  1733.                         break;
  1734.  
  1735.                     case EVENT_MOVE_TORNADOS_4:
  1736.                         waypoint = 30;
  1737.                         events.ScheduleEvent(EVENT_MOVE_TORNADOS_1, 4000);
  1738.                         break;
  1739.  
  1740.                     case EVENT_SUMMON_DRUIDS:
  1741.                         for(uint8 i = 0; i < 2; ++i)
  1742.                             me->SummonCreature(53734,ClawTalon[i]);
  1743.                         break;
  1744.  
  1745.                     case EVENT_PHASE_2_TORNADOS_ENDS:
  1746.                         events.CancelEvent(EVENT_HARSH_WINDS);
  1747.                         CancelMove();
  1748.                         DespawnCreatures(53693);
  1749.                         DespawnCreatures(53698);
  1750.                         phase = PHASE_GROUND;
  1751.                         DoCast(me,SPELL_BURNOUT);
  1752.                         DoCast(me,SPELL_SPARK);
  1753.                         me->SetPower(POWER_ENERGY,0);
  1754.                         DoCast(me,SPELL_ZERO_POWER);
  1755.                         me->GetMotionMaster()->MoveJump(FallPos[0].GetPositionX(),FallPos[0].GetPositionY(),FallPos[0].GetPositionZ(),100,4);
  1756.                         events.ScheduleEvent(EVENT_SUMMON_DRUIDS, 500);
  1757.                         break;
  1758.  
  1759.                     default:
  1760.                         break;
  1761.                 }
  1762.             }
  1763.  
  1764.                 DoMeleeAttackIfReady();
  1765.         }
  1766.  
  1767.         int32 SelectTalon()
  1768.         {
  1769.             uint8 talon = urand(0,3);
  1770.  
  1771.             if (LastTalon != 4)
  1772.                 while (LastTalon == talon)
  1773.                     talon = urand(0,3);
  1774.  
  1775.             LastTalon = talon;
  1776.  
  1777.             if (talon == 0)
  1778.                 return 0;
  1779.             else if (talon == 1)
  1780.                 return 2;
  1781.             else if (talon == 2)
  1782.                 return 4;
  1783.             else if (talon == 3)
  1784.                 return 6;
  1785.             else
  1786.                 return 6;
  1787.         }
  1788.        
  1789.         void CastHarshOnPlayers()
  1790.         {
  1791.             Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
  1792.             if (!PlayerList.isEmpty())
  1793.                 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
  1794.                     if (Creature* tornado = me->FindNearestCreature(53693, 5000.0f))
  1795.                         if (i->GetSource()->GetDistance(tornado) > 60.0f)
  1796.                             me->AddAura(SPELL_HARSH_WINDS,i->GetSource());
  1797.         }
  1798.  
  1799.         void SetPlayersInCombat()
  1800.         {
  1801.             uint8 players = 0;
  1802.             Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
  1803.             if (!PlayerList.isEmpty())
  1804.                 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
  1805.                     if (Player *player = i->GetSource())
  1806.                         if (player->IsAlive())
  1807.                         {
  1808.                             ++players;
  1809.                             player->SetInCombatWith(me->ToUnit());
  1810.                         }
  1811.             if (players == 0)
  1812.                 EnterEvadeMode();
  1813.         }
  1814.  
  1815.         void RemoveFly()
  1816.         {
  1817.             Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
  1818.             if (!PlayerList.isEmpty())
  1819.                 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
  1820.                     if (i->GetSource()->HasAura(SPELL_FLY))
  1821.                         i->GetSource()->RemoveAura(SPELL_FLY);
  1822.         }
  1823.  
  1824.         void RemoveAllFeathers()
  1825.         {
  1826.             Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
  1827.             if (!PlayerList.isEmpty())
  1828.                 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
  1829.                     if (i->GetSource()->HasAura(SPELL_CAST_ON_MOVE_VISUAL))
  1830.                         i->GetSource()->RemoveAura(SPELL_CAST_ON_MOVE_VISUAL);
  1831.         }
  1832.  
  1833.         void RemoveEncounterAuras()
  1834.         {
  1835.             Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
  1836.             if (!PlayerList.isEmpty())
  1837.                 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
  1838.                 {
  1839.                     if (i->GetSource()->HasAura(SPELL_FLY))
  1840.                         i->GetSource()->RemoveAura(SPELL_FLY);
  1841.                     if (i->GetSource()->HasAura(SPELL_INDICATOR))
  1842.                         i->GetSource()->RemoveAura(SPELL_INDICATOR);
  1843.                     if (i->GetSource()->HasAura(SPELL_CAST_ON_MOVE_VISUAL))
  1844.                         i->GetSource()->RemoveAura(SPELL_CAST_ON_MOVE_VISUAL);
  1845.                     if (i->GetSource()->HasAura(SPELL_IMPRINTED))
  1846.                         i->GetSource()->RemoveAura(SPELL_IMPRINTED);
  1847.                 }
  1848.         }
  1849.  
  1850.         void JustDied(Unit* /*killer*/)
  1851.         {
  1852.             me->RemoveAllAuras();
  1853.             RemoveEncounterAuras();
  1854.             if (instance)
  1855.             {
  1856.                 instance->SetBossState(DATA_ALYSRAZAR, DONE);
  1857.                 instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); // Remove
  1858.             }
  1859.  
  1860.             _JustDied();
  1861.         }
  1862.     };
  1863. };
  1864.  
  1865. class npc_fier_tornado : public CreatureScript // 53158
  1866. {
  1867. public:
  1868.     npc_fier_tornado() : CreatureScript("npc_fier_tornado") { }
  1869.  
  1870.     CreatureAI* GetAI(Creature* creature) const
  1871.     {
  1872.         return new npc_fier_tornadoAI(creature);
  1873.     }
  1874.  
  1875.     struct npc_fier_tornadoAI : public ScriptedAI
  1876.     {
  1877.         npc_fier_tornadoAI(Creature* creature) : ScriptedAI(creature)
  1878.         {
  1879.             creature->SetDisplayId(11686);
  1880.             started = false;
  1881.             needSummon = false;
  1882.         }
  1883.  
  1884.         bool started,needSummon;
  1885.         uint32 timerSummon;
  1886.  
  1887.         void IsSummonedBy(Unit* /*summoner*/)
  1888.         {
  1889.             started = true;
  1890.             DoCast(me,SPELL_SUMMON_DMG);
  1891.             timerSummon = 5000;
  1892.             needSummon = true;
  1893.         }
  1894.  
  1895.         void UpdateAI(uint32 diff)
  1896.         {
  1897.             if (!started)
  1898.                 return;
  1899.  
  1900.             if (timerSummon <= diff && needSummon)
  1901.             {
  1902.                 for (uint8 i = 0;i < 14;++i)
  1903.                 {
  1904.                     uint8 tal = 0;
  1905.  
  1906.                          if (i == 0) tal = 0;
  1907.                     else if (i == 1) tal = 4;
  1908.                     else if (i == 2) tal = 10;
  1909.                     else if (i == 3) tal = 16;
  1910.                     else if (i == 4) tal = 22;
  1911.                     else if (i == 5) tal = 28;
  1912.                     else if (i == 6) tal = 34;
  1913.                     else if (i == 7) tal = 40;
  1914.                     else if (i == 8) tal = 46;
  1915.                     else if (i == 8) tal = 52;
  1916.                     else if (i == 9) tal = 58;
  1917.                     else if (i == 10) tal = 64;
  1918.                     else if (i == 11) tal = 70;
  1919.                     else if (i == 12) tal = 76;
  1920.                     else if (i == 13) tal = 82;
  1921.  
  1922.                     me->SummonCreature(53698, Tornado[tal]);
  1923.                 }
  1924.                 needSummon = false;
  1925.             }
  1926.             else timerSummon -= diff;
  1927.         }
  1928.     };
  1929. };
  1930.  
  1931. class spell_molthen_feater : public SpellScriptLoader
  1932. {
  1933.     public:
  1934.         spell_molthen_feater() : SpellScriptLoader("spell_molthen_feater") { }
  1935.  
  1936.         class spell_molthen_feater_AuraScript : public AuraScript
  1937.         {
  1938.             PrepareAuraScript(spell_molthen_feater_AuraScript);
  1939.  
  1940.             void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
  1941.             {
  1942.                 GetTarget()->SetAltPower(0);
  1943.                 GetTarget()->SetPower(POWER_ALTERNATE_POWER, 0);
  1944.  
  1945.                 for (uint8 i = 0; i < 10; i++)
  1946.                     if (GetTarget()->HasAura(98761 + i))
  1947.                         GetTarget()->RemoveAura(98761 + i);
  1948.             }
  1949.  
  1950.             void Register()
  1951.             {
  1952.                 AfterEffectRemove += AuraEffectRemoveFn(spell_molthen_feater_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_MOD_INCREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
  1953.             }
  1954.         };
  1955.  
  1956.         AuraScript* GetAuraScript() const
  1957.         {
  1958.             return new spell_molthen_feater_AuraScript();
  1959.         }
  1960. };
  1961.  
  1962. class spell_fieroblast : public SpellScriptLoader
  1963. {
  1964.     public:
  1965.         spell_fieroblast() : SpellScriptLoader("spell_fieroblast") { }
  1966.  
  1967.         class spell_fieroblast_AuraScript : public AuraScript
  1968.         {
  1969.             PrepareAuraScript(spell_fieroblast_AuraScript);
  1970.  
  1971.             void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
  1972.             {
  1973.                 if (GetCaster())
  1974.                     GetCaster()->AddAura(SPELL_FIREITUP,GetCaster());
  1975.             }
  1976.  
  1977.             void Register()
  1978.             {
  1979.                  OnEffectApply += AuraEffectApplyFn(spell_fieroblast_AuraScript::OnApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
  1980.             }
  1981.         };
  1982.  
  1983.         AuraScript* GetAuraScript() const
  1984.         {
  1985.             return new spell_fieroblast_AuraScript();
  1986.         }
  1987. };
  1988.  
  1989. class spell_molthen : public SpellScriptLoader
  1990. {
  1991.     public:
  1992.         spell_molthen() : SpellScriptLoader("spell_molthen") { }
  1993.  
  1994.         class spell_molthen_AuraScript : public AuraScript
  1995.         {
  1996.             PrepareAuraScript(spell_molthen_AuraScript);
  1997.  
  1998.             void OnPeriodic(AuraEffect const* /*aurEff*/)
  1999.             {
  2000.                 if (GetTarget())
  2001.                     GetTarget()->SummonCreature(53089,GetTarget()->GetPositionX()-urand(5,30),GetTarget()->GetPositionY()-urand(-5,-30),56.500f);
  2002.             }
  2003.  
  2004.             void Register()
  2005.             {
  2006.                 OnEffectPeriodic += AuraEffectPeriodicFn(spell_molthen_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
  2007.             }
  2008.         };
  2009.  
  2010.         AuraScript* GetAuraScript() const
  2011.         {
  2012.             return new spell_molthen_AuraScript();
  2013.         }
  2014. };
  2015.  
  2016. class spell_hatchling_debuff : public SpellScriptLoader
  2017. {
  2018.     public:
  2019.         spell_hatchling_debuff() : SpellScriptLoader("spell_hatchling_debuff") { }
  2020.  
  2021.         class spell_hatchling_debuff_AuraScript : public AuraScript
  2022.         {
  2023.             PrepareAuraScript(spell_hatchling_debuff_AuraScript);
  2024.  
  2025.             void PeriodicTick(AuraEffect const* /*aurEff*/)
  2026.             {
  2027.                 if (GetTarget()->HealthBelowPct(51) && GetTarget()->HasAura(SPELL_DEBUFF))
  2028.                     GetTarget()->RemoveAura(SPELL_DEBUFF);
  2029.             }
  2030.  
  2031.             void Register()
  2032.             {
  2033.                 OnEffectPeriodic += AuraEffectPeriodicFn(spell_hatchling_debuff_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
  2034.             }
  2035.         };
  2036.  
  2037.         AuraScript* GetAuraScript() const
  2038.         {
  2039.             return new spell_hatchling_debuff_AuraScript();
  2040.         }
  2041. };
  2042.  
  2043. void AddSC_boss_alysrazor()
  2044. {
  2045.     new npc_molten_feather();
  2046.     new npc_incindiary_cloud_53541();
  2047.     new boss_alysrazor();
  2048.     new npc_alysrazor_volcano();
  2049.     new npc_fier_tornado();
  2050.     new spell_molthen_feater();
  2051.     new spell_molthen();
  2052.     new npc_blazing_power_53554();
  2053.     new npc_plumb_lava_worm();
  2054.     new npc_blazing_broodmother();
  2055.     new npc_molten_egg();
  2056.     new npc_voracious_hatchling();
  2057.     new spell_hatchling_debuff();
  2058.     new npc_blazing_talon_clawshaper();
  2059.     new npc_blazing_talon();
  2060.     new npc_brushfire();
  2061.     new spell_fieroblast();
  2062.     new npc_fiery_tornado();
  2063. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement