Implement generic script loaders to greatly reduce code duplication
This commit is contained in:
@@ -87,7 +87,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity
|
||||
public const uint IrisOpened = 61012; // Visual When Starting Encounter
|
||||
public const uint SummomRedDragonBuddy = 56070;
|
||||
}
|
||||
|
||||
|
||||
[Script]
|
||||
class instance_eye_of_eternity : InstanceMapScript
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ using System;
|
||||
namespace Scripts.Northrend.Nexus.Nexus
|
||||
{
|
||||
struct AnomalusConst
|
||||
{
|
||||
{
|
||||
//Spells
|
||||
public const uint SpellSpark = 47751;
|
||||
public const uint SpellSparkHeroic = 57062;
|
||||
@@ -64,208 +64,188 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_anomalus : CreatureScript
|
||||
class boss_anomalus : ScriptedAI
|
||||
{
|
||||
public boss_anomalus() : base("boss_anomalus") { }
|
||||
|
||||
class boss_anomalusAI : ScriptedAI
|
||||
public boss_anomalus(Creature creature) : base(creature)
|
||||
{
|
||||
public boss_anomalusAI(Creature creature) : base(creature)
|
||||
instance = me.GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
instance = me.GetInstanceScript();
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
DoCast(target, AnomalusConst.SpellSpark);
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(5));
|
||||
});
|
||||
|
||||
Phase = 0;
|
||||
uiChaoticRiftGUID.Clear();
|
||||
chaosTheory = true;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
instance.SetBossState(DataTypes.Anomalus, EncounterState.NotStarted);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(AnomalusConst.SayAggro);
|
||||
|
||||
instance.SetBossState(DataTypes.Anomalus, EncounterState.InProgress);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(AnomalusConst.SayDeath);
|
||||
|
||||
instance.SetBossState(DataTypes.Anomalus, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
if (type == AnomalusConst.DataChaosTheory)
|
||||
return chaosTheory ? 1 : 0u;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void SummonedCreatureDies(Creature summoned, Unit who)
|
||||
{
|
||||
if (summoned.GetEntry() == AnomalusConst.NpcChaoticRift)
|
||||
chaosTheory = false;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me.GetDistance(me.GetHomePosition()) > 60.0f)
|
||||
{
|
||||
// Not blizzlike, hack to avoid an exploit
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
if (me.HasAura(AnomalusConst.SpellRiftShield))
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
if (!uiChaoticRiftGUID.IsEmpty())
|
||||
{
|
||||
Creature Rift = ObjectAccessor.GetCreature(me, uiChaoticRiftGUID);
|
||||
if (Rift && Rift.IsDead())
|
||||
{
|
||||
me.RemoveAurasDueToSpell(AnomalusConst.SpellRiftShield);
|
||||
uiChaoticRiftGUID.Clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
uiChaoticRiftGUID.Clear();
|
||||
|
||||
if ((Phase == 0) && HealthBelowPct(50))
|
||||
{
|
||||
Phase = 1;
|
||||
Talk(AnomalusConst.SayShield);
|
||||
DoCast(me, AnomalusConst.SpellRiftShield);
|
||||
Creature Rift = me.SummonCreature(AnomalusConst.NpcChaoticRift, AnomalusConst.RiftLocation[RandomHelper.IRand(0, 5)], TempSummonType.TimedDespawnOOC, 1000);
|
||||
if (Rift)
|
||||
{
|
||||
//DoCast(Rift, SPELL_CHARGE_RIFT);
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
DoCast(target, AnomalusConst.SpellSpark);
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(5));
|
||||
});
|
||||
|
||||
Phase = 0;
|
||||
uiChaoticRiftGUID.Clear();
|
||||
chaosTheory = true;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
instance.SetBossState(DataTypes.Anomalus, EncounterState.NotStarted);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(AnomalusConst.SayAggro);
|
||||
|
||||
instance.SetBossState(DataTypes.Anomalus, EncounterState.InProgress);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(AnomalusConst.SayDeath);
|
||||
|
||||
instance.SetBossState(DataTypes.Anomalus, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
if (type == AnomalusConst.DataChaosTheory)
|
||||
return chaosTheory ? 1 : 0u;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void SummonedCreatureDies(Creature summoned, Unit who)
|
||||
{
|
||||
if (summoned.GetEntry() == AnomalusConst.NpcChaoticRift)
|
||||
chaosTheory = false;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me.GetDistance(me.GetHomePosition()) > 60.0f)
|
||||
{
|
||||
// Not blizzlike, hack to avoid an exploit
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
Rift.GetAI().AttackStart(target);
|
||||
uiChaoticRiftGUID = Rift.GetGUID();
|
||||
Talk(AnomalusConst.SayRift);
|
||||
}
|
||||
|
||||
if (me.HasAura(AnomalusConst.SpellRiftShield))
|
||||
{
|
||||
if (!uiChaoticRiftGUID.IsEmpty())
|
||||
{
|
||||
Creature Rift = ObjectAccessor.GetCreature(me, uiChaoticRiftGUID);
|
||||
if (Rift && Rift.IsDead())
|
||||
{
|
||||
me.RemoveAurasDueToSpell(AnomalusConst.SpellRiftShield);
|
||||
uiChaoticRiftGUID.Clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
uiChaoticRiftGUID.Clear();
|
||||
|
||||
if ((Phase == 0) && HealthBelowPct(50))
|
||||
{
|
||||
Phase = 1;
|
||||
Talk(AnomalusConst.SayShield);
|
||||
DoCast(me, AnomalusConst.SpellRiftShield);
|
||||
Creature Rift = me.SummonCreature(AnomalusConst.NpcChaoticRift, AnomalusConst.RiftLocation[RandomHelper.IRand(0, 5)], TempSummonType.TimedDespawnOOC, 1000);
|
||||
if (Rift)
|
||||
{
|
||||
//DoCast(Rift, SPELL_CHARGE_RIFT);
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
Rift.GetAI().AttackStart(target);
|
||||
uiChaoticRiftGUID = Rift.GetGUID();
|
||||
Talk(AnomalusConst.SayRift);
|
||||
}
|
||||
}
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
_scheduler.Update(diff);
|
||||
|
||||
byte Phase;
|
||||
ObjectGuid uiChaoticRiftGUID;
|
||||
bool chaosTheory;
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return GetInstanceAI<boss_anomalusAI>(creature);
|
||||
}
|
||||
InstanceScript instance;
|
||||
|
||||
byte Phase;
|
||||
ObjectGuid uiChaoticRiftGUID;
|
||||
bool chaosTheory;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_chaotic_rift : CreatureScript
|
||||
class npc_chaotic_rift : ScriptedAI
|
||||
{
|
||||
public npc_chaotic_rift() : base("npc_chaotic_rift") { }
|
||||
|
||||
class npc_chaotic_riftAI : ScriptedAI
|
||||
public npc_chaotic_rift(Creature creature) : base(creature)
|
||||
{
|
||||
public npc_chaotic_riftAI(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = me.GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
Initialize();
|
||||
instance = me.GetInstanceScript();
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiChaoticEnergyBurstTimer = 1000;
|
||||
uiSummonCrazedManaWraithTimer = 5000;
|
||||
}
|
||||
void Initialize()
|
||||
{
|
||||
uiChaoticEnergyBurstTimer = 1000;
|
||||
uiSummonCrazedManaWraithTimer = 5000;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
me.SetDisplayId(me.GetCreatureTemplate().ModelId2);
|
||||
DoCast(me, AnomalusConst.SpellArcaneform, false);
|
||||
}
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
me.SetDisplayId(me.GetCreatureTemplate().ModelId2);
|
||||
DoCast(me, AnomalusConst.SpellArcaneform, false);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiChaoticEnergyBurstTimer <= diff)
|
||||
if (uiChaoticEnergyBurstTimer <= diff)
|
||||
{
|
||||
Creature Anomalus = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.Anomalus));
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
{
|
||||
if (Anomalus && Anomalus.HasAura(AnomalusConst.SpellRiftShield))
|
||||
DoCast(target, AnomalusConst.SpellChargedChaoticEnergyBurst);
|
||||
else
|
||||
DoCast(target, AnomalusConst.SpellChaoticEnergyBurst);
|
||||
}
|
||||
uiChaoticEnergyBurstTimer = 1000;
|
||||
}
|
||||
else
|
||||
uiChaoticEnergyBurstTimer -= diff;
|
||||
|
||||
if (uiSummonCrazedManaWraithTimer <= diff)
|
||||
{
|
||||
Creature Wraith = me.SummonCreature(AnomalusConst.NpcCrazedManaWraith, me.GetPositionX() + 1, me.GetPositionY() + 1, me.GetPositionZ(), 0, TempSummonType.TimedDespawnOOC, 1000);
|
||||
if (Wraith)
|
||||
{
|
||||
Creature Anomalus = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.Anomalus));
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
{
|
||||
if (Anomalus && Anomalus.HasAura(AnomalusConst.SpellRiftShield))
|
||||
DoCast(target, AnomalusConst.SpellChargedChaoticEnergyBurst);
|
||||
else
|
||||
DoCast(target, AnomalusConst.SpellChaoticEnergyBurst);
|
||||
}
|
||||
uiChaoticEnergyBurstTimer = 1000;
|
||||
Wraith.GetAI().AttackStart(target);
|
||||
}
|
||||
Creature Anomalus = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.Anomalus));
|
||||
if (Anomalus && Anomalus.HasAura(AnomalusConst.SpellRiftShield))
|
||||
uiSummonCrazedManaWraithTimer = 5000;
|
||||
else
|
||||
uiChaoticEnergyBurstTimer -= diff;
|
||||
|
||||
if (uiSummonCrazedManaWraithTimer <= diff)
|
||||
{
|
||||
Creature Wraith = me.SummonCreature(AnomalusConst.NpcCrazedManaWraith, me.GetPositionX() + 1, me.GetPositionY() + 1, me.GetPositionZ(), 0, TempSummonType.TimedDespawnOOC, 1000);
|
||||
if (Wraith)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
Wraith.GetAI().AttackStart(target);
|
||||
}
|
||||
Creature Anomalus = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.Anomalus));
|
||||
if (Anomalus && Anomalus.HasAura(AnomalusConst.SpellRiftShield))
|
||||
uiSummonCrazedManaWraithTimer = 5000;
|
||||
else
|
||||
uiSummonCrazedManaWraithTimer = 10000;
|
||||
}
|
||||
else
|
||||
uiSummonCrazedManaWraithTimer -= diff;
|
||||
uiSummonCrazedManaWraithTimer = 10000;
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
uint uiChaoticEnergyBurstTimer;
|
||||
uint uiSummonCrazedManaWraithTimer;
|
||||
else
|
||||
uiSummonCrazedManaWraithTimer -= diff;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return GetInstanceAI<npc_chaotic_riftAI>(creature);
|
||||
}
|
||||
InstanceScript instance;
|
||||
|
||||
uint uiChaoticEnergyBurstTimer;
|
||||
uint uiSummonCrazedManaWraithTimer;
|
||||
}
|
||||
|
||||
[Script]
|
||||
|
||||
@@ -52,151 +52,141 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_keristrasza : CreatureScript
|
||||
public class boss_keristrasza : BossAI
|
||||
{
|
||||
public boss_keristrasza() : base("boss_keristrasza") { }
|
||||
|
||||
public class boss_keristraszaAI : BossAI
|
||||
public boss_keristrasza(Creature creature) : base(creature, DataTypes.Keristrasza)
|
||||
{
|
||||
public boss_keristraszaAI(Creature creature) : base(creature, DataTypes.Keristrasza)
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_enrage = false;
|
||||
|
||||
//Crystal FireBreath
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(14), task =>
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
DoCastVictim(KeristraszaConst.SpellCrystalFireBreath);
|
||||
task.Repeat(TimeSpan.FromSeconds(14));
|
||||
});
|
||||
|
||||
void Initialize()
|
||||
//CrystalChainsCrystalize
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(DungeonMode<uint>(30, 11)), task =>
|
||||
{
|
||||
_enrage = false;
|
||||
|
||||
//Crystal FireBreath
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(14), task =>
|
||||
{
|
||||
DoCastVictim(KeristraszaConst.SpellCrystalFireBreath);
|
||||
task.Repeat(TimeSpan.FromSeconds(14));
|
||||
});
|
||||
|
||||
//CrystalChainsCrystalize
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(DungeonMode<uint>(30, 11)), task =>
|
||||
{
|
||||
Talk(KeristraszaConst.SayCrystalNova);
|
||||
if (IsHeroic())
|
||||
DoCast(me, KeristraszaConst.SpellCrystalize);
|
||||
else
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f, true);
|
||||
if (target)
|
||||
DoCast(target, KeristraszaConst.SpellCrystalChains);
|
||||
}
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(DungeonMode<uint>(30, 11)));
|
||||
});
|
||||
|
||||
//TailSweep
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
DoCast(me, KeristraszaConst.SpellTailSweep);
|
||||
task.Repeat(TimeSpan.FromSeconds(5));
|
||||
});
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
_intenseColdList.Clear();
|
||||
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.Stunned);
|
||||
|
||||
RemovePrison(CheckContainmentSpheres());
|
||||
_Reset();
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(KeristraszaConst.SayAggro);
|
||||
DoCastAOE(KeristraszaConst.SpellIntenseCold);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(KeristraszaConst.SayDeath);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(KeristraszaConst.SaySlay);
|
||||
}
|
||||
|
||||
public bool CheckContainmentSpheres(bool removePrison = false)
|
||||
{
|
||||
for (uint i = DataTypes.AnomalusContainmetSphere; i < (DataTypes.AnomalusContainmetSphere + KeristraszaConst.DataContainmentSpheres); ++i)
|
||||
{
|
||||
GameObject containmentSpheres = ObjectAccessor.GetGameObject(me, instance.GetGuidData(i));
|
||||
if (!containmentSpheres || containmentSpheres.GetGoState() != GameObjectState.Active)
|
||||
return false;
|
||||
}
|
||||
if (removePrison)
|
||||
RemovePrison(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemovePrison(bool remove)
|
||||
{
|
||||
if (remove)
|
||||
{
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
if (me.HasAura(KeristraszaConst.SpellFrozenPrison))
|
||||
me.RemoveAurasDueToSpell(KeristraszaConst.SpellFrozenPrison);
|
||||
}
|
||||
Talk(KeristraszaConst.SayCrystalNova);
|
||||
if (IsHeroic())
|
||||
DoCast(me, KeristraszaConst.SpellCrystalize);
|
||||
else
|
||||
{
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
DoCast(me, KeristraszaConst.SpellFrozenPrison, false);
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f, true);
|
||||
if (target)
|
||||
DoCast(target, KeristraszaConst.SpellCrystalChains);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetGUID(ObjectGuid guid, int id = 0)
|
||||
task.Repeat(TimeSpan.FromSeconds(DungeonMode<uint>(30, 11)));
|
||||
});
|
||||
|
||||
//TailSweep
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
if (id == KeristraszaConst.DataIntenseCold)
|
||||
_intenseColdList.Add(guid);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!_enrage && me.HealthBelowPctDamaged(25, damage))
|
||||
{
|
||||
Talk(KeristraszaConst.SayEnrage);
|
||||
Talk(KeristraszaConst.SayFrenzy);
|
||||
DoCast(me, KeristraszaConst.SpellEnrage);
|
||||
_enrage = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool _enrage;
|
||||
|
||||
public List<ObjectGuid> _intenseColdList = new List<ObjectGuid>();
|
||||
DoCast(me, KeristraszaConst.SpellTailSweep);
|
||||
task.Repeat(TimeSpan.FromSeconds(5));
|
||||
});
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
public override void Reset()
|
||||
{
|
||||
return GetInstanceAI<boss_keristraszaAI>(creature);
|
||||
Initialize();
|
||||
_intenseColdList.Clear();
|
||||
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.Stunned);
|
||||
|
||||
RemovePrison(CheckContainmentSpheres());
|
||||
_Reset();
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(KeristraszaConst.SayAggro);
|
||||
DoCastAOE(KeristraszaConst.SpellIntenseCold);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(KeristraszaConst.SayDeath);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(KeristraszaConst.SaySlay);
|
||||
}
|
||||
|
||||
public bool CheckContainmentSpheres(bool removePrison = false)
|
||||
{
|
||||
for (uint i = DataTypes.AnomalusContainmetSphere; i < (DataTypes.AnomalusContainmetSphere + KeristraszaConst.DataContainmentSpheres); ++i)
|
||||
{
|
||||
GameObject containmentSpheres = ObjectAccessor.GetGameObject(me, instance.GetGuidData(i));
|
||||
if (!containmentSpheres || containmentSpheres.GetGoState() != GameObjectState.Active)
|
||||
return false;
|
||||
}
|
||||
if (removePrison)
|
||||
RemovePrison(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemovePrison(bool remove)
|
||||
{
|
||||
if (remove)
|
||||
{
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
if (me.HasAura(KeristraszaConst.SpellFrozenPrison))
|
||||
me.RemoveAurasDueToSpell(KeristraszaConst.SpellFrozenPrison);
|
||||
}
|
||||
else
|
||||
{
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
DoCast(me, KeristraszaConst.SpellFrozenPrison, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetGUID(ObjectGuid guid, int id = 0)
|
||||
{
|
||||
if (id == KeristraszaConst.DataIntenseCold)
|
||||
_intenseColdList.Add(guid);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!_enrage && me.HealthBelowPctDamaged(25, damage))
|
||||
{
|
||||
Talk(KeristraszaConst.SayEnrage);
|
||||
Talk(KeristraszaConst.SayFrenzy);
|
||||
DoCast(me, KeristraszaConst.SpellEnrage);
|
||||
_enrage = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool _enrage;
|
||||
|
||||
public List<ObjectGuid> _intenseColdList = new List<ObjectGuid>();
|
||||
}
|
||||
|
||||
[Script]
|
||||
@@ -215,7 +205,7 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
|
||||
go.SetGoState(GameObjectState.Active);
|
||||
|
||||
((boss_keristrasza.boss_keristraszaAI)pKeristrasza.GetAI()).CheckContainmentSpheres(true);
|
||||
((boss_keristrasza)pKeristrasza.GetAI()).CheckContainmentSpheres(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -223,33 +213,23 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_intense_cold : SpellScriptLoader
|
||||
class spell_intense_cold : AuraScript
|
||||
{
|
||||
public spell_intense_cold() : base("spell_intense_cold") { }
|
||||
|
||||
class spell_intense_cold_AuraScript : AuraScript
|
||||
void HandlePeriodicTick(AuraEffect aurEff)
|
||||
{
|
||||
void HandlePeriodicTick(AuraEffect aurEff)
|
||||
{
|
||||
if (aurEff.GetBase().GetStackAmount() < 2)
|
||||
return;
|
||||
Unit caster = GetCaster();
|
||||
/// @todo the caster should be boss but not the player
|
||||
if (!caster || caster.GetAI() == null)
|
||||
return;
|
||||
if (aurEff.GetBase().GetStackAmount() < 2)
|
||||
return;
|
||||
Unit caster = GetCaster();
|
||||
/// @todo the caster should be boss but not the player
|
||||
if (!caster || caster.GetAI() == null)
|
||||
return;
|
||||
|
||||
caster.GetAI().SetGUID(GetTarget().GetGUID(), (int)KeristraszaConst.DataIntenseCold);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodicTick, 1, AuraType.PeriodicDamage));
|
||||
}
|
||||
caster.GetAI().SetGUID(GetTarget().GetGUID(), (int)KeristraszaConst.DataIntenseCold);
|
||||
}
|
||||
|
||||
public override AuraScript GetAuraScript()
|
||||
public override void Register()
|
||||
{
|
||||
return new spell_intense_cold_AuraScript();
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodicTick, 1, AuraType.PeriodicDamage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +243,7 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
var _intenseColdList = ((boss_keristrasza.boss_keristraszaAI)target.ToCreature().GetAI())._intenseColdList;
|
||||
var _intenseColdList = ((boss_keristrasza)target.ToCreature().GetAI())._intenseColdList;
|
||||
if (!_intenseColdList.Empty())
|
||||
{
|
||||
foreach (var guid in _intenseColdList)
|
||||
|
||||
@@ -55,252 +55,242 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_magus_telestra : CreatureScript
|
||||
class boss_magus_telestra : ScriptedAI
|
||||
{
|
||||
public boss_magus_telestra() : base("boss_magus_telestra") { }
|
||||
|
||||
class boss_magus_telestraAI : ScriptedAI
|
||||
public boss_magus_telestra(Creature creature) : base(creature)
|
||||
{
|
||||
public boss_magus_telestraAI(Creature creature) : base(creature)
|
||||
instance = creature.GetInstanceScript();
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
uiIsWaitingToAppearTimer = 0;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Phase = 0;
|
||||
|
||||
uiIceNovaTimer = 7 * Time.InMilliseconds;
|
||||
uiFireBombTimer = 0;
|
||||
uiGravityWellTimer = 15 * Time.InMilliseconds;
|
||||
uiCooldown = 0;
|
||||
|
||||
for (byte n = 0; n < 3; ++n)
|
||||
time[n] = 0;
|
||||
|
||||
splitPersonality = 0;
|
||||
bIsWaitingToAppear = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
|
||||
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.NotStarted);
|
||||
|
||||
if (IsHeroic() && Global.GameEventMgr.IsActiveEvent(MagusTelestraConst.GameEventWinterVeil) && !me.HasAura(MagusTelestraConst.SpellWearChristmasHat))
|
||||
me.AddAura(MagusTelestraConst.SpellWearChristmasHat, me);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(MagusTelestraConst.SayAggro);
|
||||
|
||||
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.InProgress);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(MagusTelestraConst.SayDeath);
|
||||
|
||||
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(MagusTelestraConst.SayKill);
|
||||
}
|
||||
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
if (type == MagusTelestraConst.DataSplitPersonality)
|
||||
return splitPersonality;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (bIsWaitingToAppear)
|
||||
{
|
||||
instance = creature.GetInstanceScript();
|
||||
me.StopMoving();
|
||||
me.AttackStop();
|
||||
if (uiIsWaitingToAppearTimer <= diff)
|
||||
{
|
||||
me.CastSpell(me, 47714, true);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
bIsWaitingToAppear = false;
|
||||
InVanish = false;
|
||||
me.SendAIReaction(AiReaction.Hostile);
|
||||
}
|
||||
else
|
||||
uiIsWaitingToAppearTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 1) || (Phase == 3))
|
||||
{
|
||||
if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead)
|
||||
{
|
||||
for (byte n = 0; n < 3; ++n)
|
||||
time[n] = 0;
|
||||
|
||||
me.GetMotionMaster().Clear();
|
||||
DoCast(me, MagusTelestraConst.SpellTelestraBack);
|
||||
if (Phase == 1)
|
||||
Phase = 2;
|
||||
if (Phase == 3)
|
||||
Phase = 4;
|
||||
bIsWaitingToAppear = true;
|
||||
uiIsWaitingToAppearTimer = 4 * Time.InMilliseconds;
|
||||
Talk(MagusTelestraConst.SayMerge);
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 0) && HealthBelowPct(50))
|
||||
{
|
||||
InVanish = true;
|
||||
Phase = 1;
|
||||
me.CastStop();
|
||||
me.RemoveAllAuras();
|
||||
me.CastSpell(me, 47710, false);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
uiIsWaitingToAppearTimer = 0;
|
||||
Talk(MagusTelestraConst.SaySplit);
|
||||
return;
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
if (IsHeroic() && (Phase == 2) && HealthBelowPct(10))
|
||||
{
|
||||
Phase = 0;
|
||||
InVanish = true;
|
||||
Phase = 3;
|
||||
me.CastStop();
|
||||
me.RemoveAllAuras();
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
Talk(MagusTelestraConst.SaySplit);
|
||||
return;
|
||||
}
|
||||
|
||||
uiIceNovaTimer = 7 * Time.InMilliseconds;
|
||||
uiFireBombTimer = 0;
|
||||
if (uiCooldown != 0)
|
||||
{
|
||||
if (uiCooldown <= diff)
|
||||
uiCooldown = 0;
|
||||
else
|
||||
{
|
||||
uiCooldown -= diff;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (uiIceNovaTimer <= diff)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, MagusTelestraConst.SpellIceNova, false);
|
||||
uiCooldown = 1500;
|
||||
}
|
||||
uiIceNovaTimer = 15 * Time.InMilliseconds;
|
||||
}
|
||||
else uiIceNovaTimer -= diff;
|
||||
|
||||
if (uiGravityWellTimer <= diff)
|
||||
{
|
||||
Unit target = me.GetVictim();
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, MagusTelestraConst.SpellGravityWell);
|
||||
uiCooldown = 6 * Time.InMilliseconds;
|
||||
}
|
||||
uiGravityWellTimer = 15 * Time.InMilliseconds;
|
||||
uiCooldown = 0;
|
||||
|
||||
for (byte n = 0; n < 3; ++n)
|
||||
time[n] = 0;
|
||||
|
||||
splitPersonality = 0;
|
||||
bIsWaitingToAppear = false;
|
||||
}
|
||||
else uiGravityWellTimer -= diff;
|
||||
|
||||
public override void Reset()
|
||||
if (uiFireBombTimer <= diff)
|
||||
{
|
||||
Initialize();
|
||||
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
|
||||
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.NotStarted);
|
||||
|
||||
if (IsHeroic() && Global.GameEventMgr.IsActiveEvent(MagusTelestraConst.GameEventWinterVeil) && !me.HasAura(MagusTelestraConst.SpellWearChristmasHat))
|
||||
me.AddAura(MagusTelestraConst.SpellWearChristmasHat, me);
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, MagusTelestraConst.SpellFirebomb, false);
|
||||
uiCooldown = 2 * Time.InMilliseconds;
|
||||
}
|
||||
uiFireBombTimer = 2 * Time.InMilliseconds;
|
||||
}
|
||||
else uiFireBombTimer -= diff;
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(MagusTelestraConst.SayAggro);
|
||||
|
||||
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.InProgress);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(MagusTelestraConst.SayDeath);
|
||||
|
||||
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(MagusTelestraConst.SayKill);
|
||||
}
|
||||
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
if (type == MagusTelestraConst.DataSplitPersonality)
|
||||
return splitPersonality;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (bIsWaitingToAppear)
|
||||
{
|
||||
me.StopMoving();
|
||||
me.AttackStop();
|
||||
if (uiIsWaitingToAppearTimer <= diff)
|
||||
{
|
||||
me.CastSpell(me, 47714, true);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
bIsWaitingToAppear = false;
|
||||
InVanish = false;
|
||||
me.SendAIReaction(AiReaction.Hostile);
|
||||
}
|
||||
else
|
||||
uiIsWaitingToAppearTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 1) || (Phase == 3))
|
||||
{
|
||||
if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead)
|
||||
{
|
||||
for (byte n = 0; n < 3; ++n)
|
||||
time[n] = 0;
|
||||
|
||||
me.GetMotionMaster().Clear();
|
||||
DoCast(me, MagusTelestraConst.SpellTelestraBack);
|
||||
if (Phase == 1)
|
||||
Phase = 2;
|
||||
if (Phase == 3)
|
||||
Phase = 4;
|
||||
bIsWaitingToAppear = true;
|
||||
uiIsWaitingToAppearTimer = 4 * Time.InMilliseconds;
|
||||
Talk(MagusTelestraConst.SayMerge);
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 0) && HealthBelowPct(50))
|
||||
{
|
||||
InVanish = true;
|
||||
Phase = 1;
|
||||
me.CastStop();
|
||||
me.RemoveAllAuras();
|
||||
me.CastSpell(me, 47710, false);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
Talk(MagusTelestraConst.SaySplit);
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsHeroic() && (Phase == 2) && HealthBelowPct(10))
|
||||
{
|
||||
InVanish = true;
|
||||
Phase = 3;
|
||||
me.CastStop();
|
||||
me.RemoveAllAuras();
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
Talk(MagusTelestraConst.SaySplit);
|
||||
return;
|
||||
}
|
||||
|
||||
if (uiCooldown != 0)
|
||||
{
|
||||
if (uiCooldown <= diff)
|
||||
uiCooldown = 0;
|
||||
else
|
||||
{
|
||||
uiCooldown -= diff;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (uiIceNovaTimer <= diff)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, MagusTelestraConst.SpellIceNova, false);
|
||||
uiCooldown = 1500;
|
||||
}
|
||||
uiIceNovaTimer = 15 * Time.InMilliseconds;
|
||||
}
|
||||
else uiIceNovaTimer -= diff;
|
||||
|
||||
if (uiGravityWellTimer <= diff)
|
||||
{
|
||||
Unit target = me.GetVictim();
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, MagusTelestraConst.SpellGravityWell);
|
||||
uiCooldown = 6 * Time.InMilliseconds;
|
||||
}
|
||||
uiGravityWellTimer = 15 * Time.InMilliseconds;
|
||||
}
|
||||
else uiGravityWellTimer -= diff;
|
||||
|
||||
if (uiFireBombTimer <= diff)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, MagusTelestraConst.SpellFirebomb, false);
|
||||
uiCooldown = 2 * Time.InMilliseconds;
|
||||
}
|
||||
uiFireBombTimer = 2 * Time.InMilliseconds;
|
||||
}
|
||||
else uiFireBombTimer -= diff;
|
||||
|
||||
if (!InVanish)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override void SummonedCreatureDies(Creature summon, Unit killer)
|
||||
{
|
||||
if (summon.IsAlive())
|
||||
return;
|
||||
|
||||
switch (summon.GetEntry())
|
||||
{
|
||||
case MagusTelestraConst.NpcFireMagus:
|
||||
bFireMagusDead = true;
|
||||
break;
|
||||
case MagusTelestraConst.NpcFrostMagus:
|
||||
bFrostMagusDead = true;
|
||||
break;
|
||||
case MagusTelestraConst.NpcArcaneMagus:
|
||||
bArcaneMagusDead = true;
|
||||
break;
|
||||
}
|
||||
|
||||
byte i = 0;
|
||||
while (time[i] != 0)
|
||||
++i;
|
||||
|
||||
time[i] = Global.WorldMgr.GetGameTime();
|
||||
if (i == 2 && (time[2] - time[1] < 5) && (time[1] - time[0] < 5))
|
||||
++splitPersonality;
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
bool bFireMagusDead;
|
||||
bool bFrostMagusDead;
|
||||
bool bArcaneMagusDead;
|
||||
bool bIsWaitingToAppear;
|
||||
bool InVanish;
|
||||
|
||||
uint uiIsWaitingToAppearTimer;
|
||||
uint uiIceNovaTimer;
|
||||
uint uiFireBombTimer;
|
||||
uint uiGravityWellTimer;
|
||||
uint uiCooldown;
|
||||
|
||||
byte Phase;
|
||||
byte splitPersonality;
|
||||
long[] time = new long[3];
|
||||
if (!InVanish)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
public override void SummonedCreatureDies(Creature summon, Unit killer)
|
||||
{
|
||||
return GetInstanceAI<boss_magus_telestraAI>(creature);
|
||||
if (summon.IsAlive())
|
||||
return;
|
||||
|
||||
switch (summon.GetEntry())
|
||||
{
|
||||
case MagusTelestraConst.NpcFireMagus:
|
||||
bFireMagusDead = true;
|
||||
break;
|
||||
case MagusTelestraConst.NpcFrostMagus:
|
||||
bFrostMagusDead = true;
|
||||
break;
|
||||
case MagusTelestraConst.NpcArcaneMagus:
|
||||
bArcaneMagusDead = true;
|
||||
break;
|
||||
}
|
||||
|
||||
byte i = 0;
|
||||
while (time[i] != 0)
|
||||
++i;
|
||||
|
||||
time[i] = Global.WorldMgr.GetGameTime();
|
||||
if (i == 2 && (time[2] - time[1] < 5) && (time[1] - time[0] < 5))
|
||||
++splitPersonality;
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
bool bFireMagusDead;
|
||||
bool bFrostMagusDead;
|
||||
bool bArcaneMagusDead;
|
||||
bool bIsWaitingToAppear;
|
||||
bool InVanish;
|
||||
|
||||
uint uiIsWaitingToAppearTimer;
|
||||
uint uiIceNovaTimer;
|
||||
uint uiFireBombTimer;
|
||||
uint uiGravityWellTimer;
|
||||
uint uiCooldown;
|
||||
|
||||
byte Phase;
|
||||
byte splitPersonality;
|
||||
long[] time = new long[3];
|
||||
}
|
||||
|
||||
[Script]
|
||||
@@ -325,25 +315,15 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_gravity_well_effect : SpellScriptLoader
|
||||
class spell_gravity_well_effect : SpellScript
|
||||
{
|
||||
public spell_gravity_well_effect() : base("spell_gravity_well_effect") { }
|
||||
|
||||
class spell_gravity_well_effect_SpellScript : SpellScript
|
||||
void HandleDummy(uint index)
|
||||
{
|
||||
void HandleDummy(uint index)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public override SpellScript GetSpellScript()
|
||||
public override void Register()
|
||||
{
|
||||
return new spell_gravity_well_effect_SpellScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,75 +39,65 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_nexus_commanders : CreatureScript
|
||||
class boss_nexus_commanders : BossAI
|
||||
{
|
||||
public boss_nexus_commanders() : base("boss_nexus_commanders") { }
|
||||
boss_nexus_commanders(Creature creature) : base(creature, DataTypes.Commander) { }
|
||||
|
||||
class boss_nexus_commandersAI : BossAI
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
boss_nexus_commandersAI(Creature creature) : base(creature, DataTypes.Commander) { }
|
||||
_EnterCombat();
|
||||
Talk(NexusCommandersConst.SayAggro);
|
||||
me.RemoveAurasDueToSpell(NexusCommandersConst.SpellFrozenPrison);
|
||||
DoCast(me, NexusCommandersConst.SpellBattleShout);
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
//Charge
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(NexusCommandersConst.SayAggro);
|
||||
me.RemoveAurasDueToSpell(NexusCommandersConst.SpellFrozenPrison);
|
||||
DoCast(me, NexusCommandersConst.SpellBattleShout);
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f, true);
|
||||
if (target)
|
||||
DoCast(target, NexusCommandersConst.SpellCharge);
|
||||
|
||||
//Charge
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f, true);
|
||||
if (target)
|
||||
DoCast(target, NexusCommandersConst.SpellCharge);
|
||||
task.Repeat(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(15));
|
||||
});
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(15));
|
||||
});
|
||||
|
||||
//Whirlwind
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(8), task =>
|
||||
{
|
||||
DoCast(me, NexusCommandersConst.SpellWhirlwind);
|
||||
task.Repeat(TimeSpan.FromSeconds(19.5), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
|
||||
//Frightening Shout
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(15), task =>
|
||||
{
|
||||
DoCastAOE(NexusCommandersConst.SpellFrighteningShout);
|
||||
task.Repeat(TimeSpan.FromSeconds(45), TimeSpan.FromSeconds(55));
|
||||
});
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
//Whirlwind
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(8), task =>
|
||||
{
|
||||
_JustDied();
|
||||
Talk(NexusCommandersConst.SayDeath);
|
||||
}
|
||||
DoCast(me, NexusCommandersConst.SpellWhirlwind);
|
||||
task.Repeat(TimeSpan.FromSeconds(19.5), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
//Frightening Shout
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(15), task =>
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(NexusCommandersConst.SayKill);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
DoCastAOE(NexusCommandersConst.SpellFrighteningShout);
|
||||
task.Repeat(TimeSpan.FromSeconds(45), TimeSpan.FromSeconds(55));
|
||||
});
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
return GetInstanceAI<boss_nexus_commandersAI>(creature);
|
||||
_JustDied();
|
||||
Talk(NexusCommandersConst.SayDeath);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(NexusCommandersConst.SayKill);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,113 +43,103 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_ormorok : CreatureScript
|
||||
class boss_ormorok : BossAI
|
||||
{
|
||||
public boss_ormorok() : base("boss_ormorok") { }
|
||||
|
||||
class boss_ormorokAI : BossAI
|
||||
public boss_ormorok(Creature creature) : base(creature, DataTypes.Ormorok)
|
||||
{
|
||||
public boss_ormorokAI(Creature creature) : base(creature, DataTypes.Ormorok)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
frenzy = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
_EnterCombat();
|
||||
|
||||
//Crystal Spikes
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
Talk(OrmorokConst.SayCrystalSpikes);
|
||||
DoCast(OrmorokConst.SpellCrystalSpikes);
|
||||
task.Repeat(TimeSpan.FromSeconds(12));
|
||||
});
|
||||
|
||||
//Trample
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
|
||||
{
|
||||
DoCast(me, OrmorokConst.SpellTrample);
|
||||
task.Repeat(TimeSpan.FromSeconds(10));
|
||||
});
|
||||
|
||||
//Spell Reflection
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(30), task =>
|
||||
{
|
||||
Talk(OrmorokConst.SayReflect);
|
||||
DoCast(me, OrmorokConst.SpellReflection);
|
||||
task.Repeat(TimeSpan.FromSeconds(30));
|
||||
});
|
||||
|
||||
//Heroic Crystalline Tangler
|
||||
if (IsHeroic())
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(17), task =>
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, new OrmorokTanglerPredicate(me));
|
||||
if (target)
|
||||
DoCast(target, OrmorokConst.SpellSummonCrystallineTangler);
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(17));
|
||||
});
|
||||
}
|
||||
|
||||
Talk(OrmorokConst.SayAggro);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!frenzy && HealthBelowPct(25))
|
||||
{
|
||||
Talk(OrmorokConst.SayFrenzy);
|
||||
DoCast(me, OrmorokConst.SpellFrenzy);
|
||||
frenzy = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(OrmorokConst.SayDeath);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(OrmorokConst.SayKill);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool frenzy;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
void Initialize()
|
||||
{
|
||||
return GetInstanceAI<boss_ormorokAI>(creature);
|
||||
frenzy = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
_EnterCombat();
|
||||
|
||||
//Crystal Spikes
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
Talk(OrmorokConst.SayCrystalSpikes);
|
||||
DoCast(OrmorokConst.SpellCrystalSpikes);
|
||||
task.Repeat(TimeSpan.FromSeconds(12));
|
||||
});
|
||||
|
||||
//Trample
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
|
||||
{
|
||||
DoCast(me, OrmorokConst.SpellTrample);
|
||||
task.Repeat(TimeSpan.FromSeconds(10));
|
||||
});
|
||||
|
||||
//Spell Reflection
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(30), task =>
|
||||
{
|
||||
Talk(OrmorokConst.SayReflect);
|
||||
DoCast(me, OrmorokConst.SpellReflection);
|
||||
task.Repeat(TimeSpan.FromSeconds(30));
|
||||
});
|
||||
|
||||
//Heroic Crystalline Tangler
|
||||
if (IsHeroic())
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(17), task =>
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, new OrmorokTanglerPredicate(me));
|
||||
if (target)
|
||||
DoCast(target, OrmorokConst.SpellSummonCrystallineTangler);
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(17));
|
||||
});
|
||||
}
|
||||
|
||||
Talk(OrmorokConst.SayAggro);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!frenzy && HealthBelowPct(25))
|
||||
{
|
||||
Talk(OrmorokConst.SayFrenzy);
|
||||
DoCast(me, OrmorokConst.SpellFrenzy);
|
||||
frenzy = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(OrmorokConst.SayDeath);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
Talk(OrmorokConst.SayKill);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool frenzy;
|
||||
}
|
||||
|
||||
class OrmorokTanglerPredicate : ISelector
|
||||
@@ -189,103 +179,83 @@ namespace Scripts.Northrend.Nexus.Nexus
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_crystal_spike_trigger : CreatureScript
|
||||
class npc_crystal_spike_trigger : ScriptedAI
|
||||
{
|
||||
public npc_crystal_spike_trigger() : base("npc_crystal_spike_trigger") { }
|
||||
public npc_crystal_spike_trigger(Creature creature) : base(creature) { }
|
||||
|
||||
class npc_crystal_spike_triggerAI : ScriptedAI
|
||||
public override void IsSummonedBy(Unit owner)
|
||||
{
|
||||
public npc_crystal_spike_triggerAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void IsSummonedBy(Unit owner)
|
||||
switch (me.GetEntry())
|
||||
{
|
||||
switch (me.GetEntry())
|
||||
{
|
||||
case CrystalSpikesConst.NpcCrystalSpikeInitial:
|
||||
_count = 0;
|
||||
me.SetFacingToObject(owner);
|
||||
break;
|
||||
case CrystalSpikesConst.NpcCrystalSpikeTrigger:
|
||||
Creature trigger = owner.ToCreature();
|
||||
if (trigger)
|
||||
_count = trigger.GetAI().GetData(CrystalSpikesConst.DataCount) + 1;
|
||||
break;
|
||||
default:
|
||||
_count = CrystalSpikesConst.MaxCount;
|
||||
break;
|
||||
}
|
||||
case CrystalSpikesConst.NpcCrystalSpikeInitial:
|
||||
_count = 0;
|
||||
me.SetFacingToObject(owner);
|
||||
break;
|
||||
case CrystalSpikesConst.NpcCrystalSpikeTrigger:
|
||||
Creature trigger = owner.ToCreature();
|
||||
if (trigger)
|
||||
_count = trigger.GetAI().GetData(CrystalSpikesConst.DataCount) + 1;
|
||||
break;
|
||||
default:
|
||||
_count = CrystalSpikesConst.MaxCount;
|
||||
break;
|
||||
}
|
||||
|
||||
if (me.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeTrigger)
|
||||
{
|
||||
GameObject trap = me.FindNearestGameObject(CrystalSpikesConst.GoCrystalSpikeTrap, 1.0f);
|
||||
if (trap)
|
||||
trap.Use(me);
|
||||
}
|
||||
|
||||
//Despawn
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
if (me.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeTrigger)
|
||||
{
|
||||
GameObject trap = me.FindNearestGameObject(CrystalSpikesConst.GoCrystalSpikeTrap, 1.0f);
|
||||
if (trap)
|
||||
trap.Use(me);
|
||||
trap.Delete();
|
||||
}
|
||||
|
||||
//Despawn
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
if (me.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeTrigger)
|
||||
{
|
||||
GameObject trap = me.FindNearestGameObject(CrystalSpikesConst.GoCrystalSpikeTrap, 1.0f);
|
||||
if (trap)
|
||||
trap.Delete();
|
||||
}
|
||||
|
||||
me.DespawnOrUnsummon();
|
||||
});
|
||||
}
|
||||
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
return type == CrystalSpikesConst.DataCount ? _count : 0;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
uint _count;
|
||||
me.DespawnOrUnsummon();
|
||||
});
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
return new npc_crystal_spike_triggerAI(creature);
|
||||
return type == CrystalSpikesConst.DataCount ? _count : 0;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
uint _count;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_crystal_spike : SpellScriptLoader
|
||||
class spell_crystal_spike : AuraScript
|
||||
{
|
||||
public spell_crystal_spike() : base("spell_crystal_spike") { }
|
||||
|
||||
class spell_crystal_spike_AuraScript : AuraScript
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
{
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
Unit target = GetTarget();
|
||||
if (target.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeInitial || target.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeTrigger)
|
||||
{
|
||||
Unit target = GetTarget();
|
||||
if (target.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeInitial || target.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeTrigger)
|
||||
Creature trigger = target.ToCreature();
|
||||
if (trigger)
|
||||
{
|
||||
Creature trigger = target.ToCreature();
|
||||
if (trigger)
|
||||
{
|
||||
uint spell = target.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeInitial ? CrystalSpikesConst.CrystalSpikeSummon[0] : CrystalSpikesConst.CrystalSpikeSummon[RandomHelper.IRand(0, 2)];
|
||||
if (trigger.GetAI().GetData(CrystalSpikesConst.DataCount) < CrystalSpikesConst.MaxCount)
|
||||
trigger.CastSpell(trigger, spell, true);
|
||||
}
|
||||
uint spell = target.GetEntry() == CrystalSpikesConst.NpcCrystalSpikeInitial ? CrystalSpikesConst.CrystalSpikeSummon[0] : CrystalSpikesConst.CrystalSpikeSummon[RandomHelper.IRand(0, 2)];
|
||||
if (trigger.GetAI().GetData(CrystalSpikesConst.DataCount) < CrystalSpikesConst.MaxCount)
|
||||
trigger.CastSpell(trigger, spell, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
|
||||
public override AuraScript GetAuraScript()
|
||||
public override void Register()
|
||||
{
|
||||
return new spell_crystal_spike_AuraScript();
|
||||
OnEffectPeriodic.Add(new EffectPeriodicHandler(HandlePeriodic, 0, AuraType.PeriodicDummy));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,10 +359,5 @@ namespace Scripts.Northrend.Nexus.Oculus
|
||||
EventMap events = new EventMap();
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_oculus_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user