*Add some AI to the Living Mojo's around Drakkari Colossus boss, by manuel, and do some cleanup
--HG-- branch : trunk
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Script Data Start
|
||||
SDName: Boss Drakkari Colossus
|
||||
SDAuthor: Manuel
|
||||
@@ -19,13 +37,19 @@ enum Spells
|
||||
SPELL_MERGE = 54878,
|
||||
SPELL_SURGE = 54801,
|
||||
|
||||
SPELL_FREEZE_ANIM = 16245
|
||||
SPELL_FREEZE_ANIM = 16245,
|
||||
|
||||
SPELL_MOJO_PUDDLE = 55627,
|
||||
H_SPELL_MOJO_PUDDLE = 58994,
|
||||
|
||||
SPELL_MOJO_WAVE = 55626,
|
||||
H_SPELL_MOJO_WAVE = 58993
|
||||
};
|
||||
|
||||
enum Entrys
|
||||
enum Entries
|
||||
{
|
||||
DRAKKARI_COLOSSUS = 29307,
|
||||
DRAKKARI_ELEMENTAL = 29573
|
||||
//DRAKKARI_ELEMENTAL = 29573
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI
|
||||
@@ -47,7 +71,6 @@ struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DRAKKARI_COLOSSUS_EVENT, NOT_STARTED);
|
||||
|
||||
|
||||
m_creature->clearUnitState(UNIT_STAT_STUNNED);
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
|
||||
@@ -68,6 +91,7 @@ struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI
|
||||
m_creature->addUnitState(UNIT_STAT_STUNNED);
|
||||
m_creature->CastSpell(m_creature,SPELL_EMERGE,false);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
@@ -102,10 +126,8 @@ struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI
|
||||
} else MightyBlowTimer -= diff;
|
||||
|
||||
if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
@@ -178,7 +200,6 @@ struct TRINITY_DLL_DECL boss_drakkari_elementalAI : public ScriptedAI
|
||||
if(m_creature->GetVisibility() == VISIBILITY_ON)
|
||||
{
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
m_creature->CastSpell(target,SPELL_SURGE,false);
|
||||
}
|
||||
|
||||
@@ -195,10 +216,8 @@ struct TRINITY_DLL_DECL boss_drakkari_elementalAI : public ScriptedAI
|
||||
|
||||
//prevent do melee if is invisible
|
||||
if(m_creature->GetVisibility() == VISIBILITY_ON)
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
@@ -208,17 +227,27 @@ struct TRINITY_DLL_DECL boss_drakkari_elementalAI : public ScriptedAI
|
||||
|
||||
struct TRINITY_DLL_DECL npc_living_mojoAI : public ScriptedAI
|
||||
{
|
||||
npc_living_mojoAI(Creature *c) : ScriptedAI(c) {}
|
||||
npc_living_mojoAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
}
|
||||
|
||||
bool HeroicMode;
|
||||
|
||||
uint32 MojoWaveTimer;
|
||||
uint32 MojoPuddleTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
//Check if the npc is near of Drakkari Colossus.
|
||||
if (m_creature->IsInRange3d(1672.959,743.487,143.337,0.0f,17.0f))
|
||||
{
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
|
||||
}else
|
||||
|
||||
else
|
||||
{
|
||||
m_creature->SetReactState(REACT_AGGRESSIVE);
|
||||
MojoWaveTimer = 2000;
|
||||
MojoPuddleTimer = 7000;
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* pDone_by, uint32& uiDamage)
|
||||
@@ -230,8 +259,8 @@ struct TRINITY_DLL_DECL npc_living_mojoAI : public ScriptedAI
|
||||
Colossus->RemoveAura(SPELL_FREEZE_ANIM);
|
||||
Colossus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
Colossus->SetReactState(REACT_AGGRESSIVE);
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +270,18 @@ struct TRINITY_DLL_DECL npc_living_mojoAI : public ScriptedAI
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (MojoWaveTimer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_MOJO_WAVE : SPELL_MOJO_WAVE);
|
||||
MojoWaveTimer = 15000;
|
||||
} else MojoWaveTimer -= diff;
|
||||
|
||||
if (MojoPuddleTimer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_MOJO_PUDDLE : SPELL_MOJO_PUDDLE);
|
||||
MojoPuddleTimer = 18000;
|
||||
} else MojoPuddleTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user