/*
* Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
* Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
* Copyright (C) 2007-2008 Moon++ Team <http://www.moonplusplus.info/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "StdAfx.h"
//Tehdark Custom Mob by Sybil
//DisplayID is 15613
#define CN_TEHDARK ???
#define SPELL_CORRUPTION 47813
#define SPELL_SHADOWFURY 47847
#define SPELL_CHAOSBOLT 71108
#define SPELL_SHADOWBOLT 69387
#define SPELL_AOEFEAR 65543
#define SPELL_FEAR 65809
class TehdarkAI : public MoonScriptBossAI
{
SpellDesc* Shadowfury;
MOONSCRIPT_FACTORY_FUNCTION(TehdarkAI, MoonScriptBossAI)
TehdarkAI(Creature *pCreature) : MoonScriptBossAI(pCreature)
{
AddPhaseMaskSpell(0x2 | 0x4, AddSpell2(SPELL_CORRUPTION, Target_RandomPlayer, 5000, 3000));
Shadowfury = AddPhaseSpell(1, AddSpell2(SPELL_SHADOWFURY, Target_Self)
AddPhaseSpell(3, AddSpell2(SPELL_CHAOSBOLT, Target_Current, 7200, 1000));
AddPhaseSpell(2, AddSpell2(SPELL_SHADOWBOLT, Target Current, 7200, 1000));
AddPhaseMaskSpell(0x2 | 0x4, AddSpell2(SPELL_FEAR, Target_RandomPlayerNotCurrent, 20000, 500));
AddSpell(SPELL_AOEFEAR, Target_Self);
_unit->AddProcTriggerSpell(0, 0, SPELL_AOEFEAR, PROC_ON_PHYSICAL_ATTACK, 35.f NULL);
}
void OnCombatStart(Unit *pAttacker)
{
ApplyAura(SPELL_AOEFEAR);
}
void AIUpdate()
{
if(GetHealthPercent() <=50)
{
SetPhase(3);
}
if(GetPhase() == 1 && GetHealthPercent() <=99)
{
CastSpellNowNoScheduling(Shadowfury);
SetPhase(2);
}
ParentClass::AIUpdate();
}
};
void SetupMaraudon(ScriptMgr * mgr)
{
mgr->register_creature_script(CN_TEHDARK, &TehdarkAI::Create);
}