Small cleanup in boss Ouro script.
[scriptdev2-git.git] / scripts / eastern_kingdoms / zulgurub / boss_gahzranka.cpp
blob4fe633a8ad88854f69d994b1036c5bc5ce0add65
1 /* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 /* ScriptData
18 SDName: Boss_Gahz'ranka
19 SD%Complete: 85
20 SDComment: Massive Geyser with knockback not working. Spell buggy.
21 SDCategory: Zul'Gurub
22 EndScriptData */
24 #include "precompiled.h"
26 #define SPELL_FROSTBREATH 16099
27 #define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
28 #define SPELL_SLAM 24326
30 struct MANGOS_DLL_DECL boss_gahzrankaAI : public ScriptedAI
32 boss_gahzrankaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
33 uint32 Frostbreath_Timer;
34 uint32 MassiveGeyser_Timer;
35 uint32 Slam_Timer;
37 void Reset()
39 Frostbreath_Timer = 8000;
40 MassiveGeyser_Timer = 25000;
41 Slam_Timer = 17000;
44 void UpdateAI(const uint32 diff)
46 //Return since we have no target
47 if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
48 return;
50 //Frostbreath_Timer
51 if (Frostbreath_Timer < diff)
53 DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBREATH);
54 Frostbreath_Timer = urand(7000, 11000);
55 }else Frostbreath_Timer -= diff;
57 //MassiveGeyser_Timer
58 if (MassiveGeyser_Timer < diff)
60 DoCastSpellIfCan(m_creature->getVictim(),SPELL_MASSIVEGEYSER);
61 DoResetThreat();
63 MassiveGeyser_Timer = urand(22000, 32000);
64 }else MassiveGeyser_Timer -= diff;
66 //Slam_Timer
67 if (Slam_Timer < diff)
69 DoCastSpellIfCan(m_creature->getVictim(),SPELL_SLAM);
70 Slam_Timer = urand(12000, 20000);
71 }else Slam_Timer -= diff;
73 DoMeleeAttackIfReady();
76 CreatureAI* GetAI_boss_gahzranka(Creature* pCreature)
78 return new boss_gahzrankaAI(pCreature);
81 void AddSC_boss_gahzranka()
83 Script *newscript;
84 newscript = new Script;
85 newscript->Name = "boss_gahzranka";
86 newscript->GetAI = &GetAI_boss_gahzranka;
87 newscript->RegisterSelf();