Fix build. (scripts are fixed but most need updated tho)
This commit is contained in:
@@ -35,271 +35,339 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayMidnightKill = 0;
|
||||
public const uint SayAppear = 1;
|
||||
public const uint SayMount = 2;
|
||||
|
||||
public const uint SayKill = 0;
|
||||
public const uint SayDisarmed = 1;
|
||||
public const uint SayDeath = 2;
|
||||
public const uint SayRandom = 3;
|
||||
public const uint SayRandom = 1;
|
||||
public const uint SayDisarmed = 2;
|
||||
public const uint SayMidnightKill = 3;
|
||||
public const uint SayAppear = 4;
|
||||
public const uint SayMount = 5;
|
||||
|
||||
public const uint SayDeath = 3;
|
||||
|
||||
// Midnight
|
||||
public const uint EmoteCallAttumen = 0;
|
||||
public const uint EmoteMountUp = 1;
|
||||
}
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Shadowcleave = 29832;
|
||||
public const uint IntangiblePresence = 29833;
|
||||
public const uint BerserkerCharge = 26561; //Only When Mounted
|
||||
public const uint SpawnSmoke = 10389;
|
||||
public const uint Charge = 29847;
|
||||
|
||||
// Midnight
|
||||
public const uint Knockdown = 29711;
|
||||
public const uint SummonAttumen = 29714;
|
||||
public const uint Mount = 29770;
|
||||
public const uint SummonAttumenMounted = 29799;
|
||||
}
|
||||
|
||||
enum Phases
|
||||
{
|
||||
None,
|
||||
AttumenEngages,
|
||||
Mounted
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class boss_attumen : ScriptedAI
|
||||
public class boss_attumen : BossAI
|
||||
{
|
||||
public boss_attumen(Creature creature) : base(creature)
|
||||
public boss_attumen(Creature creature) : base(creature, DataTypes.Attumen)
|
||||
{
|
||||
CleaveTimer = RandomHelper.URand(10000, 15000);
|
||||
CurseTimer = 30000;
|
||||
RandomYellTimer = RandomHelper.URand(30000, 60000); //Occasionally yell
|
||||
ChargeTimer = 20000;
|
||||
ResetTimer = 0;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_midnightGUID.Clear();
|
||||
_phase = Phases.None;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
ResetTimer = 0;
|
||||
Midnight.Clear();
|
||||
Initialize();
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
base.EnterEvadeMode(why);
|
||||
ResetTimer = 2000;
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
_DespawnAtEvade(10, midnight);
|
||||
|
||||
me.DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who) { }
|
||||
public override void ScheduleTasks()
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Shadowcleave);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(45), task =>
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.IntangiblePresence);
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(45));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60), task =>
|
||||
{
|
||||
Talk(TextIds.SayRandom);
|
||||
task.Repeat(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60));
|
||||
});
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
// Attumen does not die until he mounts Midnight, let health fall to 1 and prevent further damage.
|
||||
if (damage >= me.GetHealth() && _phase != Phases.Mounted)
|
||||
damage = (uint)(me.GetHealth() - 1);
|
||||
|
||||
if (_phase == Phases.AttumenEngages && me.HealthBelowPctDamaged(25, damage))
|
||||
{
|
||||
_phase = Phases.None;
|
||||
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
midnight.GetAI().DoCastAOE(SpellIds.Mount, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(TextIds.SayKill);
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
if (summon.GetEntry() == CreatureIds.AttumenMounted)
|
||||
{
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
{
|
||||
if (midnight.GetHealth() > me.GetHealth())
|
||||
summon.SetHealth(midnight.GetHealth());
|
||||
else
|
||||
summon.SetHealth(me.GetHealth());
|
||||
|
||||
summon.GetAI().DoZoneInCombat();
|
||||
summon.GetAI().SetGUID(_midnightGUID, (int)CreatureIds.Midnight);
|
||||
}
|
||||
}
|
||||
|
||||
base.JustSummoned(summon);
|
||||
}
|
||||
|
||||
public override void IsSummonedBy(Unit summoner)
|
||||
{
|
||||
if (summoner.GetEntry() == CreatureIds.Midnight)
|
||||
_phase = Phases.AttumenEngages;
|
||||
|
||||
if (summoner.GetEntry() == CreatureIds.AttumenUnmounted)
|
||||
{
|
||||
_phase = Phases.Mounted;
|
||||
DoCastSelf(SpellIds.SpawnSmoke);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25), task =>
|
||||
{
|
||||
Unit target = null;
|
||||
var t_list = me.GetThreatManager().getThreatList();
|
||||
List<Unit> target_list = new List<Unit>();
|
||||
|
||||
foreach (var itr in t_list)
|
||||
{
|
||||
target = Global.ObjAccessor.GetUnit(me, itr.getUnitGuid());
|
||||
if (target && !target.IsWithinDist(me, 8.00f, false) && target.IsWithinDist(me, 25.0f, false))
|
||||
target_list.Add(target);
|
||||
|
||||
target = null;
|
||||
}
|
||||
|
||||
if (!target_list.Empty())
|
||||
target = target_list.SelectRandom();
|
||||
|
||||
DoCast(target, SpellIds.Charge);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(35), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Knockdown);
|
||||
task.Repeat(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(35));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(TextIds.SayDeath);
|
||||
Unit midnight = Global.ObjAccessor.GetUnit(me, Midnight);
|
||||
Unit midnight = Global.ObjAccessor.GetUnit(me, _midnightGUID);
|
||||
if (midnight)
|
||||
midnight.KillSelf();
|
||||
|
||||
base.JustDied(killer);
|
||||
}
|
||||
|
||||
public override void SetGUID(ObjectGuid guid, int id = 0)
|
||||
{
|
||||
if (id == CreatureIds.Midnight)
|
||||
_midnightGUID = guid;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (ResetTimer != 0)
|
||||
{
|
||||
if (ResetTimer <= diff)
|
||||
{
|
||||
ResetTimer = 0;
|
||||
Unit pMidnight = Global.ObjAccessor.GetUnit(me, Midnight);
|
||||
if (pMidnight)
|
||||
{
|
||||
pMidnight.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
pMidnight.SetVisible(true);
|
||||
}
|
||||
Midnight.Clear();
|
||||
me.SetVisible(false);
|
||||
me.KillSelf();
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() && _phase != Phases.None)
|
||||
return;
|
||||
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable))
|
||||
return;
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Shadowcleave);
|
||||
CleaveTimer = RandomHelper.URand(10000, 15000);
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
|
||||
if (CurseTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.IntangiblePresence);
|
||||
CurseTimer = 30000;
|
||||
}
|
||||
else CurseTimer -= diff;
|
||||
|
||||
if (RandomYellTimer <= diff)
|
||||
{
|
||||
Talk(TextIds.SayRandom);
|
||||
RandomYellTimer = RandomHelper.URand(30000, 60000);
|
||||
}
|
||||
else RandomYellTimer -= diff;
|
||||
|
||||
if (me.GetUInt32Value(UnitFields.DisplayId) == Misc.MountedDisplayid)
|
||||
{
|
||||
if (ChargeTimer <= diff)
|
||||
{
|
||||
var t_list = me.GetThreatManager().getThreatList();
|
||||
List<Unit> target_list = new List<Unit>();
|
||||
foreach (var hostileRefe in t_list)
|
||||
{
|
||||
var unit = Global.ObjAccessor.GetUnit(me, hostileRefe.getUnitGuid());
|
||||
if (unit && !unit.IsWithinDist(me, SharedConst.AttackDistance, false))
|
||||
target_list.Add(unit);
|
||||
unit = null;
|
||||
}
|
||||
Unit target = null;
|
||||
if (!target_list.Empty())
|
||||
target = target_list.SelectRandom();
|
||||
|
||||
DoCast(target, SpellIds.BerserkerCharge);
|
||||
ChargeTimer = 20000;
|
||||
}
|
||||
else ChargeTimer -= diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (HealthBelowPct(25))
|
||||
{
|
||||
Creature pMidnight = ObjectAccessor.GetCreature(me, Midnight);
|
||||
if (pMidnight && pMidnight.IsTypeId(TypeId.Unit))
|
||||
{
|
||||
((boss_midnight)pMidnight.GetAI()).Mount(me);
|
||||
me.SetHealth(pMidnight.GetHealth());
|
||||
DoResetThreat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
}
|
||||
|
||||
public override void SpellHit(Unit source, SpellInfo spell)
|
||||
{
|
||||
if (spell.Mechanic == Mechanics.Disarm)
|
||||
Talk(TextIds.SayDisarmed);
|
||||
|
||||
if (spell.Id == SpellIds.Mount)
|
||||
{
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
{
|
||||
_phase = Phases.None;
|
||||
_scheduler.CancelAll();
|
||||
|
||||
midnight.AttackStop();
|
||||
midnight.RemoveAllAttackers();
|
||||
midnight.SetReactState(ReactStates.Passive);
|
||||
midnight.GetMotionMaster().MoveChase(me);
|
||||
midnight.GetAI().Talk(TextIds.EmoteMountUp);
|
||||
|
||||
me.AttackStop();
|
||||
me.RemoveAllAttackers();
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
me.GetMotionMaster().MoveChase(midnight);
|
||||
Talk(TextIds.SayMount);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
|
||||
{
|
||||
Creature midnight1 = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight1 != null)
|
||||
{
|
||||
if (me.IsWithinMeleeRange(midnight1))
|
||||
{
|
||||
DoCastAOE(SpellIds.SummonAttumenMounted);
|
||||
me.SetVisible(false);
|
||||
midnight1.SetVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
midnight1.GetMotionMaster().MoveChase(me);
|
||||
me.GetMotionMaster().MoveChase(midnight1);
|
||||
task.Repeat(TimeSpan.FromSeconds(3));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectGuid Midnight;
|
||||
uint CleaveTimer;
|
||||
uint CurseTimer;
|
||||
uint RandomYellTimer;
|
||||
uint ChargeTimer; //only when mounted
|
||||
uint ResetTimer;
|
||||
ObjectGuid _midnightGUID;
|
||||
Phases _phase;
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class boss_midnight : ScriptedAI
|
||||
public class boss_midnight : BossAI
|
||||
{
|
||||
public boss_midnight(Creature creature) : base(creature) { }
|
||||
public boss_midnight(Creature creature) : base(creature, DataTypes.Attumen)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_phase = Phases.None;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Phase = 1;
|
||||
Attumen.Clear();
|
||||
mountTimer = 0;
|
||||
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
Initialize();
|
||||
base.Reset();
|
||||
me.SetVisible(true);
|
||||
me.SetReactState(ReactStates.Defensive);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who) { }
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
// Midnight never dies, let health fall to 1 and prevent further damage.
|
||||
if (damage >= me.GetHealth())
|
||||
damage = (uint)(me.GetHealth() - 1);
|
||||
|
||||
if (_phase == Phases.None && me.HealthBelowPctDamaged(95, damage))
|
||||
{
|
||||
_phase = Phases.AttumenEngages;
|
||||
Talk(TextIds.EmoteCallAttumen);
|
||||
DoCastAOE(SpellIds.SummonAttumen);
|
||||
}
|
||||
else if (_phase == Phases.AttumenEngages && me.HealthBelowPctDamaged(25, damage))
|
||||
{
|
||||
_phase = Phases.Mounted;
|
||||
DoCastAOE(SpellIds.Mount, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
if (summon.GetEntry() == CreatureIds.AttumenUnmounted)
|
||||
{
|
||||
_attumenGUID = summon.GetGUID();
|
||||
summon.GetAI().SetGUID(me.GetGUID(), (int)CreatureIds.Midnight);
|
||||
summon.GetAI().AttackStart(me.GetVictim());
|
||||
summon.GetAI().Talk(TextIds.SayAppear);
|
||||
}
|
||||
|
||||
base.JustSummoned(summon);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
base.EnterCombat(who);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Knockdown);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
}
|
||||
|
||||
public override void EnterEvadeMode(EvadeReason why = EvadeReason.Other)
|
||||
{
|
||||
base._DespawnAtEvade(10);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
if (Phase == 2)
|
||||
if (_phase == Phases.AttumenEngages)
|
||||
{
|
||||
Unit unit = Global.ObjAccessor.GetUnit(me, Attumen);
|
||||
if (unit)
|
||||
Unit unit = Global.ObjAccessor.GetUnit(me, _attumenGUID);
|
||||
if (unit != null)
|
||||
Talk(TextIds.SayMidnightKill, unit);
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
if (!UpdateVictim() || _phase == Phases.Mounted)
|
||||
return;
|
||||
|
||||
if (Phase == 1 && HealthBelowPct(95))
|
||||
{
|
||||
Phase = 2;
|
||||
Creature attumen = me.SummonCreature(Misc.SummonAttumen, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedOrDeadDespawn, 30000);
|
||||
if (attumen)
|
||||
{
|
||||
Attumen = attumen.GetGUID();
|
||||
attumen.GetAI().AttackStart(me.GetVictim());
|
||||
SetMidnight(attumen, me.GetGUID());
|
||||
Talk(TextIds.SayAppear, attumen);
|
||||
}
|
||||
}
|
||||
else if (Phase == 2 && HealthBelowPct(25))
|
||||
{
|
||||
Unit pAttumen = Global.ObjAccessor.GetUnit(me, Attumen);
|
||||
if (pAttumen)
|
||||
Mount(pAttumen);
|
||||
}
|
||||
else if (Phase == 3)
|
||||
{
|
||||
if (mountTimer != 0)
|
||||
{
|
||||
if (mountTimer <= diff)
|
||||
{
|
||||
mountTimer = 0;
|
||||
me.SetVisible(false);
|
||||
me.GetMotionMaster().MoveIdle();
|
||||
Unit pAttumen = Global.ObjAccessor.GetUnit(me, Attumen);
|
||||
if (pAttumen)
|
||||
{
|
||||
pAttumen.SetDisplayId(Misc.MountedDisplayid);
|
||||
pAttumen.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
if (pAttumen.GetVictim())
|
||||
{
|
||||
pAttumen.GetMotionMaster().MoveChase(pAttumen.GetVictim());
|
||||
pAttumen.SetTarget(pAttumen.GetVictim().GetGUID());
|
||||
}
|
||||
pAttumen.SetObjectScale(1);
|
||||
}
|
||||
}
|
||||
else mountTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (Phase != 3)
|
||||
DoMeleeAttackIfReady();
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
}
|
||||
|
||||
public void Mount(Unit pAttumen)
|
||||
{
|
||||
Talk(TextIds.SayMount, pAttumen);
|
||||
Phase = 3;
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
pAttumen.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
float angle = me.GetAngle(pAttumen);
|
||||
float distance = me.GetDistance2d(pAttumen);
|
||||
float newX = me.GetPositionX() + (float)Math.Cos(angle) * (distance / 2);
|
||||
float newY = me.GetPositionY() + (float)Math.Sin(angle) * (distance / 2);
|
||||
float newZ = 50;
|
||||
me.GetMotionMaster().Clear();
|
||||
me.GetMotionMaster().MovePoint(0, newX, newY, newZ);
|
||||
distance += 10;
|
||||
newX = me.GetPositionX() + (float)Math.Cos(angle) * (distance / 2);
|
||||
newY = me.GetPositionY() + (float)Math.Sin(angle) * (distance / 2);
|
||||
pAttumen.GetMotionMaster().Clear();
|
||||
pAttumen.GetMotionMaster().MovePoint(0, newX, newY, newZ);
|
||||
mountTimer = 1000;
|
||||
}
|
||||
|
||||
void SetMidnight(Creature pAttumen, ObjectGuid value)
|
||||
{
|
||||
((boss_attumen)pAttumen.GetAI()).Midnight = value;
|
||||
}
|
||||
|
||||
ObjectGuid Attumen;
|
||||
byte Phase;
|
||||
uint mountTimer;
|
||||
ObjectGuid _attumenGUID;
|
||||
Phases _phase;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,124 +35,135 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
//Flare spell info
|
||||
public const uint AstralFlarePassive = 30234; //Visual effect + Flare damage
|
||||
|
||||
//Curator spell info
|
||||
public const uint HatefulBolt = 30383;
|
||||
public const uint Evocation = 30254;
|
||||
public const uint Enrage = 30403; //Arcane Infusion: Transforms Curator and adds damage.
|
||||
public const uint ArcaneInfusion = 30403;
|
||||
public const uint Berserk = 26662;
|
||||
public const uint SummonAstralFlareNE = 30236;
|
||||
public const uint SummonAstralFlareNW = 30239;
|
||||
public const uint SummonAstralFlareSE = 30240;
|
||||
public const uint SummonAstralFlareSW = 30241;
|
||||
}
|
||||
|
||||
struct EventIds
|
||||
{
|
||||
public const uint HatefulBolt = 1;
|
||||
public const uint SummonAstralFlare = 2;
|
||||
public const uint ArcaneInfusion = 3;
|
||||
public const uint Berserk = 4;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_curator : ScriptedAI
|
||||
class boss_curator : BossAI
|
||||
{
|
||||
public boss_curator(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
|
||||
{
|
||||
//Summon Astral Flare
|
||||
Creature AstralFlare = DoSpawnCreature(17096, RandomHelper.Rand32() % 37, RandomHelper.Rand32() % 37, 0, 0, TempSummonType.TimedDespawnOOC, 5000);
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
|
||||
if (AstralFlare && target)
|
||||
{
|
||||
AstralFlare.CastSpell(AstralFlare, SpellIds.AstralFlarePassive, false);
|
||||
AstralFlare.GetAI().AttackStart(target);
|
||||
}
|
||||
|
||||
//Reduce Mana by 10% of max health
|
||||
int mana = me.GetMaxPower(PowerType.Mana);
|
||||
if (mana != 0)
|
||||
{
|
||||
mana /= 10;
|
||||
me.ModifyPower(PowerType.Mana, -mana);
|
||||
|
||||
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
|
||||
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
|
||||
{
|
||||
Talk(TextIds.SayEvocate);
|
||||
me.InterruptNonMeleeSpells(false);
|
||||
DoCast(me, SpellIds.Evocation);
|
||||
_scheduler.DelayAll(TimeSpan.FromSeconds(20));
|
||||
//Evocating = true;
|
||||
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RandomHelper.URand(0, 1) == 0)
|
||||
{
|
||||
Talk(TextIds.SaySummon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task.Repeat();
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(15), task =>
|
||||
{
|
||||
if (Enraged)
|
||||
task.Repeat(TimeSpan.FromSeconds(7));
|
||||
else
|
||||
task.Repeat();
|
||||
|
||||
Unit target = SelectTarget(SelectAggroTarget.TopAggro, 1);
|
||||
if (target)
|
||||
DoCast(target, SpellIds.HatefulBolt);
|
||||
});
|
||||
|
||||
Enraged = false;
|
||||
}
|
||||
public boss_curator(Creature creature) : base(creature, DataTypes.Curator) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
|
||||
_Reset();
|
||||
_infused = false;
|
||||
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Arcane, true);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(TextIds.SayKill);
|
||||
if (victim.GetTypeId() == TypeId.Player)
|
||||
Talk(TextIds.SayKill);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(TextIds.SayDeath);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit victim)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(TextIds.SayAggro);
|
||||
|
||||
_events.ScheduleEvent(EventIds.HatefulBolt, TimeSpan.FromSeconds(12));
|
||||
_events.ScheduleEvent(EventIds.SummonAstralFlare, TimeSpan.FromSeconds(10));
|
||||
_events.ScheduleEvent(EventIds.Berserk, TimeSpan.FromMinutes(12));
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!HealthAbovePct(15) && !_infused)
|
||||
{
|
||||
_infused = true;
|
||||
_events.ScheduleEvent(EventIds.ArcaneInfusion, TimeSpan.FromMilliseconds(1));
|
||||
_events.CancelEvent(EventIds.SummonAstralFlare);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExecuteEvent(uint eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EventIds.HatefulBolt:
|
||||
Unit target = SelectTarget(SelectAggroTarget.TopAggro, 1);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.HatefulBolt);
|
||||
_events.Repeat(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(15));
|
||||
break;
|
||||
case EventIds.ArcaneInfusion:
|
||||
DoCastSelf(SpellIds.ArcaneInfusion, true);
|
||||
break;
|
||||
case EventIds.SummonAstralFlare:
|
||||
if (RandomHelper.randChance(50))
|
||||
Talk(TextIds.SaySummon);
|
||||
|
||||
|
||||
DoCastSelf(RandomHelper.RAND(SpellIds.SummonAstralFlareNE, SpellIds.SummonAstralFlareNW, SpellIds.SummonAstralFlareSE, SpellIds.SummonAstralFlareSW), true);
|
||||
|
||||
int mana = me.GetMaxPower(PowerType.Mana) / 10;
|
||||
if (mana != 0)
|
||||
{
|
||||
me.ModifyPower(PowerType.Mana, -mana);
|
||||
|
||||
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
|
||||
{
|
||||
Talk(TextIds.SayEvocate);
|
||||
me.InterruptNonMeleeSpells(false);
|
||||
DoCastSelf(SpellIds.Evocation);
|
||||
}
|
||||
}
|
||||
_events.Repeat(TimeSpan.FromSeconds(10));
|
||||
break;
|
||||
case EventIds.Berserk:
|
||||
Talk(TextIds.SayEnrage);
|
||||
DoCastSelf(SpellIds.Berserk, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool _infused;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_curator_astral_flareAI : ScriptedAI
|
||||
{
|
||||
public npc_curator_astral_flareAI(Creature creature) : base(creature)
|
||||
{
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
me.SetReactState(ReactStates.Aggressive);
|
||||
me.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
DoZoneInCombat();
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (!Enraged)
|
||||
{
|
||||
if (!HealthAbovePct(15))
|
||||
{
|
||||
Enraged = true;
|
||||
DoCast(me, SpellIds.Enrage);
|
||||
Talk(TextIds.SayEnrage);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool Enraged;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,19 +28,6 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
{
|
||||
public const uint MaxEncounter = 12;
|
||||
|
||||
public const uint BossAttumen = 1;
|
||||
public const uint BossMoroes = 2;
|
||||
public const uint BossMaiden = 3;
|
||||
public const uint OptionalBoss = 4;
|
||||
public const uint BossOpera = 5;
|
||||
public const uint Curator = 6;
|
||||
public const uint Aran = 7;
|
||||
public const uint Terestian = 8;
|
||||
public const uint Netherspite = 9;
|
||||
public const uint Chess = 10;
|
||||
public const uint Malchezzar = 11;
|
||||
public const uint Nightbane = 12;
|
||||
|
||||
public static Dialogue[] OzDialogue =
|
||||
{
|
||||
new Dialogue(0, 6000),
|
||||
@@ -108,6 +95,15 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
|
||||
public const uint NpcArcanagos = 17652;
|
||||
public const uint NpcSpotlight = 19525;
|
||||
|
||||
public static Position[] OptionalSpawn =
|
||||
{
|
||||
new Position(-10960.981445f, -1940.138428f, 46.178097f, 4.12f), // Hyakiss the Lurker
|
||||
new Position(-10945.769531f, -2040.153320f, 49.474438f, 0.077f), // Shadikith the Glider
|
||||
new Position(-10899.903320f, -2085.573730f, 49.474449f, 1.38f) // Rokad the Ravager
|
||||
};
|
||||
|
||||
public const uint OptionalBossRequiredDeathCount = 50;
|
||||
}
|
||||
|
||||
struct Dialogue
|
||||
@@ -124,12 +120,22 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
|
||||
struct DataTypes
|
||||
{
|
||||
public const uint OperaPerformance = 13;
|
||||
public const uint Attumen = 1;
|
||||
public const uint Moroes = 2;
|
||||
public const uint MaidenOfVirtue = 3;
|
||||
public const uint OptionalBoss = 4;
|
||||
public const uint OperaPerformance = 5;
|
||||
public const uint Curator = 6;
|
||||
public const uint Aran = 7;
|
||||
public const uint Terestian = 8;
|
||||
public const uint Netherspite = 9;
|
||||
public const uint Chess = 10;
|
||||
public const uint Malchezzar = 11;
|
||||
public const uint Nightbane = 12;
|
||||
|
||||
public const uint OperaOzDeathcount = 14;
|
||||
|
||||
public const uint Kilrek = 15;
|
||||
public const uint Terestian = 16;
|
||||
public const uint Moroes = 17;
|
||||
public const uint GoCurtains = 18;
|
||||
public const uint GoStagedoorleft = 19;
|
||||
public const uint GoStagedoorright = 20;
|
||||
@@ -143,6 +149,7 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
public const uint MastersTerraceDoor1 = 27;
|
||||
public const uint MastersTerraceDoor2 = 28;
|
||||
public const uint GoSideEntranceDoor = 29;
|
||||
public const uint GoBlackenedUrn = 30;
|
||||
}
|
||||
|
||||
struct OperaEvents
|
||||
@@ -152,6 +159,47 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
public const uint RAJ = 3;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint HyakissTheLurker = 16179;
|
||||
public const uint RokadTheRavager = 16181;
|
||||
public const uint ShadikithTheGlider = 16180;
|
||||
public const uint TerestianIllhoof = 15688;
|
||||
public const uint Moroes = 15687;
|
||||
public const uint Nightbane = 17225;
|
||||
public const uint AttumenUnmounted = 15550;
|
||||
public const uint AttumenMounted = 16152;
|
||||
public const uint Midnight = 16151;
|
||||
|
||||
// Trash
|
||||
public const uint ColdmistWidow = 16171;
|
||||
public const uint ColdmistStalker = 16170;
|
||||
public const uint Shadowbat = 16173;
|
||||
public const uint VampiricShadowbat = 16175;
|
||||
public const uint GreaterShadowbat = 16174;
|
||||
public const uint PhaseHound = 16178;
|
||||
public const uint Dreadbeast = 16177;
|
||||
public const uint Shadowbeast = 16176;
|
||||
public const uint Kilrek = 17229;
|
||||
}
|
||||
|
||||
struct GameObjectIds
|
||||
{
|
||||
public const uint StageCurtain = 183932;
|
||||
public const uint StageDoorLeft = 184278;
|
||||
public const uint StageDoorRight = 184279;
|
||||
public const uint PrivateLibraryDoor = 184517;
|
||||
public const uint MassiveDoor = 185521;
|
||||
public const uint GamesmanHallDoor = 184276;
|
||||
public const uint GamesmanHallExitDoor = 184277;
|
||||
public const uint NetherspaceDoor = 185134;
|
||||
public const uint MastersTerraceDoor = 184274;
|
||||
public const uint MastersTerraceDoor2 = 184280;
|
||||
public const uint SideEntranceDoor = 184275;
|
||||
public const uint DustCoveredChest = 185119;
|
||||
public const uint BlackenedUrn = 194092;
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class instance_karazhan : InstanceMapScript
|
||||
{
|
||||
@@ -162,33 +210,70 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
public instance_karazhan_InstanceMapScript(InstanceMap map) : base(map)
|
||||
{
|
||||
SetHeaders("KZ");
|
||||
SetBossNumber(karazhanConst.MaxEncounter);
|
||||
|
||||
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
|
||||
m_uiOperaEvent = RandomHelper.URand(1, 3);
|
||||
m_uiOzDeathCount = 0;
|
||||
}
|
||||
|
||||
public override bool IsEncounterInProgress()
|
||||
{
|
||||
for (byte i = 0; i < karazhanConst.MaxEncounter; ++i)
|
||||
if (m_auiEncounter[i] == (uint)EncounterState.InProgress)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
OperaEvent = RandomHelper.URand(1, 3);
|
||||
OzDeathCount = 0;
|
||||
OptionalBossCount = 0;
|
||||
}
|
||||
|
||||
public override void OnCreatureCreate(Creature creature)
|
||||
{
|
||||
switch (creature.GetEntry())
|
||||
{
|
||||
case 17229:
|
||||
m_uiKilrekGUID = creature.GetGUID();
|
||||
case CreatureIds.Kilrek:
|
||||
KilrekGUID = creature.GetGUID();
|
||||
break;
|
||||
case 15688:
|
||||
m_uiTerestianGUID = creature.GetGUID();
|
||||
case CreatureIds.TerestianIllhoof:
|
||||
TerestianGUID = creature.GetGUID();
|
||||
break;
|
||||
case 15687:
|
||||
m_uiMoroesGUID = creature.GetGUID();
|
||||
case CreatureIds.Moroes:
|
||||
MoroesGUID = creature.GetGUID();
|
||||
break;
|
||||
case CreatureIds.Nightbane:
|
||||
NightbaneGUID = creature.GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUnitDeath(Unit unit)
|
||||
{
|
||||
Creature creature = unit.ToCreature();
|
||||
if (creature == null)
|
||||
return;
|
||||
|
||||
switch (creature.GetEntry())
|
||||
{
|
||||
case CreatureIds.ColdmistWidow:
|
||||
case CreatureIds.ColdmistStalker:
|
||||
case CreatureIds.Shadowbat:
|
||||
case CreatureIds.VampiricShadowbat:
|
||||
case CreatureIds.GreaterShadowbat:
|
||||
case CreatureIds.PhaseHound:
|
||||
case CreatureIds.Dreadbeast:
|
||||
case CreatureIds.Shadowbeast:
|
||||
if (GetBossState(DataTypes.OptionalBoss) == EncounterState.ToBeDecided)
|
||||
{
|
||||
++OptionalBossCount;
|
||||
if (OptionalBossCount == karazhanConst.OptionalBossRequiredDeathCount)
|
||||
{
|
||||
switch (RandomHelper.URand(CreatureIds.HyakissTheLurker, CreatureIds.RokadTheRavager))
|
||||
{
|
||||
case CreatureIds.HyakissTheLurker:
|
||||
instance.SummonCreature(CreatureIds.HyakissTheLurker, karazhanConst.OptionalSpawn[0]);
|
||||
break;
|
||||
case CreatureIds.ShadikithTheGlider:
|
||||
instance.SummonCreature(CreatureIds.ShadikithTheGlider, karazhanConst.OptionalSpawn[1]);
|
||||
break;
|
||||
case CreatureIds.RokadTheRavager:
|
||||
instance.SummonCreature(CreatureIds.RokadTheRavager, karazhanConst.OptionalSpawn[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -197,67 +282,42 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case karazhanConst.BossAttumen:
|
||||
m_auiEncounter[0] = uiData;
|
||||
break;
|
||||
case karazhanConst.BossMoroes:
|
||||
if (m_auiEncounter[1] == (uint)EncounterState.Done)
|
||||
break;
|
||||
m_auiEncounter[1] = uiData;
|
||||
break;
|
||||
case karazhanConst.BossMaiden:
|
||||
m_auiEncounter[2] = uiData;
|
||||
break;
|
||||
case karazhanConst.OptionalBoss:
|
||||
m_auiEncounter[3] = uiData;
|
||||
break;
|
||||
case karazhanConst.BossOpera:
|
||||
m_auiEncounter[4] = uiData;
|
||||
if (uiData == (uint)EncounterState.Done)
|
||||
UpdateEncounterStateForKilledCreature(16812, null);
|
||||
break;
|
||||
case karazhanConst.Curator:
|
||||
m_auiEncounter[5] = uiData;
|
||||
break;
|
||||
case karazhanConst.Aran:
|
||||
m_auiEncounter[6] = uiData;
|
||||
break;
|
||||
case karazhanConst.Terestian:
|
||||
m_auiEncounter[7] = uiData;
|
||||
break;
|
||||
case karazhanConst.Netherspite:
|
||||
m_auiEncounter[8] = uiData;
|
||||
break;
|
||||
case karazhanConst.Chess:
|
||||
if (uiData == (uint)EncounterState.Done)
|
||||
DoRespawnGameObject(DustCoveredChest, Time.Day);
|
||||
m_auiEncounter[9] = uiData;
|
||||
break;
|
||||
case karazhanConst.Malchezzar:
|
||||
m_auiEncounter[10] = uiData;
|
||||
break;
|
||||
case karazhanConst.Nightbane:
|
||||
if (m_auiEncounter[11] != (uint)EncounterState.Done)
|
||||
m_auiEncounter[11] = uiData;
|
||||
break;
|
||||
case DataTypes.OperaOzDeathcount:
|
||||
if (uiData == (uint)EncounterState.Special)
|
||||
++m_uiOzDeathCount;
|
||||
++OzDeathCount;
|
||||
else if (uiData == (uint)EncounterState.InProgress)
|
||||
m_uiOzDeathCount = 0;
|
||||
OzDeathCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool SetBossState(uint id, EncounterState state)
|
||||
{
|
||||
if (!base.SetBossState(id, state))
|
||||
return false;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case DataTypes.OperaPerformance:
|
||||
if (state == EncounterState.Done)
|
||||
{
|
||||
HandleGameObject(StageDoorLeftGUID, true);
|
||||
HandleGameObject(StageDoorRightGUID, true);
|
||||
GameObject sideEntrance = instance.GetGameObject(SideEntranceDoor);
|
||||
if (sideEntrance != null)
|
||||
sideEntrance.RemoveFlag(GameObjectFlags.Locked);
|
||||
UpdateEncounterStateForKilledCreature(16812, null);
|
||||
}
|
||||
break;
|
||||
case DataTypes.Chess:
|
||||
if (state == EncounterState.Done)
|
||||
DoRespawnGameObject(DustCoveredChest, Time.Day);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (uiData == (uint)EncounterState.Done)
|
||||
{
|
||||
OUT_SAVE_INST_DATA();
|
||||
|
||||
strSaveData =
|
||||
$"{m_auiEncounter[0]} {m_auiEncounter[1]} {m_auiEncounter[2]} {m_auiEncounter[3]} {m_auiEncounter[4]} {m_auiEncounter[5]} {m_auiEncounter[6]} {m_auiEncounter[7]} {m_auiEncounter[8]} {m_auiEncounter[9]} {m_auiEncounter[10]} {m_auiEncounter[11]}";
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void SetGuidData(uint identifier, ObjectGuid data)
|
||||
@@ -270,53 +330,56 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
{
|
||||
switch (go.GetEntry())
|
||||
{
|
||||
case 183932:
|
||||
m_uiCurtainGUID = go.GetGUID();
|
||||
case GameObjectIds.StageCurtain:
|
||||
CurtainGUID = go.GetGUID();
|
||||
break;
|
||||
case 184278:
|
||||
m_uiStageDoorLeftGUID = go.GetGUID();
|
||||
if (m_auiEncounter[4] == (uint)EncounterState.Done)
|
||||
case GameObjectIds.StageDoorLeft:
|
||||
StageDoorLeftGUID = go.GetGUID();
|
||||
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
|
||||
go.SetGoState(GameObjectState.Active);
|
||||
break;
|
||||
case 184279:
|
||||
m_uiStageDoorRightGUID = go.GetGUID();
|
||||
if (m_auiEncounter[4] == (uint)EncounterState.Done)
|
||||
case GameObjectIds.StageDoorRight:
|
||||
StageDoorRightGUID = go.GetGUID();
|
||||
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
|
||||
go.SetGoState(GameObjectState.Active);
|
||||
break;
|
||||
case 184517:
|
||||
m_uiLibraryDoor = go.GetGUID();
|
||||
case GameObjectIds.PrivateLibraryDoor:
|
||||
LibraryDoor = go.GetGUID();
|
||||
break;
|
||||
case 185521:
|
||||
m_uiMassiveDoor = go.GetGUID();
|
||||
case GameObjectIds.MassiveDoor:
|
||||
MassiveDoor = go.GetGUID();
|
||||
break;
|
||||
case 184276:
|
||||
m_uiGamesmansDoor = go.GetGUID();
|
||||
case GameObjectIds.GamesmanHallDoor:
|
||||
GamesmansDoor = go.GetGUID();
|
||||
break;
|
||||
case 184277:
|
||||
m_uiGamesmansExitDoor = go.GetGUID();
|
||||
case GameObjectIds.GamesmanHallExitDoor:
|
||||
GamesmansExitDoor = go.GetGUID();
|
||||
break;
|
||||
case 185134:
|
||||
m_uiNetherspaceDoor = go.GetGUID();
|
||||
case GameObjectIds.NetherspaceDoor:
|
||||
NetherspaceDoor = go.GetGUID();
|
||||
break;
|
||||
case 184274:
|
||||
case GameObjectIds.MastersTerraceDoor:
|
||||
MastersTerraceDoor[0] = go.GetGUID();
|
||||
break;
|
||||
case 184280:
|
||||
case GameObjectIds.MastersTerraceDoor2:
|
||||
MastersTerraceDoor[1] = go.GetGUID();
|
||||
break;
|
||||
case 184275:
|
||||
m_uiSideEntranceDoor = go.GetGUID();
|
||||
if (m_auiEncounter[4] == (uint)EncounterState.Done)
|
||||
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
|
||||
case GameObjectIds.SideEntranceDoor:
|
||||
SideEntranceDoor = go.GetGUID();
|
||||
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
|
||||
go.AddFlag(GameObjectFlags.Locked);
|
||||
else
|
||||
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
|
||||
go.RemoveFlag(GameObjectFlags.Locked);
|
||||
break;
|
||||
case 185119:
|
||||
case GameObjectIds.DustCoveredChest:
|
||||
DustCoveredChest = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.BlackenedUrn:
|
||||
BlackenedUrnGUID = go.GetGUID();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (m_uiOperaEvent)
|
||||
switch (OperaEvent)
|
||||
{
|
||||
// @todo Set Object visibilities for Opera based on performance
|
||||
case OperaEvents.Oz:
|
||||
@@ -330,43 +393,14 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSaveData()
|
||||
{
|
||||
return strSaveData;
|
||||
}
|
||||
|
||||
public override uint GetData(uint uiData)
|
||||
{
|
||||
switch (uiData)
|
||||
{
|
||||
case karazhanConst.BossAttumen:
|
||||
return m_auiEncounter[0];
|
||||
case karazhanConst.BossMoroes:
|
||||
return m_auiEncounter[1];
|
||||
case karazhanConst.BossMaiden:
|
||||
return m_auiEncounter[2];
|
||||
case karazhanConst.OptionalBoss:
|
||||
return m_auiEncounter[3];
|
||||
case karazhanConst.BossOpera:
|
||||
return m_auiEncounter[4];
|
||||
case karazhanConst.Curator:
|
||||
return m_auiEncounter[5];
|
||||
case karazhanConst.Aran:
|
||||
return m_auiEncounter[6];
|
||||
case karazhanConst.Terestian:
|
||||
return m_auiEncounter[7];
|
||||
case karazhanConst.Netherspite:
|
||||
return m_auiEncounter[8];
|
||||
case karazhanConst.Chess:
|
||||
return m_auiEncounter[9];
|
||||
case karazhanConst.Malchezzar:
|
||||
return m_auiEncounter[10];
|
||||
case karazhanConst.Nightbane:
|
||||
return m_auiEncounter[11];
|
||||
case DataTypes.OperaPerformance:
|
||||
return m_uiOperaEvent;
|
||||
return OperaEvent;
|
||||
case DataTypes.OperaOzDeathcount:
|
||||
return m_uiOzDeathCount;
|
||||
return OzDeathCount;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -377,82 +411,64 @@ namespace Scripts.EasternKingdoms.Karazhan
|
||||
switch (uiData)
|
||||
{
|
||||
case DataTypes.Kilrek:
|
||||
return m_uiKilrekGUID;
|
||||
return KilrekGUID;
|
||||
case DataTypes.Terestian:
|
||||
return m_uiTerestianGUID;
|
||||
return TerestianGUID;
|
||||
case DataTypes.Moroes:
|
||||
return m_uiMoroesGUID;
|
||||
return MoroesGUID;
|
||||
case DataTypes.Nightbane:
|
||||
return NightbaneGUID;
|
||||
case DataTypes.GoStagedoorleft:
|
||||
return m_uiStageDoorLeftGUID;
|
||||
return StageDoorLeftGUID;
|
||||
case DataTypes.GoStagedoorright:
|
||||
return m_uiStageDoorRightGUID;
|
||||
return StageDoorRightGUID;
|
||||
case DataTypes.GoCurtains:
|
||||
return m_uiCurtainGUID;
|
||||
return CurtainGUID;
|
||||
case DataTypes.GoLibraryDoor:
|
||||
return m_uiLibraryDoor;
|
||||
return LibraryDoor;
|
||||
case DataTypes.GoMassiveDoor:
|
||||
return m_uiMassiveDoor;
|
||||
return MassiveDoor;
|
||||
case DataTypes.GoSideEntranceDoor:
|
||||
return m_uiSideEntranceDoor;
|
||||
return SideEntranceDoor;
|
||||
case DataTypes.GoGameDoor:
|
||||
return m_uiGamesmansDoor;
|
||||
return GamesmansDoor;
|
||||
case DataTypes.GoGameExitDoor:
|
||||
return m_uiGamesmansExitDoor;
|
||||
return GamesmansExitDoor;
|
||||
case DataTypes.GoNetherDoor:
|
||||
return m_uiNetherspaceDoor;
|
||||
return NetherspaceDoor;
|
||||
case DataTypes.MastersTerraceDoor1:
|
||||
return MastersTerraceDoor[0];
|
||||
case DataTypes.MastersTerraceDoor2:
|
||||
return MastersTerraceDoor[1];
|
||||
case DataTypes.ImageOfMedivh:
|
||||
return ImageGUID;
|
||||
case DataTypes.GoBlackenedUrn:
|
||||
return BlackenedUrnGUID;
|
||||
}
|
||||
|
||||
return ObjectGuid.Empty;
|
||||
}
|
||||
|
||||
public override void Load(string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL();
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
StringArguments loadStream = new StringArguments(str);
|
||||
|
||||
for (byte i = 0; i < karazhanConst.MaxEncounter; ++i)
|
||||
{
|
||||
var state = (EncounterState)loadStream.NextUInt32();
|
||||
// Do not load an encounter as "In Progress" - reset it instead.
|
||||
m_auiEncounter[i] = (uint)(state == EncounterState.InProgress ? EncounterState.NotStarted : state);
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE();
|
||||
}
|
||||
|
||||
uint[] m_auiEncounter = new uint[karazhanConst.MaxEncounter];
|
||||
string strSaveData;
|
||||
|
||||
uint m_uiOperaEvent;
|
||||
uint m_uiOzDeathCount;
|
||||
|
||||
ObjectGuid m_uiCurtainGUID;
|
||||
ObjectGuid m_uiStageDoorLeftGUID;
|
||||
ObjectGuid m_uiStageDoorRightGUID;
|
||||
ObjectGuid m_uiKilrekGUID;
|
||||
ObjectGuid m_uiTerestianGUID;
|
||||
ObjectGuid m_uiMoroesGUID;
|
||||
ObjectGuid m_uiLibraryDoor; // Door at Shade of Aran
|
||||
ObjectGuid m_uiMassiveDoor; // Door at Netherspite
|
||||
ObjectGuid m_uiSideEntranceDoor; // Side Entrance
|
||||
ObjectGuid m_uiGamesmansDoor; // Door before Chess
|
||||
ObjectGuid m_uiGamesmansExitDoor; // Door after Chess
|
||||
ObjectGuid m_uiNetherspaceDoor; // Door at Malchezaar
|
||||
uint OperaEvent;
|
||||
uint OzDeathCount;
|
||||
uint OptionalBossCount;
|
||||
ObjectGuid CurtainGUID;
|
||||
ObjectGuid StageDoorLeftGUID;
|
||||
ObjectGuid StageDoorRightGUID;
|
||||
ObjectGuid KilrekGUID;
|
||||
ObjectGuid TerestianGUID;
|
||||
ObjectGuid MoroesGUID;
|
||||
ObjectGuid NightbaneGUID;
|
||||
ObjectGuid LibraryDoor; // Door at Shade of Aran
|
||||
ObjectGuid MassiveDoor; // Door at Netherspite
|
||||
ObjectGuid SideEntranceDoor; // Side Entrance
|
||||
ObjectGuid GamesmansDoor; // Door before Chess
|
||||
ObjectGuid GamesmansExitDoor; // Door after Chess
|
||||
ObjectGuid NetherspaceDoor; // Door at Malchezaar
|
||||
ObjectGuid[] MastersTerraceDoor = new ObjectGuid[2];
|
||||
ObjectGuid ImageGUID;
|
||||
ObjectGuid DustCoveredChest;
|
||||
ObjectGuid BlackenedUrnGUID;
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
|
||||
@@ -112,12 +112,12 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
if (me.IsAlive())
|
||||
SpawnAdds();
|
||||
|
||||
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.NotStarted);
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.InProgress);
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.InProgress);
|
||||
|
||||
DoZoneInCombat();
|
||||
}
|
||||
@@ -140,7 +140,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
{
|
||||
Talk(TextIds.Death);
|
||||
|
||||
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.Done);
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.Done);
|
||||
|
||||
DeSpawnAdds();
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (instance.GetData(karazhanConst.BossMoroes) == 0)
|
||||
if (instance.GetData(DataTypes.Moroes) == 0)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -338,7 +338,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.NotStarted);
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
|
||||
}
|
||||
|
||||
public void AcquireGUID()
|
||||
@@ -371,7 +371,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (instance.GetData(karazhanConst.BossMoroes) == 0)
|
||||
if (instance.GetData(DataTypes.Moroes) == 0)
|
||||
EnterEvadeMode();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -25,8 +25,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
#region Wizard of Oz
|
||||
struct WizardOfOz
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayDorotheeDeath = 0;
|
||||
public const uint SayDorotheeSummon = 1;
|
||||
@@ -49,52 +48,70 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
public const uint SayCroneAggro = 0;
|
||||
public const uint SayCroneDeath = 1;
|
||||
public const uint SayCroneSlay = 2;
|
||||
|
||||
// Dorothee
|
||||
public const uint SpellWaterbolt = 31012;
|
||||
public const uint SpellScream = 31013;
|
||||
public const uint SpellSummontito = 31014;
|
||||
|
||||
// Tito
|
||||
public const uint SpellYipping = 31015;
|
||||
|
||||
// Strawman
|
||||
public const uint SpellBrainBash = 31046;
|
||||
public const uint SpellBrainWipe = 31069;
|
||||
public const uint SpellBurningStraw = 31075;
|
||||
|
||||
// Tinhead
|
||||
public const uint SpellCleave = 31043;
|
||||
public const uint SpellRust = 31086;
|
||||
|
||||
// Roar
|
||||
public const uint SpellMangle = 31041;
|
||||
public const uint SpellShred = 31042;
|
||||
public const uint SpellFrightenedScream = 31013;
|
||||
|
||||
// Crone
|
||||
public const uint SpellChainLightning = 32337;
|
||||
|
||||
// Cyclone
|
||||
public const uint SpellKnockback = 32334;
|
||||
public const uint SpellCycloneVisual = 32332;
|
||||
|
||||
public const uint NpcTito = 17548;
|
||||
public const uint NpcCyclone = 18412;
|
||||
public const uint NpcCrone = 18168;
|
||||
}
|
||||
|
||||
public class WizardofOzBase : ScriptedAI
|
||||
struct SpellIds
|
||||
{
|
||||
public WizardofOzBase(Creature creature) : base(creature) { }
|
||||
// Dorothee
|
||||
public const uint Waterbolt = 31012;
|
||||
public const uint Scream = 31013;
|
||||
public const uint Summontito = 31014;
|
||||
|
||||
// Tito
|
||||
public const uint Yipping = 31015;
|
||||
|
||||
// Strawman
|
||||
public const uint BrainBash = 31046;
|
||||
public const uint BrainWipe = 31069;
|
||||
public const uint BurningStraw = 31075;
|
||||
|
||||
// Tinhead
|
||||
public const uint Cleave = 31043;
|
||||
public const uint Rust = 31086;
|
||||
|
||||
// Roar
|
||||
public const uint Mangle = 31041;
|
||||
public const uint Shred = 31042;
|
||||
public const uint FrightenedScream = 31013;
|
||||
|
||||
// Crone
|
||||
public const uint ChainLightning = 32337;
|
||||
|
||||
// Cyclone
|
||||
public const uint Knockback = 32334;
|
||||
public const uint CycloneVisual = 32332;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint Tito = 17548;
|
||||
public const uint Cyclone = 18412;
|
||||
public const uint Crone = 18168;
|
||||
}
|
||||
|
||||
#region Wizard of Oz
|
||||
public abstract class WizardofOzBase : ScriptedAI
|
||||
{
|
||||
public WizardofOzBase(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
|
||||
public abstract void Initialize();
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void SummonCroneIfReady(InstanceScript instance, Creature creature)
|
||||
{
|
||||
instance.SetData(DataTypes.OperaOzDeathcount, (uint)EncounterState.Special); // Increment DeathCount
|
||||
instance.SetBossState(DataTypes.OperaOzDeathcount, EncounterState.Special); // Increment DeathCount
|
||||
|
||||
if (instance.GetData(DataTypes.OperaOzDeathcount) == 4)
|
||||
{
|
||||
Creature pCrone = creature.SummonCreature(WizardOfOz.NpcCrone, -10891.96f, -1755.95f, creature.GetPositionZ(), 4.64f, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
|
||||
Creature pCrone = creature.SummonCreature(CreatureIds.Crone, -10891.96f, -1755.95f, creature.GetPositionZ(), 4.64f, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
|
||||
if (pCrone)
|
||||
{
|
||||
if (creature.GetVictim())
|
||||
@@ -106,17 +123,16 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
public bool TitoDied;
|
||||
public ObjectGuid DorotheeGUID;
|
||||
public uint AggroTimer;
|
||||
|
||||
public InstanceScript instance;
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class boss_dorothee : WizardofOzBase
|
||||
{
|
||||
public boss_dorothee(Creature creature) : base(creature)
|
||||
{
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
public boss_dorothee(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
public override void Initialize()
|
||||
{
|
||||
AggroTimer = 500;
|
||||
|
||||
@@ -130,7 +146,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(WizardOfOz.SayDorotheeAggro);
|
||||
Talk(TextIds.SayDorotheeAggro);
|
||||
}
|
||||
|
||||
public override void JustReachedHome()
|
||||
@@ -140,14 +156,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(WizardOfOz.SayDorotheeDeath);
|
||||
Talk(TextIds.SayDorotheeDeath);
|
||||
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
public override void AttackStart(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.AttackStart(who);
|
||||
@@ -155,7 +171,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void MoveInLineOfSight(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.MoveInLineOfSight(who);
|
||||
@@ -167,7 +183,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
if (AggroTimer <= diff)
|
||||
{
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
AggroTimer = 0;
|
||||
}
|
||||
else AggroTimer -= diff;
|
||||
@@ -178,14 +194,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
if (WaterBoltTimer <= diff)
|
||||
{
|
||||
DoCast(SelectTarget(SelectAggroTarget.Random, 0), WizardOfOz.SpellWaterbolt);
|
||||
DoCast(SelectTarget(SelectAggroTarget.Random, 0), SpellIds.Waterbolt);
|
||||
WaterBoltTimer = (uint)(TitoDied ? 1500 : 5000);
|
||||
}
|
||||
else WaterBoltTimer -= diff;
|
||||
|
||||
if (FearTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellScream);
|
||||
DoCastVictim(SpellIds.Scream);
|
||||
FearTimer = 30000;
|
||||
}
|
||||
else FearTimer -= diff;
|
||||
@@ -202,10 +218,10 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
void SummonTito()
|
||||
{
|
||||
Creature pTito = me.SummonCreature(WizardOfOz.NpcTito, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedDespawnOOC, 30000);
|
||||
Creature pTito = me.SummonCreature(CreatureIds.Tito, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedDespawnOOC, 30000);
|
||||
if (pTito)
|
||||
{
|
||||
Talk(WizardOfOz.SayDorotheeSummon);
|
||||
Talk(TextIds.SayDorotheeSummon);
|
||||
DorotheeGUID = me.GetGUID();
|
||||
pTito.GetAI().AttackStart(me.GetVictim());
|
||||
SummonedTito = true;
|
||||
@@ -213,8 +229,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
}
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
uint WaterBoltTimer;
|
||||
uint FearTimer;
|
||||
uint SummonTitoTimer;
|
||||
@@ -225,9 +239,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
[Script]
|
||||
public class npc_tito : WizardofOzBase
|
||||
{
|
||||
public npc_tito(Creature creature) : base(creature) { }
|
||||
public npc_tito(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
public override void Initialize()
|
||||
{
|
||||
DorotheeGUID.Clear();
|
||||
YipTimer = 10000;
|
||||
@@ -243,7 +260,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
if (Dorothee && Dorothee.IsAlive())
|
||||
{
|
||||
TitoDied = true;
|
||||
Talk(WizardOfOz.SayDorotheeTitoDeath, Dorothee);
|
||||
Talk(TextIds.SayDorotheeTitoDeath, Dorothee);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,7 +272,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
if (YipTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellYipping);
|
||||
DoCastVictim(SpellIds.Yipping);
|
||||
YipTimer = 10000;
|
||||
}
|
||||
else YipTimer -= diff;
|
||||
@@ -271,10 +288,11 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
public boss_strawman(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
public override void Initialize()
|
||||
{
|
||||
AggroTimer = 13000;
|
||||
BrainBashTimer = 5000;
|
||||
@@ -283,7 +301,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void AttackStart(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.AttackStart(who);
|
||||
@@ -291,7 +309,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void MoveInLineOfSight(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.MoveInLineOfSight(who);
|
||||
@@ -299,27 +317,27 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(WizardOfOz.SayStrawmanAggro);
|
||||
Talk(TextIds.SayStrawmanAggro);
|
||||
}
|
||||
|
||||
public override void SpellHit(Unit caster, SpellInfo Spell)
|
||||
{
|
||||
if ((Spell.SchoolMask == SpellSchoolMask.Fire) && ((RandomHelper.randChance() % 10) == 0))
|
||||
{
|
||||
DoCast(me, WizardOfOz.SpellBurningStraw, true);
|
||||
DoCast(me, SpellIds.BurningStraw, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(WizardOfOz.SayStrawmanDeath);
|
||||
Talk(TextIds.SayStrawmanDeath);
|
||||
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(WizardOfOz.SayStrawmanSlay);
|
||||
Talk(TextIds.SayStrawmanSlay);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -328,7 +346,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
if (AggroTimer <= diff)
|
||||
{
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
AggroTimer = 0;
|
||||
}
|
||||
else AggroTimer -= diff;
|
||||
@@ -339,7 +357,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
if (BrainBashTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellBrainBash);
|
||||
DoCastVictim(SpellIds.BrainBash);
|
||||
BrainBashTimer = 15000;
|
||||
}
|
||||
else BrainBashTimer -= diff;
|
||||
@@ -348,7 +366,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
|
||||
if (target)
|
||||
DoCast(target, WizardOfOz.SpellBrainWipe);
|
||||
DoCast(target, SpellIds.BrainWipe);
|
||||
BrainWipeTimer = 20000;
|
||||
}
|
||||
else BrainWipeTimer -= diff;
|
||||
@@ -356,8 +374,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
uint BrainBashTimer;
|
||||
uint BrainWipeTimer;
|
||||
}
|
||||
@@ -365,12 +381,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
[Script]
|
||||
class boss_tinhead : WizardofOzBase
|
||||
{
|
||||
public boss_tinhead(Creature creature) : base(creature)
|
||||
{
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
public boss_tinhead(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
public override void Initialize()
|
||||
{
|
||||
AggroTimer = 15000;
|
||||
CleaveTimer = 5000;
|
||||
@@ -381,7 +394,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(WizardOfOz.SayTinheadAggro);
|
||||
Talk(TextIds.SayTinheadAggro);
|
||||
}
|
||||
|
||||
public override void JustReachedHome()
|
||||
@@ -391,7 +404,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void AttackStart(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.AttackStart(who);
|
||||
@@ -399,7 +412,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void MoveInLineOfSight(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.MoveInLineOfSight(who);
|
||||
@@ -407,14 +420,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(WizardOfOz.SayTinheadDeath);
|
||||
Talk(TextIds.SayTinheadDeath);
|
||||
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(WizardOfOz.SayTinheadSlay);
|
||||
Talk(TextIds.SayTinheadSlay);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -423,7 +436,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
if (AggroTimer <= diff)
|
||||
{
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
AggroTimer = 0;
|
||||
}
|
||||
else AggroTimer -= diff;
|
||||
@@ -434,7 +447,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellCleave);
|
||||
DoCastVictim(SpellIds.Cleave);
|
||||
CleaveTimer = 5000;
|
||||
}
|
||||
else CleaveTimer -= diff;
|
||||
@@ -444,8 +457,8 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
if (RustTimer <= diff)
|
||||
{
|
||||
++RustCount;
|
||||
Talk(WizardOfOz.EmoteRust);
|
||||
DoCast(me, WizardOfOz.SpellRust);
|
||||
Talk(TextIds.EmoteRust);
|
||||
DoCast(me, SpellIds.Rust);
|
||||
RustTimer = 6000;
|
||||
}
|
||||
else RustTimer -= diff;
|
||||
@@ -454,8 +467,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
uint CleaveTimer;
|
||||
uint RustTimer;
|
||||
|
||||
@@ -465,12 +476,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
[Script]
|
||||
class boss_roar : WizardofOzBase
|
||||
{
|
||||
public boss_roar(Creature creature) : base(creature)
|
||||
{
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
public boss_roar(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
public override void Initialize()
|
||||
{
|
||||
AggroTimer = 20000;
|
||||
MangleTimer = 5000;
|
||||
@@ -478,25 +486,25 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
ScreamTimer = 15000;
|
||||
}
|
||||
|
||||
public override void MoveInLineOfSight(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
public override void AttackStart(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.AttackStart(who);
|
||||
}
|
||||
|
||||
public override void MoveInLineOfSight(Unit who)
|
||||
{
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(WizardOfOz.SayRoarAggro);
|
||||
Talk(TextIds.SayRoarAggro);
|
||||
}
|
||||
|
||||
public override void JustReachedHome()
|
||||
@@ -506,14 +514,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(WizardOfOz.SayRoarDeath);
|
||||
Talk(TextIds.SayRoarDeath);
|
||||
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(WizardOfOz.SayRoarSlay);
|
||||
Talk(TextIds.SayRoarSlay);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -522,7 +530,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
if (AggroTimer <= diff)
|
||||
{
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
AggroTimer = 0;
|
||||
}
|
||||
else AggroTimer -= diff;
|
||||
@@ -533,21 +541,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
if (MangleTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellMangle);
|
||||
DoCastVictim(SpellIds.Mangle);
|
||||
MangleTimer = RandomHelper.URand(5000, 8000);
|
||||
}
|
||||
else MangleTimer -= diff;
|
||||
|
||||
if (ShredTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellShred);
|
||||
DoCastVictim(SpellIds.Shred);
|
||||
ShredTimer = RandomHelper.URand(10000, 15000);
|
||||
}
|
||||
else ShredTimer -= diff;
|
||||
|
||||
if (ScreamTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellFrightenedScream);
|
||||
DoCastVictim(SpellIds.FrightenedScream);
|
||||
ScreamTimer = RandomHelper.URand(20000, 30000);
|
||||
}
|
||||
else ScreamTimer -= diff;
|
||||
@@ -555,8 +563,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
uint MangleTimer;
|
||||
uint ShredTimer;
|
||||
uint ScreamTimer;
|
||||
@@ -570,8 +576,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
public override void Initialize()
|
||||
{
|
||||
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.NonAttackable);
|
||||
CycloneTimer = 30000;
|
||||
ChainLightningTimer = 10000;
|
||||
}
|
||||
@@ -583,27 +590,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(WizardOfOz.SayCroneSlay);
|
||||
Talk(TextIds.SayCroneSlay);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(WizardOfOz.SayCroneAggro);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
Talk(TextIds.SayCroneAggro);
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(WizardOfOz.SayCroneDeath);
|
||||
Talk(TextIds.SayCroneDeath);
|
||||
|
||||
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
|
||||
|
||||
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
|
||||
if (pSideEntrance)
|
||||
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
|
||||
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -611,21 +612,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
|
||||
if (CycloneTimer <= diff)
|
||||
{
|
||||
Creature Cyclone = DoSpawnCreature(WizardOfOz.NpcCyclone, RandomHelper.FRand(0, 9), RandomHelper.FRand(0, 9), 0, 0, TempSummonType.TimedDespawn, 15000);
|
||||
Creature Cyclone = DoSpawnCreature(CreatureIds.Cyclone, RandomHelper.FRand(0, 9), RandomHelper.FRand(0, 9), 0, 0, TempSummonType.TimedDespawn, 15000);
|
||||
if (Cyclone)
|
||||
Cyclone.CastSpell(Cyclone, WizardOfOz.SpellCycloneVisual, true);
|
||||
Cyclone.CastSpell(Cyclone, SpellIds.CycloneVisual, true);
|
||||
CycloneTimer = 30000;
|
||||
}
|
||||
else CycloneTimer -= diff;
|
||||
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
DoCastVictim(WizardOfOz.SpellChainLightning);
|
||||
DoCastVictim(SpellIds.ChainLightning);
|
||||
ChainLightningTimer = 15000;
|
||||
}
|
||||
else ChainLightningTimer -= diff;
|
||||
@@ -633,8 +634,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
uint CycloneTimer;
|
||||
uint ChainLightningTimer;
|
||||
}
|
||||
@@ -655,8 +654,8 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!me.HasAura(WizardOfOz.SpellKnockback))
|
||||
DoCast(me, WizardOfOz.SpellKnockback, true);
|
||||
if (!me.HasAura(SpellIds.Knockback))
|
||||
DoCast(me, SpellIds.Knockback, true);
|
||||
|
||||
if (MoveTimer <= diff)
|
||||
{
|
||||
@@ -746,14 +745,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
DoPlaySoundToSet(me, RedRidingHood.SoundWolfDeath);
|
||||
|
||||
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
|
||||
|
||||
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
|
||||
if (pSideEntrance)
|
||||
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
|
||||
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -884,7 +876,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void MoveInLineOfSight(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.MoveInLineOfSight(who);
|
||||
@@ -895,7 +887,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
me.InterruptNonMeleeSpells(true);
|
||||
me.RemoveAllAuras();
|
||||
me.SetHealth(0);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
me.AddUnitFlag(UnitFlags.NotSelectable);
|
||||
me.GetMotionMaster().MovementExpired(false);
|
||||
me.GetMotionMaster().MoveIdle();
|
||||
me.SetStandState(UnitStandStateType.Dead);
|
||||
@@ -903,7 +895,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public void Resurrect(Creature target)
|
||||
{
|
||||
target.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
target.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
target.SetFullHealth();
|
||||
target.SetStandState(UnitStandStateType.Stand);
|
||||
target.CastSpell(target, JulianneRomulo.SpellResVisual, true);
|
||||
@@ -972,7 +964,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public override void AttackStart(Unit who)
|
||||
{
|
||||
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
|
||||
if (me.HasUnitFlag(UnitFlags.NonAttackable))
|
||||
return;
|
||||
|
||||
base.AttackStart(who);
|
||||
@@ -1026,12 +1018,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
Romulo = ObjectAccessor.GetCreature(me, RomuloGUID);
|
||||
if (Romulo)
|
||||
{
|
||||
Romulo.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
Romulo.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
Romulo.GetMotionMaster().Clear();
|
||||
Romulo.setDeathState(DeathState.JustDied);
|
||||
Romulo.CombatStop(true);
|
||||
Romulo.DeleteThreatList();
|
||||
Romulo.SetUInt32Value(ObjectFields.DynamicFlags, (uint)UnitDynFlags.Lootable);
|
||||
Romulo.SetDynamicFlags(UnitDynFlags.Lootable);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -1055,14 +1047,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(JulianneRomulo.SayJulianneDeath02);
|
||||
|
||||
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
|
||||
|
||||
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
|
||||
if (pSideEntrance)
|
||||
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
|
||||
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
@@ -1087,7 +1072,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
if (AggroYellTimer <= diff)
|
||||
{
|
||||
Talk(JulianneRomulo.SayJulianneAggro);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
me.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
me.SetFaction(16);
|
||||
AggroYellTimer = 0;
|
||||
}
|
||||
@@ -1271,12 +1256,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
Julianne = ObjectAccessor.GetCreature(me, JulianneGUID);
|
||||
if (Julianne)
|
||||
{
|
||||
Julianne.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
Julianne.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
Julianne.GetMotionMaster().Clear();
|
||||
Julianne.setDeathState(DeathState.JustDied);
|
||||
Julianne.CombatStop(true);
|
||||
Julianne.DeleteThreatList();
|
||||
Julianne.SetUInt32Value(ObjectFields.DynamicFlags, (uint)UnitDynFlags.Lootable);
|
||||
Julianne.SetDynamicFlags(UnitDynFlags.Lootable);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1313,14 +1298,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(JulianneRomulo.SayRomuloDeath);
|
||||
|
||||
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
|
||||
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
|
||||
|
||||
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
|
||||
if (pSideEntrance)
|
||||
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
|
||||
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
@@ -1428,7 +1406,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
public void StartEvent()
|
||||
{
|
||||
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.InProgress);
|
||||
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.InProgress);
|
||||
|
||||
//resets count for this event, in case earlier failed
|
||||
if (m_uiEventId == OperaEvents.Oz)
|
||||
@@ -1454,7 +1432,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
Creature spotlight = me.SummonCreature(karazhanConst.NpcSpotlight, me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), 0.0f, TempSummonType.TimedOrDeadDespawn, 60000);
|
||||
if (spotlight)
|
||||
{
|
||||
spotlight.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
spotlight.AddUnitFlag(UnitFlags.NotSelectable);
|
||||
spotlight.CastSpell(spotlight, karazhanConst.SpellSpotlight, false);
|
||||
m_uiSpotlightGUID = spotlight.GetGUID();
|
||||
}
|
||||
@@ -1530,11 +1508,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
|
||||
Creature creature = me.SummonCreature(entry, PosX, karazhanConst.SPAWN_Y, karazhanConst.SPAWN_Z, karazhanConst.SPAWN_O, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
|
||||
if (creature)
|
||||
{
|
||||
// In case database has bad flags
|
||||
creature.SetUInt32Value(UnitFields.Flags, 0);
|
||||
creature.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
|
||||
}
|
||||
creature.AddUnitFlag(UnitFlags.NonAttackable);
|
||||
}
|
||||
|
||||
RaidWiped = false;
|
||||
@@ -1654,7 +1628,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
if (instance != null)
|
||||
{
|
||||
// Check for death of Moroes and if opera event is not done already
|
||||
if (instance.GetData(karazhanConst.BossMoroes) == (uint)EncounterState.Done && instance.GetData(karazhanConst.BossOpera) != (uint)EncounterState.Done)
|
||||
if (instance.GetBossState(DataTypes.Moroes) == EncounterState.Done && instance.GetBossState(DataTypes.OperaPerformance) != EncounterState.Done)
|
||||
{
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Scripts.EasternKingdoms
|
||||
Initialize();
|
||||
_events.Reset();
|
||||
me.SetFaction(7);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
me.AddUnitFlag(UnitFlags.ImmuneToPc);
|
||||
me.SetStandState(UnitStandStateType.Kneel);
|
||||
me.LoadEquipment(0, true);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ namespace Scripts.EasternKingdoms
|
||||
else
|
||||
{
|
||||
me.SetFaction(14);
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
|
||||
phase = UnworthyInitiatePhase.Attacking;
|
||||
|
||||
Player target = Global.ObjAccessor.GetPlayer(me, playerGUID);
|
||||
@@ -468,7 +468,7 @@ namespace Scripts.EasternKingdoms
|
||||
|
||||
me.RestoreFaction();
|
||||
base.Reset();
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.Unk15);
|
||||
me.AddUnitFlag(UnitFlags.Unk15);
|
||||
}
|
||||
|
||||
public override void SpellHit(Unit pCaster, SpellInfo pSpell)
|
||||
@@ -569,8 +569,8 @@ namespace Scripts.EasternKingdoms
|
||||
return true;
|
||||
}
|
||||
|
||||
creature.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
creature.RemoveFlag(UnitFields.Flags, UnitFlags.Unk15);
|
||||
creature.RemoveUnitFlag(UnitFlags.ImmuneToPc);
|
||||
creature.RemoveUnitFlag(UnitFlags.Unk15);
|
||||
|
||||
player.CastSpell(creature, SpellIds.Duel, false);
|
||||
player.CastSpell(player, SpellIds.DuelFlag, true);
|
||||
@@ -703,7 +703,7 @@ namespace Scripts.EasternKingdoms
|
||||
if (charmer.HasAura(SpellIds.EffectStolenHorse))
|
||||
{
|
||||
charmer.RemoveAurasDueToSpell(SpellIds.EffectStolenHorse);
|
||||
caster.RemoveFlag(UnitFields.NpcFlags, NPCFlags.SpellClick);
|
||||
caster.RemoveNpcFlag(NPCFlags.SpellClick);
|
||||
caster.SetFaction(35);
|
||||
DoCast(caster, SpellIds.CallDarkRider, true);
|
||||
Creature Dark_Rider = me.FindNearestCreature(CreatureIds.DarkRiderOfAcherus, 15);
|
||||
@@ -765,8 +765,8 @@ namespace Scripts.EasternKingdoms
|
||||
return;
|
||||
|
||||
deathcharger.RestoreFaction();
|
||||
deathcharger.RemoveFlag(UnitFields.NpcFlags, NPCFlags.SpellClick);
|
||||
deathcharger.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
deathcharger.RemoveNpcFlag(NPCFlags.SpellClick);
|
||||
deathcharger.AddUnitFlag(UnitFlags.NotSelectable);
|
||||
if (!me.GetVehicle() && deathcharger.IsVehicle() && deathcharger.GetVehicleKit().HasEmptySeat(0))
|
||||
me.EnterVehicle(deathcharger);
|
||||
}
|
||||
@@ -779,8 +779,8 @@ namespace Scripts.EasternKingdoms
|
||||
|
||||
if (killer.IsTypeId(TypeId.Player) && deathcharger.IsTypeId(TypeId.Unit) && deathcharger.IsVehicle())
|
||||
{
|
||||
deathcharger.SetFlag(UnitFields.NpcFlags, NPCFlags.SpellClick);
|
||||
deathcharger.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
|
||||
deathcharger.AddNpcFlag(NPCFlags.SpellClick);
|
||||
deathcharger.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
deathcharger.SetFaction(2096);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user