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
24 #include "precompiled.h"
27 #define SPELL_AVARTAR 24646 //The Enrage Spell
28 #define SPELL_GROUNDTREMOR 6524
30 struct MANGOS_DLL_DECL boss_grilekAI
: public ScriptedAI
32 boss_grilekAI(Creature
* pCreature
) : ScriptedAI(pCreature
) {Reset();}
35 uint32 GroundTremor_Timer
;
39 Avartar_Timer
= urand(15000, 25000);
40 GroundTremor_Timer
= urand(8000, 16000);
43 void UpdateAI(const uint32 diff
)
45 //Return since we have no target
46 if (!m_creature
->SelectHostileTarget() || !m_creature
->getVictim())
50 if (Avartar_Timer
< diff
)
53 DoCastSpellIfCan(m_creature
, SPELL_AVARTAR
);
56 target
= SelectUnit(SELECT_TARGET_RANDOM
,1);
58 if (m_creature
->getThreatManager().getThreat(m_creature
->getVictim()))
59 m_creature
->getThreatManager().modifyThreatPercent(m_creature
->getVictim(),-50);
63 Avartar_Timer
= urand(25000, 35000);
64 }else Avartar_Timer
-= diff
;
67 if (GroundTremor_Timer
< diff
)
69 DoCastSpellIfCan(m_creature
->getVictim(), SPELL_GROUNDTREMOR
);
70 GroundTremor_Timer
= urand(12000, 16000);
71 }else GroundTremor_Timer
-= diff
;
73 DoMeleeAttackIfReady();
76 CreatureAI
* GetAI_boss_grilek(Creature
* pCreature
)
78 return new boss_grilekAI(pCreature
);
81 void AddSC_boss_grilek()
84 newscript
= new Script
;
85 newscript
->Name
= "boss_grilek";
86 newscript
->GetAI
= &GetAI_boss_grilek
;
87 newscript
->RegisterSelf();