Converting EasternKingdoms/ZulAman and EasternKingdoms/ZulGurub.

Need to recheck tomorrow. :)

--HG--
branch : trunk
This commit is contained in:
John Holiver
2010-08-08 05:01:17 -03:00
parent 0ce01cdb63
commit 99a054bfd2
24 changed files with 5403 additions and 5149 deletions
@@ -374,12 +374,12 @@ EndScriptData */
#define SPELL_BOSS_OBJECT_VISUAL 11206 #define SPELL_BOSS_OBJECT_VISUAL 11206
class go_altar_of_archaedas : public CreatureScript class go_altar_of_archaedas : public GameObjectScript
{ {
public: public:
go_altar_of_archaedas() go_altar_of_archaedas()
: CreatureScript("go_altar_of_archaedas") : GameObjectScript("go_altar_of_archaedas")
{ {
} }
@@ -406,12 +406,12 @@ EndScriptData */
#define SPELL_BOSS_OBJECT_VISUAL 11206 #define SPELL_BOSS_OBJECT_VISUAL 11206
class go_altar_of_the_keepers : public CreatureScript class go_altar_of_the_keepers : public GameObjectScript
{ {
public: public:
go_altar_of_the_keepers() go_altar_of_the_keepers()
: CreatureScript("go_altar_of_the_keepers") : GameObjectScript("go_altar_of_the_keepers")
{ {
} }
@@ -298,5 +298,5 @@ class instance_uldaman : public InstanceMapScript
void AddSC_instance_uldaman() void AddSC_instance_uldaman()
{ {
new instance_uldaman; new instance_uldaman();
} }
@@ -59,411 +59,421 @@ EndScriptData */
#define SE_LOC_Y_MAX 1435 #define SE_LOC_Y_MAX 1435
#define SE_LOC_Y_MIN 1370 #define SE_LOC_Y_MIN 1370
struct boss_akilzonAI : public ScriptedAI class boss_akilzon : public CreatureScript
{ {
boss_akilzonAI(Creature *c) : ScriptedAI(c) public:
{
SpellEntry *TempSpell = GET_SPELL(SPELL_ELECTRICAL_DAMAGE);
if (TempSpell)
TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint64 BirdGUIDs[8]; boss_akilzon()
uint64 TargetGUID; : CreatureScript("boss_akilzon")
uint64 CycloneGUID;
uint64 CloudGUID;
uint32 StaticDisruption_Timer;
uint32 GustOfWind_Timer;
uint32 CallLighting_Timer;
uint32 ElectricalStorm_Timer;
uint32 SummonEagles_Timer;
uint32 Enrage_Timer;
uint32 StormCount;
uint32 StormSequenceTimer;
bool isRaining;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
StaticDisruption_Timer = urand(10000,20000); //10 to 20 seconds (bosskillers)
GustOfWind_Timer = urand(20000,30000); //20 to 30 seconds(bosskillers)
CallLighting_Timer = urand(10000,20000); //totaly random timer. can't find any info on this
ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
Enrage_Timer = 10*MINUTE*IN_MILLISECONDS; //10 minutes till enrage(bosskillers)
SummonEagles_Timer = 99999;
TargetGUID = 0;
CloudGUID = 0;
CycloneGUID = 0;
DespawnSummons();
for (uint8 i = 0; i < 8; ++i)
BirdGUIDs[i] = 0;
StormCount = 0;
StormSequenceTimer = 0;
isRaining = false;
SetWeather(WEATHER_STATE_FINE, 0.0f);
}
void EnterCombat(Unit * /*who*/)
{
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
//DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
}
void JustDied(Unit* /*Killer*/)
{
me->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_ONDEATH);
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, DONE);
DespawnSummons();
}
void KilledUnit(Unit* /*victim*/)
{
switch (urand(0,1))
{ {
case 0:
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
break;
case 1:
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
break;
} }
}
void DespawnSummons() struct boss_akilzonAI : public ScriptedAI
{
for (uint8 i = 0; i < 8; ++i)
{ {
Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); boss_akilzonAI(Creature *c) : ScriptedAI(c)
if (bird && bird->isAlive())
{ {
bird->SetVisibility(VISIBILITY_OFF); SpellEntry *TempSpell = GET_SPELL(SPELL_ELECTRICAL_DAMAGE);
bird->setDeathState(JUST_DIED); if (TempSpell)
TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core
pInstance = c->GetInstanceData();
} }
} ScriptedInstance *pInstance;
}
void SetWeather(uint32 weather, float grade) uint64 BirdGUIDs[8];
{ uint64 TargetGUID;
Map* pMap = me->GetMap(); uint64 CycloneGUID;
if (!pMap->IsDungeon()) uint64 CloudGUID;
return;
WorldPacket data(SMSG_WEATHER, (4+4+4)); uint32 StaticDisruption_Timer;
data << uint32(weather) << float(grade) << uint8(0); uint32 GustOfWind_Timer;
uint32 CallLighting_Timer;
uint32 ElectricalStorm_Timer;
uint32 SummonEagles_Timer;
uint32 Enrage_Timer;
pMap->SendToPlayers(&data); uint32 StormCount;
} uint32 StormSequenceTimer;
void HandleStormSequence(Unit *Cloud) // 1: begin, 2-9: tick, 10: end bool isRaining;
{
if (StormCount < 10 && StormCount > 1)
{
// deal damage
int32 bp0 = 800;
for (uint8 i = 2; i < StormCount; ++i)
bp0 *= 2;
CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
std::list<Unit *> tempUnitMap;
void Reset()
{ {
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999); if (pInstance)
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check); pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); StaticDisruption_Timer = urand(10000,20000); //10 to 20 seconds (bosskillers)
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); GustOfWind_Timer = urand(20000,30000); //20 to 30 seconds(bosskillers)
CallLighting_Timer = urand(10000,20000); //totaly random timer. can't find any info on this
ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
Enrage_Timer = 10*MINUTE*IN_MILLISECONDS; //10 minutes till enrage(bosskillers)
SummonEagles_Timer = 99999;
cell.Visit(p, world_unit_searcher, *(me->GetMap())); TargetGUID = 0;
cell.Visit(p, grid_unit_searcher, *(me->GetMap())); CloudGUID = 0;
CycloneGUID = 0;
DespawnSummons();
for (uint8 i = 0; i < 8; ++i)
BirdGUIDs[i] = 0;
StormCount = 0;
StormSequenceTimer = 0;
isRaining = false;
SetWeather(WEATHER_STATE_FINE, 0.0f);
} }
//dealdamege
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) void EnterCombat(Unit * /*who*/)
{ {
if (!Cloud->IsWithinDist(*i, 6, false)) me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
//DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
}
void JustDied(Unit* /*Killer*/)
{
me->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_ONDEATH);
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, DONE);
DespawnSummons();
}
void KilledUnit(Unit* /*victim*/)
{
switch (urand(0,1))
{ {
Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); case 0:
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
break;
case 1:
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
break;
} }
} }
// visual
float x,y,z; void DespawnSummons()
z = me->GetPositionZ();
for (uint8 i = 0; i < 5+rand()%5; ++i)
{ {
x = 343+rand()%60; for (uint8 i = 0; i < 8; ++i)
y = 1380+rand()%60;
if (Unit *trigger = me->SummonTrigger(x, y, z, 0, 2000))
{ {
trigger->setFaction(35); Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]);
trigger->SetMaxHealth(100000); if (bird && bird->isAlive())
trigger->SetHealth(100000); {
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); bird->SetVisibility(VISIBILITY_OFF);
bird->setDeathState(JUST_DIED);
}
}
}
void SetWeather(uint32 weather, float grade)
{
Map* pMap = me->GetMap();
if (!pMap->IsDungeon())
return;
WorldPacket data(SMSG_WEATHER, (4+4+4));
data << uint32(weather) << float(grade) << uint8(0);
pMap->SendToPlayers(&data);
}
void HandleStormSequence(Unit *Cloud) // 1: begin, 2-9: tick, 10: end
{
if (StormCount < 10 && StormCount > 1)
{
// deal damage
int32 bp0 = 800;
for (uint8 i = 2; i < StormCount; ++i)
bp0 *= 2;
CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
std::list<Unit *> tempUnitMap;
{
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999);
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
cell.Visit(p, world_unit_searcher, *(me->GetMap()));
cell.Visit(p, grid_unit_searcher, *(me->GetMap()));
}
//dealdamege
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
{
if (!Cloud->IsWithinDist(*i, 6, false))
{
Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID());
}
}
// visual
float x,y,z;
z = me->GetPositionZ();
for (uint8 i = 0; i < 5+rand()%5; ++i)
{
x = 343+rand()%60;
y = 1380+rand()%60;
if (Unit *trigger = me->SummonTrigger(x, y, z, 0, 2000))
{
trigger->setFaction(35);
trigger->SetMaxHealth(100000);
trigger->SetHealth(100000);
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Cloud)
Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID());
}
}
}
++StormCount;
if (StormCount > 10)
{
StormCount = 0; // finish
SummonEagles_Timer = 5000;
me->InterruptNonMeleeSpells(false);
CloudGUID = 0;
if (Cloud) if (Cloud)
Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
SetWeather(WEATHER_STATE_FINE, 0.0f);
isRaining = false;
}
StormSequenceTimer = 1000;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (StormCount)
{
Unit *pTarget = Unit::GetUnit(*me, CloudGUID);
if (!pTarget || !pTarget->isAlive())
{
EnterEvadeMode();
return;
}
else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID))
Cyclone->CastSpell(pTarget, 25160, true); // keep casting or...
if (StormSequenceTimer <= diff)
HandleStormSequence(pTarget);
else
StormSequenceTimer -= diff;
return;
}
if (Enrage_Timer <= diff)
{
me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONENRAGE);
DoCast(me, SPELL_BERSERK, true);
Enrage_Timer = 600000;
} else Enrage_Timer -= diff;
if (StaticDisruption_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
TargetGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_STATIC_DISRUPTION, false);
me->SetInFront(me->getVictim());
StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
/*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
} else StaticDisruption_Timer -= diff;
if (GustOfWind_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
DoCast(pTarget, SPELL_GUST_OF_WIND);
GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
} else GustOfWind_Timer -= diff;
if (CallLighting_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CALL_LIGHTNING);
CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this
} else CallLighting_Timer -= diff;
if (!isRaining && ElectricalStorm_Timer < 8000 + rand()%5000)
{
SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
isRaining = true;
}
if (ElectricalStorm_Timer <= diff) {
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (!pTarget)
{
EnterEvadeMode();
return;
}
pTarget->CastSpell(pTarget, 44007, true);//cloud visual
DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual
float x,y,z;
pTarget->GetPosition(x,y,z);
if (pTarget)
{
pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0);
}
Unit *Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
{
CloudGUID = Cloud->GetGUID();
Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
Cloud->StopMoving();
Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
Cloud->setFaction(35);
Cloud->SetMaxHealth(9999999);
Cloud->SetHealth(9999999);
Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
StormCount = 1;
StormSequenceTimer = 0;
} else ElectricalStorm_Timer -= diff;
if (SummonEagles_Timer <= diff)
{
me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSUMMON);
float x, y, z;
me->GetPosition(x, y, z);
for (uint8 i = 0; i < 8; ++i)
{
Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]);
if (!bird) //they despawned on die
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
x = pTarget->GetPositionX() + irand(-10,10);
y = pTarget->GetPositionY() + irand(-10,10);
z = pTarget->GetPositionZ() + urand(16,20);
if (z > 95)
z = 95 - urand(0,5);
}
Creature *pCreature = me->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (pCreature)
{
pCreature->AddThreat(me->getVictim(), 1.0f);
pCreature->AI()->AttackStart(me->getVictim());
BirdGUIDs[i] = pCreature->GetGUID();
}
}
}
SummonEagles_Timer = 999999;
} else SummonEagles_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_akilzonAI(creature);
}
};
class mob_akilzon_eagle : public CreatureScript
{
public:
mob_akilzon_eagle()
: CreatureScript("mob_akilzon_eagle")
{
}
struct mob_akilzon_eagleAI : public ScriptedAI
{
mob_akilzon_eagleAI(Creature *c) : ScriptedAI(c) {}
uint32 EagleSwoop_Timer;
bool arrived;
uint32 TargetGUID;
void Reset()
{
EagleSwoop_Timer = 5000 + rand()%5000;
arrived = true;
TargetGUID = 0;
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
}
void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
void MoveInLineOfSight(Unit* /*who*/) {}
void MovementInform(uint32, uint32)
{
arrived = true;
if (TargetGUID)
{
if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, SPELL_EAGLE_SWOOP, true);
TargetGUID = 0;
me->SetSpeed(MOVE_RUN, 1.2f);
EagleSwoop_Timer = 5000 + rand()%5000;
} }
} }
}
++StormCount;
if (StormCount > 10)
{
StormCount = 0; // finish
SummonEagles_Timer = 5000;
me->InterruptNonMeleeSpells(false);
CloudGUID = 0;
if (Cloud)
Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
SetWeather(WEATHER_STATE_FINE, 0.0f);
isRaining = false;
}
StormSequenceTimer = 1000;
}
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (StormCount)
{
Unit *pTarget = Unit::GetUnit(*me, CloudGUID);
if (!pTarget || !pTarget->isAlive())
{ {
EnterEvadeMode(); if (EagleSwoop_Timer <= diff)
return; EagleSwoop_Timer = 0;
} else
else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID)) EagleSwoop_Timer -= diff;
Cyclone->CastSpell(pTarget, 25160, true); // keep casting or...
if (StormSequenceTimer <= diff) if (arrived)
HandleStormSequence(pTarget);
else
StormSequenceTimer -= diff;
return;
}
if (Enrage_Timer <= diff)
{
me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONENRAGE);
DoCast(me, SPELL_BERSERK, true);
Enrage_Timer = 600000;
} else Enrage_Timer -= diff;
if (StaticDisruption_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
TargetGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_STATIC_DISRUPTION, false);
me->SetInFront(me->getVictim());
StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
/*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
} else StaticDisruption_Timer -= diff;
if (GustOfWind_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
DoCast(pTarget, SPELL_GUST_OF_WIND);
GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
} else GustOfWind_Timer -= diff;
if (CallLighting_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CALL_LIGHTNING);
CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this
} else CallLighting_Timer -= diff;
if (!isRaining && ElectricalStorm_Timer < 8000 + rand()%5000)
{
SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
isRaining = true;
}
if (ElectricalStorm_Timer <= diff) {
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (!pTarget)
{
EnterEvadeMode();
return;
}
pTarget->CastSpell(pTarget, 44007, true);//cloud visual
DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual
float x,y,z;
pTarget->GetPosition(x,y,z);
if (pTarget)
{
pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0);
}
Unit *Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
{
CloudGUID = Cloud->GetGUID();
Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
Cloud->StopMoving();
Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
Cloud->setFaction(35);
Cloud->SetMaxHealth(9999999);
Cloud->SetHealth(9999999);
Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
StormCount = 1;
StormSequenceTimer = 0;
} else ElectricalStorm_Timer -= diff;
if (SummonEagles_Timer <= diff)
{
me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSUMMON);
float x, y, z;
me->GetPosition(x, y, z);
for (uint8 i = 0; i < 8; ++i)
{
Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]);
if (!bird) //they despawned on die
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{ {
x = pTarget->GetPositionX() + irand(-10,10); float x, y, z;
y = pTarget->GetPositionY() + irand(-10,10); if (EagleSwoop_Timer)
z = pTarget->GetPositionZ() + urand(16,20); {
if (z > 95) x = pTarget->GetPositionX() + irand(-10,10);
z = 95 - urand(0,5); y = pTarget->GetPositionY() + irand(-10,10);
} z = pTarget->GetPositionZ() + urand(10,15);
Creature *pCreature = me->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); if (z > 95)
if (pCreature) z = 95 - urand(0,5);
{ }
pCreature->AddThreat(me->getVictim(), 1.0f); else
pCreature->AI()->AttackStart(me->getVictim()); {
BirdGUIDs[i] = pCreature->GetGUID(); pTarget->GetContactPoint(me, x, y, z);
z += 2;
me->SetSpeed(MOVE_RUN, 5.0f);
TargetGUID = pTarget->GetGUID();
}
me->GetMotionMaster()->MovePoint(0, x, y, z);
arrived = false;
} }
} }
} }
SummonEagles_Timer = 999999; };
} else SummonEagles_Timer -= diff;
DoMeleeAttackIfReady(); CreatureAI* GetAI(Creature* creature) const
}
};
struct mob_soaring_eagleAI : public ScriptedAI
{
mob_soaring_eagleAI(Creature *c) : ScriptedAI(c) {}
uint32 EagleSwoop_Timer;
bool arrived;
uint32 TargetGUID;
void Reset()
{
EagleSwoop_Timer = 5000 + rand()%5000;
arrived = true;
TargetGUID = 0;
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
}
void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
void MoveInLineOfSight(Unit* /*who*/) {}
void MovementInform(uint32, uint32)
{
arrived = true;
if (TargetGUID)
{ {
if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID)) return new mob_akilzon_eagleAI(creature);
DoCast(pTarget, SPELL_EAGLE_SWOOP, true);
TargetGUID = 0;
me->SetSpeed(MOVE_RUN, 1.2f);
EagleSwoop_Timer = 5000 + rand()%5000;
} }
}
void UpdateAI(const uint32 diff)
{
if (EagleSwoop_Timer <= diff)
EagleSwoop_Timer = 0;
else
EagleSwoop_Timer -= diff;
if (arrived)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
float x, y, z;
if (EagleSwoop_Timer)
{
x = pTarget->GetPositionX() + irand(-10,10);
y = pTarget->GetPositionY() + irand(-10,10);
z = pTarget->GetPositionZ() + urand(10,15);
if (z > 95)
z = 95 - urand(0,5);
}
else
{
pTarget->GetContactPoint(me, x, y, z);
z += 2;
me->SetSpeed(MOVE_RUN, 5.0f);
TargetGUID = pTarget->GetGUID();
}
me->GetMotionMaster()->MovePoint(0, x, y, z);
arrived = false;
}
}
}
}; };
//Soaring Eagle
CreatureAI* GetAI_mob_soaring_eagle(Creature* pCreature)
{
return new mob_soaring_eagleAI(pCreature);
}
CreatureAI* GetAI_boss_akilzon(Creature* pCreature)
{
return new boss_akilzonAI(pCreature);
}
void AddSC_boss_akilzon() void AddSC_boss_akilzon()
{ {
Script *newscript = NULL; new boss_akilzon();
new mob_akilzon_eagle();
newscript = new Script;
newscript->Name = "boss_akilzon";
newscript->GetAI = &GetAI_boss_akilzon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_akilzon_eagle";
newscript->GetAI = &GetAI_mob_soaring_eagle;
newscript->RegisterSelf();
} }
@@ -73,331 +73,342 @@ enum PhaseHalazzi
PHASE_ENRAGE = 5 PHASE_ENRAGE = 5
}; };
struct boss_halazziAI : public ScriptedAI class boss_halazzi : public CreatureScript
{ {
boss_halazziAI(Creature *c) : ScriptedAI(c) public:
{
pInstance = c->GetInstanceData();
// need to find out what controls totem's spell cooldown
SpellEntry *TempSpell = GET_SPELL(SPELL_LIGHTNING);
if (TempSpell && TempSpell->CastingTimeIndex != 5)
TempSpell->CastingTimeIndex = 5; // 2000 ms casting time
}
ScriptedInstance *pInstance; boss_halazzi()
: CreatureScript("boss_halazzi")
uint32 FrenzyTimer;
uint32 SaberlashTimer;
uint32 ShockTimer;
uint32 TotemTimer;
uint32 CheckTimer;
uint32 BerserkTimer;
uint32 TransformCount;
PhaseHalazzi Phase;
uint64 LynxGUID;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
TransformCount = 0;
BerserkTimer = 600000;
CheckTimer = 1000;
DoCast(me, SPELL_DUAL_WIELD, true);
Phase = PHASE_NONE;
EnterPhase(PHASE_LYNX);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_AGGRO);
EnterPhase(PHASE_LYNX);
}
void JustSummoned(Creature* summon)
{
summon->AI()->AttackStart(me->getVictim());
if (summon->GetEntry() == MOB_SPIRIT_LYNX)
LynxGUID = summon->GetGUID();
}
void DamageTaken(Unit * /*done_by*/, uint32 &damage)
{
if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE)
damage = 0;
}
void SpellHit(Unit*, const SpellEntry *spell)
{
if (spell->Id == SPELL_TRANSFORM_SPLIT2)
EnterPhase(PHASE_HUMAN);
}
void AttackStart(Unit *who)
{
if (Phase != PHASE_MERGE) ScriptedAI::AttackStart(who);
}
void EnterPhase(PhaseHalazzi NextPhase)
{
switch(NextPhase)
{ {
case PHASE_LYNX:
case PHASE_ENRAGE:
if (Phase == PHASE_MERGE)
{
DoCast(me, SPELL_TRANSFORM_MERGE, true);
me->Attack(me->getVictim(), true);
me->GetMotionMaster()->MoveChase(me->getVictim());
}
if (Creature *Lynx = Unit::GetCreature(*me, LynxGUID))
Lynx->DisappearAndDie();
me->SetMaxHealth(600000);
me->SetHealth(600000 - 150000 * TransformCount);
FrenzyTimer = 16000;
SaberlashTimer = 20000;
ShockTimer = 10000;
TotemTimer = 12000;
break;
case PHASE_SPLIT:
me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_SPLIT);
DoCast(me, SPELL_TRANSFORM_SPLIT, true);
break;
case PHASE_HUMAN:
//DoCast(me, SPELL_SUMMON_LYNX, true);
DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SetMaxHealth(400000);
me->SetHealth(400000);
ShockTimer = 10000;
TotemTimer = 12000;
break;
case PHASE_MERGE:
if (Unit *pLynx = Unit::GetUnit(*me, LynxGUID))
{
me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_MERGE);
pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pLynx->GetMotionMaster()->Clear();
pLynx->GetMotionMaster()->MoveFollow(me, 0, 0);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveFollow(pLynx, 0, 0);
++TransformCount;
}
break;
default:
break;
}
Phase = NextPhase;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (BerserkTimer <= diff)
{
me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_BERSERK);
DoCast(me, SPELL_BERSERK, true);
BerserkTimer = 60000;
} else BerserkTimer -= diff;
if (Phase == PHASE_LYNX || Phase == PHASE_ENRAGE)
{
if (SaberlashTimer <= diff)
{
// A tank with more than 490 defense skills should receive no critical hit
//DoCast(me, 41296, true);
DoCast(me->getVictim(), SPELL_SABER_LASH, true);
//me->RemoveAurasDueToSpell(41296);
SaberlashTimer = 30000;
} else SaberlashTimer -= diff;
if (FrenzyTimer <= diff)
{
DoCast(me, SPELL_FRENZY);
FrenzyTimer = urand(10000,15000);
} else FrenzyTimer -= diff;
if (Phase == PHASE_LYNX)
if (CheckTimer <= diff)
{
if (me->GetHealth() * 4 < me->GetMaxHealth() * (3 - TransformCount))
EnterPhase(PHASE_SPLIT);
CheckTimer = 1000;
} else CheckTimer -= diff;
} }
if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE) struct boss_halazziAI : public ScriptedAI
{ {
if (TotemTimer <= diff) boss_halazziAI(Creature *c) : ScriptedAI(c)
{ {
DoCast(me, SPELL_SUMMON_TOTEM); pInstance = c->GetInstanceData();
TotemTimer = 20000; // need to find out what controls totem's spell cooldown
} else TotemTimer -= diff; SpellEntry *TempSpell = GET_SPELL(SPELL_LIGHTNING);
if (TempSpell && TempSpell->CastingTimeIndex != 5)
TempSpell->CastingTimeIndex = 5; // 2000 ms casting time
}
if (ShockTimer <= diff) ScriptedInstance *pInstance;
uint32 FrenzyTimer;
uint32 SaberlashTimer;
uint32 ShockTimer;
uint32 TotemTimer;
uint32 CheckTimer;
uint32 BerserkTimer;
uint32 TransformCount;
PhaseHalazzi Phase;
uint64 LynxGUID;
void Reset()
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
TransformCount = 0;
BerserkTimer = 600000;
CheckTimer = 1000;
DoCast(me, SPELL_DUAL_WIELD, true);
Phase = PHASE_NONE;
EnterPhase(PHASE_LYNX);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_AGGRO);
EnterPhase(PHASE_LYNX);
}
void JustSummoned(Creature* summon)
{
summon->AI()->AttackStart(me->getVictim());
if (summon->GetEntry() == MOB_SPIRIT_LYNX)
LynxGUID = summon->GetGUID();
}
void DamageTaken(Unit * /*done_by*/, uint32 &damage)
{
if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE)
damage = 0;
}
void SpellHit(Unit*, const SpellEntry *spell)
{
if (spell->Id == SPELL_TRANSFORM_SPLIT2)
EnterPhase(PHASE_HUMAN);
}
void AttackStart(Unit *who)
{
if (Phase != PHASE_MERGE) ScriptedAI::AttackStart(who);
}
void EnterPhase(PhaseHalazzi NextPhase)
{
switch(NextPhase)
{ {
if (pTarget->IsNonMeleeSpellCasted(false)) case PHASE_LYNX:
DoCast(pTarget, SPELL_EARTHSHOCK); case PHASE_ENRAGE:
else if (Phase == PHASE_MERGE)
DoCast(pTarget, SPELL_FLAMESHOCK); {
ShockTimer = 10000 + rand()%5000; DoCast(me, SPELL_TRANSFORM_MERGE, true);
me->Attack(me->getVictim(), true);
me->GetMotionMaster()->MoveChase(me->getVictim());
}
if (Creature *Lynx = Unit::GetCreature(*me, LynxGUID))
Lynx->DisappearAndDie();
me->SetMaxHealth(600000);
me->SetHealth(600000 - 150000 * TransformCount);
FrenzyTimer = 16000;
SaberlashTimer = 20000;
ShockTimer = 10000;
TotemTimer = 12000;
break;
case PHASE_SPLIT:
me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_SPLIT);
DoCast(me, SPELL_TRANSFORM_SPLIT, true);
break;
case PHASE_HUMAN:
//DoCast(me, SPELL_SUMMON_LYNX, true);
DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SetMaxHealth(400000);
me->SetHealth(400000);
ShockTimer = 10000;
TotemTimer = 12000;
break;
case PHASE_MERGE:
if (Unit *pLynx = Unit::GetUnit(*me, LynxGUID))
{
me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_MERGE);
pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pLynx->GetMotionMaster()->Clear();
pLynx->GetMotionMaster()->MoveFollow(me, 0, 0);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveFollow(pLynx, 0, 0);
++TransformCount;
}
break;
default:
break;
} }
} else ShockTimer -= diff; Phase = NextPhase;
}
if (Phase == PHASE_HUMAN) void UpdateAI(const uint32 diff)
if (CheckTimer <= diff) {
if (!UpdateVictim())
return;
if (BerserkTimer <= diff)
{ {
if (((me->GetHealth()*100) / me->GetMaxHealth() <= 20)/*me->GetHealth() * 10 < me->GetMaxHealth()*/) me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
EnterPhase(PHASE_MERGE); DoPlaySoundToSet(me, SOUND_BERSERK);
else DoCast(me, SPELL_BERSERK, true);
BerserkTimer = 60000;
} else BerserkTimer -= diff;
if (Phase == PHASE_LYNX || Phase == PHASE_ENRAGE)
{
if (SaberlashTimer <= diff)
{
// A tank with more than 490 defense skills should receive no critical hit
//DoCast(me, 41296, true);
DoCast(me->getVictim(), SPELL_SABER_LASH, true);
//me->RemoveAurasDueToSpell(41296);
SaberlashTimer = 30000;
} else SaberlashTimer -= diff;
if (FrenzyTimer <= diff)
{
DoCast(me, SPELL_FRENZY);
FrenzyTimer = urand(10000,15000);
} else FrenzyTimer -= diff;
if (Phase == PHASE_LYNX)
if (CheckTimer <= diff)
{
if (me->GetHealth() * 4 < me->GetMaxHealth() * (3 - TransformCount))
EnterPhase(PHASE_SPLIT);
CheckTimer = 1000;
} else CheckTimer -= diff;
}
if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE)
{
if (TotemTimer <= diff)
{
DoCast(me, SPELL_SUMMON_TOTEM);
TotemTimer = 20000;
} else TotemTimer -= diff;
if (ShockTimer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
if (pTarget->IsNonMeleeSpellCasted(false))
DoCast(pTarget, SPELL_EARTHSHOCK);
else
DoCast(pTarget, SPELL_FLAMESHOCK);
ShockTimer = 10000 + rand()%5000;
}
} else ShockTimer -= diff;
if (Phase == PHASE_HUMAN)
if (CheckTimer <= diff)
{
if (((me->GetHealth()*100) / me->GetMaxHealth() <= 20)/*me->GetHealth() * 10 < me->GetMaxHealth()*/)
EnterPhase(PHASE_MERGE);
else
{
Unit *Lynx = Unit::GetUnit(*me, LynxGUID);
if (Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/)
EnterPhase(PHASE_MERGE);
}
CheckTimer = 1000;
} else CheckTimer -= diff;
}
if (Phase == PHASE_MERGE)
{
if (CheckTimer <= diff)
{ {
Unit *Lynx = Unit::GetUnit(*me, LynxGUID); Unit *Lynx = Unit::GetUnit(*me, LynxGUID);
if (Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/) if (Lynx)
EnterPhase(PHASE_MERGE); {
} Lynx->GetMotionMaster()->MoveFollow(me, 0, 0);
CheckTimer = 1000; me->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
} else CheckTimer -= diff; if (me->IsWithinDistInMap(Lynx, 6.0f))
} {
if (TransformCount < 3)
if (Phase == PHASE_MERGE) EnterPhase(PHASE_LYNX);
{ else
if (CheckTimer <= diff) EnterPhase(PHASE_ENRAGE);
{ }
Unit *Lynx = Unit::GetUnit(*me, LynxGUID); }
if (Lynx) CheckTimer = 1000;
{ } else CheckTimer -= diff;
Lynx->GetMotionMaster()->MoveFollow(me, 0, 0);
me->GetMotionMaster()->MoveFollow(Lynx, 0, 0);
if (me->IsWithinDistInMap(Lynx, 6.0f))
{
if (TransformCount < 3)
EnterPhase(PHASE_LYNX);
else
EnterPhase(PHASE_ENRAGE);
}
} }
CheckTimer = 1000;
} else CheckTimer -= diff;
}
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
void KilledUnit(Unit* /*victim*/) void KilledUnit(Unit* /*victim*/)
{ {
switch (urand(0,1)) switch (urand(0,1))
{
case 0:
me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
}
}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, DONE);
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
}
};
CreatureAI* GetAI(Creature* creature) const
{ {
case 0: return new boss_halazziAI(creature);
me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
} }
}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_HALAZZIEVENT, DONE);
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
}
}; };
// Spirits Lynx AI // Spirits Lynx AI
class mob_halazzi_lynx : public CreatureScript
struct boss_spiritlynxAI : public ScriptedAI
{ {
boss_spiritlynxAI(Creature *c) : ScriptedAI(c) {} public:
uint32 FrenzyTimer; mob_halazzi_lynx()
uint32 shredder_timer; : CreatureScript("mob_halazzi_lynx")
void Reset()
{
FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds
shredder_timer = 4000;
}
void DamageTaken(Unit * /*done_by*/, uint32 &damage)
{
if (damage >= me->GetHealth())
damage = 0;
}
void AttackStart(Unit *who)
{
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
ScriptedAI::AttackStart(who);
}
void EnterCombat(Unit * /*who*/) {/*DoZoneInCombat();*/}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (FrenzyTimer <= diff)
{ {
DoCast(me, SPELL_LYNX_FRENZY); }
FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds
} else FrenzyTimer -= diff;
if (shredder_timer <= diff) struct mob_halazzi_lynxAI : public ScriptedAI
{ {
DoCast(me->getVictim(), SPELL_SHRED_ARMOR); mob_halazzi_lynxAI(Creature *c) : ScriptedAI(c) {}
shredder_timer = 4000;
} else shredder_timer -= diff;
DoMeleeAttackIfReady(); uint32 FrenzyTimer;
} uint32 shredder_timer;
void Reset()
{
FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds
shredder_timer = 4000;
}
void DamageTaken(Unit * /*done_by*/, uint32 &damage)
{
if (damage >= me->GetHealth())
damage = 0;
}
void AttackStart(Unit *who)
{
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
ScriptedAI::AttackStart(who);
}
void EnterCombat(Unit * /*who*/) {/*DoZoneInCombat();*/}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (FrenzyTimer <= diff)
{
DoCast(me, SPELL_LYNX_FRENZY);
FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds
} else FrenzyTimer -= diff;
if (shredder_timer <= diff)
{
DoCast(me->getVictim(), SPELL_SHRED_ARMOR);
shredder_timer = 4000;
} else shredder_timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_halazzi_lynxAI(creature);
}
}; };
CreatureAI* GetAI_boss_halazziAI(Creature* pCreature)
{
return new boss_halazziAI (pCreature);
}
CreatureAI* GetAI_boss_spiritlynxAI(Creature* pCreature)
{
return new boss_spiritlynxAI (pCreature);
}
void AddSC_boss_halazzi() void AddSC_boss_halazzi()
{ {
Script *newscript; new boss_halazzi();
newscript = new Script; new mob_halazzi_lynx();
newscript->Name = "boss_halazzi";
newscript->GetAI = &GetAI_boss_halazziAI;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_halazzi_lynx";
newscript->GetAI = &GetAI_boss_spiritlynxAI;
newscript->RegisterSelf();
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -90,364 +90,371 @@ float NalorakkWay[8][3] =
#define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!" #define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!"
#define SOUND_YELL_TOBEAR 12072 #define SOUND_YELL_TOBEAR 12072
struct boss_nalorakkAI : public ScriptedAI class boss_nalorakk : public CreatureScript
{ {
boss_nalorakkAI(Creature *c) : ScriptedAI(c) public:
{
MoveEvent = true;
MovePhase = 0;
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance; boss_nalorakk()
: CreatureScript("boss_nalorakk")
uint32 BrutalSwipe_Timer;
uint32 Mangle_Timer;
uint32 Surge_Timer;
uint32 LaceratingSlash_Timer;
uint32 RendFlesh_Timer;
uint32 DeafeningRoar_Timer;
uint32 ShapeShift_Timer;
uint32 Berserk_Timer;
bool inBearForm;
bool MoveEvent;
bool inMove;
uint32 MovePhase;
uint32 waitTimer;
void Reset()
{
if (MoveEvent)
{ {
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
inMove = false;
waitTimer = 0;
me->SetSpeed(MOVE_RUN,2);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
}else
{
(*me).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]);
} }
if (pInstance) struct boss_nalorakkAI : public ScriptedAI
pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
Surge_Timer = 15000 + rand()%5000;
BrutalSwipe_Timer = 7000 + rand()%5000;
Mangle_Timer = 10000 + rand()%5000;
ShapeShift_Timer = 45000 + rand()%5000;
Berserk_Timer = 600000;
inBearForm = false;
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id
}
void SendAttacker(Unit *pTarget)
{
std::list<Creature*> templist;
float x, y, z;
me->GetPosition(x, y, z);
{ {
CellPair pair(Trinity::ComputeCellPair(x, y)); boss_nalorakkAI(Creature *c) : ScriptedAI(c)
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllFriendlyCreaturesInGrid check(me);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *(me->GetMap()));
}
if (!templist.size())
return;
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
if ((*i) && me->IsWithinDistInMap((*i),25))
{ {
(*i)->SetNoCallAssistance(true); MoveEvent = true;
(*i)->AI()->AttackStart(pTarget); MovePhase = 0;
pInstance = c->GetInstanceData();
} }
}
}
void AttackStart(Unit* who) ScriptedInstance *pInstance;
{
if (!MoveEvent)
ScriptedAI::AttackStart(who);
}
void MoveInLineOfSight(Unit *who) uint32 BrutalSwipe_Timer;
{ uint32 Mangle_Timer;
if (!MoveEvent) uint32 Surge_Timer;
{
ScriptedAI::MoveInLineOfSight(who); uint32 LaceratingSlash_Timer;
} uint32 RendFlesh_Timer;
else uint32 DeafeningRoar_Timer;
{
if (me->IsHostileTo(who)) uint32 ShapeShift_Timer;
uint32 Berserk_Timer;
bool inBearForm;
bool MoveEvent;
bool inMove;
uint32 MovePhase;
uint32 waitTimer;
void Reset()
{ {
if (!inMove) if (MoveEvent)
{ {
switch(MovePhase) me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
{ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
case 0:
if (me->IsWithinDistInMap(who, 50))
{
me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1);
(*me).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]);
MovePhase ++;
inMove = true;
SendAttacker(who);
}
break;
case 2:
if (me->IsWithinDistInMap(who, 40))
{
me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2);
(*me).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]);
MovePhase ++;
inMove = true;
SendAttacker(who);
}
break;
case 5:
if (me->IsWithinDistInMap(who, 40))
{
me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3);
(*me).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]);
MovePhase ++;
inMove = true;
SendAttacker(who);
}
break;
case 7:
if (me->IsWithinDistInMap(who, 50))
{
SendAttacker(who);
me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
MoveEvent = false;
}
break;
}
}
}
}
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
DoZoneInCombat();
}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_NALORAKKEVENT, DONE);
me->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
}
void KilledUnit(Unit* /*victim*/)
{
switch (urand(0,1))
{
case 0:
me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
break;
case 1:
me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
break;
}
}
void MovementInform(uint32 type, uint32 id)
{
if (MoveEvent)
{
if (type != POINT_MOTION_TYPE)
return;
if (!inMove)
return;
if (MovePhase != id)
return;
switch(MovePhase)
{
case 2:
me->SetOrientation(3.1415*2);
inMove = false; inMove = false;
return;
case 1:
case 3:
case 4:
case 6:
MovePhase ++;
waitTimer = 1;
inMove = true;
return;
case 5:
me->SetOrientation(3.1415*0.5);
inMove = false;
return;
case 7:
me->SetOrientation(3.1415*0.5);
inMove = false;
return;
}
}
}
void UpdateAI(const uint32 diff)
{
if (waitTimer)
{
if (inMove)
if (waitTimer <= diff)
{
(*me).GetMotionMaster()->MovementExpired();
(*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]);
waitTimer = 0; waitTimer = 0;
} else waitTimer -= diff; me->SetSpeed(MOVE_RUN,2);
} me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
}else
{
(*me).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]);
}
if (!UpdateVictim()) if (pInstance)
return; pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_BERSERK);
Berserk_Timer = 600000;
} else Berserk_Timer -= diff;
if (ShapeShift_Timer <= diff)
{
if (inBearForm)
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_TOTROLL);
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
Surge_Timer = 15000 + rand()%5000; Surge_Timer = 15000 + rand()%5000;
BrutalSwipe_Timer = 7000 + rand()%5000; BrutalSwipe_Timer = 7000 + rand()%5000;
Mangle_Timer = 10000 + rand()%5000; Mangle_Timer = 10000 + rand()%5000;
ShapeShift_Timer = 45000 + rand()%5000; ShapeShift_Timer = 45000 + rand()%5000;
Berserk_Timer = 600000;
inBearForm = false; inBearForm = false;
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id
} }
else
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_TOBEAR);
DoCast(me, SPELL_BEARFORM, true);
LaceratingSlash_Timer = 2000; // dur 18s
RendFlesh_Timer = 3000; // dur 5s
DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s
ShapeShift_Timer = 20000 + rand()%5000; // dur 30s
inBearForm = true;
}
} else ShapeShift_Timer -= diff;
if (!inBearForm) void SendAttacker(Unit *pTarget)
{
if (BrutalSwipe_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_BRUTALSWIPE); std::list<Creature*> templist;
BrutalSwipe_Timer = 7000 + rand()%5000; float x, y, z;
} else BrutalSwipe_Timer -= diff; me->GetPosition(x, y, z);
if (Mangle_Timer <= diff)
{
if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT))
{ {
DoCast(me->getVictim(), SPELL_MANGLE); CellPair pair(Trinity::ComputeCellPair(x, y));
Mangle_Timer = 1000; Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllFriendlyCreaturesInGrid check(me);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *(me->GetMap()));
} }
else Mangle_Timer = 10000 + rand()%5000;
} else Mangle_Timer -= diff;
if (Surge_Timer <= diff) if (!templist.size())
return;
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
if ((*i) && me->IsWithinDistInMap((*i),25))
{
(*i)->SetNoCallAssistance(true);
(*i)->AI()->AttackStart(pTarget);
}
}
}
void AttackStart(Unit* who)
{ {
me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); if (!MoveEvent)
DoPlaySoundToSet(me, SOUND_YELL_SURGE); ScriptedAI::AttackStart(who);
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); }
if (pTarget)
DoCast(pTarget, SPELL_SURGE); void MoveInLineOfSight(Unit *who)
Surge_Timer = 15000 + rand()%5000; {
} else Surge_Timer -= diff; if (!MoveEvent)
} {
else ScriptedAI::MoveInLineOfSight(who);
}
else
{
if (me->IsHostileTo(who))
{
if (!inMove)
{
switch(MovePhase)
{
case 0:
if (me->IsWithinDistInMap(who, 50))
{
me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1);
(*me).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]);
MovePhase ++;
inMove = true;
SendAttacker(who);
}
break;
case 2:
if (me->IsWithinDistInMap(who, 40))
{
me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2);
(*me).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]);
MovePhase ++;
inMove = true;
SendAttacker(who);
}
break;
case 5:
if (me->IsWithinDistInMap(who, 40))
{
me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3);
(*me).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]);
MovePhase ++;
inMove = true;
SendAttacker(who);
}
break;
case 7:
if (me->IsWithinDistInMap(who, 50))
{
SendAttacker(who);
me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
MoveEvent = false;
}
break;
}
}
}
}
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
DoZoneInCombat();
}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_NALORAKKEVENT, DONE);
me->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
}
void KilledUnit(Unit* /*victim*/)
{
switch (urand(0,1))
{
case 0:
me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
break;
case 1:
me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
break;
}
}
void MovementInform(uint32 type, uint32 id)
{
if (MoveEvent)
{
if (type != POINT_MOTION_TYPE)
return;
if (!inMove)
return;
if (MovePhase != id)
return;
switch(MovePhase)
{
case 2:
me->SetOrientation(3.1415*2);
inMove = false;
return;
case 1:
case 3:
case 4:
case 6:
MovePhase ++;
waitTimer = 1;
inMove = true;
return;
case 5:
me->SetOrientation(3.1415*0.5);
inMove = false;
return;
case 7:
me->SetOrientation(3.1415*0.5);
inMove = false;
return;
}
}
}
void UpdateAI(const uint32 diff)
{
if (waitTimer)
{
if (inMove)
if (waitTimer <= diff)
{
(*me).GetMotionMaster()->MovementExpired();
(*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]);
waitTimer = 0;
} else waitTimer -= diff;
}
if (!UpdateVictim())
return;
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_BERSERK);
Berserk_Timer = 600000;
} else Berserk_Timer -= diff;
if (ShapeShift_Timer <= diff)
{
if (inBearForm)
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_TOTROLL);
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
Surge_Timer = 15000 + rand()%5000;
BrutalSwipe_Timer = 7000 + rand()%5000;
Mangle_Timer = 10000 + rand()%5000;
ShapeShift_Timer = 45000 + rand()%5000;
inBearForm = false;
}
else
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_TOBEAR);
DoCast(me, SPELL_BEARFORM, true);
LaceratingSlash_Timer = 2000; // dur 18s
RendFlesh_Timer = 3000; // dur 5s
DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s
ShapeShift_Timer = 20000 + rand()%5000; // dur 30s
inBearForm = true;
}
} else ShapeShift_Timer -= diff;
if (!inBearForm)
{
if (BrutalSwipe_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_BRUTALSWIPE);
BrutalSwipe_Timer = 7000 + rand()%5000;
} else BrutalSwipe_Timer -= diff;
if (Mangle_Timer <= diff)
{
if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT))
{
DoCast(me->getVictim(), SPELL_MANGLE);
Mangle_Timer = 1000;
}
else Mangle_Timer = 10000 + rand()%5000;
} else Mangle_Timer -= diff;
if (Surge_Timer <= diff)
{
me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_SURGE);
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (pTarget)
DoCast(pTarget, SPELL_SURGE);
Surge_Timer = 15000 + rand()%5000;
} else Surge_Timer -= diff;
}
else
{
if (LaceratingSlash_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_LACERATINGSLASH);
LaceratingSlash_Timer = 18000 + rand()%5000;
} else LaceratingSlash_Timer -= diff;
if (RendFlesh_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_RENDFLESH);
RendFlesh_Timer = 5000 + rand()%5000;
} else RendFlesh_Timer -= diff;
if (DeafeningRoar_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_DEAFENINGROAR);
DeafeningRoar_Timer = 15000 + rand()%5000;
} else DeafeningRoar_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{ {
if (LaceratingSlash_Timer <= diff) return new boss_nalorakkAI(creature);
{
DoCast(me->getVictim(), SPELL_LACERATINGSLASH);
LaceratingSlash_Timer = 18000 + rand()%5000;
} else LaceratingSlash_Timer -= diff;
if (RendFlesh_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_RENDFLESH);
RendFlesh_Timer = 5000 + rand()%5000;
} else RendFlesh_Timer -= diff;
if (DeafeningRoar_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_DEAFENINGROAR);
DeafeningRoar_Timer = 15000 + rand()%5000;
} else DeafeningRoar_Timer -= diff;
} }
DoMeleeAttackIfReady();
}
}; };
CreatureAI* GetAI_boss_nalorakk(Creature* pCreature)
{
return new boss_nalorakkAI (pCreature);
}
void AddSC_boss_nalorakk() void AddSC_boss_nalorakk()
{ {
Script *newscript; new boss_nalorakk();
newscript = new Script;
newscript->Name = "boss_nalorakk";
newscript->GetAI = &GetAI_boss_nalorakk;
newscript->RegisterSelf();
} }
@@ -140,486 +140,500 @@ static TransformStruct Transform[] =
{SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX}
}; };
struct boss_zuljinAI : public ScriptedAI class boss_zuljin : public CreatureScript
{ {
boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(me) public:
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint64 SpiritGUID[4]; boss_zuljin()
uint64 ClawTargetGUID; : CreatureScript("boss_zuljin")
uint64 TankGUID;
uint32 Phase;
uint32 health_20;
uint32 Intro_Timer;
uint32 Berserk_Timer;
uint32 Whirlwind_Timer;
uint32 Grievous_Throw_Timer;
uint32 Creeping_Paralysis_Timer;
uint32 Overpower_Timer;
uint32 Claw_Rage_Timer;
uint32 Lynx_Rush_Timer;
uint32 Claw_Counter;
uint32 Claw_Loop_Timer;
uint32 Flame_Whirl_Timer;
uint32 Flame_Breath_Timer;
uint32 Pillar_Of_Fire_Timer;
SummonList Summons;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
Phase = 0;
health_20 = me->GetMaxHealth()*0.2;
Intro_Timer = 37000;
Berserk_Timer = 600000;
Whirlwind_Timer = 7000;
Grievous_Throw_Timer = 8000;
Creeping_Paralysis_Timer = 7000;
Overpower_Timer = 0;
Claw_Rage_Timer = 5000;
Lynx_Rush_Timer = 14000;
Claw_Loop_Timer = 0;
Claw_Counter = 0;
Flame_Whirl_Timer = 5000;
Flame_Breath_Timer = 6000;
Pillar_Of_Fire_Timer = 7000;
ClawTargetGUID = 0;
TankGUID = 0;
Summons.DespawnAll();
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
//me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
DoZoneInCombat();
me->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_INTRO);
SpawnAdds();
EnterPhase(0);
}
void KilledUnit(Unit* /*victim*/)
{
if (Intro_Timer)
return;
switch (urand(0,1))
{ {
case 0:
me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
} }
}
void JustDied(Unit* /*Killer*/) struct boss_zuljinAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, DONE);
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
void AttackStart(Unit *who)
{
if (Phase == 2)
AttackStartNoMove(who);
else
ScriptedAI::AttackStart(who);
}
void DoMeleeAttackIfReady()
{
if (!me->IsNonMeleeSpellCasted(false))
{ {
if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim())) boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(me)
{ {
if (Phase == 1 && !Overpower_Timer) pInstance = c->GetInstanceData();
{
uint32 health = me->getVictim()->GetHealth();
me->AttackerStateUpdate(me->getVictim());
if (me->getVictim() && health == me->getVictim()->GetHealth())
{
DoCast(me->getVictim(), SPELL_OVERPOWER, false);
Overpower_Timer = 5000;
}
} else me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
} }
} ScriptedInstance *pInstance;
}
void SpawnAdds() uint64 SpiritGUID[4];
{ uint64 ClawTargetGUID;
Creature *pCreature = NULL; uint64 TankGUID;
for (uint8 i = 0; i < 4; ++i)
{ uint32 Phase;
pCreature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0); uint32 health_20;
if (pCreature)
uint32 Intro_Timer;
uint32 Berserk_Timer;
uint32 Whirlwind_Timer;
uint32 Grievous_Throw_Timer;
uint32 Creeping_Paralysis_Timer;
uint32 Overpower_Timer;
uint32 Claw_Rage_Timer;
uint32 Lynx_Rush_Timer;
uint32 Claw_Counter;
uint32 Claw_Loop_Timer;
uint32 Flame_Whirl_Timer;
uint32 Flame_Breath_Timer;
uint32 Pillar_Of_Fire_Timer;
SummonList Summons;
void Reset()
{ {
pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true); if (pInstance)
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
SpiritGUID[i] = pCreature->GetGUID(); Phase = 0;
health_20 = me->GetMaxHealth()*0.2;
Intro_Timer = 37000;
Berserk_Timer = 600000;
Whirlwind_Timer = 7000;
Grievous_Throw_Timer = 8000;
Creeping_Paralysis_Timer = 7000;
Overpower_Timer = 0;
Claw_Rage_Timer = 5000;
Lynx_Rush_Timer = 14000;
Claw_Loop_Timer = 0;
Claw_Counter = 0;
Flame_Whirl_Timer = 5000;
Flame_Breath_Timer = 6000;
Pillar_Of_Fire_Timer = 7000;
ClawTargetGUID = 0;
TankGUID = 0;
Summons.DespawnAll();
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
//me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
} }
}
}
void DespawnAdds() void EnterCombat(Unit * /*who*/)
{
for (uint8 i = 0; i < 4; ++i)
{
Unit* Temp = NULL;
if (SpiritGUID[i])
{ {
if (Temp = Unit::GetUnit(*me, SpiritGUID[i])) if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
DoZoneInCombat();
me->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me, SOUND_INTRO);
SpawnAdds();
EnterPhase(0);
}
void KilledUnit(Unit* /*victim*/)
{
if (Intro_Timer)
return;
switch (urand(0,1))
{ {
Temp->SetVisibility(VISIBILITY_OFF); case 0:
Temp->setDeathState(DEAD); me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
} }
} }
SpiritGUID[i] = 0;
}
}
void JustSummoned(Creature *summon) void JustDied(Unit* /*Killer*/)
{
Summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature *summon)
{
Summons.Despawn(summon);
}
void EnterPhase(uint32 NextPhase)
{
switch(NextPhase)
{
case 0:
break;
case 1:
case 2:
case 3:
case 4:
DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100);
DoResetThreat();
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
me->RemoveAurasDueToSpell(Transform[Phase].unaura);
DoCast(me, Transform[Phase].spell);
me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, Transform[Phase].sound);
if (Phase > 0)
{ {
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, DONE);
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
} }
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1]))
Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp void AttackStart(Unit *who)
if (NextPhase == 2)
{ {
me->GetMotionMaster()->Clear(); if (Phase == 2)
DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura AttackStartNoMove(who);
else
ScriptedAI::AttackStart(who);
}
void DoMeleeAttackIfReady()
{
if (!me->IsNonMeleeSpellCasted(false))
{
if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim()))
{
if (Phase == 1 && !Overpower_Timer)
{
uint32 health = me->getVictim()->GetHealth();
me->AttackerStateUpdate(me->getVictim());
if (me->getVictim() && health == me->getVictim()->GetHealth())
{
DoCast(me->getVictim(), SPELL_OVERPOWER, false);
Overpower_Timer = 5000;
}
} else me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
}
}
void SpawnAdds()
{
Creature *pCreature = NULL;
for (uint8 i = 0; i < 4; ++i) for (uint8 i = 0; i < 4; ++i)
{ {
Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); pCreature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Vortex) if (pCreature)
{ {
Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true); pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true);
Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true); pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Vortex->SetSpeed(MOVE_RUN, 1.0f); SpiritGUID[i] = pCreature->GetGUID();
Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
DoZoneInCombat(Vortex);
} }
} }
} }
else
me->AI()->AttackStart(me->getVictim()); void DespawnAdds()
if (NextPhase == 3)
{ {
me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); for (uint8 i = 0; i < 4; ++i)
Summons.DespawnEntry(CREATURE_FEATHER_VORTEX);
me->GetMotionMaster()->MoveChase(me->getVictim());
}
break;
default:
break;
}
Phase = NextPhase;
}
void UpdateAI(const uint32 diff)
{
if (!TankGUID)
{
if (!UpdateVictim())
return;
if (me->GetHealth() < health_20 * (4 - Phase))
EnterPhase(Phase + 1);
}
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_BERSERK);
Berserk_Timer = 60000;
} else Berserk_Timer -= diff;
switch (Phase)
{
case 0:
if (Intro_Timer)
{
if (Intro_Timer <= diff)
{ {
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); Unit* Temp = NULL;
DoPlaySoundToSet(me, SOUND_AGGRO); if (SpiritGUID[i])
Intro_Timer = 0;
} else Intro_Timer -= diff;
}
if (Whirlwind_Timer <= diff)
{
DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 15000 + rand()%5000;
} else Whirlwind_Timer -= diff;
if (Grievous_Throw_Timer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_GRIEVOUS_THROW, false);
Grievous_Throw_Timer = 10000;
} else Grievous_Throw_Timer -= diff;
break;
case 1:
if (Creeping_Paralysis_Timer <= diff)
{
DoCast(me, SPELL_CREEPING_PARALYSIS);
Creeping_Paralysis_Timer = 20000;
} else Creeping_Paralysis_Timer -= diff;
if (Overpower_Timer <= diff)
{
// implemented in DoMeleeAttackIfReady()
Overpower_Timer = 0;
} else Overpower_Timer -= diff;
break;
case 2:
return;
case 3:
if (Claw_Rage_Timer <= diff)
{
if (!TankGUID)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{ {
TankGUID = me->getVictim()->GetGUID(); if (Temp = Unit::GetUnit(*me, SpiritGUID[i]))
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
Claw_Counter = 0;
}
}
else if (!Claw_Rage_Timer) // do not do this when Lynx_Rush
{
if (Claw_Loop_Timer <= diff)
{
Unit *pTarget = me->getVictim();
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID);
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
{ {
AttackStart(pTarget); Temp->SetVisibility(VISIBILITY_OFF);
if (me->IsWithinMeleeRange(pTarget)) Temp->setDeathState(DEAD);
{
DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 12)
{
Claw_Rage_Timer = 15000 + rand()%5000;
me->SetSpeed(MOVE_RUN, 1.2f);
AttackStart(Unit::GetUnit(*me, TankGUID));
TankGUID = 0;
return;
}
else
Claw_Loop_Timer = 500;
}
} }
else
{
EnterEvadeMode(); // if (pTarget)
return;
}
} else Claw_Loop_Timer -= diff;
} //if (TankGUID)
} else Claw_Rage_Timer -= diff;
if (Lynx_Rush_Timer <= diff)
{
if (!TankGUID)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->getVictim()->GetGUID();
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Lynx_Rush_Timer = 0;
Claw_Counter = 0;
} }
SpiritGUID[i] = 0;
} }
else if (!Lynx_Rush_Timer) }
void JustSummoned(Creature *summon)
{
Summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature *summon)
{
Summons.Despawn(summon);
}
void EnterPhase(uint32 NextPhase)
{
switch(NextPhase)
{ {
Unit *pTarget = me->getVictim(); case 0:
if (!pTarget || !pTarget->isTargetableForAttack()) break;
case 1:
case 2:
case 3:
case 4:
DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100);
DoResetThreat();
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
me->RemoveAurasDueToSpell(Transform[Phase].unaura);
DoCast(me, Transform[Phase].spell);
me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, Transform[Phase].sound);
if (Phase > 0)
{ {
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1]))
AttackStart(pTarget); Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
} }
if (pTarget) if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1]))
Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp
if (NextPhase == 2)
{ {
if (me->IsWithinMeleeRange(pTarget)) me->GetMotionMaster()->Clear();
DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura
for (uint8 i = 0; i < 4; ++i)
{ {
DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true); Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
++Claw_Counter; if (Vortex)
if (Claw_Counter == 9)
{ {
Lynx_Rush_Timer = 15000 + rand()%5000; Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
me->SetSpeed(MOVE_RUN, 1.2f); Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
AttackStart(Unit::GetUnit(*me, TankGUID)); Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
TankGUID = 0; Vortex->SetSpeed(MOVE_RUN, 1.0f);
Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
DoZoneInCombat(Vortex);
} }
else
AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
} }
} }
else else
me->AI()->AttackStart(me->getVictim());
if (NextPhase == 3)
{ {
EnterEvadeMode(); // if (pTarget) me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
return; Summons.DespawnEntry(CREATURE_FEATHER_VORTEX);
me->GetMotionMaster()->MoveChase(me->getVictim());
} }
} //if (TankGUID) break;
} else Lynx_Rush_Timer -= diff; default:
break;
}
Phase = NextPhase;
}
break; void UpdateAI(const uint32 diff)
case 4:
if (Flame_Whirl_Timer <= diff)
{ {
DoCast(me, SPELL_FLAME_WHIRL); if (!TankGUID)
Flame_Whirl_Timer = 12000; {
}Flame_Whirl_Timer -= diff; if (!UpdateVictim())
return;
if (Pillar_Of_Fire_Timer <= diff) if (me->GetHealth() < health_20 * (4 - Phase))
{ EnterPhase(Phase + 1);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) }
DoCast(pTarget, SPELL_SUMMON_PILLAR);
Pillar_Of_Fire_Timer = 10000;
} else Pillar_Of_Fire_Timer -= diff;
if (Flame_Breath_Timer <= diff) if (Berserk_Timer <= diff)
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(me, SPELL_BERSERK, true);
me->SetInFront(pTarget); me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoCast(me, SPELL_FLAME_BREATH); DoPlaySoundToSet(me, SOUND_BERSERK);
Flame_Breath_Timer = 10000; Berserk_Timer = 60000;
} else Flame_Breath_Timer -= diff; } else Berserk_Timer -= diff;
break;
default: switch (Phase)
break; {
case 0:
if (Intro_Timer)
{
if (Intro_Timer <= diff)
{
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_AGGRO);
Intro_Timer = 0;
} else Intro_Timer -= diff;
}
if (Whirlwind_Timer <= diff)
{
DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 15000 + rand()%5000;
} else Whirlwind_Timer -= diff;
if (Grievous_Throw_Timer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_GRIEVOUS_THROW, false);
Grievous_Throw_Timer = 10000;
} else Grievous_Throw_Timer -= diff;
break;
case 1:
if (Creeping_Paralysis_Timer <= diff)
{
DoCast(me, SPELL_CREEPING_PARALYSIS);
Creeping_Paralysis_Timer = 20000;
} else Creeping_Paralysis_Timer -= diff;
if (Overpower_Timer <= diff)
{
// implemented in DoMeleeAttackIfReady()
Overpower_Timer = 0;
} else Overpower_Timer -= diff;
break;
case 2:
return;
case 3:
if (Claw_Rage_Timer <= diff)
{
if (!TankGUID)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->getVictim()->GetGUID();
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
Claw_Counter = 0;
}
}
else if (!Claw_Rage_Timer) // do not do this when Lynx_Rush
{
if (Claw_Loop_Timer <= diff)
{
Unit *pTarget = me->getVictim();
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID);
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
{
AttackStart(pTarget);
if (me->IsWithinMeleeRange(pTarget))
{
DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 12)
{
Claw_Rage_Timer = 15000 + rand()%5000;
me->SetSpeed(MOVE_RUN, 1.2f);
AttackStart(Unit::GetUnit(*me, TankGUID));
TankGUID = 0;
return;
}
else
Claw_Loop_Timer = 500;
}
}
else
{
EnterEvadeMode(); // if (pTarget)
return;
}
} else Claw_Loop_Timer -= diff;
} //if (TankGUID)
} else Claw_Rage_Timer -= diff;
if (Lynx_Rush_Timer <= diff)
{
if (!TankGUID)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->getVictim()->GetGUID();
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
Lynx_Rush_Timer = 0;
Claw_Counter = 0;
}
}
else if (!Lynx_Rush_Timer)
{
Unit *pTarget = me->getVictim();
if (!pTarget || !pTarget->isTargetableForAttack())
{
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
AttackStart(pTarget);
}
if (pTarget)
{
if (me->IsWithinMeleeRange(pTarget))
{
DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 9)
{
Lynx_Rush_Timer = 15000 + rand()%5000;
me->SetSpeed(MOVE_RUN, 1.2f);
AttackStart(Unit::GetUnit(*me, TankGUID));
TankGUID = 0;
}
else
AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
}
}
else
{
EnterEvadeMode(); // if (pTarget)
return;
}
} //if (TankGUID)
} else Lynx_Rush_Timer -= diff;
break;
case 4:
if (Flame_Whirl_Timer <= diff)
{
DoCast(me, SPELL_FLAME_WHIRL);
Flame_Whirl_Timer = 12000;
}Flame_Whirl_Timer -= diff;
if (Pillar_Of_Fire_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SUMMON_PILLAR);
Pillar_Of_Fire_Timer = 10000;
} else Pillar_Of_Fire_Timer -= diff;
if (Flame_Breath_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
me->SetInFront(pTarget);
DoCast(me, SPELL_FLAME_BREATH);
Flame_Breath_Timer = 10000;
} else Flame_Breath_Timer -= diff;
break;
default:
break;
}
if (!TankGUID)
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_zuljinAI(creature);
}
};
class mob_zuljin_vortex : public CreatureScript
{
public:
mob_zuljin_vortex()
: CreatureScript("mob_zuljin_vortex")
{
} }
if (!TankGUID) struct mob_zuljin_vortexAI : public ScriptedAI
DoMeleeAttackIfReady(); {
} mob_zuljin_vortexAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit * /*pTarget*/) {}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_ZAP_INFORM)
DoCast(caster, SPELL_ZAP_DAMAGE, true);
}
void UpdateAI(const uint32 /*diff*/)
{
//if the vortex reach the target, it change his target to another player
if (me->IsWithinMeleeRange(me->getVictim()))
AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_zuljin_vortexAI(creature);
}
}; };
CreatureAI* GetAI_boss_zuljin(Creature* pCreature)
{
return new boss_zuljinAI (pCreature);
}
struct feather_vortexAI : public ScriptedAI
{
feather_vortexAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit * /*pTarget*/) {}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_ZAP_INFORM)
DoCast(caster, SPELL_ZAP_DAMAGE, true);
}
void UpdateAI(const uint32 /*diff*/)
{
//if the vortex reach the target, it change his target to another player
if (me->IsWithinMeleeRange(me->getVictim()))
AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
}
};
CreatureAI* GetAI_feather_vortexAI(Creature* pCreature)
{
return new feather_vortexAI (pCreature);
}
void AddSC_boss_zuljin() void AddSC_boss_zuljin()
{ {
Script *newscript; new boss_zuljin();
newscript = new Script; new mob_zuljin_vortex();
newscript->Name = "boss_zuljin";
newscript->GetAI = &GetAI_boss_zuljin;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_zuljin_vortex";
newscript->GetAI = &GetAI_feather_vortexAI;
newscript->RegisterSelf();
} }
@@ -51,272 +51,277 @@ static SHostageInfo HostageInfo[] =
}; };
struct instance_zulaman : public ScriptedInstance class instance_zulaman : public InstanceMapScript
{ {
instance_zulaman(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; public:
instance_zulaman()
uint64 HarkorsSatchelGUID; : InstanceMapScript("instance_zulaman")
uint64 TanzarsTrunkGUID;
uint64 AshlisBagGUID;
uint64 KrazsPackageGUID;
uint64 HexLordGateGUID;
uint64 ZulJinGateGUID;
uint64 AkilzonDoorGUID;
uint64 ZulJinDoorGUID;
uint64 HalazziDoorGUID;
uint32 QuestTimer;
uint16 BossKilled;
uint16 QuestMinute;
uint16 ChestLooted;
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 RandVendor[RAND_VENDOR];
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
HarkorsSatchelGUID = 0;
TanzarsTrunkGUID = 0;
AshlisBagGUID = 0;
KrazsPackageGUID = 0;
HexLordGateGUID = 0;
ZulJinGateGUID = 0;
AkilzonDoorGUID = 0;
HalazziDoorGUID = 0;
ZulJinDoorGUID = 0;
QuestTimer = 0;
QuestMinute = 21;
BossKilled = 0;
ChestLooted = 0;
for (uint8 i = 0; i < RAND_VENDOR; ++i)
RandVendor[i] = NOT_STARTED;
}
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{ {
case 23578://janalai
case 23863://zuljin
case 24239://hexlord
case 23577://halazzi
case 23576://nalorakk
default: break;
} }
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/) struct instance_zulaman_InstanceMapScript : public ScriptedInstance
{
switch(pGo->GetEntry())
{ {
case 186303: HalazziDoorGUID = pGo->GetGUID(); break; instance_zulaman_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
case 186304: ZulJinGateGUID = pGo->GetGUID(); break;
case 186305: HexLordGateGUID = pGo->GetGUID(); break;
case 186858: AkilzonDoorGUID = pGo->GetGUID(); break;
case 186859: ZulJinDoorGUID = pGo->GetGUID(); break;
case 187021: HarkorsSatchelGUID = pGo->GetGUID(); break; uint64 HarkorsSatchelGUID;
case 186648: TanzarsTrunkGUID = pGo->GetGUID(); break; uint64 TanzarsTrunkGUID;
case 186672: AshlisBagGUID = pGo->GetGUID(); break; uint64 AshlisBagGUID;
case 186667: KrazsPackageGUID = pGo->GetGUID(); break; uint64 KrazsPackageGUID;
default: break;
} uint64 HexLordGateGUID;
CheckInstanceStatus(); uint64 ZulJinGateGUID;
} uint64 AkilzonDoorGUID;
uint64 ZulJinDoorGUID;
uint64 HalazziDoorGUID;
void SummonHostage(uint8 num) uint32 QuestTimer;
{ uint16 BossKilled;
if (!QuestMinute) uint16 QuestMinute;
return; uint16 ChestLooted;
Map::PlayerList const &PlayerList = instance->GetPlayers(); uint32 m_auiEncounter[MAX_ENCOUNTER];
if (PlayerList.isEmpty()) uint32 RandVendor[RAND_VENDOR];
return;
Map::PlayerList::const_iterator i = PlayerList.begin(); void Initialize()
if (Player* i_pl = i->getSource())
{
if (Unit* Hostage = i_pl->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0))
{ {
Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
HarkorsSatchelGUID = 0;
TanzarsTrunkGUID = 0;
AshlisBagGUID = 0;
KrazsPackageGUID = 0;
HexLordGateGUID = 0;
ZulJinGateGUID = 0;
AkilzonDoorGUID = 0;
HalazziDoorGUID = 0;
ZulJinDoorGUID = 0;
QuestTimer = 0;
QuestMinute = 21;
BossKilled = 0;
ChestLooted = 0;
for (uint8 i = 0; i < RAND_VENDOR; ++i)
RandVendor[i] = NOT_STARTED;
} }
}
}
void CheckInstanceStatus() bool IsEncounterInProgress() const
{
if (BossKilled >= 4)
HandleGameObject(HexLordGateGUID, true);
if (BossKilled >= 5)
HandleGameObject(ZulJinGateGUID, true);
}
std::string GetSaveData()
{
std::ostringstream ss;
ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute;
char* data = new char[ss.str().length()+1];
strcpy(data, ss.str().c_str());
//sLog.outError("TSCR: Zul'aman saved, %s.", data);
return data;
}
void Load(const char* load)
{
if (!load) return;
std::istringstream ss(load);
//sLog.outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str());
char dataHead; // S
uint16 data1, data2, data3;
ss >> dataHead >> data1 >> data2 >> data3;
//sLog.outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3);
if (dataHead == 'S')
{
BossKilled = data1;
ChestLooted = data2;
QuestMinute = data3;
} else sLog.outError("TSCR: Zul'aman: corrupted save data.");
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_NALORAKKEVENT:
m_auiEncounter[0] = data;
if (data == DONE)
{ {
if (QuestMinute) for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{ {
QuestMinute += 15; case 23578://janalai
DoUpdateWorldState(3106, QuestMinute); case 23863://zuljin
case 24239://hexlord
case 23577://halazzi
case 23576://nalorakk
default: break;
} }
SummonHostage(0);
} }
break;
case DATA_AKILZONEVENT: void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
m_auiEncounter[1] = data;
HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS);
if (data == DONE)
{ {
if (QuestMinute) switch(pGo->GetEntry())
{ {
QuestMinute += 10; case 186303: HalazziDoorGUID = pGo->GetGUID(); break;
DoUpdateWorldState(3106, QuestMinute); case 186304: ZulJinGateGUID = pGo->GetGUID(); break;
case 186305: HexLordGateGUID = pGo->GetGUID(); break;
case 186858: AkilzonDoorGUID = pGo->GetGUID(); break;
case 186859: ZulJinDoorGUID = pGo->GetGUID(); break;
case 187021: HarkorsSatchelGUID = pGo->GetGUID(); break;
case 186648: TanzarsTrunkGUID = pGo->GetGUID(); break;
case 186672: AshlisBagGUID = pGo->GetGUID(); break;
case 186667: KrazsPackageGUID = pGo->GetGUID(); break;
default: break;
} }
SummonHostage(1);
}
break;
case DATA_JANALAIEVENT:
m_auiEncounter[2] = data;
if (data == DONE) SummonHostage(2);
break;
case DATA_HALAZZIEVENT:
m_auiEncounter[3] = data;
HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS);
if (data == DONE) SummonHostage(3);
break;
case DATA_HEXLORDEVENT:
m_auiEncounter[4] = data;
if (data == IN_PROGRESS)
HandleGameObject(HexLordGateGUID, false);
else if (data == NOT_STARTED)
CheckInstanceStatus(); CheckInstanceStatus();
break;
case DATA_ZULJINEVENT:
m_auiEncounter[5] = data;
HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS);
break;
case DATA_CHESTLOOTED:
++ChestLooted;
SaveToDB();
break;
case TYPE_RAND_VENDOR_1:
RandVendor[0] = data;
break;
case TYPE_RAND_VENDOR_2:
RandVendor[1] = data;
break;
}
if (data == DONE)
{
++BossKilled;
if (QuestMinute && BossKilled >= 4)
{
QuestMinute = 0;
DoUpdateWorldState(3104, 0);
} }
CheckInstanceStatus();
SaveToDB();
}
}
uint32 GetData(uint32 type) void SummonHostage(uint8 num)
{ {
switch(type) if (!QuestMinute)
{ return;
case DATA_NALORAKKEVENT: return m_auiEncounter[0];
case DATA_AKILZONEVENT: return m_auiEncounter[1]; Map::PlayerList const &PlayerList = instance->GetPlayers();
case DATA_JANALAIEVENT: return m_auiEncounter[2]; if (PlayerList.isEmpty())
case DATA_HALAZZIEVENT: return m_auiEncounter[3]; return;
case DATA_HEXLORDEVENT: return m_auiEncounter[4];
case DATA_ZULJINEVENT: return m_auiEncounter[5]; Map::PlayerList::const_iterator i = PlayerList.begin();
case DATA_CHESTLOOTED: return ChestLooted; if (Player* i_pl = i->getSource())
case TYPE_RAND_VENDOR_1: return RandVendor[0]; {
case TYPE_RAND_VENDOR_2: return RandVendor[1]; if (Unit* Hostage = i_pl->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0))
default: return 0; {
} Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
} Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void Update(uint32 diff) }
{ }
if (QuestMinute)
{ void CheckInstanceStatus()
if (QuestTimer <= diff) {
if (BossKilled >= 4)
HandleGameObject(HexLordGateGUID, true);
if (BossKilled >= 5)
HandleGameObject(ZulJinGateGUID, true);
}
std::string GetSaveData()
{
std::ostringstream ss;
ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute;
char* data = new char[ss.str().length()+1];
strcpy(data, ss.str().c_str());
//sLog.outError("TSCR: Zul'aman saved, %s.", data);
return data;
}
void Load(const char* load)
{
if (!load) return;
std::istringstream ss(load);
//sLog.outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str());
char dataHead; // S
uint16 data1, data2, data3;
ss >> dataHead >> data1 >> data2 >> data3;
//sLog.outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3);
if (dataHead == 'S')
{
BossKilled = data1;
ChestLooted = data2;
QuestMinute = data3;
} else sLog.outError("TSCR: Zul'aman: corrupted save data.");
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_NALORAKKEVENT:
m_auiEncounter[0] = data;
if (data == DONE)
{
if (QuestMinute)
{
QuestMinute += 15;
DoUpdateWorldState(3106, QuestMinute);
}
SummonHostage(0);
}
break;
case DATA_AKILZONEVENT:
m_auiEncounter[1] = data;
HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS);
if (data == DONE)
{
if (QuestMinute)
{
QuestMinute += 10;
DoUpdateWorldState(3106, QuestMinute);
}
SummonHostage(1);
}
break;
case DATA_JANALAIEVENT:
m_auiEncounter[2] = data;
if (data == DONE) SummonHostage(2);
break;
case DATA_HALAZZIEVENT:
m_auiEncounter[3] = data;
HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS);
if (data == DONE) SummonHostage(3);
break;
case DATA_HEXLORDEVENT:
m_auiEncounter[4] = data;
if (data == IN_PROGRESS)
HandleGameObject(HexLordGateGUID, false);
else if (data == NOT_STARTED)
CheckInstanceStatus();
break;
case DATA_ZULJINEVENT:
m_auiEncounter[5] = data;
HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS);
break;
case DATA_CHESTLOOTED:
++ChestLooted;
SaveToDB();
break;
case TYPE_RAND_VENDOR_1:
RandVendor[0] = data;
break;
case TYPE_RAND_VENDOR_2:
RandVendor[1] = data;
break;
}
if (data == DONE)
{
++BossKilled;
if (QuestMinute && BossKilled >= 4)
{
QuestMinute = 0;
DoUpdateWorldState(3104, 0);
}
CheckInstanceStatus();
SaveToDB();
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_NALORAKKEVENT: return m_auiEncounter[0];
case DATA_AKILZONEVENT: return m_auiEncounter[1];
case DATA_JANALAIEVENT: return m_auiEncounter[2];
case DATA_HALAZZIEVENT: return m_auiEncounter[3];
case DATA_HEXLORDEVENT: return m_auiEncounter[4];
case DATA_ZULJINEVENT: return m_auiEncounter[5];
case DATA_CHESTLOOTED: return ChestLooted;
case TYPE_RAND_VENDOR_1: return RandVendor[0];
case TYPE_RAND_VENDOR_2: return RandVendor[1];
default: return 0;
}
}
void Update(uint32 diff)
{ {
QuestMinute--;
SaveToDB();
QuestTimer += 60000;
if (QuestMinute) if (QuestMinute)
{ {
DoUpdateWorldState(3104, 1); if (QuestTimer <= diff)
DoUpdateWorldState(3106, QuestMinute); {
} else DoUpdateWorldState(3104, 0); QuestMinute--;
SaveToDB();
QuestTimer += 60000;
if (QuestMinute)
{
DoUpdateWorldState(3104, 1);
DoUpdateWorldState(3106, QuestMinute);
} else DoUpdateWorldState(3104, 0);
}
QuestTimer -= diff;
}
} }
QuestTimer -= diff; };
}
}
};
InstanceData* GetInstanceData_instance_zulaman(Map* pMap) InstanceData* GetInstanceData(InstanceMap* pMap) const
{ {
return new instance_zulaman(pMap); return new instance_zulaman_InstanceMapScript(pMap);
} }
};
void AddSC_instance_zulaman() void AddSC_instance_zulaman()
{ {
Script *newscript; new instance_zulaman();
newscript = new Script;
newscript->Name = "instance_zulaman";
newscript->GetInstanceData = &GetInstanceData_instance_zulaman;
newscript->RegisterSelf();
} }
@@ -38,64 +38,75 @@ EndContentData */
#define SPELL_PUSH_MOJO 43923 #define SPELL_PUSH_MOJO 43923
#define ENTRY_FOREST_FROG 24396 #define ENTRY_FOREST_FROG 24396
struct npc_forest_frogAI : public ScriptedAI class npc_forest_frog : public CreatureScript
{ {
npc_forest_frogAI(Creature* c) : ScriptedAI(c) public:
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance; npc_forest_frog()
: CreatureScript("npc_forest_frog")
void Reset() {}
void EnterCombat(Unit * /*who*/) {}
void DoSpawnRandom()
{
if (pInstance)
{ {
uint32 cEntry = 0; }
switch(rand()%10)
struct npc_forest_frogAI : public ScriptedAI
{
npc_forest_frogAI(Creature* c) : ScriptedAI(c)
{ {
case 0: cEntry = 24397; break; //Mannuth pInstance = c->GetInstanceData();
case 1: cEntry = 24403; break; //Deez
case 2: cEntry = 24404; break; //Galathryn
case 3: cEntry = 24405; break; //Adarrah
case 4: cEntry = 24406; break; //Fudgerick
case 5: cEntry = 24407; break; //Darwen
case 6: cEntry = 24445; break; //Mitzi
case 7: cEntry = 24448; break; //Christian
case 8: cEntry = 24453; break; //Brennan
case 9: cEntry = 24455; break; //Hollee
} }
if (!pInstance->GetData(TYPE_RAND_VENDOR_1)) ScriptedInstance *pInstance;
if (rand()%10 == 1) cEntry = 24408; //Gunter
if (!pInstance->GetData(TYPE_RAND_VENDOR_2))
if (rand()%10 == 1) cEntry = 24409; //Kyren
if (cEntry) me->UpdateEntry(cEntry); void Reset() {}
if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE); void EnterCombat(Unit * /*who*/) {}
if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE);
}
}
void SpellHit(Unit *caster, const SpellEntry *spell) void DoSpawnRandom()
{ {
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG) if (pInstance)
{
uint32 cEntry = 0;
switch(rand()%10)
{
case 0: cEntry = 24397; break; //Mannuth
case 1: cEntry = 24403; break; //Deez
case 2: cEntry = 24404; break; //Galathryn
case 3: cEntry = 24405; break; //Adarrah
case 4: cEntry = 24406; break; //Fudgerick
case 5: cEntry = 24407; break; //Darwen
case 6: cEntry = 24445; break; //Mitzi
case 7: cEntry = 24448; break; //Christian
case 8: cEntry = 24453; break; //Brennan
case 9: cEntry = 24455; break; //Hollee
}
if (!pInstance->GetData(TYPE_RAND_VENDOR_1))
if (rand()%10 == 1) cEntry = 24408; //Gunter
if (!pInstance->GetData(TYPE_RAND_VENDOR_2))
if (rand()%10 == 1) cEntry = 24409; //Kyren
if (cEntry) me->UpdateEntry(cEntry);
if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE);
if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE);
}
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG)
{
//increase or decrease chance of mojo?
if (rand()%99 == 50) DoCast(caster, SPELL_PUSH_MOJO, true);
else DoSpawnRandom();
}
}
};
CreatureAI* GetAI(Creature* creature) const
{ {
//increase or decrease chance of mojo? return new npc_forest_frogAI(creature);
if (rand()%99 == 50) DoCast(caster, SPELL_PUSH_MOJO, true);
else DoSpawnRandom();
} }
}
}; };
CreatureAI* GetAI_npc_forest_frog(Creature* pCreature)
{
return new npc_forest_frogAI (pCreature);
}
/*###### /*######
## npc_zulaman_hostage ## npc_zulaman_hostage
@@ -106,89 +117,79 @@ CreatureAI* GetAI_npc_forest_frog(Creature* pCreature)
static uint32 HostageEntry[] = {23790, 23999, 24024, 24001}; static uint32 HostageEntry[] = {23790, 23999, 24024, 24001};
static uint32 ChestEntry[] = {186648, 187021, 186672, 186667}; static uint32 ChestEntry[] = {186648, 187021, 186672, 186667};
struct npc_zulaman_hostageAI : public ScriptedAI class npc_zulaman_hostage : public CreatureScript
{ {
npc_zulaman_hostageAI(Creature *c) : ScriptedAI(c) {IsLoot = false;} public:
bool IsLoot;
uint64 PlayerGUID;
void Reset() {}
void EnterCombat(Unit * /*who*/) {}
void JustDied(Unit* /*who*/)
{
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
if (pPlayer) pPlayer->SendLoot(me->GetGUID(), LOOT_CORPSE);
}
void UpdateAI(const uint32 /*diff*/)
{
if (IsLoot)
DoCast(me, 7, false);
}
};
bool GossipHello_npc_zulaman_hostage(Player* pPlayer, Creature* pCreature) npc_zulaman_hostage()
{ : CreatureScript("npc_zulaman_hostage")
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_zulaman_hostage(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
pPlayer->CLOSE_GOSSIP_MENU();
if (!pCreature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return true;
pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (pInstance)
{
//uint8 progress = pInstance->GetData(DATA_CHESTLOOTED);
pInstance->SetData(DATA_CHESTLOOTED, 0);
float x, y, z;
pCreature->GetPosition(x, y, z);
uint32 entry = pCreature->GetEntry();
for (uint8 i = 0; i < 4; ++i)
{ {
if (HostageEntry[i] == entry)
{
pCreature->SummonGameObject(ChestEntry[i], x-2, y, z, 0, 0, 0, 0, 0, 0);
break;
}
} }
/*Creature* summon = pCreature->SummonCreature(HostageInfo[progress], x-2, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
if (summon)
{
CAST_AI(npc_zulaman_hostageAI, summon->AI())->PlayerGUID = pPlayer->GetGUID();
CAST_AI(npc_zulaman_hostageAI, summon->AI())->IsLoot = true;
summon->SetDisplayId(10056);
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summon->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}*/
}
return true;
}
CreatureAI* GetAI_npc_zulaman_hostage(Creature* pCreature) struct npc_zulaman_hostageAI : public ScriptedAI
{ {
return new npc_zulaman_hostageAI(pCreature); npc_zulaman_hostageAI(Creature *c) : ScriptedAI(c) {IsLoot = false;}
} bool IsLoot;
uint64 PlayerGUID;
void Reset() {}
void EnterCombat(Unit * /*who*/) {}
void JustDied(Unit* /*who*/)
{
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
if (pPlayer) pPlayer->SendLoot(me->GetGUID(), LOOT_CORPSE);
}
void UpdateAI(const uint32 /*diff*/)
{
if (IsLoot)
DoCast(me, 7, false);
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_zulaman_hostageAI(creature);
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
pPlayer->CLOSE_GOSSIP_MENU();
if (!pCreature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return true;
pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (pInstance)
{
//uint8 progress = pInstance->GetData(DATA_CHESTLOOTED);
pInstance->SetData(DATA_CHESTLOOTED, 0);
float x, y, z;
pCreature->GetPosition(x, y, z);
uint32 entry = pCreature->GetEntry();
for (uint8 i = 0; i < 4; ++i)
{
if (HostageEntry[i] == entry)
{
pCreature->SummonGameObject(ChestEntry[i], x-2, y, z, 0, 0, 0, 0, 0, 0);
break;
}
}
}
return true;
}
};
void AddSC_zulaman() void AddSC_zulaman()
{ {
Script *newscript; new npc_forest_frog();
new npc_zulaman_hostage();
newscript = new Script;
newscript->Name = "npc_forest_frog";
newscript->GetAI = &GetAI_npc_forest_frog;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_zulaman_hostage";
newscript->GetAI = &GetAI_npc_zulaman_hostage;
newscript->pGossipHello = &GossipHello_npc_zulaman_hostage;
newscript->pGossipSelect = &GossipSelect_npc_zulaman_hostage;
newscript->RegisterSelf();
} }
@@ -26,26 +26,15 @@ EndScriptData */
#include "ScriptPCH.h" #include "ScriptPCH.h"
#include "zulgurub.h" #include "zulgurub.h"
bool GOHello_go_gong_of_bethekk(Player* /*pPlayer*/, GameObject* pGo) enum eYells
{
if (ScriptedInstance* m_pInstance = pGo->GetInstanceData())
{
if (m_pInstance->GetData(TYPE_ARLOKK) == DONE || m_pInstance->GetData(TYPE_ARLOKK) == IN_PROGRESS)
return true;
m_pInstance->SetData(TYPE_ARLOKK, IN_PROGRESS);
return true;
}
return true;
}
enum eEnums
{ {
SAY_AGGRO = -1309011, SAY_AGGRO = -1309011,
SAY_FEAST_PANTHER = -1309012, SAY_FEAST_PANTHER = -1309012,
SAY_DEATH = -1309013, SAY_DEATH = -1309013,
};
enum eSpells
{
SPELL_SHADOWWORDPAIN = 23952, SPELL_SHADOWWORDPAIN = 23952,
SPELL_GOUGE = 24698, SPELL_GOUGE = 24698,
SPELL_MARK = 24210, SPELL_MARK = 24210,
@@ -59,222 +48,245 @@ enum eEnums
NPC_ZULIAN_PROWLER = 15101 NPC_ZULIAN_PROWLER = 15101
}; };
struct boss_arlokkAI : public ScriptedAI class boss_arlokk : public CreatureScript
{ {
boss_arlokkAI(Creature* pCreature) : ScriptedAI(pCreature) public:
{
m_pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* m_pInstance; boss_arlokk()
: CreatureScript("boss_arlokk")
uint32 m_uiShadowWordPain_Timer;
uint32 m_uiGouge_Timer;
uint32 m_uiMark_Timer;
uint32 m_uiCleave_Timer;
uint32 m_uiVanish_Timer;
uint32 m_uiVisible_Timer;
uint32 m_uiSummon_Timer;
uint32 m_uiSummonCount;
Unit* m_pMarkedTarget;
uint64 MarkedTargetGUID;
bool m_bIsPhaseTwo;
bool m_bIsVanished;
void Reset()
{
m_uiShadowWordPain_Timer = 8000;
m_uiGouge_Timer = 14000;
m_uiMark_Timer = 35000;
m_uiCleave_Timer = 4000;
m_uiVanish_Timer = 60000;
m_uiVisible_Timer = 6000;
m_uiSummon_Timer = 5000;
m_uiSummonCount = 0;
m_bIsPhaseTwo = false;
m_bIsVanished = false;
MarkedTargetGUID = 0;
me->SetDisplayId(MODEL_ID_NORMAL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
void JustReachedHome()
{
if (m_pInstance)
m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED);
//we should be summoned, so despawn
me->ForcedDespawn();
}
void JustDied(Unit* /*pKiller*/)
{
DoScriptText(SAY_DEATH, me);
me->SetDisplayId(MODEL_ID_NORMAL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (m_pInstance)
m_pInstance->SetData(TYPE_ARLOKK, DONE);
}
void DoSummonPhanters()
{
if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget);
me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
}
void JustSummoned(Creature* pSummoned)
{
if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
pSummoned->AI()->AttackStart(pMarkedTarget);
++m_uiSummonCount;
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
if (!m_bIsPhaseTwo)
{ {
if (m_uiShadowWordPain_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
m_uiShadowWordPain_Timer = 15000;
}
else
m_uiShadowWordPain_Timer -= uiDiff;
if (m_uiMark_Timer <= uiDiff)
{
Unit *pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pMarkedTarget)
{
DoCast(pMarkedTarget, SPELL_MARK);
MarkedTargetGUID = pMarkedTarget->GetGUID();
}
else
sLog.outError("TSCR: boss_arlokk could not accuire pMarkedTarget.");
m_uiMark_Timer = 15000;
}
else
m_uiMark_Timer -= uiDiff;
}
else
{
//Cleave_Timer
if (m_uiCleave_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleave_Timer = 16000;
}
else
m_uiCleave_Timer -= uiDiff;
//Gouge_Timer
if (m_uiGouge_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_GOUGE);
DoModifyThreatPercent(me->getVictim(),-80);
m_uiGouge_Timer = 17000+rand()%10000;
}
else
m_uiGouge_Timer -= uiDiff;
} }
if (m_uiSummonCount <= 30) struct boss_arlokkAI : public ScriptedAI
{ {
if (m_uiSummon_Timer <= uiDiff) boss_arlokkAI(Creature* pCreature) : ScriptedAI(pCreature)
{ {
DoSummonPhanters(); m_pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* m_pInstance;
uint32 m_uiShadowWordPain_Timer;
uint32 m_uiGouge_Timer;
uint32 m_uiMark_Timer;
uint32 m_uiCleave_Timer;
uint32 m_uiVanish_Timer;
uint32 m_uiVisible_Timer;
uint32 m_uiSummon_Timer;
uint32 m_uiSummonCount;
Unit* m_pMarkedTarget;
uint64 MarkedTargetGUID;
bool m_bIsPhaseTwo;
bool m_bIsVanished;
void Reset()
{
m_uiShadowWordPain_Timer = 8000;
m_uiGouge_Timer = 14000;
m_uiMark_Timer = 35000;
m_uiCleave_Timer = 4000;
m_uiVanish_Timer = 60000;
m_uiVisible_Timer = 6000;
m_uiSummon_Timer = 5000; m_uiSummon_Timer = 5000;
m_uiSummonCount = 0;
m_bIsPhaseTwo = false;
m_bIsVanished = false;
MarkedTargetGUID = 0;
me->SetDisplayId(MODEL_ID_NORMAL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} }
else
m_uiSummon_Timer -= uiDiff;
}
if (m_uiVanish_Timer <= uiDiff) void EnterCombat(Unit* /*pWho*/)
{
//Invisble Model
me->SetDisplayId(MODEL_ID_BLANK);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AttackStop();
DoResetThreat();
m_bIsVanished = true;
m_uiVanish_Timer = 45000;
m_uiVisible_Timer = 6000;
}
else
m_uiVanish_Timer -= uiDiff;
if (m_bIsVanished)
{
if (m_uiVisible_Timer <= uiDiff)
{ {
//The Panther Model DoScriptText(SAY_AGGRO, me);
me->SetDisplayId(MODEL_ID_PANTHER); }
void JustReachedHome()
{
if (m_pInstance)
m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED);
//we should be summoned, so despawn
me->ForcedDespawn();
}
void JustDied(Unit* /*pKiller*/)
{
DoScriptText(SAY_DEATH, me);
me->SetDisplayId(MODEL_ID_NORMAL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
const CreatureInfo *cinfo = me->GetCreatureInfo(); if (m_pInstance)
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); m_pInstance->SetData(TYPE_ARLOKK, DONE);
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
AttackStart(pTarget);
m_bIsPhaseTwo = true;
m_bIsVanished = false;
} }
else
m_uiVisible_Timer -= uiDiff; void DoSummonPhanters()
{
if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget);
me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
}
void JustSummoned(Creature* pSummoned)
{
if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
pSummoned->AI()->AttackStart(pMarkedTarget);
++m_uiSummonCount;
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
if (!m_bIsPhaseTwo)
{
if (m_uiShadowWordPain_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
m_uiShadowWordPain_Timer = 15000;
}
else
m_uiShadowWordPain_Timer -= uiDiff;
if (m_uiMark_Timer <= uiDiff)
{
Unit *pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pMarkedTarget)
{
DoCast(pMarkedTarget, SPELL_MARK);
MarkedTargetGUID = pMarkedTarget->GetGUID();
}
else
sLog.outError("TSCR: boss_arlokk could not accuire pMarkedTarget.");
m_uiMark_Timer = 15000;
}
else
m_uiMark_Timer -= uiDiff;
}
else
{
//Cleave_Timer
if (m_uiCleave_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleave_Timer = 16000;
}
else
m_uiCleave_Timer -= uiDiff;
//Gouge_Timer
if (m_uiGouge_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_GOUGE);
DoModifyThreatPercent(me->getVictim(),-80);
m_uiGouge_Timer = 17000+rand()%10000;
}
else
m_uiGouge_Timer -= uiDiff;
}
if (m_uiSummonCount <= 30)
{
if (m_uiSummon_Timer <= uiDiff)
{
DoSummonPhanters();
m_uiSummon_Timer = 5000;
}
else
m_uiSummon_Timer -= uiDiff;
}
if (m_uiVanish_Timer <= uiDiff)
{
//Invisble Model
me->SetDisplayId(MODEL_ID_BLANK);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AttackStop();
DoResetThreat();
m_bIsVanished = true;
m_uiVanish_Timer = 45000;
m_uiVisible_Timer = 6000;
}
else
m_uiVanish_Timer -= uiDiff;
if (m_bIsVanished)
{
if (m_uiVisible_Timer <= uiDiff)
{
//The Panther Model
me->SetDisplayId(MODEL_ID_PANTHER);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
AttackStart(pTarget);
m_bIsPhaseTwo = true;
m_bIsVanished = false;
}
else
m_uiVisible_Timer -= uiDiff;
}
else
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_arlokkAI(creature);
} }
else
DoMeleeAttackIfReady();
}
}; };
CreatureAI* GetAI_boss_arlokk(Creature* pCreature) class go_gong_of_bethekk : public GameObjectScript
{ {
return new boss_arlokkAI (pCreature); public:
} go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk")
{
}
bool OnGossipHello(Player* /*pPlayer*/, GameObject* pGo)
{
if (ScriptedInstance* m_pInstance = pGo->GetInstanceData())
{
if (m_pInstance->GetData(TYPE_ARLOKK) == DONE || m_pInstance->GetData(TYPE_ARLOKK) == IN_PROGRESS)
return true;
m_pInstance->SetData(TYPE_ARLOKK, IN_PROGRESS);
return true;
}
return true;
}
};
void AddSC_boss_arlokk() void AddSC_boss_arlokk()
{ {
Script *newscript; new boss_arlokk();
new go_gong_of_bethekk();
newscript = new Script;
newscript->Name = "go_gong_of_bethekk";
newscript->pGOHello = &GOHello_go_gong_of_bethekk;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_arlokk";
newscript->GetAI = &GetAI_boss_arlokk;
newscript->RegisterSelf();
} }
@@ -29,67 +29,74 @@ EndScriptData */
#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... #define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
#define SPELL_SLAM 24326 #define SPELL_SLAM 24326
struct boss_gahzrankaAI : public ScriptedAI class boss_gahzranka : public CreatureScript
{ {
boss_gahzrankaAI(Creature *c) : ScriptedAI(c) {} public:
uint32 Frostbreath_Timer;
uint32 MassiveGeyser_Timer;
uint32 Slam_Timer;
void Reset() boss_gahzranka()
{ : CreatureScript("boss_gahzranka")
Frostbreath_Timer = 8000;
MassiveGeyser_Timer = 25000;
Slam_Timer = 17000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Frostbreath_Timer
if (Frostbreath_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_FROSTBREATH); }
Frostbreath_Timer = 7000 + rand()%4000;
} else Frostbreath_Timer -= diff;
//MassiveGeyser_Timer struct boss_gahzrankaAI : public ScriptedAI
if (MassiveGeyser_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_MASSIVEGEYSER); boss_gahzrankaAI(Creature *c) : ScriptedAI(c) {}
DoResetThreat(); uint32 Frostbreath_Timer;
uint32 MassiveGeyser_Timer;
uint32 Slam_Timer;
MassiveGeyser_Timer = 22000 + rand()%10000; void Reset()
} else MassiveGeyser_Timer -= diff; {
Frostbreath_Timer = 8000;
MassiveGeyser_Timer = 25000;
Slam_Timer = 17000;
}
//Slam_Timer void EnterCombat(Unit * /*who*/)
if (Slam_Timer <= diff) {
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Frostbreath_Timer
if (Frostbreath_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROSTBREATH);
Frostbreath_Timer = 7000 + rand()%4000;
} else Frostbreath_Timer -= diff;
//MassiveGeyser_Timer
if (MassiveGeyser_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MASSIVEGEYSER);
DoResetThreat();
MassiveGeyser_Timer = 22000 + rand()%10000;
} else MassiveGeyser_Timer -= diff;
//Slam_Timer
if (Slam_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SLAM);
Slam_Timer = 12000 + rand()%8000;
} else Slam_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{ {
DoCast(me->getVictim(), SPELL_SLAM); return new boss_gahzrankaAI(creature);
Slam_Timer = 12000 + rand()%8000; }
} else Slam_Timer -= diff;
DoMeleeAttackIfReady();
}
}; };
CreatureAI* GetAI_boss_gahzranka(Creature* pCreature)
{
return new boss_gahzrankaAI (pCreature);
}
void AddSC_boss_gahzranka() void AddSC_boss_gahzranka()
{ {
Script *newscript; new boss_gahzranka();
newscript = new Script;
newscript->Name = "boss_gahzranka";
newscript->GetAI = &GetAI_boss_gahzranka;
newscript->RegisterSelf();
} }
@@ -29,67 +29,74 @@ EndScriptData */
#define SPELL_AVARTAR 24646 //The Enrage Spell #define SPELL_AVARTAR 24646 //The Enrage Spell
#define SPELL_GROUNDTREMOR 6524 #define SPELL_GROUNDTREMOR 6524
struct boss_grilekAI : public ScriptedAI class boss_grilek : public CreatureScript
{ {
boss_grilekAI(Creature *c) : ScriptedAI(c) {} public:
uint32 Avartar_Timer; boss_grilek()
uint32 GroundTremor_Timer; : CreatureScript("boss_grilek")
void Reset()
{
Avartar_Timer = 15000 + rand()%10000;
GroundTremor_Timer = 8000 + rand()%8000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Avartar_Timer
if (Avartar_Timer <= diff)
{ {
}
DoCast(me, SPELL_AVARTAR); struct boss_grilekAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-50);
if (pTarget)
AttackStart(pTarget);
Avartar_Timer = 25000 + rand()%10000;
} else Avartar_Timer -= diff;
//GroundTremor_Timer
if (GroundTremor_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_GROUNDTREMOR); boss_grilekAI(Creature *c) : ScriptedAI(c) {}
GroundTremor_Timer = 12000 + rand()%4000;
} else GroundTremor_Timer -= diff;
DoMeleeAttackIfReady(); uint32 Avartar_Timer;
} uint32 GroundTremor_Timer;
void Reset()
{
Avartar_Timer = 15000 + rand()%10000;
GroundTremor_Timer = 8000 + rand()%8000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Avartar_Timer
if (Avartar_Timer <= diff)
{
DoCast(me, SPELL_AVARTAR);
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-50);
if (pTarget)
AttackStart(pTarget);
Avartar_Timer = 25000 + rand()%10000;
} else Avartar_Timer -= diff;
//GroundTremor_Timer
if (GroundTremor_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
GroundTremor_Timer = 12000 + rand()%4000;
} else GroundTremor_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_grilekAI(creature);
}
}; };
CreatureAI* GetAI_boss_grilek(Creature* pCreature)
{
return new boss_grilekAI (pCreature);
}
void AddSC_boss_grilek() void AddSC_boss_grilek()
{ {
Script *newscript; new boss_grilek();
newscript = new Script;
newscript->Name = "boss_grilek";
newscript->GetAI = &GetAI_boss_grilek;
newscript->RegisterSelf();
} }
@@ -44,209 +44,215 @@ EndScriptData */
#define SPELL_ASPECT_OF_THEKAL 24689 #define SPELL_ASPECT_OF_THEKAL 24689
#define SPELL_ASPECT_OF_ARLOKK 24690 #define SPELL_ASPECT_OF_ARLOKK 24690
struct boss_hakkarAI : public ScriptedAI class boss_hakkar : public CreatureScript
{ {
boss_hakkarAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
ScriptedInstance *m_pInstance; boss_hakkar()
: CreatureScript("boss_hakkar")
uint32 BloodSiphon_Timer;
uint32 CorruptedBlood_Timer;
uint32 CauseInsanity_Timer;
uint32 WillOfHakkar_Timer;
uint32 Enrage_Timer;
uint32 CheckJeklik_Timer;
uint32 CheckVenoxis_Timer;
uint32 CheckMarli_Timer;
uint32 CheckThekal_Timer;
uint32 CheckArlokk_Timer;
uint32 AspectOfJeklik_Timer;
uint32 AspectOfVenoxis_Timer;
uint32 AspectOfMarli_Timer;
uint32 AspectOfThekal_Timer;
uint32 AspectOfArlokk_Timer;
bool Enraged;
void Reset()
{
BloodSiphon_Timer = 90000;
CorruptedBlood_Timer = 25000;
CauseInsanity_Timer = 17000;
WillOfHakkar_Timer = 17000;
Enrage_Timer = 600000;
CheckJeklik_Timer = 1000;
CheckVenoxis_Timer = 2000;
CheckMarli_Timer = 3000;
CheckThekal_Timer = 4000;
CheckArlokk_Timer = 5000;
AspectOfJeklik_Timer = 4000;
AspectOfVenoxis_Timer = 7000;
AspectOfMarli_Timer = 12000;
AspectOfThekal_Timer = 8000;
AspectOfArlokk_Timer = 18000;
Enraged = false;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//BloodSiphon_Timer
if (BloodSiphon_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_BLOODSIPHON); }
BloodSiphon_Timer = 90000;
} else BloodSiphon_Timer -= diff;
//CorruptedBlood_Timer struct boss_hakkarAI : public ScriptedAI
if (CorruptedBlood_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); boss_hakkarAI(Creature *c) : ScriptedAI(c)
CorruptedBlood_Timer = 30000 + rand()%15000;
} else CorruptedBlood_Timer -= diff;
//CauseInsanity_Timer
/*if (CauseInsanity_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_CAUSEINSANITY);
CauseInsanity_Timer = 35000 + rand()%8000;
} else CauseInsanity_Timer -= diff;*/
//WillOfHakkar_Timer
if (WillOfHakkar_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_WILLOFHAKKAR);
WillOfHakkar_Timer = 25000 + rand()%10000;
} else WillOfHakkar_Timer -= diff;
if (!Enraged && Enrage_Timer <= diff)
{
DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else Enrage_Timer -= diff;
//Checking if Jeklik is dead. If not we cast her Aspect
if (CheckJeklik_Timer <= diff)
{
if (m_pInstance)
{ {
if (m_pInstance->GetData(TYPE_JEKLIK) != DONE) m_pInstance = c->GetInstanceData();
{
if (AspectOfJeklik_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK);
AspectOfJeklik_Timer = 10000 + rand()%4000;
} else AspectOfJeklik_Timer -= diff;
}
} }
CheckJeklik_Timer = 1000;
} else CheckJeklik_Timer -= diff;
//Checking if Venoxis is dead. If not we cast his Aspect ScriptedInstance *m_pInstance;
if (CheckVenoxis_Timer <= diff)
{ uint32 BloodSiphon_Timer;
if (m_pInstance) uint32 CorruptedBlood_Timer;
uint32 CauseInsanity_Timer;
uint32 WillOfHakkar_Timer;
uint32 Enrage_Timer;
uint32 CheckJeklik_Timer;
uint32 CheckVenoxis_Timer;
uint32 CheckMarli_Timer;
uint32 CheckThekal_Timer;
uint32 CheckArlokk_Timer;
uint32 AspectOfJeklik_Timer;
uint32 AspectOfVenoxis_Timer;
uint32 AspectOfMarli_Timer;
uint32 AspectOfThekal_Timer;
uint32 AspectOfArlokk_Timer;
bool Enraged;
void Reset()
{ {
if (m_pInstance->GetData(TYPE_VENOXIS) != DONE) BloodSiphon_Timer = 90000;
{ CorruptedBlood_Timer = 25000;
if (AspectOfVenoxis_Timer <= diff) CauseInsanity_Timer = 17000;
{ WillOfHakkar_Timer = 17000;
DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS); Enrage_Timer = 600000;
AspectOfVenoxis_Timer = 8000;
} else AspectOfVenoxis_Timer -= diff;
}
}
CheckVenoxis_Timer = 1000;
} else CheckVenoxis_Timer -= diff;
//Checking if Marli is dead. If not we cast her Aspect CheckJeklik_Timer = 1000;
if (CheckMarli_Timer <= diff) CheckVenoxis_Timer = 2000;
{ CheckMarli_Timer = 3000;
if (m_pInstance) CheckThekal_Timer = 4000;
CheckArlokk_Timer = 5000;
AspectOfJeklik_Timer = 4000;
AspectOfVenoxis_Timer = 7000;
AspectOfMarli_Timer = 12000;
AspectOfThekal_Timer = 8000;
AspectOfArlokk_Timer = 18000;
Enraged = false;
}
void EnterCombat(Unit * /*who*/)
{ {
if (m_pInstance->GetData(TYPE_MARLI) != DONE) DoScriptText(SAY_AGGRO, me);
{
if (AspectOfMarli_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
AspectOfMarli_Timer = 10000;
} else AspectOfMarli_Timer -= diff;
}
} }
CheckMarli_Timer = 1000;
} else CheckMarli_Timer -= diff;
//Checking if Thekal is dead. If not we cast his Aspect void UpdateAI(const uint32 diff)
if (CheckThekal_Timer <= diff)
{
if (m_pInstance)
{ {
if (m_pInstance->GetData(TYPE_THEKAL) != DONE) if (!UpdateVictim())
{ return;
if (AspectOfThekal_Timer <= diff)
{
DoCast(me, SPELL_ASPECT_OF_THEKAL);
AspectOfThekal_Timer = 15000;
} else AspectOfThekal_Timer -= diff;
}
}
CheckThekal_Timer = 1000;
} else CheckThekal_Timer -= diff;
//Checking if Arlokk is dead. If yes we cast her Aspect //BloodSiphon_Timer
if (CheckArlokk_Timer <= diff) if (BloodSiphon_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_BLOODSIPHON);
BloodSiphon_Timer = 90000;
} else BloodSiphon_Timer -= diff;
//CorruptedBlood_Timer
if (CorruptedBlood_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD);
CorruptedBlood_Timer = 30000 + rand()%15000;
} else CorruptedBlood_Timer -= diff;
//CauseInsanity_Timer
/*if (CauseInsanity_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_CAUSEINSANITY);
CauseInsanity_Timer = 35000 + rand()%8000;
} else CauseInsanity_Timer -= diff;*/
//WillOfHakkar_Timer
if (WillOfHakkar_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_WILLOFHAKKAR);
WillOfHakkar_Timer = 25000 + rand()%10000;
} else WillOfHakkar_Timer -= diff;
if (!Enraged && Enrage_Timer <= diff)
{
DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else Enrage_Timer -= diff;
//Checking if Jeklik is dead. If not we cast her Aspect
if (CheckJeklik_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_JEKLIK) != DONE)
{
if (AspectOfJeklik_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK);
AspectOfJeklik_Timer = 10000 + rand()%4000;
} else AspectOfJeklik_Timer -= diff;
}
}
CheckJeklik_Timer = 1000;
} else CheckJeklik_Timer -= diff;
//Checking if Venoxis is dead. If not we cast his Aspect
if (CheckVenoxis_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_VENOXIS) != DONE)
{
if (AspectOfVenoxis_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS);
AspectOfVenoxis_Timer = 8000;
} else AspectOfVenoxis_Timer -= diff;
}
}
CheckVenoxis_Timer = 1000;
} else CheckVenoxis_Timer -= diff;
//Checking if Marli is dead. If not we cast her Aspect
if (CheckMarli_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_MARLI) != DONE)
{
if (AspectOfMarli_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
AspectOfMarli_Timer = 10000;
} else AspectOfMarli_Timer -= diff;
}
}
CheckMarli_Timer = 1000;
} else CheckMarli_Timer -= diff;
//Checking if Thekal is dead. If not we cast his Aspect
if (CheckThekal_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_THEKAL) != DONE)
{
if (AspectOfThekal_Timer <= diff)
{
DoCast(me, SPELL_ASPECT_OF_THEKAL);
AspectOfThekal_Timer = 15000;
} else AspectOfThekal_Timer -= diff;
}
}
CheckThekal_Timer = 1000;
} else CheckThekal_Timer -= diff;
//Checking if Arlokk is dead. If yes we cast her Aspect
if (CheckArlokk_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_ARLOKK) != DONE)
{
if (AspectOfArlokk_Timer <= diff)
{
DoCast(me, SPELL_ASPECT_OF_ARLOKK);
DoResetThreat();
AspectOfArlokk_Timer = 10000 + rand()%5000;
} else AspectOfArlokk_Timer -= diff;
}
}
CheckArlokk_Timer = 1000;
} else CheckArlokk_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{ {
if (m_pInstance) return new boss_hakkarAI(creature);
{ }
if (m_pInstance->GetData(TYPE_ARLOKK) != DONE)
{
if (AspectOfArlokk_Timer <= diff)
{
DoCast(me, SPELL_ASPECT_OF_ARLOKK);
DoResetThreat();
AspectOfArlokk_Timer = 10000 + rand()%5000;
} else AspectOfArlokk_Timer -= diff;
}
}
CheckArlokk_Timer = 1000;
} else CheckArlokk_Timer -= diff;
DoMeleeAttackIfReady();
}
}; };
CreatureAI* GetAI_boss_hakkar(Creature* pCreature)
{
return new boss_hakkarAI (pCreature);
}
void AddSC_boss_hakkar() void AddSC_boss_hakkar()
{ {
Script *newscript; new boss_hakkar();
newscript = new Script;
newscript->Name = "boss_hakkar";
newscript->GetAI = &GetAI_boss_hakkar;
newscript->RegisterSelf();
} }
@@ -29,78 +29,85 @@ EndScriptData */
#define SPELL_MANABURN 26046 #define SPELL_MANABURN 26046
#define SPELL_SLEEP 24664 #define SPELL_SLEEP 24664
struct boss_hazzarahAI : public ScriptedAI class boss_hazzarah : public CreatureScript
{ {
boss_hazzarahAI(Creature *c) : ScriptedAI(c) {} public:
uint32 ManaBurn_Timer; boss_hazzarah()
uint32 Sleep_Timer; : CreatureScript("boss_hazzarah")
uint32 Illusions_Timer;
void Reset()
{
ManaBurn_Timer = 4000 + rand()%6000;
Sleep_Timer = 10000 + rand()%8000;
Illusions_Timer = 10000 + rand()%8000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//ManaBurn_Timer
if (ManaBurn_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_MANABURN); }
ManaBurn_Timer = 8000 + rand()%8000;
} else ManaBurn_Timer -= diff;
//Sleep_Timer struct boss_hazzarahAI : public ScriptedAI
if (Sleep_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_SLEEP); boss_hazzarahAI(Creature *c) : ScriptedAI(c) {}
Sleep_Timer = 12000 + rand()%8000;
} else Sleep_Timer -= diff;
//Illusions_Timer uint32 ManaBurn_Timer;
if (Illusions_Timer <= diff) uint32 Sleep_Timer;
{ uint32 Illusions_Timer;
//We will summon 3 illusions that will spawn on a random gamer and attack this gamer
//We will just use one model for the beginning void Reset()
Unit *pTarget = NULL;
for (uint8 i = 0; i < 3; ++i)
{ {
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); ManaBurn_Timer = 4000 + rand()%6000;
if (!pTarget) Sleep_Timer = 10000 + rand()%8000;
return; Illusions_Timer = 10000 + rand()%8000;
Creature *Illusion = me->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
if (Illusion)
Illusion->AI()->AttackStart(pTarget);
} }
Illusions_Timer = 15000 + rand()%10000; void EnterCombat(Unit * /*who*/)
} else Illusions_Timer -= diff; {
}
DoMeleeAttackIfReady(); void UpdateAI(const uint32 diff)
} {
if (!UpdateVictim())
return;
//ManaBurn_Timer
if (ManaBurn_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MANABURN);
ManaBurn_Timer = 8000 + rand()%8000;
} else ManaBurn_Timer -= diff;
//Sleep_Timer
if (Sleep_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SLEEP);
Sleep_Timer = 12000 + rand()%8000;
} else Sleep_Timer -= diff;
//Illusions_Timer
if (Illusions_Timer <= diff)
{
//We will summon 3 illusions that will spawn on a random gamer and attack this gamer
//We will just use one model for the beginning
Unit *pTarget = NULL;
for (uint8 i = 0; i < 3; ++i)
{
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
return;
Creature *Illusion = me->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
if (Illusion)
Illusion->AI()->AttackStart(pTarget);
}
Illusions_Timer = 15000 + rand()%10000;
} else Illusions_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_hazzarahAI(creature);
}
}; };
CreatureAI* GetAI_boss_hazzarah(Creature* pCreature)
{
return new boss_hazzarahAI (pCreature);
}
void AddSC_boss_hazzarah() void AddSC_boss_hazzarah()
{ {
Script *newscript; new boss_hazzarah();
newscript = new Script;
newscript->Name = "boss_hazzarah";
newscript->GetAI = &GetAI_boss_hazzarah;
newscript->RegisterSelf();
} }
@@ -43,251 +43,263 @@ EndScriptData */
#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working... #define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working...
struct boss_jeklikAI : public ScriptedAI class boss_jeklik : public CreatureScript
{ {
boss_jeklikAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
ScriptedInstance *m_pInstance; boss_jeklik()
: CreatureScript("boss_jeklik")
uint32 Charge_Timer;
uint32 SonicBurst_Timer;
uint32 Screech_Timer;
uint32 SpawnBats_Timer;
uint32 ShadowWordPain_Timer;
uint32 MindFlay_Timer;
uint32 ChainMindFlay_Timer;
uint32 GreaterHeal_Timer;
uint32 SpawnFlyingBats_Timer;
bool PhaseTwo;
void Reset()
{
Charge_Timer = 20000;
SonicBurst_Timer = 8000;
Screech_Timer = 13000;
SpawnBats_Timer = 60000;
ShadowWordPain_Timer = 6000;
MindFlay_Timer = 11000;
ChainMindFlay_Timer = 26000;
GreaterHeal_Timer = 50000;
SpawnFlyingBats_Timer = 10000;
PhaseTwo = false;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoCast(me, SPELL_BAT_FORM);
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_JEKLIK, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->getVictim() && me->isAlive())
{ {
if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) }
struct boss_jeklikAI : public ScriptedAI
{
boss_jeklikAI(Creature *c) : ScriptedAI(c)
{ {
if (Charge_Timer <= diff) m_pInstance = c->GetInstanceData();
}
ScriptedInstance *m_pInstance;
uint32 Charge_Timer;
uint32 SonicBurst_Timer;
uint32 Screech_Timer;
uint32 SpawnBats_Timer;
uint32 ShadowWordPain_Timer;
uint32 MindFlay_Timer;
uint32 ChainMindFlay_Timer;
uint32 GreaterHeal_Timer;
uint32 SpawnFlyingBats_Timer;
bool PhaseTwo;
void Reset()
{
Charge_Timer = 20000;
SonicBurst_Timer = 8000;
Screech_Timer = 13000;
SpawnBats_Timer = 60000;
ShadowWordPain_Timer = 6000;
MindFlay_Timer = 11000;
ChainMindFlay_Timer = 26000;
GreaterHeal_Timer = 50000;
SpawnFlyingBats_Timer = 10000;
PhaseTwo = false;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoCast(me, SPELL_BAT_FORM);
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_JEKLIK, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->getVictim() && me->isAlive())
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) if ((me->GetHealth()*100 / me->GetMaxHealth() > 50))
{ {
DoCast(pTarget, SPELL_CHARGE); if (Charge_Timer <= diff)
AttackStart(pTarget); {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoCast(pTarget, SPELL_CHARGE);
AttackStart(pTarget);
}
Charge_Timer = 15000 + rand()%15000;
} else Charge_Timer -= diff;
if (SonicBurst_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SONICBURST);
SonicBurst_Timer = 8000 + rand()%5000;
} else SonicBurst_Timer -= diff;
if (Screech_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SCREECH);
Screech_Timer = 18000 + rand()%8000;
} else Screech_Timer -= diff;
if (SpawnBats_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Bat = NULL;
Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
SpawnBats_Timer = 60000;
} else SpawnBats_Timer -= diff;
}
else
{
if (PhaseTwo)
{
if (PhaseTwo && ShadowWordPain_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoCast(pTarget, SPELL_SHADOW_WORD_PAIN);
ShadowWordPain_Timer = 12000 + rand()%6000;
}
}ShadowWordPain_Timer -=diff;
if (MindFlay_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
MindFlay_Timer = 16000;
}MindFlay_Timer -=diff;
if (ChainMindFlay_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY);
ChainMindFlay_Timer = 15000 + rand()%15000;
}ChainMindFlay_Timer -=diff;
if (GreaterHeal_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_GREATERHEAL);
GreaterHeal_Timer = 25000 + rand()%10000;
}GreaterHeal_Timer -=diff;
if (SpawnFlyingBats_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
return;
Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (FlyingBat)
FlyingBat->AI()->AttackStart(pTarget);
SpawnFlyingBats_Timer = 10000 + rand()%5000;
} else SpawnFlyingBats_Timer -=diff;
}
else
{
me->SetDisplayId(15219);
DoResetThreat();
PhaseTwo = true;
}
} }
Charge_Timer = 15000 + rand()%15000; DoMeleeAttackIfReady();
} else Charge_Timer -= diff;
if (SonicBurst_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SONICBURST);
SonicBurst_Timer = 8000 + rand()%5000;
} else SonicBurst_Timer -= diff;
if (Screech_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SCREECH);
Screech_Timer = 18000 + rand()%8000;
} else Screech_Timer -= diff;
if (SpawnBats_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Bat = NULL;
Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
SpawnBats_Timer = 60000;
} else SpawnBats_Timer -= diff;
}
else
{
if (PhaseTwo)
{
if (PhaseTwo && ShadowWordPain_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoCast(pTarget, SPELL_SHADOW_WORD_PAIN);
ShadowWordPain_Timer = 12000 + rand()%6000;
}
}ShadowWordPain_Timer -=diff;
if (MindFlay_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
MindFlay_Timer = 16000;
}MindFlay_Timer -=diff;
if (ChainMindFlay_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY);
ChainMindFlay_Timer = 15000 + rand()%15000;
}ChainMindFlay_Timer -=diff;
if (GreaterHeal_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_GREATERHEAL);
GreaterHeal_Timer = 25000 + rand()%10000;
}GreaterHeal_Timer -=diff;
if (SpawnFlyingBats_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
return;
Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (FlyingBat)
FlyingBat->AI()->AttackStart(pTarget);
SpawnFlyingBats_Timer = 10000 + rand()%5000;
} else SpawnFlyingBats_Timer -=diff;
}
else
{
me->SetDisplayId(15219);
DoResetThreat();
PhaseTwo = true;
} }
} }
};
DoMeleeAttackIfReady(); CreatureAI* GetAI(Creature* creature) const
{
return new boss_jeklikAI(creature);
} }
}
}; };
//Flying Bat //Flying Bat
struct mob_batriderAI : public ScriptedAI class mob_batrider : public CreatureScript
{ {
mob_batriderAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
ScriptedInstance *m_pInstance; mob_batrider()
: CreatureScript("mob_batrider")
uint32 Bomb_Timer;
uint32 Check_Timer;
void Reset()
{
Bomb_Timer = 2000;
Check_Timer = 1000;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit * /*who*/) {}
void UpdateAI (const uint32 diff)
{
if (!UpdateVictim())
return;
//Bomb_Timer
if (Bomb_Timer <= diff)
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) }
struct mob_batriderAI : public ScriptedAI
{
mob_batriderAI(Creature *c) : ScriptedAI(c)
{ {
DoCast(pTarget, SPELL_BOMB); m_pInstance = c->GetInstanceData();
Bomb_Timer = 5000;
} }
} else Bomb_Timer -= diff;
//Check_Timer ScriptedInstance *m_pInstance;
if (Check_Timer <= diff)
{ uint32 Bomb_Timer;
if (m_pInstance) uint32 Check_Timer;
void Reset()
{ {
if (m_pInstance->GetData(TYPE_JEKLIK) == DONE) Bomb_Timer = 2000;
{ Check_Timer = 1000;
me->setDeathState(JUST_DIED);
me->RemoveCorpse(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit * /*who*/) {}
void UpdateAI (const uint32 diff)
{
if (!UpdateVictim())
return; return;
}
//Bomb_Timer
if (Bomb_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_BOMB);
Bomb_Timer = 5000;
}
} else Bomb_Timer -= diff;
//Check_Timer
if (Check_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_JEKLIK) == DONE)
{
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
Check_Timer = 1000;
} else Check_Timer -= diff;
DoMeleeAttackIfReady();
} }
};
Check_Timer = 1000; CreatureAI* GetAI(Creature* creature) const
} else Check_Timer -= diff; {
return new mob_batriderAI(creature);
DoMeleeAttackIfReady(); }
}
}; };
CreatureAI* GetAI_boss_jeklik(Creature* pCreature)
{
return new boss_jeklikAI (pCreature);
}
CreatureAI* GetAI_mob_batrider(Creature* pCreature)
{
return new mob_batriderAI (pCreature);
}
void AddSC_boss_jeklik() void AddSC_boss_jeklik()
{ {
Script *newscript; new boss_jeklik();
newscript = new Script; new mob_batrider();
newscript->Name = "boss_jeklik";
newscript->GetAI = &GetAI_boss_jeklik;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_batrider";
newscript->GetAI = &GetAI_mob_batrider;
newscript->RegisterSelf();
} }
@@ -41,225 +41,242 @@ EndScriptData */
#define SPELL_SHADOWSHOCK 19460 #define SPELL_SHADOWSHOCK 19460
#define SPELL_INVISIBLE 24699 #define SPELL_INVISIBLE 24699
struct boss_jindoAI : public ScriptedAI class boss_jindo : public CreatureScript
{ {
boss_jindoAI(Creature *c) : ScriptedAI(c) {} public:
uint32 BrainWashTotem_Timer; boss_jindo()
uint32 HealingWard_Timer; : CreatureScript("boss_jindo")
uint32 Hex_Timer;
uint32 Delusions_Timer;
uint32 Teleport_Timer;
void Reset()
{
BrainWashTotem_Timer = 20000;
HealingWard_Timer = 16000;
Hex_Timer = 8000;
Delusions_Timer = 10000;
Teleport_Timer = 5000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//BrainWashTotem_Timer
if (BrainWashTotem_Timer <= diff)
{ {
DoCast(me, SPELL_BRAINWASHTOTEM); }
BrainWashTotem_Timer = 18000 + rand()%8000;
} else BrainWashTotem_Timer -= diff;
//HealingWard_Timer struct boss_jindoAI : public ScriptedAI
if (HealingWard_Timer <= diff)
{ {
//DoCast(me, SPELL_POWERFULLHEALINGWARD); boss_jindoAI(Creature *c) : ScriptedAI(c) {}
me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
HealingWard_Timer = 14000 + rand()%6000;
} else HealingWard_Timer -= diff;
//Hex_Timer uint32 BrainWashTotem_Timer;
if (Hex_Timer <= diff) uint32 HealingWard_Timer;
{ uint32 Hex_Timer;
DoCast(me->getVictim(), SPELL_HEX); uint32 Delusions_Timer;
uint32 Teleport_Timer;
if (DoGetThreat(me->getVictim())) void Reset()
DoModifyThreatPercent(me->getVictim(),-80);
Hex_Timer = 12000 + rand()%8000;
} else Hex_Timer -= diff;
//Casting the delusion curse with a shade. So shade will attack the same target with the curse.
if (Delusions_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{ {
DoCast(pTarget, SPELL_DELUSIONSOFJINDO); BrainWashTotem_Timer = 20000;
HealingWard_Timer = 16000;
Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); Hex_Timer = 8000;
if (Shade) Delusions_Timer = 10000;
Shade->AI()->AttackStart(pTarget); Teleport_Timer = 5000;
} }
Delusions_Timer = 4000 + rand()%8000; void EnterCombat(Unit * /*who*/)
} else Delusions_Timer -= diff;
//Teleporting a random gamer and spawning 9 skeletons that will attack this gamer
if (Teleport_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{ {
DoTeleportPlayer(pTarget, -11583.7783,-1249.4278,77.5471,4.745); DoScriptText(SAY_AGGRO, me);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(pTarget,-100);
Creature *Skeletons;
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
} }
Teleport_Timer = 15000 + rand()%8000; void UpdateAI(const uint32 diff)
} else Teleport_Timer -= diff; {
if (!UpdateVictim())
return;
DoMeleeAttackIfReady(); //BrainWashTotem_Timer
} if (BrainWashTotem_Timer <= diff)
{
DoCast(me, SPELL_BRAINWASHTOTEM);
BrainWashTotem_Timer = 18000 + rand()%8000;
} else BrainWashTotem_Timer -= diff;
//HealingWard_Timer
if (HealingWard_Timer <= diff)
{
//DoCast(me, SPELL_POWERFULLHEALINGWARD);
me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
HealingWard_Timer = 14000 + rand()%6000;
} else HealingWard_Timer -= diff;
//Hex_Timer
if (Hex_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HEX);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-80);
Hex_Timer = 12000 + rand()%8000;
} else Hex_Timer -= diff;
//Casting the delusion curse with a shade. So shade will attack the same target with the curse.
if (Delusions_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoCast(pTarget, SPELL_DELUSIONSOFJINDO);
Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Shade)
Shade->AI()->AttackStart(pTarget);
}
Delusions_Timer = 4000 + rand()%8000;
} else Delusions_Timer -= diff;
//Teleporting a random gamer and spawning 9 skeletons that will attack this gamer
if (Teleport_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{
DoTeleportPlayer(pTarget, -11583.7783,-1249.4278,77.5471,4.745);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(pTarget,-100);
Creature *Skeletons;
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
}
Teleport_Timer = 15000 + rand()%8000;
} else Teleport_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_jindoAI(creature);
}
}; };
//Healing Ward //Healing Ward
struct mob_healing_wardAI : public ScriptedAI class mob_healing_ward : public CreatureScript
{ {
mob_healing_wardAI(Creature *c) : ScriptedAI(c) public:
{
pInstance = c->GetInstanceData();
}
uint32 Heal_Timer; mob_healing_ward()
: CreatureScript("mob_healing_ward")
ScriptedInstance *pInstance;
void Reset()
{
Heal_Timer = 2000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI (const uint32 diff)
{
//Heal_Timer
if (Heal_Timer <= diff)
{ {
if (pInstance) }
{
Unit *pJindo = Unit::GetUnit((*me), pInstance->GetData64(DATA_JINDO));
if (pJindo)
DoCast(pJindo, SPELL_HEAL);
}
Heal_Timer = 3000;
} else Heal_Timer -= diff;
DoMeleeAttackIfReady(); struct mob_healing_wardAI : public ScriptedAI
} {
mob_healing_wardAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
uint32 Heal_Timer;
ScriptedInstance *pInstance;
void Reset()
{
Heal_Timer = 2000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI (const uint32 diff)
{
//Heal_Timer
if (Heal_Timer <= diff)
{
if (pInstance)
{
Unit *pJindo = Unit::GetUnit((*me), pInstance->GetData64(DATA_JINDO));
if (pJindo)
DoCast(pJindo, SPELL_HEAL);
}
Heal_Timer = 3000;
} else Heal_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_healing_wardAI(creature);
}
}; };
//Shade of Jindo //Shade of Jindo
struct mob_shade_of_jindoAI : public ScriptedAI class mob_shade_of_jindo : public CreatureScript
{ {
mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) {} public:
uint32 ShadowShock_Timer; mob_shade_of_jindo()
: CreatureScript("mob_shade_of_jindo")
void Reset()
{
ShadowShock_Timer = 1000;
DoCast(me, SPELL_INVISIBLE, true);
}
void EnterCombat(Unit * /*who*/){}
void UpdateAI (const uint32 diff)
{
//ShadowShock_Timer
if (ShadowShock_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_SHADOWSHOCK); }
ShadowShock_Timer = 2000;
} else ShadowShock_Timer -= diff;
DoMeleeAttackIfReady(); struct mob_shade_of_jindoAI : public ScriptedAI
} {
mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowShock_Timer;
void Reset()
{
ShadowShock_Timer = 1000;
DoCast(me, SPELL_INVISIBLE, true);
}
void EnterCombat(Unit * /*who*/){}
void UpdateAI (const uint32 diff)
{
//ShadowShock_Timer
if (ShadowShock_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
ShadowShock_Timer = 2000;
} else ShadowShock_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_shade_of_jindoAI(creature);
}
}; };
CreatureAI* GetAI_boss_jindo(Creature* pCreature)
{
return new boss_jindoAI (pCreature);
}
CreatureAI* GetAI_mob_healing_ward(Creature* pCreature)
{
return new mob_healing_wardAI (pCreature);
}
CreatureAI* GetAI_mob_shade_of_jindo(Creature* pCreature)
{
return new mob_shade_of_jindoAI (pCreature);
}
void AddSC_boss_jindo() void AddSC_boss_jindo()
{ {
Script *newscript; new boss_jindo();
new mob_healing_ward();
newscript = new Script; new mob_shade_of_jindo();
newscript->Name = "boss_jindo";
newscript->GetAI = &GetAI_boss_jindo;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_healing_ward";
newscript->GetAI = &GetAI_mob_healing_ward;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_shade_of_jindo";
newscript->GetAI = &GetAI_mob_shade_of_jindo;
newscript->RegisterSelf();
} }
@@ -44,292 +44,303 @@ EndScriptData */
//Ohgans Spells //Ohgans Spells
#define SPELL_SUNDERARMOR 24317 #define SPELL_SUNDERARMOR 24317
struct boss_mandokirAI : public ScriptedAI class boss_mandokir : public CreatureScript
{ {
boss_mandokirAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
uint32 KillCount; boss_mandokir()
uint32 Watch_Timer; : CreatureScript("boss_mandokir")
uint32 TargetInRange;
uint32 Cleave_Timer;
uint32 Whirlwind_Timer;
uint32 Fear_Timer;
uint32 MortalStrike_Timer;
uint32 Check_Timer;
float targetX;
float targetY;
float targetZ;
ScriptedInstance *m_pInstance;
bool endWatch;
bool someWatched;
bool RaptorDead;
bool CombatStart;
uint64 WatchTarget;
void Reset()
{
KillCount = 0;
Watch_Timer = 33000;
Cleave_Timer = 7000;
Whirlwind_Timer = 20000;
Fear_Timer = 1000;
MortalStrike_Timer = 1000;
Check_Timer = 1000;
targetX = 0.0;
targetY = 0.0;
targetZ = 0.0;
TargetInRange = 0;
WatchTarget = 0;
someWatched = false;
endWatch = false;
RaptorDead = false;
CombatStart = false;
DoCast(me, 23243);
}
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
{ {
++KillCount;
if (KillCount == 3)
{
DoScriptText(SAY_DING_KILL, me);
if (m_pInstance)
{
uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO);
if (JindoGUID)
{
if (Unit* jTemp = Unit::GetUnit(*me,JindoGUID))
{
if (jTemp->isAlive())
DoScriptText(SAY_GRATS_JINDO, jTemp);
}
}
}
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
} }
}
void EnterCombat(Unit * /*who*/) struct boss_mandokirAI : public ScriptedAI
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->getVictim() && me->isAlive())
{ {
if (!CombatStart) boss_mandokirAI(Creature *c) : ScriptedAI(c)
{ {
//At combat Start Mandokir is mounted so we must unmount it first m_pInstance = c->GetInstanceData();
me->Unmount();
//And summon his raptor
me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
CombatStart = true;
} }
if (Watch_Timer <= diff) //Every 20 Sec Mandokir will check this uint32 KillCount;
uint32 Watch_Timer;
uint32 TargetInRange;
uint32 Cleave_Timer;
uint32 Whirlwind_Timer;
uint32 Fear_Timer;
uint32 MortalStrike_Timer;
uint32 Check_Timer;
float targetX;
float targetY;
float targetZ;
ScriptedInstance *m_pInstance;
bool endWatch;
bool someWatched;
bool RaptorDead;
bool CombatStart;
uint64 WatchTarget;
void Reset()
{ {
if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him KillCount = 0;
{ Watch_Timer = 33000;
Unit* pUnit = Unit::GetUnit(*me, WatchTarget); Cleave_Timer = 7000;
Whirlwind_Timer = 20000;
if (pUnit && ( Fear_Timer = 1000;
targetX != pUnit->GetPositionX() || MortalStrike_Timer = 1000;
targetY != pUnit->GetPositionY() ||
targetZ != pUnit->GetPositionZ() ||
pUnit->isInCombat()))
{
if (me->IsWithinMeleeRange(pUnit))
{
DoCast(pUnit, 24316);
}
else
{
DoCast(pUnit, SPELL_CHARGE);
//me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1);
AttackStart(pUnit);
}
}
}
someWatched = false;
Watch_Timer = 20000;
} else Watch_Timer -= diff;
if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target
{
if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoScriptText(SAY_WATCH, me, p);
DoCast(p, SPELL_WATCH);
WatchTarget = p->GetGUID();
someWatched = true;
endWatch = true;
}
}
if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position
{
Unit* pUnit = Unit::GetUnit(*me, WatchTarget);
if (pUnit)
{
targetX = pUnit->GetPositionX();
targetY = pUnit->GetPositionY();
targetZ = pUnit->GetPositionZ();
}
endWatch = false;
}
if (!someWatched)
{
//Cleave
if (Cleave_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//Whirlwind
if (Whirlwind_Timer <= diff)
{
DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 18000;
} else Whirlwind_Timer -= diff;
//If more then 3 targets in melee range mandokir will cast fear
if (Fear_Timer <= diff)
{
TargetInRange = 0;
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (; i != me->getThreatManager().getThreatList().end(); ++i)
{
Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid());
if (pUnit && me->IsWithinMeleeRange(pUnit))
++TargetInRange;
}
if (TargetInRange > 3)
DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 4000;
} else Fear_Timer -=diff;
//Mortal Strike if target below 50% hp
if (me->getVictim() && me->getVictim()->GetHealth() < me->getVictim()->GetMaxHealth()*0.5)
{
if (MortalStrike_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
}
}
//Checking if Ohgan is dead. If yes Mandokir will enrage.
if (Check_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_OHGAN) == DONE)
{
if (!RaptorDead)
{
DoCast(me, SPELL_ENRAGE);
RaptorDead = true;
}
}
}
Check_Timer = 1000; Check_Timer = 1000;
} else Check_Timer -= diff;
DoMeleeAttackIfReady(); targetX = 0.0;
targetY = 0.0;
targetZ = 0.0;
TargetInRange = 0;
WatchTarget = 0;
someWatched = false;
endWatch = false;
RaptorDead = false;
CombatStart = false;
DoCast(me, 23243);
}
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
if (KillCount == 3)
{
DoScriptText(SAY_DING_KILL, me);
if (m_pInstance)
{
uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO);
if (JindoGUID)
{
if (Unit* jTemp = Unit::GetUnit(*me,JindoGUID))
{
if (jTemp->isAlive())
DoScriptText(SAY_GRATS_JINDO, jTemp);
}
}
}
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
}
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->getVictim() && me->isAlive())
{
if (!CombatStart)
{
//At combat Start Mandokir is mounted so we must unmount it first
me->Unmount();
//And summon his raptor
me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
CombatStart = true;
}
if (Watch_Timer <= diff) //Every 20 Sec Mandokir will check this
{
if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him
{
Unit* pUnit = Unit::GetUnit(*me, WatchTarget);
if (pUnit && (
targetX != pUnit->GetPositionX() ||
targetY != pUnit->GetPositionY() ||
targetZ != pUnit->GetPositionZ() ||
pUnit->isInCombat()))
{
if (me->IsWithinMeleeRange(pUnit))
{
DoCast(pUnit, 24316);
}
else
{
DoCast(pUnit, SPELL_CHARGE);
//me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1);
AttackStart(pUnit);
}
}
}
someWatched = false;
Watch_Timer = 20000;
} else Watch_Timer -= diff;
if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target
{
if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoScriptText(SAY_WATCH, me, p);
DoCast(p, SPELL_WATCH);
WatchTarget = p->GetGUID();
someWatched = true;
endWatch = true;
}
}
if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position
{
Unit* pUnit = Unit::GetUnit(*me, WatchTarget);
if (pUnit)
{
targetX = pUnit->GetPositionX();
targetY = pUnit->GetPositionY();
targetZ = pUnit->GetPositionZ();
}
endWatch = false;
}
if (!someWatched)
{
//Cleave
if (Cleave_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//Whirlwind
if (Whirlwind_Timer <= diff)
{
DoCast(me, SPELL_WHIRLWIND);
Whirlwind_Timer = 18000;
} else Whirlwind_Timer -= diff;
//If more then 3 targets in melee range mandokir will cast fear
if (Fear_Timer <= diff)
{
TargetInRange = 0;
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (; i != me->getThreatManager().getThreatList().end(); ++i)
{
Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid());
if (pUnit && me->IsWithinMeleeRange(pUnit))
++TargetInRange;
}
if (TargetInRange > 3)
DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 4000;
} else Fear_Timer -=diff;
//Mortal Strike if target below 50% hp
if (me->getVictim() && me->getVictim()->GetHealth() < me->getVictim()->GetMaxHealth()*0.5)
{
if (MortalStrike_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
}
}
//Checking if Ohgan is dead. If yes Mandokir will enrage.
if (Check_Timer <= diff)
{
if (m_pInstance)
{
if (m_pInstance->GetData(TYPE_OHGAN) == DONE)
{
if (!RaptorDead)
{
DoCast(me, SPELL_ENRAGE);
RaptorDead = true;
}
}
}
Check_Timer = 1000;
} else Check_Timer -= diff;
DoMeleeAttackIfReady();
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_mandokirAI(creature);
} }
}
}; };
//Ohgan //Ohgan
struct mob_ohganAI : public ScriptedAI class mob_ohgan : public CreatureScript
{ {
mob_ohganAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
uint32 SunderArmor_Timer; mob_ohgan()
ScriptedInstance *m_pInstance; : CreatureScript("mob_ohgan")
void Reset()
{
SunderArmor_Timer = 5000;
}
void EnterCombat(Unit * /*who*/) {}
void JustDied(Unit* /*Killer*/)
{
if (m_pInstance)
m_pInstance->SetData(TYPE_OHGAN, DONE);
}
void UpdateAI (const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//SunderArmor_Timer
if (SunderArmor_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_SUNDERARMOR); }
SunderArmor_Timer = 10000 + rand()%5000;
} else SunderArmor_Timer -= diff;
DoMeleeAttackIfReady(); struct mob_ohganAI : public ScriptedAI
} {
mob_ohganAI(Creature *c) : ScriptedAI(c)
{
m_pInstance = c->GetInstanceData();
}
uint32 SunderArmor_Timer;
ScriptedInstance *m_pInstance;
void Reset()
{
SunderArmor_Timer = 5000;
}
void EnterCombat(Unit * /*who*/) {}
void JustDied(Unit* /*Killer*/)
{
if (m_pInstance)
m_pInstance->SetData(TYPE_OHGAN, DONE);
}
void UpdateAI (const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//SunderArmor_Timer
if (SunderArmor_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SUNDERARMOR);
SunderArmor_Timer = 10000 + rand()%5000;
} else SunderArmor_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_ohganAI(creature);
}
}; };
CreatureAI* GetAI_boss_mandokir(Creature* pCreature)
{
return new boss_mandokirAI (pCreature);
}
CreatureAI* GetAI_mob_ohgan(Creature* pCreature)
{
return new mob_ohganAI (pCreature);
}
void AddSC_boss_mandokir() void AddSC_boss_mandokir()
{ {
Script *newscript; new boss_mandokir();
new mob_ohgan();
newscript = new Script;
newscript->Name = "boss_mandokir";
newscript->GetAI = &GetAI_boss_mandokir;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_ohgan";
newscript->GetAI = &GetAI_mob_ohgan;
newscript->RegisterSelf();
} }
@@ -40,224 +40,236 @@ EndScriptData */
//The Spider Spells //The Spider Spells
#define SPELL_LEVELUP 24312 //Not right Spell. #define SPELL_LEVELUP 24312 //Not right Spell.
struct boss_marliAI : public ScriptedAI class boss_marli : public CreatureScript
{ {
boss_marliAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
ScriptedInstance *m_pInstance; boss_marli()
: CreatureScript("boss_marli")
uint32 SpawnStartSpiders_Timer;
uint32 PoisonVolley_Timer;
uint32 SpawnSpider_Timer;
uint32 Charge_Timer;
uint32 Aspect_Timer;
uint32 Transform_Timer;
uint32 TransformBack_Timer;
bool Spawned;
bool PhaseTwo;
void Reset()
{
SpawnStartSpiders_Timer = 1000;
PoisonVolley_Timer = 15000;
SpawnSpider_Timer = 30000;
Charge_Timer = 1500;
Aspect_Timer = 12000;
Transform_Timer = 45000;
TransformBack_Timer = 25000;
Spawned = false;
PhaseTwo = false;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_MARLI, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->getVictim() && me->isAlive())
{ {
if (PoisonVolley_Timer <= diff) }
struct boss_marliAI : public ScriptedAI
{
boss_marliAI(Creature *c) : ScriptedAI(c)
{ {
DoCast(me->getVictim(), SPELL_POISONVOLLEY); m_pInstance = c->GetInstanceData();
PoisonVolley_Timer = 10000 + rand()%10000;
} else PoisonVolley_Timer -= diff;
if (!PhaseTwo && Aspect_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
Aspect_Timer = 13000 + rand()%5000;
} else Aspect_Timer -= diff;
if (!Spawned && SpawnStartSpiders_Timer <= diff)
{
DoScriptText(SAY_SPIDER_SPAWN, me);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
return;
Creature *Spider = NULL;
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spawned = true;
} else SpawnStartSpiders_Timer -= diff;
if (SpawnSpider_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
return;
Creature *Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
SpawnSpider_Timer = 12000 + rand()%5000;
} else SpawnSpider_Timer -= diff;
if (!PhaseTwo && Transform_Timer <= diff)
{
DoScriptText(SAY_TRANSFORM, me);
DoCast(me, SPELL_SPIDER_FORM);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
DoCast(me->getVictim(), SPELL_ENVOLWINGWEB);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-100);
PhaseTwo = true;
Transform_Timer = urand(35000,60000);
} else Transform_Timer -= diff;
if (PhaseTwo)
{
if (Charge_Timer <= diff)
{
Unit *pTarget = NULL;
int i = 0;
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true); // not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget)
{
DoCast(pTarget, SPELL_CHARGE);
//me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
//me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
AttackStart(pTarget);
}
Charge_Timer = 8000;
} else Charge_Timer -= diff;
if (TransformBack_Timer <= diff)
{
me->SetDisplayId(15220);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
me->UpdateDamagePhysical(BASE_ATTACK);
PhaseTwo = false;
TransformBack_Timer = urand(25000,40000);
} else TransformBack_Timer -= diff;
} }
DoMeleeAttackIfReady(); ScriptedInstance *m_pInstance;
uint32 SpawnStartSpiders_Timer;
uint32 PoisonVolley_Timer;
uint32 SpawnSpider_Timer;
uint32 Charge_Timer;
uint32 Aspect_Timer;
uint32 Transform_Timer;
uint32 TransformBack_Timer;
bool Spawned;
bool PhaseTwo;
void Reset()
{
SpawnStartSpiders_Timer = 1000;
PoisonVolley_Timer = 15000;
SpawnSpider_Timer = 30000;
Charge_Timer = 1500;
Aspect_Timer = 12000;
Transform_Timer = 45000;
TransformBack_Timer = 25000;
Spawned = false;
PhaseTwo = false;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_MARLI, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->getVictim() && me->isAlive())
{
if (PoisonVolley_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_POISONVOLLEY);
PoisonVolley_Timer = 10000 + rand()%10000;
} else PoisonVolley_Timer -= diff;
if (!PhaseTwo && Aspect_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
Aspect_Timer = 13000 + rand()%5000;
} else Aspect_Timer -= diff;
if (!Spawned && SpawnStartSpiders_Timer <= diff)
{
DoScriptText(SAY_SPIDER_SPAWN, me);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
return;
Creature *Spider = NULL;
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spawned = true;
} else SpawnStartSpiders_Timer -= diff;
if (SpawnSpider_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
return;
Creature *Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
SpawnSpider_Timer = 12000 + rand()%5000;
} else SpawnSpider_Timer -= diff;
if (!PhaseTwo && Transform_Timer <= diff)
{
DoScriptText(SAY_TRANSFORM, me);
DoCast(me, SPELL_SPIDER_FORM);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
DoCast(me->getVictim(), SPELL_ENVOLWINGWEB);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-100);
PhaseTwo = true;
Transform_Timer = urand(35000,60000);
} else Transform_Timer -= diff;
if (PhaseTwo)
{
if (Charge_Timer <= diff)
{
Unit *pTarget = NULL;
int i = 0;
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true); // not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget)
{
DoCast(pTarget, SPELL_CHARGE);
//me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
//me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
AttackStart(pTarget);
}
Charge_Timer = 8000;
} else Charge_Timer -= diff;
if (TransformBack_Timer <= diff)
{
me->SetDisplayId(15220);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
me->UpdateDamagePhysical(BASE_ATTACK);
PhaseTwo = false;
TransformBack_Timer = urand(25000,40000);
} else TransformBack_Timer -= diff;
}
DoMeleeAttackIfReady();
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new example_creatureAI(creature);
} }
}
}; };
//Spawn of Marli //Spawn of Marli
struct mob_spawn_of_marliAI : public ScriptedAI class mob_spawn_of_marli : public CreatureScript
{ {
mob_spawn_of_marliAI(Creature *c) : ScriptedAI(c) {} public:
uint32 LevelUp_Timer; mob_spawn_of_marli()
: CreatureScript("mob_spawn_of_marli")
void Reset()
{
LevelUp_Timer = 3000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI (const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//LevelUp_Timer
if (LevelUp_Timer <= diff)
{ {
DoCast(me, SPELL_LEVELUP); }
LevelUp_Timer = 3000;
} else LevelUp_Timer -= diff;
DoMeleeAttackIfReady(); struct mob_spawn_of_marliAI : public ScriptedAI
} {
mob_spawn_of_marliAI(Creature *c) : ScriptedAI(c) {}
uint32 LevelUp_Timer;
void Reset()
{
LevelUp_Timer = 3000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI (const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//LevelUp_Timer
if (LevelUp_Timer <= diff)
{
DoCast(me, SPELL_LEVELUP);
LevelUp_Timer = 3000;
} else LevelUp_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_spawn_of_marliAI(creature);
}
}; };
CreatureAI* GetAI_boss_marli(Creature* pCreature)
{
return new boss_marliAI (pCreature);
}
CreatureAI* GetAI_mob_spawn_of_marli(Creature* pCreature)
{
return new mob_spawn_of_marliAI (pCreature);
}
void AddSC_boss_marli() void AddSC_boss_marli()
{ {
Script *newscript; new boss_marli();
new mob_spawn_of_marli();
newscript = new Script;
newscript->Name = "boss_marli";
newscript->GetAI = &GetAI_boss_marli;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_spawn_of_marli";
newscript->GetAI = &GetAI_mob_spawn_of_marli;
newscript->RegisterSelf();
} }
@@ -31,124 +31,131 @@ EndScriptData */
#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist #define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist
struct boss_renatakiAI : public ScriptedAI class boss_renataki : public CreatureScript
{ {
boss_renatakiAI(Creature *c) : ScriptedAI(c) {} public:
uint32 Invisible_Timer; boss_renataki()
uint32 Ambush_Timer; : CreatureScript("boss_renataki")
uint32 Visible_Timer;
uint32 Aggro_Timer;
uint32 ThousandBlades_Timer;
bool Invisible;
bool Ambushed;
void Reset()
{
Invisible_Timer = 8000 + rand()%10000;
Ambush_Timer = 3000;
Visible_Timer = 4000;
Aggro_Timer = 15000 + rand()%10000;
ThousandBlades_Timer = 4000 + rand()%4000;
Invisible = false;
Ambushed = false;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Invisible_Timer
if (Invisible_Timer <= diff)
{ {
me->InterruptSpell(CURRENT_GENERIC_SPELL); }
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); struct boss_renatakiAI : public ScriptedAI
me->SetDisplayId(11686);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = true;
Invisible_Timer = 15000 + rand()%15000;
} else Invisible_Timer -= diff;
if (Invisible)
{ {
if (Ambush_Timer <= diff) boss_renatakiAI(Creature *c) : ScriptedAI(c) {}
uint32 Invisible_Timer;
uint32 Ambush_Timer;
uint32 Visible_Timer;
uint32 Aggro_Timer;
uint32 ThousandBlades_Timer;
bool Invisible;
bool Ambushed;
void Reset()
{ {
Unit *pTarget = NULL; Invisible_Timer = 8000 + rand()%10000;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); Ambush_Timer = 3000;
if (pTarget) Visible_Timer = 4000;
Aggro_Timer = 15000 + rand()%10000;
ThousandBlades_Timer = 4000 + rand()%4000;
Invisible = false;
Ambushed = false;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Invisible_Timer
if (Invisible_Timer <= diff)
{ {
DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); me->InterruptSpell(CURRENT_GENERIC_SPELL);
DoCast(pTarget, SPELL_AMBUSH);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->SetDisplayId(11686);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = true;
Invisible_Timer = 15000 + rand()%15000;
} else Invisible_Timer -= diff;
if (Invisible)
{
if (Ambush_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
{
DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
DoCast(pTarget, SPELL_AMBUSH);
}
Ambushed = true;
Ambush_Timer = 3000;
} else Ambush_Timer -= diff;
} }
Ambushed = true; if (Ambushed)
Ambush_Timer = 3000; {
} else Ambush_Timer -= diff; if (Visible_Timer <= diff)
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
me->SetDisplayId(15268);
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = false;
Visible_Timer = 4000;
} else Visible_Timer -= diff;
}
//Resetting some aggro so he attacks other gamers
if (!Invisible)
if (Aggro_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-50);
if (pTarget)
AttackStart(pTarget);
Aggro_Timer = 7000 + rand()%13000;
} else Aggro_Timer -= diff;
if (!Invisible)
if (ThousandBlades_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_THOUSANDBLADES);
ThousandBlades_Timer = 7000 + rand()%5000;
} else ThousandBlades_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_renatakiAI(creature);
} }
if (Ambushed)
{
if (Visible_Timer <= diff)
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
me->SetDisplayId(15268);
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = false;
Visible_Timer = 4000;
} else Visible_Timer -= diff;
}
//Resetting some aggro so he attacks other gamers
if (!Invisible)
if (Aggro_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-50);
if (pTarget)
AttackStart(pTarget);
Aggro_Timer = 7000 + rand()%13000;
} else Aggro_Timer -= diff;
if (!Invisible)
if (ThousandBlades_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_THOUSANDBLADES);
ThousandBlades_Timer = 7000 + rand()%5000;
} else ThousandBlades_Timer -= diff;
DoMeleeAttackIfReady();
}
}; };
CreatureAI* GetAI_boss_renataki(Creature* pCreature)
{
return new boss_renatakiAI (pCreature);
}
void AddSC_boss_renataki() void AddSC_boss_renataki()
{ {
Script *newscript; new boss_renataki();
newscript = new Script;
newscript->Name = "boss_renataki";
newscript->GetAI = &GetAI_boss_renataki;
newscript->RegisterSelf();
} }
File diff suppressed because it is too large Load Diff
@@ -39,163 +39,169 @@ EndScriptData */
#define SPELL_BERSERK 23537 #define SPELL_BERSERK 23537
#define SPELL_DISPELL 23859 #define SPELL_DISPELL 23859
struct boss_venoxisAI : public ScriptedAI class boss_venoxis : public CreatureScript
{ {
boss_venoxisAI(Creature *c) : ScriptedAI(c) public:
{
m_pInstance = c->GetInstanceData();
}
ScriptedInstance *m_pInstance; boss_venoxis()
: CreatureScript("boss_venoxis")
{
}
uint32 HolyFire_Timer; struct boss_venoxisAI : public ScriptedAI
uint32 HolyWrath_Timer; {
uint32 VenomSpit_Timer; boss_venoxisAI(Creature *c) : ScriptedAI(c)
uint32 Renew_Timer;
uint32 PoisonCloud_Timer;
uint32 HolyNova_Timer;
uint32 Dispell_Timer;
uint32 TargetInRange;
bool PhaseTwo;
bool InBerserk;
void Reset()
{
HolyFire_Timer = 10000;
HolyWrath_Timer = 60500;
VenomSpit_Timer = 5500;
Renew_Timer = 30500;
PoisonCloud_Timer = 2000;
HolyNova_Timer = 5000;
Dispell_Timer = 35000;
TargetInRange = 0;
PhaseTwo = false;
InBerserk= false;
}
void EnterCombat(Unit * /*who*/)
{
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_VENOXIS, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if ((me->GetHealth()*100 / me->GetMaxHealth() > 50))
{ {
if (Dispell_Timer <= diff) m_pInstance = c->GetInstanceData();
{ }
DoCast(me, SPELL_DISPELL);
Dispell_Timer = 15000 + rand()%15000;
} else Dispell_Timer -= diff;
if (Renew_Timer <= diff) ScriptedInstance *m_pInstance;
{
DoCast(me, SPELL_RENEW);
Renew_Timer = 20000 + rand()%10000;
} else Renew_Timer -= diff;
if (HolyWrath_Timer <= diff) uint32 HolyFire_Timer;
{ uint32 HolyWrath_Timer;
DoCast(me->getVictim(), SPELL_HOLY_WRATH); uint32 VenomSpit_Timer;
HolyWrath_Timer = 15000 + rand()%10000; uint32 Renew_Timer;
} else HolyWrath_Timer -= diff; uint32 PoisonCloud_Timer;
uint32 HolyNova_Timer;
uint32 Dispell_Timer;
uint32 TargetInRange;
if (HolyNova_Timer <= diff) bool PhaseTwo;
{ bool InBerserk;
TargetInRange = 0;
for (uint8 i = 0; i < 10; ++i) void Reset()
{
HolyFire_Timer = 10000;
HolyWrath_Timer = 60500;
VenomSpit_Timer = 5500;
Renew_Timer = 30500;
PoisonCloud_Timer = 2000;
HolyNova_Timer = 5000;
Dispell_Timer = 35000;
TargetInRange = 0;
PhaseTwo = false;
InBerserk= false;
}
void EnterCombat(Unit * /*who*/)
{
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(SAY_DEATH, me);
if (m_pInstance)
m_pInstance->SetData(TYPE_VENOXIS, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if ((me->GetHealth()*100 / me->GetMaxHealth() > 50))
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) if (Dispell_Timer <= diff)
if (me->IsWithinMeleeRange(pTarget)) {
++TargetInRange; DoCast(me, SPELL_DISPELL);
} Dispell_Timer = 15000 + rand()%15000;
} else Dispell_Timer -= diff;
if (TargetInRange > 1) if (Renew_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_HOLY_NOVA); DoCast(me, SPELL_RENEW);
HolyNova_Timer = 1000; Renew_Timer = 20000 + rand()%10000;
} else Renew_Timer -= diff;
if (HolyWrath_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HOLY_WRATH);
HolyWrath_Timer = 15000 + rand()%10000;
} else HolyWrath_Timer -= diff;
if (HolyNova_Timer <= diff)
{
TargetInRange = 0;
for (uint8 i = 0; i < 10; ++i)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i))
if (me->IsWithinMeleeRange(pTarget))
++TargetInRange;
}
if (TargetInRange > 1)
{
DoCast(me->getVictim(), SPELL_HOLY_NOVA);
HolyNova_Timer = 1000;
}
else
{
HolyNova_Timer = 2000;
}
} else HolyNova_Timer -= diff;
if (HolyFire_Timer < diff && TargetInRange < 3)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_HOLY_FIRE);
HolyFire_Timer = 8000;
} else HolyFire_Timer -= diff;
} }
else else
{ {
HolyNova_Timer = 2000; if (!PhaseTwo)
{
DoScriptText(SAY_TRANSFORM, me);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SNAKE_FORM);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25)));
me->UpdateDamagePhysical(BASE_ATTACK);
DoResetThreat();
PhaseTwo = true;
}
if (PhaseTwo && PoisonCloud_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_POISON_CLOUD);
PoisonCloud_Timer = 15000;
}PoisonCloud_Timer -=diff;
if (PhaseTwo && VenomSpit_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_VENOMSPIT);
VenomSpit_Timer = 15000 + rand()%5000;
} else VenomSpit_Timer -= diff;
if (PhaseTwo && (me->GetHealth()*100 / me->GetMaxHealth() < 11))
{
if (!InBerserk)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_BERSERK);
InBerserk = true;
}
}
} }
DoMeleeAttackIfReady();
} else HolyNova_Timer -= diff;
if (HolyFire_Timer < diff && TargetInRange < 3)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_HOLY_FIRE);
HolyFire_Timer = 8000;
} else HolyFire_Timer -= diff;
} }
else };
{
if (!PhaseTwo)
{
DoScriptText(SAY_TRANSFORM, me);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SNAKE_FORM);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25)));
me->UpdateDamagePhysical(BASE_ATTACK);
DoResetThreat();
PhaseTwo = true;
}
if (PhaseTwo && PoisonCloud_Timer <= diff) CreatureAI* GetAI(Creature* creature) const
{ {
DoCast(me->getVictim(), SPELL_POISON_CLOUD); return new boss_venoxisAI(creature);
PoisonCloud_Timer = 15000; }
}PoisonCloud_Timer -=diff;
if (PhaseTwo && VenomSpit_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_VENOMSPIT);
VenomSpit_Timer = 15000 + rand()%5000;
} else VenomSpit_Timer -= diff;
if (PhaseTwo && (me->GetHealth()*100 / me->GetMaxHealth() < 11))
{
if (!InBerserk)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_BERSERK);
InBerserk = true;
}
}
}
DoMeleeAttackIfReady();
}
}; };
CreatureAI* GetAI_boss_venoxis(Creature* pCreature)
{
return new boss_venoxisAI (pCreature);
}
void AddSC_boss_venoxis() void AddSC_boss_venoxis()
{ {
Script *newscript; new boss_venoxis();
newscript = new Script;
newscript->Name = "boss_venoxis";
newscript->GetAI = &GetAI_boss_venoxis;
newscript->RegisterSelf();
} }
@@ -29,59 +29,66 @@ EndScriptData */
#define SPELL_LIGHTNINGCLOUD 25033 #define SPELL_LIGHTNINGCLOUD 25033
#define SPELL_LIGHTNINGWAVE 24819 #define SPELL_LIGHTNINGWAVE 24819
struct boss_wushoolayAI : public ScriptedAI class boss_wushoolay : public CreatureScript
{ {
boss_wushoolayAI(Creature *c) : ScriptedAI(c) {} public:
uint32 LightningCloud_Timer; boss_wushoolay()
uint32 LightningWave_Timer; : CreatureScript("boss_wushoolay")
void Reset()
{
LightningCloud_Timer = 5000 + rand()%5000;
LightningWave_Timer = 8000 + rand()%8000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//LightningCloud_Timer
if (LightningCloud_Timer <= diff)
{ {
DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD); }
LightningCloud_Timer = 15000 + rand()%5000;
} else LightningCloud_Timer -= diff;
//LightningWave_Timer struct boss_wushoolayAI : public ScriptedAI
if (LightningWave_Timer <= diff)
{ {
Unit *pTarget = NULL; boss_wushoolayAI(Creature *c) : ScriptedAI(c) {}
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget) DoCast(pTarget, SPELL_LIGHTNINGWAVE);
LightningWave_Timer = 12000 + rand()%4000; uint32 LightningCloud_Timer;
} else LightningWave_Timer -= diff; uint32 LightningWave_Timer;
DoMeleeAttackIfReady(); void Reset()
} {
LightningCloud_Timer = 5000 + rand()%5000;
LightningWave_Timer = 8000 + rand()%8000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//LightningCloud_Timer
if (LightningCloud_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD);
LightningCloud_Timer = 15000 + rand()%5000;
} else LightningCloud_Timer -= diff;
//LightningWave_Timer
if (LightningWave_Timer <= diff)
{
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget) DoCast(pTarget, SPELL_LIGHTNINGWAVE);
LightningWave_Timer = 12000 + rand()%4000;
} else LightningWave_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_wushoolayAI(creature);
}
}; };
CreatureAI* GetAI_boss_wushoolay(Creature* pCreature)
{
return new boss_wushoolayAI (pCreature);
}
void AddSC_boss_wushoolay() void AddSC_boss_wushoolay()
{ {
Script *newscript; new boss_wushoolay();
newscript = new Script;
newscript->Name = "boss_wushoolay";
newscript->GetAI = &GetAI_boss_wushoolay;
newscript->RegisterSelf();
} }
@@ -26,136 +26,140 @@ EndScriptData */
#include "ScriptPCH.h" #include "ScriptPCH.h"
#include "zulgurub.h" #include "zulgurub.h"
struct instance_zulgurub : public ScriptedInstance class instance_zulgurub : public InstanceMapScript
{ {
instance_zulgurub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; public:
instance_zulgurub()
//If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. : InstanceMapScript("instance_zulgurub")
uint32 m_auiEncounter[MAX_ENCOUNTERS];
//Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
uint64 m_uiLorKhanGUID;
uint64 m_uiZathGUID;
uint64 m_uiThekalGUID;
uint64 m_uiJindoGUID;
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
m_uiLorKhanGUID = 0;
m_uiZathGUID = 0;
m_uiThekalGUID = 0;
m_uiJindoGUID = 0;
}
bool IsEncounterInProgress() const
{
//not active in Zul'Gurub
return false;
}
void OnCreatureCreate(Creature* pCreature)
{
switch(pCreature->GetEntry())
{ {
case 11347: m_uiLorKhanGUID = pCreature->GetGUID(); break;
case 11348: m_uiZathGUID = pCreature->GetGUID(); break;
case 14509: m_uiThekalGUID = pCreature->GetGUID(); break;
case 11380: m_uiJindoGUID = pCreature->GetGUID(); break;
} }
}
void SetData(uint32 uiType, uint32 uiData) struct instance_zulgurub_InstanceMapScript : public ScriptedInstance
{
switch(uiType)
{ {
case TYPE_ARLOKK: instance_zulgurub(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
m_auiEncounter[0] = uiData;
break;
case TYPE_JEKLIK: //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too.
m_auiEncounter[1] = uiData; uint32 m_auiEncounter[MAX_ENCOUNTERS];
break;
case TYPE_VENOXIS: //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
m_auiEncounter[2] = uiData; uint64 m_uiLorKhanGUID;
break; uint64 m_uiZathGUID;
uint64 m_uiThekalGUID;
uint64 m_uiJindoGUID;
case TYPE_MARLI: void Initialize()
m_auiEncounter[3] = uiData; {
break; memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
case TYPE_THEKAL: m_uiLorKhanGUID = 0;
m_auiEncounter[4] = uiData; m_uiZathGUID = 0;
break; m_uiThekalGUID = 0;
m_uiJindoGUID = 0;
}
case TYPE_LORKHAN: bool IsEncounterInProgress() const
m_auiEncounter[5] = uiData; {
break; //not active in Zul'Gurub
return false;
}
case TYPE_ZATH: void OnCreatureCreate(Creature* pCreature)
m_auiEncounter[6] = uiData; {
break; switch(pCreature->GetEntry())
{
case 11347: m_uiLorKhanGUID = pCreature->GetGUID(); break;
case 11348: m_uiZathGUID = pCreature->GetGUID(); break;
case 14509: m_uiThekalGUID = pCreature->GetGUID(); break;
case 11380: m_uiJindoGUID = pCreature->GetGUID(); break;
}
}
case TYPE_OHGAN: void SetData(uint32 uiType, uint32 uiData)
m_auiEncounter[7] = uiData; {
break; switch(uiType)
} {
} case TYPE_ARLOKK:
m_auiEncounter[0] = uiData;
break;
uint32 GetData(uint32 uiType) case TYPE_JEKLIK:
{ m_auiEncounter[1] = uiData;
switch(uiType) break;
case TYPE_VENOXIS:
m_auiEncounter[2] = uiData;
break;
case TYPE_MARLI:
m_auiEncounter[3] = uiData;
break;
case TYPE_THEKAL:
m_auiEncounter[4] = uiData;
break;
case TYPE_LORKHAN:
m_auiEncounter[5] = uiData;
break;
case TYPE_ZATH:
m_auiEncounter[6] = uiData;
break;
case TYPE_OHGAN:
m_auiEncounter[7] = uiData;
break;
}
}
uint32 GetData(uint32 uiType)
{
switch(uiType)
{
case TYPE_ARLOKK:
return m_auiEncounter[0];
case TYPE_JEKLIK:
return m_auiEncounter[1];
case TYPE_VENOXIS:
return m_auiEncounter[2];
case TYPE_MARLI:
return m_auiEncounter[3];
case TYPE_THEKAL:
return m_auiEncounter[4];
case TYPE_LORKHAN:
return m_auiEncounter[5];
case TYPE_ZATH:
return m_auiEncounter[6];
case TYPE_OHGAN:
return m_auiEncounter[7];
}
return 0;
}
uint64 GetData64(uint32 uiData)
{
switch(uiData)
{
case DATA_LORKHAN:
return m_uiLorKhanGUID;
case DATA_ZATH:
return m_uiZathGUID;
case DATA_THEKAL:
return m_uiThekalGUID;
case DATA_JINDO:
return m_uiJindoGUID;
}
return 0;
}
};
InstanceData* OnGetInstanceData(InstanceMap* pMap)
{ {
case TYPE_ARLOKK: return new instance_zulgurub_InstanceMapScript(pMap);
return m_auiEncounter[0];
case TYPE_JEKLIK:
return m_auiEncounter[1];
case TYPE_VENOXIS:
return m_auiEncounter[2];
case TYPE_MARLI:
return m_auiEncounter[3];
case TYPE_THEKAL:
return m_auiEncounter[4];
case TYPE_LORKHAN:
return m_auiEncounter[5];
case TYPE_ZATH:
return m_auiEncounter[6];
case TYPE_OHGAN:
return m_auiEncounter[7];
} }
return 0;
}
uint64 GetData64(uint32 uiData)
{
switch(uiData)
{
case DATA_LORKHAN:
return m_uiLorKhanGUID;
case DATA_ZATH:
return m_uiZathGUID;
case DATA_THEKAL:
return m_uiThekalGUID;
case DATA_JINDO:
return m_uiJindoGUID;
}
return 0;
}
}; };
InstanceData* GetInstanceData_instance_zulgurub(Map* pMap)
{
return new instance_zulgurub(pMap);
}
void AddSC_instance_zulgurub() void AddSC_instance_zulgurub()
{ {
Script *newscript; new instance_zulgurub();
newscript = new Script; }
newscript->Name = "instance_zulgurub";
newscript->GetInstanceData = &GetInstanceData_instance_zulgurub;
newscript->RegisterSelf();
}