mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Take back changes in SSC.
Merge [SD2] r1037 Correcting some details for shaffar and simplify code. Let movement expire when using blink ability. Fix some possible issues with summoned beacons. --HG-- branch : trunk
This commit is contained in:
@@ -28,35 +28,34 @@ EndContentData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#define SAY_INTRO -1557000
|
||||
enum
|
||||
{
|
||||
SAY_INTRO = -1557000,
|
||||
SAY_AGGRO_1 = -1557001,
|
||||
SAY_AGGRO_2 = -1557002,
|
||||
SAY_AGGRO_3 = -1557003,
|
||||
SAY_SLAY_1 = -1557004,
|
||||
SAY_SLAY_2 = -1557005,
|
||||
SAY_SUMMON = -1557006,
|
||||
SAY_DEAD = -1557007,
|
||||
|
||||
#define SAY_AGGRO_1 -1557001
|
||||
#define SAY_AGGRO_2 -1557002
|
||||
#define SAY_AGGRO_3 -1557003
|
||||
SPELL_BLINK = 34605,
|
||||
SPELL_FROSTBOLT = 32364,
|
||||
SPELL_FIREBALL = 32363,
|
||||
SPELL_FROSTNOVA = 32365,
|
||||
|
||||
#define SAY_SLAY_1 -1557004
|
||||
#define SAY_SLAY_2 -1557005
|
||||
SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON
|
||||
SPELL_ETHEREAL_BEACON_VISUAL = 32368,
|
||||
|
||||
NPC_BEACON = 18431,
|
||||
NPC_SHAFFAR = 18344,
|
||||
|
||||
#define SAY_SUMMON -1557006
|
||||
|
||||
#define SAY_DEAD -1557007
|
||||
|
||||
#define SPELL_BLINK 34605
|
||||
#define SPELL_FROSTBOLT 32370
|
||||
#define SPELL_FIREBALL 20420
|
||||
#define SPELL_FROSTNOVA 32365
|
||||
|
||||
#define SPELL_ETHEREAL_BEACON 32371 // Summon 18431
|
||||
#define SPELL_ETHEREAL_BEACON_VISUAL 32368
|
||||
|
||||
#define ENTRY_BEACON 18431
|
||||
#define ENTRY_SHAFFAR 18344
|
||||
|
||||
#define NR_INITIAL_BEACONS 3
|
||||
NR_INITIAL_BEACONS = 3
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
{
|
||||
boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c) {}
|
||||
boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c) { HasTaunted = false; }
|
||||
|
||||
uint32 Blink_Timer;
|
||||
uint32 Beacon_Timer;
|
||||
@@ -84,7 +83,6 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
Frostbolt_Timer = 4000;
|
||||
FrostNova_Timer = 15000;
|
||||
|
||||
HasTaunted = false;
|
||||
CanBlink = false;
|
||||
|
||||
float dist = 8.0f;
|
||||
@@ -120,23 +118,10 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f))
|
||||
{
|
||||
if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) )
|
||||
{
|
||||
DoScriptText(SAY_INTRO, m_creature);
|
||||
HasTaunted = true;
|
||||
}
|
||||
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
||||
{
|
||||
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(who);
|
||||
}
|
||||
DoScriptText(SAY_INTRO, m_creature);
|
||||
HasTaunted = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +199,11 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
if( m_creature->IsNonMeleeSpellCasted(false) )
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
|
||||
//expire movement, will prevent from running right back to victim after cast
|
||||
//(but should MoveChase be used again at a certain time or should he not move?)
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
m_creature->GetMotionMaster()->MovementExpired();
|
||||
|
||||
DoCast(m_creature,SPELL_BLINK);
|
||||
Blink_Timer = 1000 + rand()%1500;
|
||||
CanBlink = false;
|
||||
@@ -228,7 +218,7 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
if( !urand(0,3) )
|
||||
DoScriptText(SAY_SUMMON, m_creature);
|
||||
|
||||
DoCast(m_creature,SPELL_ETHEREAL_BEACON);
|
||||
DoCast(m_creature,SPELL_ETHEREAL_BEACON, true);
|
||||
|
||||
Beacon_Timer = 10000;
|
||||
}else Beacon_Timer -= diff;
|
||||
@@ -242,8 +232,11 @@ CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
|
||||
return new boss_nexusprince_shaffarAI (_Creature);
|
||||
}
|
||||
|
||||
#define SPELL_ARCANE_BOLT 15254
|
||||
#define SPELL_ETHEREAL_APPRENTICE 32372 // Summon 18430
|
||||
enum
|
||||
{
|
||||
SPELL_ARCANE_BOLT = 15254,
|
||||
SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
{
|
||||
@@ -272,7 +265,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
// Send Shaffar to fight
|
||||
Unit* Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
Unit* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
|
||||
if(!Shaffar || Shaffar->isDead())
|
||||
{
|
||||
KillSelf();
|
||||
@@ -289,7 +282,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
Unit *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
|
||||
if(Shaffar)
|
||||
CAST_AI(boss_nexusprince_shaffarAI, (CAST_CRE(Shaffar)->AI()))->RemoveBeaconFromList(m_creature);
|
||||
}
|
||||
@@ -301,7 +294,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
|
||||
if(Check_Timer < diff)
|
||||
{
|
||||
Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
Unit *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
|
||||
if(!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat())
|
||||
{
|
||||
KillSelf();
|
||||
@@ -333,8 +326,11 @@ CreatureAI* GetAI_mob_ethereal_beacon(Creature *_Creature)
|
||||
return new mob_ethereal_beaconAI (_Creature);
|
||||
}
|
||||
|
||||
#define SPELL_ETHEREAL_APPRENTICE_FIREBOLT 32369
|
||||
#define SPELL_ETHEREAL_APPRENTICE_FROSTBOLT 32370
|
||||
enum
|
||||
{
|
||||
SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369,
|
||||
SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI
|
||||
{
|
||||
|
||||
@@ -642,6 +642,8 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
|
||||
if (TidalSurge_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE);
|
||||
// Hacky way to do it - won't trigger elseways
|
||||
m_creature->getVictim()->CastSpell( m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true );
|
||||
TidalSurge_Timer = 15000+rand()%5000;
|
||||
}else TidalSurge_Timer -= diff;
|
||||
|
||||
|
||||
@@ -6,316 +6,381 @@
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Hydross_The_Unstable
|
||||
SD%Complete: 90
|
||||
SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. code cleanup needed
|
||||
SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location.
|
||||
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_serpent_shrine.h"
|
||||
|
||||
enum
|
||||
{
|
||||
SAY_AGGRO = -1548000,
|
||||
SAY_SWITCH_TO_CLEAN = -1548001,
|
||||
SAY_CLEAN_SLAY1 = -1548002,
|
||||
SAY_CLEAN_SLAY2 = -1548003,
|
||||
SAY_CLEAN_DEATH = -1548004,
|
||||
SAY_SWITCH_TO_CORRUPT = -1548005,
|
||||
SAY_CORRUPT_SLAY1 = -1548006,
|
||||
SAY_CORRUPT_SLAY2 = -1548007,
|
||||
SAY_CORRUPT_DEATH = -1548008,
|
||||
#define SAY_AGGRO -1548000
|
||||
#define SAY_SWITCH_TO_CLEAN -1548001
|
||||
#define SAY_CLEAN_SLAY1 -1548002
|
||||
#define SAY_CLEAN_SLAY2 -1548003
|
||||
#define SAY_CLEAN_DEATH -1548004
|
||||
#define SAY_SWITCH_TO_CORRUPT -1548005
|
||||
#define SAY_CORRUPT_SLAY1 -1548006
|
||||
#define SAY_CORRUPT_SLAY2 -1548007
|
||||
#define SAY_CORRUPT_DEATH -1548008
|
||||
|
||||
SWITCH_RADIUS = 18,
|
||||
#define SWITCH_RADIUS 18
|
||||
|
||||
MODEL_CORRUPT = 20609,
|
||||
MODEL_CLEAN = 20162,
|
||||
#define MODEL_CORRUPT 20609
|
||||
#define MODEL_CLEAN 20162
|
||||
|
||||
SPELL_WATER_TOMB = 38235,
|
||||
SPELL_MARK_OF_HYDROSS1 = 38215,
|
||||
SPELL_MARK_OF_HYDROSS2 = 38216,
|
||||
SPELL_MARK_OF_HYDROSS3 = 38217,
|
||||
SPELL_MARK_OF_HYDROSS4 = 38218,
|
||||
SPELL_MARK_OF_HYDROSS5 = 38231,
|
||||
SPELL_MARK_OF_HYDROSS6 = 40584,
|
||||
SPELL_MARK_OF_CORRUPTION1 = 38219,
|
||||
SPELL_MARK_OF_CORRUPTION2 = 38220,
|
||||
SPELL_MARK_OF_CORRUPTION3 = 38221,
|
||||
SPELL_MARK_OF_CORRUPTION4 = 38222,
|
||||
SPELL_MARK_OF_CORRUPTION5 = 38230,
|
||||
SPELL_MARK_OF_CORRUPTION6 = 40583,
|
||||
SPELL_VILE_SLUDGE = 38246,
|
||||
SPELL_ENRAGE = 27680, //this spell need verification
|
||||
SPELL_SUMMON_WATER_ELEMENT = 36459, //not in use yet(in use ever?)
|
||||
SPELL_ELEMENTAL_SPAWNIN = 25035,
|
||||
SPELL_BLUE_BEAM = 38015, //channeled Hydross Beam Helper (not in use yet)
|
||||
#define SPELL_WATER_TOMB 38235
|
||||
#define SPELL_MARK_OF_HYDROSS1 38215
|
||||
#define SPELL_MARK_OF_HYDROSS2 38216
|
||||
#define SPELL_MARK_OF_HYDROSS3 38217
|
||||
#define SPELL_MARK_OF_HYDROSS4 38218
|
||||
#define SPELL_MARK_OF_HYDROSS5 38231
|
||||
#define SPELL_MARK_OF_HYDROSS6 40584
|
||||
#define SPELL_MARK_OF_CORRUPTION1 38219
|
||||
#define SPELL_MARK_OF_CORRUPTION2 38220
|
||||
#define SPELL_MARK_OF_CORRUPTION3 38221
|
||||
#define SPELL_MARK_OF_CORRUPTION4 38222
|
||||
#define SPELL_MARK_OF_CORRUPTION5 38230
|
||||
#define SPELL_MARK_OF_CORRUPTION6 40583
|
||||
#define SPELL_VILE_SLUDGE 38246
|
||||
#define SPELL_ENRAGE 27680 //this spell need verification
|
||||
#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?)
|
||||
#define SPELL_ELEMENTAL_SPAWNIN 25035
|
||||
#define SPELL_BLUE_BEAM /*40227*/40227 //channeled Hydross Beam Helper (not in use yet)
|
||||
|
||||
NPC_PURE_SPAWN = 22035,
|
||||
NPC_TAINTED_SPAWN = 22036
|
||||
};
|
||||
#define ENTRY_PURE_SPAWN 22035
|
||||
#define ENTRY_TAINTED_SPAWN 22036
|
||||
#define ENTRY_BEAM_DUMMY 21934
|
||||
|
||||
const float afSpawnDiffs[4][2] =
|
||||
{
|
||||
{6.934003f , -11.255012f}, // diff 1
|
||||
{-6.934003f , 11.255012f }, // diff 2
|
||||
{-12.577011f, -4.72702f }, // diff 3
|
||||
{12.577011f , 4.72702f } // diff 4
|
||||
};
|
||||
#define HYDROSS_X -239.439
|
||||
#define HYDROSS_Y -363.481
|
||||
|
||||
#define SPAWN_X_DIFF1 6.934003
|
||||
#define SPAWN_Y_DIFF1 -11.255012
|
||||
#define SPAWN_X_DIFF2 -6.934003
|
||||
#define SPAWN_Y_DIFF2 11.255012
|
||||
#define SPAWN_X_DIFF3 -12.577011
|
||||
#define SPAWN_Y_DIFF3 -4.72702
|
||||
#define SPAWN_X_DIFF4 12.577011
|
||||
#define SPAWN_Y_DIFF4 4.72702
|
||||
|
||||
struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
|
||||
{
|
||||
boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c)
|
||||
boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
|
||||
{
|
||||
m_pInstance = c->GetInstanceData();
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance; // the instance
|
||||
|
||||
uint32 m_uiPosCheck_Timer;
|
||||
uint32 m_uiMarkOfHydross_Timer;
|
||||
uint32 m_uiMarkOfCorruption_Timer;
|
||||
uint32 m_uiWaterTomb_Timer;
|
||||
uint32 m_uiVileSludge_Timer;
|
||||
uint32 m_uiMarkOfHydross_Count;
|
||||
uint32 m_uiMarkOfCorruption_Count;
|
||||
uint32 m_uiEnrageTimer;
|
||||
bool m_bCorruptedForm;
|
||||
ScriptedInstance* pInstance;
|
||||
uint64 beams[2];
|
||||
uint32 PosCheck_Timer;
|
||||
uint32 MarkOfHydross_Timer;
|
||||
uint32 MarkOfCorruption_Timer;
|
||||
uint32 WaterTomb_Timer;
|
||||
uint32 VileSludge_Timer;
|
||||
uint32 MarkOfHydross_Count;
|
||||
uint32 MarkOfCorruption_Count;
|
||||
uint32 EnrageTimer;
|
||||
bool CorruptedForm;
|
||||
bool beam;
|
||||
SummonList Summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiPosCheck_Timer = 2500;
|
||||
m_uiMarkOfHydross_Timer = 15000;
|
||||
m_uiMarkOfCorruption_Timer = 15000;
|
||||
m_uiWaterTomb_Timer = 7000;
|
||||
m_uiVileSludge_Timer = 7000;
|
||||
m_uiMarkOfHydross_Count = 0;
|
||||
m_uiMarkOfCorruption_Count = 0;
|
||||
m_uiEnrageTimer = 600000;
|
||||
|
||||
m_bCorruptedForm = false;
|
||||
DeSummonBeams();
|
||||
beams[0] = 0;
|
||||
beams[1] = 0;
|
||||
PosCheck_Timer = 2500;
|
||||
MarkOfHydross_Timer = 15000;
|
||||
MarkOfCorruption_Timer = 15000;
|
||||
WaterTomb_Timer = 7000;
|
||||
VileSludge_Timer = 7000;
|
||||
MarkOfHydross_Count = 0;
|
||||
MarkOfCorruption_Count = 0;
|
||||
EnrageTimer = 600000;
|
||||
|
||||
CorruptedForm = false;
|
||||
m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
|
||||
|
||||
m_creature->SetDisplayId(MODEL_CLEAN);
|
||||
m_creature->SetDisplayId( MODEL_CLEAN);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
|
||||
beam = false;
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
void SummonBeams()
|
||||
{
|
||||
Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
|
||||
if(beamer)
|
||||
{
|
||||
beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true);
|
||||
beamer->SetDisplayId(11686); //invisible
|
||||
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
beams[0]=beamer->GetGUID();
|
||||
}
|
||||
beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
|
||||
if(beamer)
|
||||
{
|
||||
beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true);
|
||||
beamer->SetDisplayId(11686); //invisible
|
||||
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
beams[1]=beamer->GetGUID();
|
||||
}
|
||||
}
|
||||
void DeSummonBeams()
|
||||
{
|
||||
for(uint8 i=0;i<2;i++)
|
||||
{
|
||||
Creature* mob = Unit::GetCreature(*m_creature,beams[i]);
|
||||
if(mob)
|
||||
{
|
||||
mob->setDeathState(DEAD);
|
||||
mob->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
}
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* pVictim)
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (m_bCorruptedForm)
|
||||
DoScriptText(urand(0,1) ? SAY_CORRUPT_SLAY1 : SAY_CORRUPT_SLAY2, m_creature);
|
||||
if (CorruptedForm)
|
||||
{
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_CORRUPT_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_CORRUPT_SLAY2, m_creature); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
DoScriptText(urand(0,1) ? SAY_CLEAN_SLAY1 : SAY_CLEAN_SLAY2, m_creature);
|
||||
{
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_CLEAN_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_CLEAN_SLAY2, m_creature); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
if (pSummoned->GetEntry() == NPC_PURE_SPAWN)
|
||||
pSummoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
|
||||
else if (pSummoned->GetEntry() == NPC_TAINTED_SPAWN)
|
||||
pSummoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
|
||||
pSummoned->CastSpell(pSummoned, SPELL_ELEMENTAL_SPAWNIN, true);
|
||||
if (summoned->GetEntry() == ENTRY_PURE_SPAWN)
|
||||
{
|
||||
summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
|
||||
summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
|
||||
Summons.Summon(summoned);
|
||||
}
|
||||
if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN)
|
||||
{
|
||||
summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true);
|
||||
Summons.Summon(summoned);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* pVictim)
|
||||
void SummonedCreatureDespawn(Creature *summon)
|
||||
{
|
||||
DoScriptText(m_bCorruptedForm ? SAY_CORRUPT_DEATH : SAY_CLEAN_DEATH, m_creature);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
|
||||
Summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
for(uint8 i = 0; i < 4; ++i)
|
||||
DoSpawnCreature(m_bCorruptedForm ? NPC_TAINTED_SPAWN : NPC_PURE_SPAWN,
|
||||
afSpawnDiffs[i][0], afSpawnDiffs[i][1], 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (CorruptedForm)
|
||||
DoScriptText(SAY_CORRUPT_DEATH, m_creature);
|
||||
else
|
||||
DoScriptText(SAY_CLEAN_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!beam)
|
||||
{
|
||||
SummonBeams();
|
||||
beam=true;
|
||||
}
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
// corrupted form
|
||||
if (m_bCorruptedForm)
|
||||
if (CorruptedForm)
|
||||
{
|
||||
//MarkOfCorruption_Timer
|
||||
if (m_uiMarkOfCorruption_Timer < uiDiff)
|
||||
if (MarkOfCorruption_Timer < diff)
|
||||
{
|
||||
if (m_uiMarkOfCorruption_Count <= 5)
|
||||
if (MarkOfCorruption_Count <= 5)
|
||||
{
|
||||
uint32 uiMarkSpell = 0;
|
||||
uint32 mark_spell;
|
||||
|
||||
switch(m_uiMarkOfCorruption_Count)
|
||||
switch(MarkOfCorruption_Count)
|
||||
{
|
||||
case 0: uiMarkSpell = SPELL_MARK_OF_CORRUPTION1; break;
|
||||
case 1: uiMarkSpell = SPELL_MARK_OF_CORRUPTION2; break;
|
||||
case 2: uiMarkSpell = SPELL_MARK_OF_CORRUPTION3; break;
|
||||
case 3: uiMarkSpell = SPELL_MARK_OF_CORRUPTION4; break;
|
||||
case 4: uiMarkSpell = SPELL_MARK_OF_CORRUPTION5; break;
|
||||
case 5: uiMarkSpell = SPELL_MARK_OF_CORRUPTION6; break;
|
||||
case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break;
|
||||
case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break;
|
||||
case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break;
|
||||
case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break;
|
||||
case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break;
|
||||
case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break;
|
||||
}
|
||||
|
||||
DoCast(m_creature->getVictim(), uiMarkSpell);
|
||||
DoCast(m_creature->getVictim(), mark_spell);
|
||||
|
||||
if (m_uiMarkOfCorruption_Count < 5)
|
||||
++m_uiMarkOfCorruption_Count;
|
||||
if (MarkOfCorruption_Count < 5)
|
||||
MarkOfCorruption_Count++;
|
||||
}
|
||||
|
||||
m_uiMarkOfCorruption_Timer = 15000;
|
||||
}else m_uiMarkOfCorruption_Timer -= uiDiff;
|
||||
MarkOfCorruption_Timer = 15000;
|
||||
}else MarkOfCorruption_Timer -= diff;
|
||||
|
||||
//VileSludge_Timer
|
||||
if (m_uiVileSludge_Timer < uiDiff)
|
||||
if (VileSludge_Timer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_VILE_SLUDGE);
|
||||
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_VILE_SLUDGE);
|
||||
|
||||
m_uiVileSludge_Timer = 15000;
|
||||
}else m_uiVileSludge_Timer -= uiDiff;
|
||||
VileSludge_Timer = 15000;
|
||||
}else VileSludge_Timer -= diff;
|
||||
|
||||
//PosCheck_Timer
|
||||
if (m_uiPosCheck_Timer < uiDiff)
|
||||
if (PosCheck_Timer < diff)
|
||||
{
|
||||
float fPosX, fPosY, fPosZ, fPosO;
|
||||
m_creature->GetHomePosition(fPosX, fPosY, fPosZ, fPosO);
|
||||
|
||||
if (m_creature->GetDistance2d(fPosX, fPosY) < SWITCH_RADIUS)
|
||||
if (m_creature->GetDistance2d(HYDROSS_X, HYDROSS_Y) < SWITCH_RADIUS)
|
||||
{
|
||||
DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature);
|
||||
|
||||
// switch to clean form
|
||||
m_creature->SetDisplayId(MODEL_CLEAN);
|
||||
m_uiMarkOfHydross_Count = 0;
|
||||
m_creature->SetDisplayId( MODEL_CLEAN);
|
||||
CorruptedForm = false;
|
||||
MarkOfHydross_Count = 0;
|
||||
|
||||
DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature);
|
||||
DoResetThreat();
|
||||
SummonBeams();
|
||||
|
||||
// spawn 4 adds
|
||||
SpawnAdds();
|
||||
DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
|
||||
|
||||
m_bCorruptedForm = false;
|
||||
}
|
||||
|
||||
m_uiPosCheck_Timer = 2500;
|
||||
}else m_uiPosCheck_Timer -=uiDiff;
|
||||
PosCheck_Timer = 2500;
|
||||
}else PosCheck_Timer -=diff;
|
||||
}
|
||||
// clean form
|
||||
else
|
||||
{
|
||||
//MarkOfHydross_Timer
|
||||
if (m_uiMarkOfHydross_Timer < uiDiff)
|
||||
if (MarkOfHydross_Timer < diff)
|
||||
{
|
||||
if (m_uiMarkOfHydross_Count <= 5)
|
||||
if (MarkOfHydross_Count <= 5)
|
||||
{
|
||||
uint32 uiMarkSpell;
|
||||
uint32 mark_spell;
|
||||
|
||||
switch(m_uiMarkOfHydross_Count)
|
||||
switch(MarkOfHydross_Count)
|
||||
{
|
||||
case 0: uiMarkSpell = SPELL_MARK_OF_HYDROSS1; break;
|
||||
case 1: uiMarkSpell = SPELL_MARK_OF_HYDROSS2; break;
|
||||
case 2: uiMarkSpell = SPELL_MARK_OF_HYDROSS3; break;
|
||||
case 3: uiMarkSpell = SPELL_MARK_OF_HYDROSS4; break;
|
||||
case 4: uiMarkSpell = SPELL_MARK_OF_HYDROSS5; break;
|
||||
case 5: uiMarkSpell = SPELL_MARK_OF_HYDROSS6; break;
|
||||
case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break;
|
||||
case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break;
|
||||
case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break;
|
||||
case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break;
|
||||
case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break;
|
||||
case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break;
|
||||
}
|
||||
|
||||
DoCast(m_creature->getVictim(), uiMarkSpell);
|
||||
DoCast(m_creature->getVictim(), mark_spell);
|
||||
|
||||
if (m_uiMarkOfHydross_Count < 5)
|
||||
++m_uiMarkOfHydross_Count;
|
||||
if (MarkOfHydross_Count < 5)
|
||||
MarkOfHydross_Count++;
|
||||
}
|
||||
|
||||
m_uiMarkOfHydross_Timer = 15000;
|
||||
}else m_uiMarkOfHydross_Timer -= uiDiff;
|
||||
MarkOfHydross_Timer = 15000;
|
||||
}else MarkOfHydross_Timer -= diff;
|
||||
|
||||
//WaterTomb_Timer
|
||||
if (m_uiWaterTomb_Timer < uiDiff)
|
||||
if (WaterTomb_Timer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_WATER_TOMB);
|
||||
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_WATER_TOMB);
|
||||
|
||||
m_uiWaterTomb_Timer = 7000;
|
||||
}else m_uiWaterTomb_Timer -= uiDiff;
|
||||
WaterTomb_Timer = 7000;
|
||||
}else WaterTomb_Timer -= diff;
|
||||
|
||||
//PosCheck_Timer
|
||||
if (m_uiPosCheck_Timer < uiDiff)
|
||||
if (PosCheck_Timer < diff)
|
||||
{
|
||||
float fPosX, fPosY, fPosZ, fPosO;
|
||||
m_creature->GetHomePosition(fPosX, fPosY, fPosZ, fPosO);
|
||||
|
||||
if (m_creature->GetDistance2d(fPosX, fPosY) >= SWITCH_RADIUS)
|
||||
if (m_creature->GetDistance2d(HYDROSS_X, HYDROSS_Y) >= SWITCH_RADIUS)
|
||||
{
|
||||
DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature);
|
||||
|
||||
// switch to corrupted form
|
||||
m_creature->SetDisplayId(MODEL_CORRUPT);
|
||||
m_uiMarkOfCorruption_Count = 0;
|
||||
m_creature->SetDisplayId( MODEL_CORRUPT);
|
||||
MarkOfCorruption_Count = 0;
|
||||
CorruptedForm = true;
|
||||
|
||||
DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature);
|
||||
DoResetThreat();
|
||||
DeSummonBeams();
|
||||
|
||||
// spawn 4 adds
|
||||
SpawnAdds();
|
||||
DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
|
||||
|
||||
m_bCorruptedForm = true;
|
||||
}
|
||||
|
||||
m_uiPosCheck_Timer = 2500;
|
||||
}else m_uiPosCheck_Timer -=uiDiff;
|
||||
PosCheck_Timer = 2500;
|
||||
}else PosCheck_Timer -=diff;
|
||||
}
|
||||
|
||||
//EnrageTimer
|
||||
if (m_uiEnrageTimer < uiDiff)
|
||||
if (EnrageTimer < diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ENRAGE);
|
||||
m_uiEnrageTimer = 60000;
|
||||
}else m_uiEnrageTimer -= uiDiff;
|
||||
EnrageTimer = 60000;
|
||||
}else EnrageTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature)
|
||||
CreatureAI* GetAI_boss_hydross_the_unstable(Creature *_Creature)
|
||||
{
|
||||
return new boss_hydross_the_unstableAI(pCreature);
|
||||
return new boss_hydross_the_unstableAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_hydross_the_unstable()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_hydross_the_unstable";
|
||||
newscript->Name="boss_hydross_the_unstable";
|
||||
newscript->GetAI = &GetAI_boss_hydross_the_unstable;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,51 +24,46 @@ EndScriptData */
|
||||
#include "precompiled.h"
|
||||
#include "def_serpent_shrine.h"
|
||||
|
||||
enum
|
||||
{
|
||||
SAY_AGGRO = -1548009,
|
||||
SAY_SWITCH_TO_DEMON = -1548010,
|
||||
SAY_INNER_DEMONS = -1548011,
|
||||
SAY_DEMON_SLAY1 = -1548012,
|
||||
SAY_DEMON_SLAY2 = -1548013,
|
||||
SAY_DEMON_SLAY3 = -1548014,
|
||||
SAY_NIGHTELF_SLAY1 = -1548015,
|
||||
SAY_NIGHTELF_SLAY2 = -1548016,
|
||||
SAY_NIGHTELF_SLAY3 = -1548017,
|
||||
SAY_FINAL_FORM = -1548018,
|
||||
SAY_FREE = -1548019,
|
||||
SAY_DEATH = -1548020,
|
||||
// --- Spells used by Leotheras The Blind
|
||||
#define SPELL_WHIRLWIND 37640
|
||||
#define SPELL_CHAOS_BLAST 37674
|
||||
#define SPELL_BERSERK 26662
|
||||
#define SPELL_INSIDIOUS_WHISPER 37676
|
||||
#define SPELL_DUAL_WIELD 42459
|
||||
|
||||
SPELL_BERSERK = 26662,
|
||||
// --- Spells used in banish phase ---
|
||||
#define BANISH_BEAM 38909
|
||||
#define AURA_BANISH 37833
|
||||
|
||||
SPELL_WHIRLWIND = 37640,
|
||||
SPELL_CHAOS_BLAST = 37674,
|
||||
SPELL_INSIDIOUS_WHISPER = 37676,
|
||||
SPELL_CONSUMING_MADNESS = 37749,
|
||||
// --- Spells used by Greyheart Spellbinders
|
||||
#define SPELL_EARTHSHOCK 39076
|
||||
#define SPELL_MINDBLAST 37531
|
||||
|
||||
AURA_DEMONIC_ALIGNMENT = 37713,
|
||||
SPELL_SHADOWBOLT = 39309,
|
||||
// --- Spells used by Inner Demons and creature ID
|
||||
#define INNER_DEMON_ID 21857
|
||||
#define AURA_DEMONIC_ALIGNMENT 37713
|
||||
#define SPELL_SHADOWBOLT 39309
|
||||
#define SPELL_SOUL_LINK 38007
|
||||
#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet
|
||||
|
||||
FACTION_DEMON_1 = 1829,
|
||||
FACTION_DEMON_2 = 1830,
|
||||
FACTION_DEMON_3 = 1831,
|
||||
FACTION_DEMON_4 = 1832,
|
||||
FACTION_DEMON_5 = 1833,
|
||||
//Misc.
|
||||
#define MODEL_DEMON 20125
|
||||
#define MODEL_NIGHTELF 20514
|
||||
#define DEMON_FORM 21875
|
||||
#define MOB_SPELLBINDER 21806
|
||||
|
||||
MODEL_DEMON = 20125,
|
||||
MODEL_NIGHTELF = 20514,
|
||||
|
||||
INNER_DEMON_ID = 21857,
|
||||
DEMON_FORM = 21875,
|
||||
|
||||
SPELL_DUAL_WIELD = 42459,
|
||||
BANISH_BEAM = 38909,
|
||||
AURA_BANISH = 37833,
|
||||
SPELL_EARTHSHOCK = 39076,
|
||||
SPELL_MINDBLAST = 37531,
|
||||
SPELL_SOUL_LINK = 38007,
|
||||
MOB_SPELLBINDER = 21806
|
||||
};
|
||||
#define SAY_AGGRO -1548009
|
||||
#define SAY_SWITCH_TO_DEMON -1548010
|
||||
#define SAY_INNER_DEMONS -1548011
|
||||
#define SAY_DEMON_SLAY1 -1548012
|
||||
#define SAY_DEMON_SLAY2 -1548013
|
||||
#define SAY_DEMON_SLAY3 -1548014
|
||||
#define SAY_NIGHTELF_SLAY1 -1548015
|
||||
#define SAY_NIGHTELF_SLAY2 -1548016
|
||||
#define SAY_NIGHTELF_SLAY3 -1548017
|
||||
#define SAY_FINAL_FORM -1548018
|
||||
#define SAY_FREE -1548019
|
||||
#define SAY_DEATH -1548020
|
||||
|
||||
struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
|
||||
{
|
||||
@@ -192,10 +187,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
EnrageUsed = false;
|
||||
InnderDemon_Count = 0;
|
||||
m_creature->SetSpeed( MOVE_RUN, 2.0f, true);
|
||||
|
||||
if(m_creature->GetDisplayId() != MODEL_NIGHTELF)
|
||||
m_creature->SetDisplayId(MODEL_NIGHTELF);
|
||||
|
||||
m_creature->SetDisplayId( MODEL_NIGHTELF);
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
|
||||
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
|
||||
@@ -278,7 +270,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
|
||||
|
||||
// changing model to bloodelf
|
||||
m_creature->SetDisplayId(MODEL_NIGHTELF);
|
||||
m_creature->SetDisplayId( MODEL_NIGHTELF);
|
||||
|
||||
// and reseting equipment
|
||||
m_creature->LoadEquipment(m_creature->GetEquipmentId());
|
||||
@@ -300,7 +292,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
DoCast(m_creature, AURA_BANISH);
|
||||
|
||||
// changing model
|
||||
m_creature->SetDisplayId(MODEL_DEMON);
|
||||
m_creature->SetDisplayId( MODEL_DEMON);
|
||||
|
||||
// and removing weapons
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
|
||||
@@ -353,20 +345,23 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
switch(rand()%3)
|
||||
if (DemonForm)
|
||||
{
|
||||
case 0: DoScriptText(DemonForm ? SAY_DEMON_SLAY1 : SAY_NIGHTELF_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(DemonForm ? SAY_DEMON_SLAY2 : SAY_NIGHTELF_SLAY2, m_creature); break;
|
||||
case 2: DoScriptText(DemonForm ? SAY_DEMON_SLAY3 : SAY_NIGHTELF_SLAY3, m_creature); break;
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break;
|
||||
case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
if (m_creature->getVictim() && pSummoned->GetEntry() == DEMON_FORM)
|
||||
else
|
||||
{
|
||||
Demon = pSummoned->GetGUID();
|
||||
pSummoned->AI()->AttackStart(m_creature->getVictim());
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: DoScriptText(SAY_NIGHTELF_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_NIGHTELF_SLAY2, m_creature); break;
|
||||
case 2: DoScriptText(SAY_NIGHTELF_SLAY3, m_creature); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,7 +372,10 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
//despawn copy
|
||||
if (Demon)
|
||||
{
|
||||
if (Unit* pUnit = Unit::GetUnit((*m_creature), Demon))
|
||||
Unit *pUnit = NULL;
|
||||
pUnit = Unit::GetUnit((*m_creature), Demon);
|
||||
|
||||
if (pUnit)
|
||||
pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
if (pInstance)
|
||||
@@ -448,7 +446,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
{
|
||||
DoCast(m_creature, SPELL_WHIRLWIND);
|
||||
// while whirlwinding this variable is used to countdown target's change
|
||||
Whirlwind_Timer = 30000;
|
||||
Whirlwind_Timer = 2000;
|
||||
NeedThreatReset = true;
|
||||
}else Whirlwind_Timer -= diff;
|
||||
}
|
||||
@@ -459,7 +457,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
{
|
||||
//switch to demon form
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0);
|
||||
m_creature->SetDisplayId(MODEL_DEMON);
|
||||
m_creature->SetDisplayId( MODEL_DEMON);
|
||||
DoScriptText(SAY_SWITCH_TO_DEMON, m_creature);
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
|
||||
@@ -536,7 +534,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
if(SwitchToHuman_Timer < diff)
|
||||
{
|
||||
//switch to nightelf form
|
||||
m_creature->SetDisplayId(MODEL_NIGHTELF);
|
||||
m_creature->SetDisplayId( MODEL_NIGHTELF);
|
||||
m_creature->LoadEquipment(m_creature->GetEquipmentId());
|
||||
|
||||
CastConsumingMadness();
|
||||
@@ -565,7 +563,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
DemonForm = false;
|
||||
|
||||
DoScriptText(SAY_FINAL_FORM, m_creature);
|
||||
m_creature->SetDisplayId(MODEL_NIGHTELF);
|
||||
m_creature->SetDisplayId( MODEL_NIGHTELF);
|
||||
m_creature->LoadEquipment(m_creature->GetEquipmentId());
|
||||
}
|
||||
}
|
||||
@@ -617,7 +615,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
//ChaosBlast_Timer
|
||||
if(m_creature->GetDistance(m_creature->getVictim()) < 30)
|
||||
@@ -628,9 +626,9 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI
|
||||
// will cast only when in range od spell
|
||||
if(m_creature->GetDistance(m_creature->getVictim()) < 30)
|
||||
{
|
||||
m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true);
|
||||
//int damage = 100;
|
||||
//m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
|
||||
//m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true);
|
||||
int damage = 100;
|
||||
m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
|
||||
ChaosBlast_Timer = 3000;
|
||||
}
|
||||
}else ChaosBlast_Timer -= diff;
|
||||
|
||||
@@ -1,240 +1,289 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Morogrim_Tidewalker
|
||||
SD%Complete: 90
|
||||
SDComment:
|
||||
SDComment: Water globules don't explode properly, remove hacks
|
||||
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_serpent_shrine.h"
|
||||
|
||||
enum
|
||||
#define SAY_AGGRO -1548030
|
||||
#define SAY_SUMMON1 -1548031
|
||||
#define SAY_SUMMON2 -1548032
|
||||
#define SAY_SUMMON_BUBL1 -1548033
|
||||
#define SAY_SUMMON_BUBL2 -1548034
|
||||
#define SAY_SLAY1 -1548035
|
||||
#define SAY_SLAY2 -1548036
|
||||
#define SAY_SLAY3 -1548037
|
||||
#define SAY_DEATH -1548038
|
||||
#define EMOTE_WATERY_GRAVE -1548039
|
||||
#define EMOTE_EARTHQUAKE -1548040
|
||||
#define EMOTE_WATERY_GLOBULES -1548041
|
||||
|
||||
#define SPELL_TIDAL_WAVE 37730
|
||||
#define SPELL_WATERY_GRAVE 38049
|
||||
#define SPELL_EARTHQUAKE 37764
|
||||
#define SPELL_WATERY_GRAVE_EXPLOSION 37852
|
||||
|
||||
#define WATERY_GRAVE_X1 334.64
|
||||
#define WATERY_GRAVE_Y1 -728.89
|
||||
#define WATERY_GRAVE_Z1 -14.42
|
||||
#define WATERY_GRAVE_X2 365.51
|
||||
#define WATERY_GRAVE_Y2 -737.14
|
||||
#define WATERY_GRAVE_Z2 -14.44
|
||||
#define WATERY_GRAVE_X3 366.19
|
||||
#define WATERY_GRAVE_Y3 -709.59
|
||||
#define WATERY_GRAVE_Z3 -14.36
|
||||
#define WATERY_GRAVE_X4 372.93
|
||||
#define WATERY_GRAVE_Y4 -690.96
|
||||
#define WATERY_GRAVE_Z4 -14.44
|
||||
|
||||
#define SPELL_WATERY_GRAVE_1 38023
|
||||
#define SPELL_WATERY_GRAVE_2 38024
|
||||
#define SPELL_WATERY_GRAVE_3 38025
|
||||
#define SPELL_WATERY_GRAVE_4 37850
|
||||
|
||||
#define SPELL_SUMMON_WATER_GLOBULE_1 37854
|
||||
#define SPELL_SUMMON_WATER_GLOBULE_2 37858
|
||||
#define SPELL_SUMMON_WATER_GLOBULE_3 37860
|
||||
#define SPELL_SUMMON_WATER_GLOBULE_4 37861
|
||||
|
||||
/*#define SPELL_SUMMON_MURLOC_A6 39813
|
||||
#define SPELL_SUMMON_MURLOC_A7 39814
|
||||
#define SPELL_SUMMON_MURLOC_A8 39815
|
||||
#define SPELL_SUMMON_MURLOC_A9 39816
|
||||
#define SPELL_SUMMON_MURLOC_A10 39817
|
||||
|
||||
#define SPELL_SUMMON_MURLOC_B6 39818
|
||||
#define SPELL_SUMMON_MURLOC_B7 39819
|
||||
#define SPELL_SUMMON_MURLOC_B8 39820
|
||||
#define SPELL_SUMMON_MURLOC_B9 39821
|
||||
#define SPELL_SUMMON_MURLOC_B10 39822*/
|
||||
|
||||
float MurlocCords[10][5] =
|
||||
{
|
||||
SAY_AGGRO = -1548030,
|
||||
SAY_SUMMON1 = -1548031,
|
||||
SAY_SUMMON2 = -1548032,
|
||||
SAY_SUMMON_BUBL1 = -1548033,
|
||||
SAY_SUMMON_BUBL2 = -1548034,
|
||||
SAY_SLAY1 = -1548035,
|
||||
SAY_SLAY2 = -1548036,
|
||||
SAY_SLAY3 = -1548037,
|
||||
SAY_DEATH = -1548038,
|
||||
EMOTE_WATERY_GRAVE = -1548039,
|
||||
EMOTE_EARTHQUAKE = -1548040,
|
||||
EMOTE_WATERY_GLOBULES = -1548041,
|
||||
|
||||
SPELL_TIDAL_WAVE = 37730,
|
||||
SPELL_EARTHQUAKE = 37764,
|
||||
|
||||
SPELL_WATERY_GRAVE_1 = 37850,
|
||||
SPELL_WATERY_GRAVE_2 = 38023,
|
||||
SPELL_WATERY_GRAVE_3 = 38024,
|
||||
SPELL_WATERY_GRAVE_4 = 38025,
|
||||
|
||||
SPELL_SUMMON_MURLOC_A6 = 39813,
|
||||
SPELL_SUMMON_MURLOC_A7 = 39814,
|
||||
SPELL_SUMMON_MURLOC_A8 = 39815,
|
||||
SPELL_SUMMON_MURLOC_A9 = 39816,
|
||||
SPELL_SUMMON_MURLOC_A10 = 39817,
|
||||
|
||||
SPELL_SUMMON_MURLOC_B6 = 39818,
|
||||
SPELL_SUMMON_MURLOC_B7 = 39819,
|
||||
SPELL_SUMMON_MURLOC_B8 = 39820,
|
||||
SPELL_SUMMON_MURLOC_B9 = 39821,
|
||||
SPELL_SUMMON_MURLOC_B10 = 39822,
|
||||
|
||||
SPELL_SUMMON_GLOBULE_1 = 37854,
|
||||
SPELL_SUMMON_GLOBULE_2 = 37858,
|
||||
SPELL_SUMMON_GLOBULE_3 = 37860,
|
||||
SPELL_SUMMON_GLOBULE_4 = 37861,
|
||||
|
||||
NPC_WATER_GLOBULE = 21913,
|
||||
NPC_TIDEWALKER_LURKER = 21920
|
||||
{21920, 424.36, -715.4, -7.14, 0.124},
|
||||
{21920, 425.13, -719.3, -7.14, 0.124},
|
||||
{21920, 425.05, -724.23, -7.14, 0.124},
|
||||
{21920, 424.91, -728.68, -7.14, 0.124},
|
||||
{21920, 424.84, -732.18, -7.14, 0.124},
|
||||
{21920, 321.05, -734.2, -13.15, 0.124},
|
||||
{21920, 321.05, -729.4, -13.15, 0.124},
|
||||
{21920, 321.05, -724.03, -13.15, 0.124},
|
||||
{21920, 321.05, -718.73, -13.15, 0.124},
|
||||
{21920, 321.05, -714.24, -13.15, 0.124}
|
||||
};
|
||||
|
||||
//Creatures
|
||||
#define WATER_GLOBULE 21913
|
||||
#define TIDEWALKER_LURKER 21920
|
||||
|
||||
//Morogrim Tidewalker AI
|
||||
struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
|
||||
{
|
||||
boss_morogrim_tidewalkerAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
m_pInstance = pCreature->GetInstanceData();
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance; // the instance
|
||||
ScriptedInstance* pInstance;
|
||||
Map::PlayerList const *PlayerList;
|
||||
|
||||
// timers
|
||||
uint32 m_uiTidalWave_Timer;
|
||||
uint32 m_uiWateryGrave_Timer;
|
||||
uint32 m_uiEarthquake_Timer;
|
||||
uint32 m_uiWateryGlobules_Timer;
|
||||
uint32 TidalWave_Timer;
|
||||
uint32 WateryGrave_Timer;
|
||||
uint32 Earthquake_Timer;
|
||||
uint32 WateryGlobules_Timer;
|
||||
uint32 globulespell[4];
|
||||
int8 Playercount;
|
||||
int8 counter;
|
||||
|
||||
bool m_bEarthquake;
|
||||
bool m_bPhase2;
|
||||
bool Earthquake;
|
||||
bool Phase2;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiTidalWave_Timer = 10000;
|
||||
m_uiWateryGrave_Timer = 30000;
|
||||
m_uiEarthquake_Timer = 40000;
|
||||
m_uiWateryGlobules_Timer = 0;
|
||||
TidalWave_Timer = 10000;
|
||||
WateryGrave_Timer = 30000;
|
||||
Earthquake_Timer = 40000;
|
||||
WateryGlobules_Timer = 0;
|
||||
globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1;
|
||||
globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2;
|
||||
globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3;
|
||||
globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4;
|
||||
|
||||
m_bEarthquake = false;
|
||||
m_bPhase2 = false;
|
||||
Earthquake = false;
|
||||
Phase2 = false;
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* pVictim)
|
||||
{
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SLAY2, m_creature); break;
|
||||
case 2: DoScriptText(SAY_SLAY3, m_creature); break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* pVictim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
void StartEvent()
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (pSummoned->GetEntry() == NPC_TIDEWALKER_LURKER)
|
||||
switch(rand()%3)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
}
|
||||
|
||||
if (pSummoned->GetEntry() == NPC_WATER_GLOBULE)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
pSummoned->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f);
|
||||
case 0: DoScriptText(SAY_SLAY1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SLAY2, m_creature); break;
|
||||
case 2: DoScriptText(SAY_SLAY3, m_creature); break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
PlayerList = &m_creature->GetMap()->GetPlayers();
|
||||
Playercount = PlayerList->getSize();
|
||||
StartEvent();
|
||||
}
|
||||
|
||||
void ApplyWateryGrave(Unit *player, uint8 i)
|
||||
{
|
||||
switch(i)
|
||||
{
|
||||
case 0: player->CastSpell(player, SPELL_WATERY_GRAVE_1, true); break;
|
||||
case 1: player->CastSpell(player, SPELL_WATERY_GRAVE_2, true); break;
|
||||
case 2: player->CastSpell(player, SPELL_WATERY_GRAVE_3, true); break;
|
||||
case 3: player->CastSpell(player, SPELL_WATERY_GRAVE_4, true); break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
//m_uiEarthquake_Timer
|
||||
if (m_uiEarthquake_Timer < uiDiff)
|
||||
//Earthquake_Timer
|
||||
if (Earthquake_Timer < diff)
|
||||
{
|
||||
if (!m_bEarthquake)
|
||||
if (!Earthquake)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE);
|
||||
m_bEarthquake = true;
|
||||
m_uiEarthquake_Timer = 5000;
|
||||
Earthquake = true;
|
||||
Earthquake_Timer = 10000;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScriptText(urand(0,1) ? SAY_SUMMON1 : SAY_SUMMON2, m_creature);
|
||||
|
||||
//north
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A6,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A7,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A8,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A9,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A10,true);
|
||||
|
||||
//south
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B6,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B7,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B8,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B9,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B10,true);
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SUMMON1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SUMMON2, m_creature); break;
|
||||
}
|
||||
|
||||
for(uint8 i = 0; i < 10; i++)
|
||||
{
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||
if(target && Murloc)
|
||||
Murloc->AI()->AttackStart(target);
|
||||
}
|
||||
DoScriptText(EMOTE_EARTHQUAKE, m_creature);
|
||||
|
||||
m_bEarthquake = false;
|
||||
m_uiEarthquake_Timer = 40000+rand()%5000;
|
||||
Earthquake = false;
|
||||
Earthquake_Timer = 40000+rand()%5000;
|
||||
}
|
||||
}else m_uiEarthquake_Timer -= uiDiff;
|
||||
}else Earthquake_Timer -= diff;
|
||||
|
||||
//m_uiTidalWave_Timer
|
||||
if (m_uiTidalWave_Timer < uiDiff)
|
||||
//TidalWave_Timer
|
||||
if (TidalWave_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE);
|
||||
m_uiTidalWave_Timer = 20000;
|
||||
}else m_uiTidalWave_Timer -= uiDiff;
|
||||
TidalWave_Timer = 20000;
|
||||
}else TidalWave_Timer -= diff;
|
||||
|
||||
if (!m_bPhase2)
|
||||
if (!Phase2)
|
||||
{
|
||||
//m_uiWateryGrave_Timer
|
||||
if (m_uiWateryGrave_Timer < uiDiff)
|
||||
//WateryGrave_Timer
|
||||
if (WateryGrave_Timer < diff)
|
||||
{
|
||||
//Teleport 4 players under the waterfalls
|
||||
Unit *target;
|
||||
using std::set;
|
||||
set<int>list;
|
||||
set<int>::iterator itr;
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
|
||||
|
||||
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && !pTarget->HasAuraType(SPELL_AURA_MOD_STUN) && pTarget->IsWithinDistInMap(m_creature, 45.0f))
|
||||
{
|
||||
switch(i)
|
||||
{
|
||||
case 0: m_creature->CastSpell(pTarget,SPELL_WATERY_GRAVE_1,false); break;
|
||||
case 1: m_creature->CastSpell(pTarget,SPELL_WATERY_GRAVE_2,false); break;
|
||||
case 2: m_creature->CastSpell(pTarget,SPELL_WATERY_GRAVE_3,false); break;
|
||||
case 3: m_creature->CastSpell(pTarget,SPELL_WATERY_GRAVE_4,false); break;
|
||||
}
|
||||
counter = 0;
|
||||
do{target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only
|
||||
if(counter < Playercount)
|
||||
break;
|
||||
if(target) itr = list.find(target->GetGUID());
|
||||
counter++;
|
||||
}while(itr != list.end());
|
||||
if(target){list.insert(target->GetGUID());
|
||||
ApplyWateryGrave(target, i);
|
||||
}
|
||||
}
|
||||
|
||||
DoScriptText(urand(0,1) ? SAY_SUMMON_BUBL1 : SAY_SUMMON_BUBL2, m_creature);
|
||||
DoScriptText(EMOTE_WATERY_GRAVE, m_creature);
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SUMMON_BUBL1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SUMMON_BUBL2, m_creature); break;
|
||||
}
|
||||
|
||||
m_uiWateryGrave_Timer = 30000;
|
||||
}else m_uiWateryGrave_Timer -= uiDiff;
|
||||
DoScriptText(EMOTE_WATERY_GRAVE, m_creature);
|
||||
WateryGrave_Timer = 30000;
|
||||
}else WateryGrave_Timer -= diff;
|
||||
|
||||
//Start Phase2
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
|
||||
m_bPhase2 = true;
|
||||
Phase2 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//m_uiWateryGlobules_Timer
|
||||
if (m_uiWateryGlobules_Timer < uiDiff)
|
||||
//WateryGlobules_Timer
|
||||
if (WateryGlobules_Timer < diff)
|
||||
{
|
||||
Unit* globuletarget;
|
||||
using std::set;
|
||||
set<int>globulelist;
|
||||
set<int>::iterator itr;
|
||||
for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD
|
||||
{
|
||||
counter = 0;
|
||||
do {globuletarget = SelectTarget(SELECT_TARGET_RANDOM, 0,50,true);
|
||||
if(globuletarget) itr = globulelist.find(globuletarget->GetGUID());
|
||||
if (counter > Playercount)
|
||||
break;
|
||||
counter++;
|
||||
} while (itr != globulelist.end());
|
||||
if(globuletarget)globulelist.insert(globuletarget->GetGUID());
|
||||
globuletarget->CastSpell(globuletarget, globulespell[g], true);
|
||||
}
|
||||
DoScriptText(EMOTE_WATERY_GLOBULES, m_creature);
|
||||
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_1,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_2,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_3,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_4,false);
|
||||
|
||||
m_uiWateryGlobules_Timer = 25000;
|
||||
}else m_uiWateryGlobules_Timer -= uiDiff;
|
||||
WateryGlobules_Timer = 25000;
|
||||
}else WateryGlobules_Timer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -242,61 +291,67 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
|
||||
};
|
||||
|
||||
//Water Globule AI
|
||||
#define SPELL_GLOBULE_EXPLOSION 37871
|
||||
|
||||
struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI
|
||||
{
|
||||
mob_water_globuleAI(Creature* c) : ScriptedAI(c) { }
|
||||
mob_water_globuleAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
// timers
|
||||
uint32 m_uiCheck_Timer;
|
||||
uint32 Check_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiCheck_Timer = 1000;
|
||||
Check_Timer = 1000;
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->setFaction(14);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* pWho)
|
||||
void EnterCombat(Unit *who) {}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!pWho || m_creature->getVictim())
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(pWho))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
//no attack radius check - it attacks the first target that moves in his los
|
||||
//pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(pWho);
|
||||
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(who);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
if (m_uiCheck_Timer < uiDiff)
|
||||
if (Check_Timer < diff)
|
||||
{
|
||||
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
|
||||
{
|
||||
m_creature->DealDamage(m_creature->getVictim(), 4000+rand()%2000, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FROST, NULL, false);
|
||||
DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION);
|
||||
|
||||
//despawn
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
m_uiCheck_Timer = 500;
|
||||
}else m_uiCheck_Timer -= uiDiff;
|
||||
Check_Timer = 500;
|
||||
}else Check_Timer -= diff;
|
||||
|
||||
//do NOT deal any melee damage to the target.
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature)
|
||||
CreatureAI* GetAI_boss_morogrim_tidewalker(Creature *_Creature)
|
||||
{
|
||||
return new boss_morogrim_tidewalkerAI (pCreature);
|
||||
return new boss_morogrim_tidewalkerAI (_Creature);
|
||||
}
|
||||
CreatureAI* GetAI_mob_water_globule(Creature* pCreature)
|
||||
CreatureAI* GetAI_mob_water_globule(Creature *_Creature)
|
||||
{
|
||||
return new mob_water_globuleAI (pCreature);
|
||||
return new mob_water_globuleAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_morogrim_tidewalker()
|
||||
@@ -304,12 +359,13 @@ void AddSC_boss_morogrim_tidewalker()
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_morogrim_tidewalker";
|
||||
newscript->Name="boss_morogrim_tidewalker";
|
||||
newscript->GetAI = &GetAI_boss_morogrim_tidewalker;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_water_globule";
|
||||
newscript->Name="mob_water_globule";
|
||||
newscript->GetAI = &GetAI_mob_water_globule;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user