2009-02-17 18:08:26 +01:00
|
|
|
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
2008-10-21 13:19:26 -05:00
|
|
|
* 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 2 of the License, or
|
|
|
|
|
* (at your option) 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, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*/
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
/* ScriptData
|
|
|
|
|
SDName: Emeriss
|
|
|
|
|
SD%Complete: 90
|
|
|
|
|
SDComment: Teleport function & Mark of Nature missing
|
|
|
|
|
SDCategory: Bosses
|
|
|
|
|
EndScriptData */
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-01-19 11:36:05 +01:00
|
|
|
#include "ScriptedPch.h"
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-10-17 07:42:48 -07:00
|
|
|
enum eEnums
|
2009-08-14 15:58:37 +02:00
|
|
|
{
|
|
|
|
|
SAY_AGGRO = -1000401,
|
2009-09-10 16:25:19 +02:00
|
|
|
SAY_CASTCORRUPTION = -1000402, //signed for 6182
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-14 15:58:37 +02:00
|
|
|
SPELL_SLEEP = 24777,
|
|
|
|
|
SPELL_NOXIOUSBREATH = 24818,
|
|
|
|
|
SPELL_TAILSWEEP = 15847,
|
|
|
|
|
//SPELL_MARKOFNATURE = 25040, // Not working
|
|
|
|
|
SPELL_VOLATILEINFECTION = 24928,
|
|
|
|
|
SPELL_CORRUPTIONOFEARTH = 24910
|
|
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-02-05 00:31:28 +01:00
|
|
|
struct boss_emerissAI : public ScriptedAI
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
2009-03-31 18:12:49 -06:00
|
|
|
boss_emerissAI(Creature *c) : ScriptedAI(c) {}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-14 15:58:37 +02:00
|
|
|
uint32 m_uiSleep_Timer;
|
|
|
|
|
uint32 m_uiNoxiousBreath_Timer;
|
|
|
|
|
uint32 m_uiTailSweep_Timer;
|
|
|
|
|
//uint32 m_uiMarkOfNature_Timer;
|
|
|
|
|
uint32 m_uiVolatileInfection_Timer;
|
|
|
|
|
uint32 m_uiCorruptionsCasted;
|
|
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
void Reset()
|
|
|
|
|
{
|
2009-08-14 15:58:37 +02:00
|
|
|
m_uiSleep_Timer = 15000 + rand()%5000;
|
|
|
|
|
m_uiNoxiousBreath_Timer = 8000;
|
|
|
|
|
m_uiTailSweep_Timer = 4000;
|
|
|
|
|
//m_uiMarkOfNature_Timer = 45000;
|
|
|
|
|
m_uiVolatileInfection_Timer = 12000;
|
|
|
|
|
m_uiCorruptionsCasted = 0;
|
2008-10-21 13:19:26 -05:00
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-14 15:58:37 +02:00
|
|
|
void Aggro(Unit* pWho)
|
|
|
|
|
{
|
|
|
|
|
DoScriptText(SAY_AGGRO, m_creature);
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-14 15:58:37 +02:00
|
|
|
void UpdateAI(const uint32 uiDiff)
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
|
|
|
|
//Return since we have no target
|
2009-01-30 18:10:05 -06:00
|
|
|
if (!UpdateVictim())
|
2008-10-21 13:19:26 -05:00
|
|
|
return;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
//Sleep_Timer
|
2009-10-27 21:28:20 -07:00
|
|
|
if (m_uiSleep_Timer <= uiDiff)
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
2009-08-14 15:58:37 +02:00
|
|
|
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
|
|
|
|
DoCast(pTarget, SPELL_SLEEP);
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-14 15:58:37 +02:00
|
|
|
m_uiSleep_Timer = 8000 + rand()%8000;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
m_uiSleep_Timer -= uiDiff;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
//NoxiousBreath_Timer
|
2009-10-27 21:28:20 -07:00
|
|
|
if (m_uiNoxiousBreath_Timer <= uiDiff)
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
2009-08-14 15:58:37 +02:00
|
|
|
DoCast(m_creature->getVictim(), SPELL_NOXIOUSBREATH);
|
|
|
|
|
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
m_uiNoxiousBreath_Timer -= uiDiff;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
//Tailsweep every 2 seconds
|
2009-10-27 21:28:20 -07:00
|
|
|
if (m_uiTailSweep_Timer <= uiDiff)
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
2009-08-14 15:58:37 +02:00
|
|
|
DoCast(m_creature, SPELL_TAILSWEEP);
|
|
|
|
|
m_uiTailSweep_Timer = 2000;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
m_uiTailSweep_Timer -= uiDiff;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
//MarkOfNature_Timer
|
2009-10-27 21:28:20 -07:00
|
|
|
//if (m_uiMarkOfNature_Timer <= uiDiff)
|
2008-10-21 13:19:26 -05:00
|
|
|
//{
|
2009-08-14 15:58:37 +02:00
|
|
|
// DoCast(m_creature->getVictim(), SPELL_MARKOFNATURE);
|
|
|
|
|
// m_uiMarkOfNature_Timer = 45000;
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
// m_uiMarkOfNature_Timer -= uiDiff;
|
2008-10-21 13:19:26 -05:00
|
|
|
|
2009-08-14 15:58:37 +02:00
|
|
|
//VolatileInfection_Timer
|
2009-10-27 21:28:20 -07:00
|
|
|
if (m_uiVolatileInfection_Timer <= uiDiff)
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
2009-08-14 15:58:37 +02:00
|
|
|
DoCast(m_creature->getVictim(), SPELL_VOLATILEINFECTION);
|
|
|
|
|
m_uiVolatileInfection_Timer = 7000 + rand()%5000;
|
2008-10-21 13:19:26 -05:00
|
|
|
}
|
2009-08-14 15:58:37 +02:00
|
|
|
else
|
|
|
|
|
m_uiVolatileInfection_Timer -= uiDiff;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
//CorruptionofEarth_Timer
|
2009-08-14 15:58:37 +02:00
|
|
|
//CorruptionofEarth at 75%, 50% and 25%
|
|
|
|
|
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiCorruptionsCasted)))
|
2009-08-23 01:42:57 +02:00
|
|
|
{
|
2009-08-14 15:58:37 +02:00
|
|
|
++m_uiCorruptionsCasted; // prevent casting twice on same hp
|
|
|
|
|
DoScriptText(SAY_CASTCORRUPTION, m_creature);
|
|
|
|
|
DoCast(m_creature->getVictim(), SPELL_CORRUPTIONOFEARTH);
|
2008-10-21 13:19:26 -05:00
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
DoMeleeAttackIfReady();
|
|
|
|
|
}
|
|
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-14 00:39:07 +02:00
|
|
|
CreatureAI* GetAI_boss_emeriss(Creature* pCreature)
|
2008-10-21 13:19:26 -05:00
|
|
|
{
|
2009-08-14 00:39:07 +02:00
|
|
|
return new boss_emerissAI (pCreature);
|
2008-10-21 13:19:26 -05:00
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
void AddSC_boss_emeriss()
|
|
|
|
|
{
|
|
|
|
|
Script *newscript;
|
|
|
|
|
newscript = new Script;
|
2009-10-17 04:23:24 -07:00
|
|
|
newscript->Name = "boss_emeriss";
|
2008-12-22 23:11:25 +01:00
|
|
|
newscript->GetAI = &GetAI_boss_emeriss;
|
2008-11-20 16:16:57 -06:00
|
|
|
newscript->RegisterSelf();
|
2008-10-21 13:19:26 -05:00
|
|
|
}
|
2009-02-17 20:07:49 -06:00
|
|
|
|