Fix build. (scripts are fixed but most need updated tho)

This commit is contained in:
hondacrx
2019-08-18 23:23:18 -04:00
parent aa71a8926a
commit b3faf9685a
61 changed files with 1611 additions and 1442 deletions
+1 -1
View File
@@ -569,7 +569,7 @@ namespace Framework.Dynamic
/// Returns the repeat counter which increases every time the task is repeated. /// Returns the repeat counter which increases every time the task is repeated.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
uint GetRepeatCounter() public uint GetRepeatCounter()
{ {
return _task._repeated; return _task._repeated;
} }
+1 -1
View File
@@ -365,7 +365,7 @@ namespace Game.AI
public virtual void OnCharmed(bool apply) { } public virtual void OnCharmed(bool apply) { }
public virtual void DoAction(int param) { } public virtual void DoAction(int action) { }
public virtual uint GetData(uint id = 0) { return 0; } public virtual uint GetData(uint id = 0) { return 0; }
public virtual void SetData(uint id, uint value) { } public virtual void SetData(uint id, uint value) { }
public virtual void SetGUID(ObjectGuid guid, int id = 0) { } public virtual void SetGUID(ObjectGuid guid, int id = 0) { }
@@ -402,7 +402,7 @@ namespace Game.Network.Packets
public int OverEnergize; public int OverEnergize;
} }
class SpellInstakillLog : ServerPacket public class SpellInstakillLog : ServerPacket
{ {
public SpellInstakillLog() : base(ServerOpcodes.SpellInstakillLog, ConnectionType.Instance) { } public SpellInstakillLog() : base(ServerOpcodes.SpellInstakillLog, ConnectionType.Instance) { }
@@ -35,271 +35,339 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight
struct TextIds 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 SayKill = 0;
public const uint SayDisarmed = 1; public const uint SayRandom = 1;
public const uint SayDeath = 2; public const uint SayDisarmed = 2;
public const uint SayRandom = 3; 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 struct SpellIds
{ {
public const uint Shadowcleave = 29832; public const uint Shadowcleave = 29832;
public const uint IntangiblePresence = 29833; 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] [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); Initialize();
CurseTimer = 30000; }
RandomYellTimer = RandomHelper.URand(30000, 60000); //Occasionally yell
ChargeTimer = 20000; void Initialize()
ResetTimer = 0; {
_midnightGUID.Clear();
_phase = Phases.None;
} }
public override void Reset() public override void Reset()
{ {
ResetTimer = 0; Initialize();
Midnight.Clear(); base.Reset();
} }
public override void EnterEvadeMode(EvadeReason why) public override void EnterEvadeMode(EvadeReason why)
{ {
base.EnterEvadeMode(why); Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
ResetTimer = 2000; 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) public override void KilledUnit(Unit victim)
{ {
Talk(TextIds.SayKill); 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) public override void JustDied(Unit killer)
{ {
Talk(TextIds.SayDeath); Talk(TextIds.SayDeath);
Unit midnight = Global.ObjAccessor.GetUnit(me, Midnight); Unit midnight = Global.ObjAccessor.GetUnit(me, _midnightGUID);
if (midnight) if (midnight)
midnight.KillSelf(); 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) public override void UpdateAI(uint diff)
{ {
if (ResetTimer != 0) if (!UpdateVictim() && _phase != Phases.None)
{
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())
return; return;
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable)) _scheduler.Update(diff, DoMeleeAttackIfReady);
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();
} }
public override void SpellHit(Unit source, SpellInfo spell) public override void SpellHit(Unit source, SpellInfo spell)
{ {
if (spell.Mechanic == Mechanics.Disarm) if (spell.Mechanic == Mechanics.Disarm)
Talk(TextIds.SayDisarmed); 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; ObjectGuid _midnightGUID;
uint CleaveTimer; Phases _phase;
uint CurseTimer;
uint RandomYellTimer;
uint ChargeTimer; //only when mounted
uint ResetTimer;
} }
[Script] [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() public override void Reset()
{ {
Phase = 1; Initialize();
Attumen.Clear(); base.Reset();
mountTimer = 0;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.SetVisible(true); 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) public override void KilledUnit(Unit victim)
{ {
if (Phase == 2) if (_phase == Phases.AttumenEngages)
{ {
Unit unit = Global.ObjAccessor.GetUnit(me, Attumen); Unit unit = Global.ObjAccessor.GetUnit(me, _attumenGUID);
if (unit) if (unit != null)
Talk(TextIds.SayMidnightKill, unit); Talk(TextIds.SayMidnightKill, unit);
} }
} }
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim() || _phase == Phases.Mounted)
return; return;
if (Phase == 1 && HealthBelowPct(95)) _scheduler.Update(diff, DoMeleeAttackIfReady);
{
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();
} }
public void Mount(Unit pAttumen) ObjectGuid _attumenGUID;
{ Phases _phase;
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;
} }
} }
@@ -35,124 +35,135 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
struct SpellIds 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 HatefulBolt = 30383;
public const uint Evocation = 30254; 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 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] [Script]
class boss_curator : ScriptedAI class boss_curator : BossAI
{ {
public boss_curator(Creature creature) : base(creature) public boss_curator(Creature creature) : base(creature, DataTypes.Curator) { }
{
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 override void Reset() public override void Reset()
{ {
Initialize(); _Reset();
_infused = false;
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Arcane, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Arcane, true);
} }
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
{ {
Talk(TextIds.SayKill); if (victim.GetTypeId() == TypeId.Player)
Talk(TextIds.SayKill);
} }
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
_JustDied();
Talk(TextIds.SayDeath); Talk(TextIds.SayDeath);
} }
public override void EnterCombat(Unit victim) public override void EnterCombat(Unit victim)
{ {
_EnterCombat();
Talk(TextIds.SayAggro); 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) public override void UpdateAI(uint diff)
{ {
if (!UpdateVictim())
return;
_scheduler.Update(diff); _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 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 = public static Dialogue[] OzDialogue =
{ {
new Dialogue(0, 6000), new Dialogue(0, 6000),
@@ -108,6 +95,15 @@ namespace Scripts.EasternKingdoms.Karazhan
public const uint NpcArcanagos = 17652; public const uint NpcArcanagos = 17652;
public const uint NpcSpotlight = 19525; 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 struct Dialogue
@@ -124,12 +120,22 @@ namespace Scripts.EasternKingdoms.Karazhan
struct DataTypes 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 OperaOzDeathcount = 14;
public const uint Kilrek = 15; public const uint Kilrek = 15;
public const uint Terestian = 16;
public const uint Moroes = 17;
public const uint GoCurtains = 18; public const uint GoCurtains = 18;
public const uint GoStagedoorleft = 19; public const uint GoStagedoorleft = 19;
public const uint GoStagedoorright = 20; public const uint GoStagedoorright = 20;
@@ -143,6 +149,7 @@ namespace Scripts.EasternKingdoms.Karazhan
public const uint MastersTerraceDoor1 = 27; public const uint MastersTerraceDoor1 = 27;
public const uint MastersTerraceDoor2 = 28; public const uint MastersTerraceDoor2 = 28;
public const uint GoSideEntranceDoor = 29; public const uint GoSideEntranceDoor = 29;
public const uint GoBlackenedUrn = 30;
} }
struct OperaEvents struct OperaEvents
@@ -152,6 +159,47 @@ namespace Scripts.EasternKingdoms.Karazhan
public const uint RAJ = 3; 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] [Script]
public class instance_karazhan : InstanceMapScript public class instance_karazhan : InstanceMapScript
{ {
@@ -162,33 +210,70 @@ namespace Scripts.EasternKingdoms.Karazhan
public instance_karazhan_InstanceMapScript(InstanceMap map) : base(map) public instance_karazhan_InstanceMapScript(InstanceMap map) : base(map)
{ {
SetHeaders("KZ"); SetHeaders("KZ");
SetBossNumber(karazhanConst.MaxEncounter);
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered. // 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
m_uiOperaEvent = RandomHelper.URand(1, 3); OperaEvent = RandomHelper.URand(1, 3);
m_uiOzDeathCount = 0; OzDeathCount = 0;
} OptionalBossCount = 0;
public override bool IsEncounterInProgress()
{
for (byte i = 0; i < karazhanConst.MaxEncounter; ++i)
if (m_auiEncounter[i] == (uint)EncounterState.InProgress)
return true;
return false;
} }
public override void OnCreatureCreate(Creature creature) public override void OnCreatureCreate(Creature creature)
{ {
switch (creature.GetEntry()) switch (creature.GetEntry())
{ {
case 17229: case CreatureIds.Kilrek:
m_uiKilrekGUID = creature.GetGUID(); KilrekGUID = creature.GetGUID();
break; break;
case 15688: case CreatureIds.TerestianIllhoof:
m_uiTerestianGUID = creature.GetGUID(); TerestianGUID = creature.GetGUID();
break; break;
case 15687: case CreatureIds.Moroes:
m_uiMoroesGUID = creature.GetGUID(); 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; break;
} }
} }
@@ -197,67 +282,42 @@ namespace Scripts.EasternKingdoms.Karazhan
{ {
switch (type) 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: case DataTypes.OperaOzDeathcount:
if (uiData == (uint)EncounterState.Special) if (uiData == (uint)EncounterState.Special)
++m_uiOzDeathCount; ++OzDeathCount;
else if (uiData == (uint)EncounterState.InProgress) 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; break;
} }
if (uiData == (uint)EncounterState.Done) return true;
{
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();
}
} }
public override void SetGuidData(uint identifier, ObjectGuid data) public override void SetGuidData(uint identifier, ObjectGuid data)
@@ -270,53 +330,56 @@ namespace Scripts.EasternKingdoms.Karazhan
{ {
switch (go.GetEntry()) switch (go.GetEntry())
{ {
case 183932: case GameObjectIds.StageCurtain:
m_uiCurtainGUID = go.GetGUID(); CurtainGUID = go.GetGUID();
break; break;
case 184278: case GameObjectIds.StageDoorLeft:
m_uiStageDoorLeftGUID = go.GetGUID(); StageDoorLeftGUID = go.GetGUID();
if (m_auiEncounter[4] == (uint)EncounterState.Done) if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
break; break;
case 184279: case GameObjectIds.StageDoorRight:
m_uiStageDoorRightGUID = go.GetGUID(); StageDoorRightGUID = go.GetGUID();
if (m_auiEncounter[4] == (uint)EncounterState.Done) if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
break; break;
case 184517: case GameObjectIds.PrivateLibraryDoor:
m_uiLibraryDoor = go.GetGUID(); LibraryDoor = go.GetGUID();
break; break;
case 185521: case GameObjectIds.MassiveDoor:
m_uiMassiveDoor = go.GetGUID(); MassiveDoor = go.GetGUID();
break; break;
case 184276: case GameObjectIds.GamesmanHallDoor:
m_uiGamesmansDoor = go.GetGUID(); GamesmansDoor = go.GetGUID();
break; break;
case 184277: case GameObjectIds.GamesmanHallExitDoor:
m_uiGamesmansExitDoor = go.GetGUID(); GamesmansExitDoor = go.GetGUID();
break; break;
case 185134: case GameObjectIds.NetherspaceDoor:
m_uiNetherspaceDoor = go.GetGUID(); NetherspaceDoor = go.GetGUID();
break; break;
case 184274: case GameObjectIds.MastersTerraceDoor:
MastersTerraceDoor[0] = go.GetGUID(); MastersTerraceDoor[0] = go.GetGUID();
break; break;
case 184280: case GameObjectIds.MastersTerraceDoor2:
MastersTerraceDoor[1] = go.GetGUID(); MastersTerraceDoor[1] = go.GetGUID();
break; break;
case 184275: case GameObjectIds.SideEntranceDoor:
m_uiSideEntranceDoor = go.GetGUID(); SideEntranceDoor = go.GetGUID();
if (m_auiEncounter[4] == (uint)EncounterState.Done) if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.Locked); go.AddFlag(GameObjectFlags.Locked);
else else
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked); go.RemoveFlag(GameObjectFlags.Locked);
break; break;
case 185119: case GameObjectIds.DustCoveredChest:
DustCoveredChest = go.GetGUID(); DustCoveredChest = go.GetGUID();
break; break;
case GameObjectIds.BlackenedUrn:
BlackenedUrnGUID = go.GetGUID();
break;
} }
switch (m_uiOperaEvent) switch (OperaEvent)
{ {
// @todo Set Object visibilities for Opera based on performance // @todo Set Object visibilities for Opera based on performance
case OperaEvents.Oz: case OperaEvents.Oz:
@@ -330,43 +393,14 @@ namespace Scripts.EasternKingdoms.Karazhan
} }
} }
public override string GetSaveData()
{
return strSaveData;
}
public override uint GetData(uint uiData) public override uint GetData(uint uiData)
{ {
switch (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: case DataTypes.OperaPerformance:
return m_uiOperaEvent; return OperaEvent;
case DataTypes.OperaOzDeathcount: case DataTypes.OperaOzDeathcount:
return m_uiOzDeathCount; return OzDeathCount;
} }
return 0; return 0;
@@ -377,82 +411,64 @@ namespace Scripts.EasternKingdoms.Karazhan
switch (uiData) switch (uiData)
{ {
case DataTypes.Kilrek: case DataTypes.Kilrek:
return m_uiKilrekGUID; return KilrekGUID;
case DataTypes.Terestian: case DataTypes.Terestian:
return m_uiTerestianGUID; return TerestianGUID;
case DataTypes.Moroes: case DataTypes.Moroes:
return m_uiMoroesGUID; return MoroesGUID;
case DataTypes.Nightbane:
return NightbaneGUID;
case DataTypes.GoStagedoorleft: case DataTypes.GoStagedoorleft:
return m_uiStageDoorLeftGUID; return StageDoorLeftGUID;
case DataTypes.GoStagedoorright: case DataTypes.GoStagedoorright:
return m_uiStageDoorRightGUID; return StageDoorRightGUID;
case DataTypes.GoCurtains: case DataTypes.GoCurtains:
return m_uiCurtainGUID; return CurtainGUID;
case DataTypes.GoLibraryDoor: case DataTypes.GoLibraryDoor:
return m_uiLibraryDoor; return LibraryDoor;
case DataTypes.GoMassiveDoor: case DataTypes.GoMassiveDoor:
return m_uiMassiveDoor; return MassiveDoor;
case DataTypes.GoSideEntranceDoor: case DataTypes.GoSideEntranceDoor:
return m_uiSideEntranceDoor; return SideEntranceDoor;
case DataTypes.GoGameDoor: case DataTypes.GoGameDoor:
return m_uiGamesmansDoor; return GamesmansDoor;
case DataTypes.GoGameExitDoor: case DataTypes.GoGameExitDoor:
return m_uiGamesmansExitDoor; return GamesmansExitDoor;
case DataTypes.GoNetherDoor: case DataTypes.GoNetherDoor:
return m_uiNetherspaceDoor; return NetherspaceDoor;
case DataTypes.MastersTerraceDoor1: case DataTypes.MastersTerraceDoor1:
return MastersTerraceDoor[0]; return MastersTerraceDoor[0];
case DataTypes.MastersTerraceDoor2: case DataTypes.MastersTerraceDoor2:
return MastersTerraceDoor[1]; return MastersTerraceDoor[1];
case DataTypes.ImageOfMedivh: case DataTypes.ImageOfMedivh:
return ImageGUID; return ImageGUID;
case DataTypes.GoBlackenedUrn:
return BlackenedUrnGUID;
} }
return ObjectGuid.Empty; return ObjectGuid.Empty;
} }
public override void Load(string str) uint OperaEvent;
{ uint OzDeathCount;
if (string.IsNullOrEmpty(str)) uint OptionalBossCount;
{ ObjectGuid CurtainGUID;
OUT_LOAD_INST_DATA_FAIL(); ObjectGuid StageDoorLeftGUID;
return; ObjectGuid StageDoorRightGUID;
} ObjectGuid KilrekGUID;
ObjectGuid TerestianGUID;
OUT_LOAD_INST_DATA(str); ObjectGuid MoroesGUID;
StringArguments loadStream = new StringArguments(str); ObjectGuid NightbaneGUID;
ObjectGuid LibraryDoor; // Door at Shade of Aran
for (byte i = 0; i < karazhanConst.MaxEncounter; ++i) ObjectGuid MassiveDoor; // Door at Netherspite
{ ObjectGuid SideEntranceDoor; // Side Entrance
var state = (EncounterState)loadStream.NextUInt32(); ObjectGuid GamesmansDoor; // Door before Chess
// Do not load an encounter as "In Progress" - reset it instead. ObjectGuid GamesmansExitDoor; // Door after Chess
m_auiEncounter[i] = (uint)(state == EncounterState.InProgress ? EncounterState.NotStarted : state); ObjectGuid NetherspaceDoor; // Door at Malchezaar
}
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
ObjectGuid[] MastersTerraceDoor = new ObjectGuid[2]; ObjectGuid[] MastersTerraceDoor = new ObjectGuid[2];
ObjectGuid ImageGUID; ObjectGuid ImageGUID;
ObjectGuid DustCoveredChest; ObjectGuid DustCoveredChest;
ObjectGuid BlackenedUrnGUID;
} }
public override InstanceScript GetInstanceScript(InstanceMap map) public override InstanceScript GetInstanceScript(InstanceMap map)
@@ -112,12 +112,12 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
if (me.IsAlive()) if (me.IsAlive())
SpawnAdds(); SpawnAdds();
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.NotStarted); instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
} }
void StartEvent() void StartEvent()
{ {
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.InProgress); instance.SetBossState(DataTypes.Moroes, EncounterState.InProgress);
DoZoneInCombat(); DoZoneInCombat();
} }
@@ -140,7 +140,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
{ {
Talk(TextIds.Death); Talk(TextIds.Death);
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.Done); instance.SetBossState(DataTypes.Moroes, EncounterState.Done);
DeSpawnAdds(); DeSpawnAdds();
@@ -229,7 +229,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (instance.GetData(karazhanConst.BossMoroes) == 0) if (instance.GetData(DataTypes.Moroes) == 0)
{ {
EnterEvadeMode(); EnterEvadeMode();
return; return;
@@ -338,7 +338,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
public override void Reset() public override void Reset()
{ {
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.NotStarted); instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
} }
public void AcquireGUID() public void AcquireGUID()
@@ -371,7 +371,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
{ {
if (instance.GetData(karazhanConst.BossMoroes) == 0) if (instance.GetData(DataTypes.Moroes) == 0)
EnterEvadeMode(); EnterEvadeMode();
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -25,8 +25,7 @@ using System.Collections.Generic;
namespace Scripts.EasternKingdoms.Karazhan.OperaEvent namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
#region Wizard of Oz struct TextIds
struct WizardOfOz
{ {
public const uint SayDorotheeDeath = 0; public const uint SayDorotheeDeath = 0;
public const uint SayDorotheeSummon = 1; public const uint SayDorotheeSummon = 1;
@@ -49,52 +48,70 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public const uint SayCroneAggro = 0; public const uint SayCroneAggro = 0;
public const uint SayCroneDeath = 1; public const uint SayCroneDeath = 1;
public const uint SayCroneSlay = 2; 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) 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) 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 (pCrone)
{ {
if (creature.GetVictim()) if (creature.GetVictim())
@@ -106,17 +123,16 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public bool TitoDied; public bool TitoDied;
public ObjectGuid DorotheeGUID; public ObjectGuid DorotheeGUID;
public uint AggroTimer; public uint AggroTimer;
public InstanceScript instance;
} }
[Script] [Script]
public class boss_dorothee : WizardofOzBase public class boss_dorothee : WizardofOzBase
{ {
public boss_dorothee(Creature creature) : base(creature) public boss_dorothee(Creature creature) : base(creature) { }
{
instance = creature.GetInstanceScript();
}
public override void Reset() public override void Initialize()
{ {
AggroTimer = 500; AggroTimer = 500;
@@ -130,7 +146,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void EnterCombat(Unit who) public override void EnterCombat(Unit who)
{ {
Talk(WizardOfOz.SayDorotheeAggro); Talk(TextIds.SayDorotheeAggro);
} }
public override void JustReachedHome() public override void JustReachedHome()
@@ -140,14 +156,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
Talk(WizardOfOz.SayDorotheeDeath); Talk(TextIds.SayDorotheeDeath);
SummonCroneIfReady(instance, me); SummonCroneIfReady(instance, me);
} }
public override void AttackStart(Unit who) public override void AttackStart(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.AttackStart(who); base.AttackStart(who);
@@ -155,7 +171,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who) public override void MoveInLineOfSight(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.MoveInLineOfSight(who); base.MoveInLineOfSight(who);
@@ -167,7 +183,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
if (AggroTimer <= diff) if (AggroTimer <= diff)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0; AggroTimer = 0;
} }
else AggroTimer -= diff; else AggroTimer -= diff;
@@ -178,14 +194,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (WaterBoltTimer <= diff) if (WaterBoltTimer <= diff)
{ {
DoCast(SelectTarget(SelectAggroTarget.Random, 0), WizardOfOz.SpellWaterbolt); DoCast(SelectTarget(SelectAggroTarget.Random, 0), SpellIds.Waterbolt);
WaterBoltTimer = (uint)(TitoDied ? 1500 : 5000); WaterBoltTimer = (uint)(TitoDied ? 1500 : 5000);
} }
else WaterBoltTimer -= diff; else WaterBoltTimer -= diff;
if (FearTimer <= diff) if (FearTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellScream); DoCastVictim(SpellIds.Scream);
FearTimer = 30000; FearTimer = 30000;
} }
else FearTimer -= diff; else FearTimer -= diff;
@@ -202,10 +218,10 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
void SummonTito() 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) if (pTito)
{ {
Talk(WizardOfOz.SayDorotheeSummon); Talk(TextIds.SayDorotheeSummon);
DorotheeGUID = me.GetGUID(); DorotheeGUID = me.GetGUID();
pTito.GetAI().AttackStart(me.GetVictim()); pTito.GetAI().AttackStart(me.GetVictim());
SummonedTito = true; SummonedTito = true;
@@ -213,8 +229,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
} }
} }
InstanceScript instance;
uint WaterBoltTimer; uint WaterBoltTimer;
uint FearTimer; uint FearTimer;
uint SummonTitoTimer; uint SummonTitoTimer;
@@ -225,9 +239,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
[Script] [Script]
public class npc_tito : WizardofOzBase 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(); DorotheeGUID.Clear();
YipTimer = 10000; YipTimer = 10000;
@@ -243,7 +260,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (Dorothee && Dorothee.IsAlive()) if (Dorothee && Dorothee.IsAlive())
{ {
TitoDied = true; TitoDied = true;
Talk(WizardOfOz.SayDorotheeTitoDeath, Dorothee); Talk(TextIds.SayDorotheeTitoDeath, Dorothee);
} }
} }
} }
@@ -255,7 +272,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (YipTimer <= diff) if (YipTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellYipping); DoCastVictim(SpellIds.Yipping);
YipTimer = 10000; YipTimer = 10000;
} }
else YipTimer -= diff; else YipTimer -= diff;
@@ -271,10 +288,11 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
public boss_strawman(Creature creature) : base(creature) public boss_strawman(Creature creature) : base(creature)
{ {
Initialize();
instance = creature.GetInstanceScript(); instance = creature.GetInstanceScript();
} }
public override void Reset() public override void Initialize()
{ {
AggroTimer = 13000; AggroTimer = 13000;
BrainBashTimer = 5000; BrainBashTimer = 5000;
@@ -283,7 +301,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void AttackStart(Unit who) public override void AttackStart(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.AttackStart(who); base.AttackStart(who);
@@ -291,7 +309,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who) public override void MoveInLineOfSight(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.MoveInLineOfSight(who); base.MoveInLineOfSight(who);
@@ -299,27 +317,27 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void EnterCombat(Unit who) public override void EnterCombat(Unit who)
{ {
Talk(WizardOfOz.SayStrawmanAggro); Talk(TextIds.SayStrawmanAggro);
} }
public override void SpellHit(Unit caster, SpellInfo Spell) public override void SpellHit(Unit caster, SpellInfo Spell)
{ {
if ((Spell.SchoolMask == SpellSchoolMask.Fire) && ((RandomHelper.randChance() % 10) == 0)) 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) public override void JustDied(Unit killer)
{ {
Talk(WizardOfOz.SayStrawmanDeath); Talk(TextIds.SayStrawmanDeath);
SummonCroneIfReady(instance, me); SummonCroneIfReady(instance, me);
} }
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
{ {
Talk(WizardOfOz.SayStrawmanSlay); Talk(TextIds.SayStrawmanSlay);
} }
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
@@ -328,7 +346,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
if (AggroTimer <= diff) if (AggroTimer <= diff)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0; AggroTimer = 0;
} }
else AggroTimer -= diff; else AggroTimer -= diff;
@@ -339,7 +357,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (BrainBashTimer <= diff) if (BrainBashTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellBrainBash); DoCastVictim(SpellIds.BrainBash);
BrainBashTimer = 15000; BrainBashTimer = 15000;
} }
else BrainBashTimer -= diff; else BrainBashTimer -= diff;
@@ -348,7 +366,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true); Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
if (target) if (target)
DoCast(target, WizardOfOz.SpellBrainWipe); DoCast(target, SpellIds.BrainWipe);
BrainWipeTimer = 20000; BrainWipeTimer = 20000;
} }
else BrainWipeTimer -= diff; else BrainWipeTimer -= diff;
@@ -356,8 +374,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
InstanceScript instance;
uint BrainBashTimer; uint BrainBashTimer;
uint BrainWipeTimer; uint BrainWipeTimer;
} }
@@ -365,12 +381,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
[Script] [Script]
class boss_tinhead : WizardofOzBase class boss_tinhead : WizardofOzBase
{ {
public boss_tinhead(Creature creature) : base(creature) public boss_tinhead(Creature creature) : base(creature) { }
{
instance = creature.GetInstanceScript();
}
public override void Reset() public override void Initialize()
{ {
AggroTimer = 15000; AggroTimer = 15000;
CleaveTimer = 5000; CleaveTimer = 5000;
@@ -381,7 +394,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void EnterCombat(Unit who) public override void EnterCombat(Unit who)
{ {
Talk(WizardOfOz.SayTinheadAggro); Talk(TextIds.SayTinheadAggro);
} }
public override void JustReachedHome() public override void JustReachedHome()
@@ -391,7 +404,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void AttackStart(Unit who) public override void AttackStart(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.AttackStart(who); base.AttackStart(who);
@@ -399,7 +412,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who) public override void MoveInLineOfSight(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.MoveInLineOfSight(who); base.MoveInLineOfSight(who);
@@ -407,14 +420,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
Talk(WizardOfOz.SayTinheadDeath); Talk(TextIds.SayTinheadDeath);
SummonCroneIfReady(instance, me); SummonCroneIfReady(instance, me);
} }
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
{ {
Talk(WizardOfOz.SayTinheadSlay); Talk(TextIds.SayTinheadSlay);
} }
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
@@ -423,7 +436,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
if (AggroTimer <= diff) if (AggroTimer <= diff)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0; AggroTimer = 0;
} }
else AggroTimer -= diff; else AggroTimer -= diff;
@@ -434,7 +447,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (CleaveTimer <= diff) if (CleaveTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellCleave); DoCastVictim(SpellIds.Cleave);
CleaveTimer = 5000; CleaveTimer = 5000;
} }
else CleaveTimer -= diff; else CleaveTimer -= diff;
@@ -444,8 +457,8 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (RustTimer <= diff) if (RustTimer <= diff)
{ {
++RustCount; ++RustCount;
Talk(WizardOfOz.EmoteRust); Talk(TextIds.EmoteRust);
DoCast(me, WizardOfOz.SpellRust); DoCast(me, SpellIds.Rust);
RustTimer = 6000; RustTimer = 6000;
} }
else RustTimer -= diff; else RustTimer -= diff;
@@ -454,8 +467,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
InstanceScript instance;
uint CleaveTimer; uint CleaveTimer;
uint RustTimer; uint RustTimer;
@@ -465,12 +476,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
[Script] [Script]
class boss_roar : WizardofOzBase class boss_roar : WizardofOzBase
{ {
public boss_roar(Creature creature) : base(creature) public boss_roar(Creature creature) : base(creature) { }
{
instance = creature.GetInstanceScript();
}
public override void Reset() public override void Initialize()
{ {
AggroTimer = 20000; AggroTimer = 20000;
MangleTimer = 5000; MangleTimer = 5000;
@@ -478,25 +486,25 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
ScreamTimer = 15000; 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) public override void AttackStart(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.AttackStart(who); base.AttackStart(who);
} }
public override void MoveInLineOfSight(Unit who)
{
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
}
public override void EnterCombat(Unit who) public override void EnterCombat(Unit who)
{ {
Talk(WizardOfOz.SayRoarAggro); Talk(TextIds.SayRoarAggro);
} }
public override void JustReachedHome() public override void JustReachedHome()
@@ -506,14 +514,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
Talk(WizardOfOz.SayRoarDeath); Talk(TextIds.SayRoarDeath);
SummonCroneIfReady(instance, me); SummonCroneIfReady(instance, me);
} }
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
{ {
Talk(WizardOfOz.SayRoarSlay); Talk(TextIds.SayRoarSlay);
} }
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
@@ -522,7 +530,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{ {
if (AggroTimer <= diff) if (AggroTimer <= diff)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0; AggroTimer = 0;
} }
else AggroTimer -= diff; else AggroTimer -= diff;
@@ -533,21 +541,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (MangleTimer <= diff) if (MangleTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellMangle); DoCastVictim(SpellIds.Mangle);
MangleTimer = RandomHelper.URand(5000, 8000); MangleTimer = RandomHelper.URand(5000, 8000);
} }
else MangleTimer -= diff; else MangleTimer -= diff;
if (ShredTimer <= diff) if (ShredTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellShred); DoCastVictim(SpellIds.Shred);
ShredTimer = RandomHelper.URand(10000, 15000); ShredTimer = RandomHelper.URand(10000, 15000);
} }
else ShredTimer -= diff; else ShredTimer -= diff;
if (ScreamTimer <= diff) if (ScreamTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellFrightenedScream); DoCastVictim(SpellIds.FrightenedScream);
ScreamTimer = RandomHelper.URand(20000, 30000); ScreamTimer = RandomHelper.URand(20000, 30000);
} }
else ScreamTimer -= diff; else ScreamTimer -= diff;
@@ -555,8 +563,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
InstanceScript instance;
uint MangleTimer; uint MangleTimer;
uint ShredTimer; uint ShredTimer;
uint ScreamTimer; uint ScreamTimer;
@@ -570,8 +576,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
instance = creature.GetInstanceScript(); instance = creature.GetInstanceScript();
} }
public override void Reset() public override void Initialize()
{ {
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.NonAttackable);
CycloneTimer = 30000; CycloneTimer = 30000;
ChainLightningTimer = 10000; ChainLightningTimer = 10000;
} }
@@ -583,27 +590,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
{ {
Talk(WizardOfOz.SayCroneSlay); Talk(TextIds.SayCroneSlay);
} }
public override void EnterCombat(Unit who) public override void EnterCombat(Unit who)
{ {
Talk(WizardOfOz.SayCroneAggro); Talk(TextIds.SayCroneAggro);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
} }
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
Talk(WizardOfOz.SayCroneDeath); Talk(TextIds.SayCroneDeath);
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done); instance.SetBossState(DataTypes.OperaPerformance, 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);
} }
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
@@ -611,21 +612,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
if (CycloneTimer <= diff) 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) if (Cyclone)
Cyclone.CastSpell(Cyclone, WizardOfOz.SpellCycloneVisual, true); Cyclone.CastSpell(Cyclone, SpellIds.CycloneVisual, true);
CycloneTimer = 30000; CycloneTimer = 30000;
} }
else CycloneTimer -= diff; else CycloneTimer -= diff;
if (ChainLightningTimer <= diff) if (ChainLightningTimer <= diff)
{ {
DoCastVictim(WizardOfOz.SpellChainLightning); DoCastVictim(SpellIds.ChainLightning);
ChainLightningTimer = 15000; ChainLightningTimer = 15000;
} }
else ChainLightningTimer -= diff; else ChainLightningTimer -= diff;
@@ -633,8 +634,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
InstanceScript instance;
uint CycloneTimer; uint CycloneTimer;
uint ChainLightningTimer; uint ChainLightningTimer;
} }
@@ -655,8 +654,8 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
{ {
if (!me.HasAura(WizardOfOz.SpellKnockback)) if (!me.HasAura(SpellIds.Knockback))
DoCast(me, WizardOfOz.SpellKnockback, true); DoCast(me, SpellIds.Knockback, true);
if (MoveTimer <= diff) if (MoveTimer <= diff)
{ {
@@ -746,14 +745,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
DoPlaySoundToSet(me, RedRidingHood.SoundWolfDeath); DoPlaySoundToSet(me, RedRidingHood.SoundWolfDeath);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
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);
} }
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
@@ -884,7 +876,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who) public override void MoveInLineOfSight(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.MoveInLineOfSight(who); base.MoveInLineOfSight(who);
@@ -895,7 +887,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
me.InterruptNonMeleeSpells(true); me.InterruptNonMeleeSpells(true);
me.RemoveAllAuras(); me.RemoveAllAuras();
me.SetHealth(0); me.SetHealth(0);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
me.GetMotionMaster().MovementExpired(false); me.GetMotionMaster().MovementExpired(false);
me.GetMotionMaster().MoveIdle(); me.GetMotionMaster().MoveIdle();
me.SetStandState(UnitStandStateType.Dead); me.SetStandState(UnitStandStateType.Dead);
@@ -903,7 +895,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public void Resurrect(Creature target) public void Resurrect(Creature target)
{ {
target.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); target.RemoveUnitFlag(UnitFlags.NotSelectable);
target.SetFullHealth(); target.SetFullHealth();
target.SetStandState(UnitStandStateType.Stand); target.SetStandState(UnitStandStateType.Stand);
target.CastSpell(target, JulianneRomulo.SpellResVisual, true); target.CastSpell(target, JulianneRomulo.SpellResVisual, true);
@@ -972,7 +964,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void AttackStart(Unit who) public override void AttackStart(Unit who)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
return; return;
base.AttackStart(who); base.AttackStart(who);
@@ -1026,12 +1018,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
Romulo = ObjectAccessor.GetCreature(me, RomuloGUID); Romulo = ObjectAccessor.GetCreature(me, RomuloGUID);
if (Romulo) if (Romulo)
{ {
Romulo.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); Romulo.RemoveUnitFlag(UnitFlags.NotSelectable);
Romulo.GetMotionMaster().Clear(); Romulo.GetMotionMaster().Clear();
Romulo.setDeathState(DeathState.JustDied); Romulo.setDeathState(DeathState.JustDied);
Romulo.CombatStop(true); Romulo.CombatStop(true);
Romulo.DeleteThreatList(); Romulo.DeleteThreatList();
Romulo.SetUInt32Value(ObjectFields.DynamicFlags, (uint)UnitDynFlags.Lootable); Romulo.SetDynamicFlags(UnitDynFlags.Lootable);
} }
return; return;
@@ -1055,14 +1047,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
Talk(JulianneRomulo.SayJulianneDeath02); Talk(JulianneRomulo.SayJulianneDeath02);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
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);
} }
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
@@ -1087,7 +1072,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (AggroYellTimer <= diff) if (AggroYellTimer <= diff)
{ {
Talk(JulianneRomulo.SayJulianneAggro); Talk(JulianneRomulo.SayJulianneAggro);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
me.SetFaction(16); me.SetFaction(16);
AggroYellTimer = 0; AggroYellTimer = 0;
} }
@@ -1271,12 +1256,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
Julianne = ObjectAccessor.GetCreature(me, JulianneGUID); Julianne = ObjectAccessor.GetCreature(me, JulianneGUID);
if (Julianne) if (Julianne)
{ {
Julianne.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); Julianne.RemoveUnitFlag(UnitFlags.NotSelectable);
Julianne.GetMotionMaster().Clear(); Julianne.GetMotionMaster().Clear();
Julianne.setDeathState(DeathState.JustDied); Julianne.setDeathState(DeathState.JustDied);
Julianne.CombatStop(true); Julianne.CombatStop(true);
Julianne.DeleteThreatList(); Julianne.DeleteThreatList();
Julianne.SetUInt32Value(ObjectFields.DynamicFlags, (uint)UnitDynFlags.Lootable); Julianne.SetDynamicFlags(UnitDynFlags.Lootable);
} }
return; return;
} }
@@ -1313,14 +1298,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer) public override void JustDied(Unit killer)
{ {
Talk(JulianneRomulo.SayRomuloDeath); Talk(JulianneRomulo.SayRomuloDeath);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
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);
} }
public override void KilledUnit(Unit victim) public override void KilledUnit(Unit victim)
@@ -1428,7 +1406,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public void StartEvent() 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 //resets count for this event, in case earlier failed
if (m_uiEventId == OperaEvents.Oz) 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); Creature spotlight = me.SummonCreature(karazhanConst.NpcSpotlight, me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), 0.0f, TempSummonType.TimedOrDeadDespawn, 60000);
if (spotlight) if (spotlight)
{ {
spotlight.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); spotlight.AddUnitFlag(UnitFlags.NotSelectable);
spotlight.CastSpell(spotlight, karazhanConst.SpellSpotlight, false); spotlight.CastSpell(spotlight, karazhanConst.SpellSpotlight, false);
m_uiSpotlightGUID = spotlight.GetGUID(); 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); Creature creature = me.SummonCreature(entry, PosX, karazhanConst.SPAWN_Y, karazhanConst.SPAWN_Z, karazhanConst.SPAWN_O, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
if (creature) if (creature)
{ creature.AddUnitFlag(UnitFlags.NonAttackable);
// In case database has bad flags
creature.SetUInt32Value(UnitFields.Flags, 0);
creature.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
}
} }
RaidWiped = false; RaidWiped = false;
@@ -1654,7 +1628,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (instance != null) if (instance != null)
{ {
// Check for death of Moroes and if opera event is not done already // 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); player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
@@ -153,7 +153,7 @@ namespace Scripts.EasternKingdoms
Initialize(); Initialize();
_events.Reset(); _events.Reset();
me.SetFaction(7); me.SetFaction(7);
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.AddUnitFlag(UnitFlags.ImmuneToPc);
me.SetStandState(UnitStandStateType.Kneel); me.SetStandState(UnitStandStateType.Kneel);
me.LoadEquipment(0, true); me.LoadEquipment(0, true);
} }
@@ -261,7 +261,7 @@ namespace Scripts.EasternKingdoms
else else
{ {
me.SetFaction(14); me.SetFaction(14);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
phase = UnworthyInitiatePhase.Attacking; phase = UnworthyInitiatePhase.Attacking;
Player target = Global.ObjAccessor.GetPlayer(me, playerGUID); Player target = Global.ObjAccessor.GetPlayer(me, playerGUID);
@@ -468,7 +468,7 @@ namespace Scripts.EasternKingdoms
me.RestoreFaction(); me.RestoreFaction();
base.Reset(); base.Reset();
me.SetFlag(UnitFields.Flags, UnitFlags.Unk15); me.AddUnitFlag(UnitFlags.Unk15);
} }
public override void SpellHit(Unit pCaster, SpellInfo pSpell) public override void SpellHit(Unit pCaster, SpellInfo pSpell)
@@ -569,8 +569,8 @@ namespace Scripts.EasternKingdoms
return true; return true;
} }
creature.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); creature.RemoveUnitFlag(UnitFlags.ImmuneToPc);
creature.RemoveFlag(UnitFields.Flags, UnitFlags.Unk15); creature.RemoveUnitFlag(UnitFlags.Unk15);
player.CastSpell(creature, SpellIds.Duel, false); player.CastSpell(creature, SpellIds.Duel, false);
player.CastSpell(player, SpellIds.DuelFlag, true); player.CastSpell(player, SpellIds.DuelFlag, true);
@@ -703,7 +703,7 @@ namespace Scripts.EasternKingdoms
if (charmer.HasAura(SpellIds.EffectStolenHorse)) if (charmer.HasAura(SpellIds.EffectStolenHorse))
{ {
charmer.RemoveAurasDueToSpell(SpellIds.EffectStolenHorse); charmer.RemoveAurasDueToSpell(SpellIds.EffectStolenHorse);
caster.RemoveFlag(UnitFields.NpcFlags, NPCFlags.SpellClick); caster.RemoveNpcFlag(NPCFlags.SpellClick);
caster.SetFaction(35); caster.SetFaction(35);
DoCast(caster, SpellIds.CallDarkRider, true); DoCast(caster, SpellIds.CallDarkRider, true);
Creature Dark_Rider = me.FindNearestCreature(CreatureIds.DarkRiderOfAcherus, 15); Creature Dark_Rider = me.FindNearestCreature(CreatureIds.DarkRiderOfAcherus, 15);
@@ -765,8 +765,8 @@ namespace Scripts.EasternKingdoms
return; return;
deathcharger.RestoreFaction(); deathcharger.RestoreFaction();
deathcharger.RemoveFlag(UnitFields.NpcFlags, NPCFlags.SpellClick); deathcharger.RemoveNpcFlag(NPCFlags.SpellClick);
deathcharger.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); deathcharger.AddUnitFlag(UnitFlags.NotSelectable);
if (!me.GetVehicle() && deathcharger.IsVehicle() && deathcharger.GetVehicleKit().HasEmptySeat(0)) if (!me.GetVehicle() && deathcharger.IsVehicle() && deathcharger.GetVehicleKit().HasEmptySeat(0))
me.EnterVehicle(deathcharger); me.EnterVehicle(deathcharger);
} }
@@ -779,8 +779,8 @@ namespace Scripts.EasternKingdoms
if (killer.IsTypeId(TypeId.Player) && deathcharger.IsTypeId(TypeId.Unit) && deathcharger.IsVehicle()) if (killer.IsTypeId(TypeId.Player) && deathcharger.IsTypeId(TypeId.Unit) && deathcharger.IsVehicle())
{ {
deathcharger.SetFlag(UnitFields.NpcFlags, NPCFlags.SpellClick); deathcharger.AddNpcFlag(NPCFlags.SpellClick);
deathcharger.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); deathcharger.RemoveUnitFlag(UnitFlags.NotSelectable);
deathcharger.SetFaction(2096); deathcharger.SetFaction(2096);
} }
} }
+2 -2
View File
@@ -147,7 +147,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale
switch (waypointId) switch (waypointId)
{ {
case 0: case 0:
me.SetUInt32Value(UnitFields.Bytes1, 0); me.SetStandState(UnitStandStateType.Stand);
GameObject cage = me.FindNearestGameObject(GameObjectIds.Cage, 20); GameObject cage = me.FindNearestGameObject(GameObjectIds.Cage, 20);
if (cage) if (cage)
cage.SetGoState(GameObjectState.Active); cage.SetGoState(GameObjectState.Active);
@@ -244,7 +244,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale
GameObject go = GetClosestGameObjectWithEntry(me, GameObjectIds.NagaBrazier, SharedConst.InteractionDistance * 2); GameObject go = GetClosestGameObjectWithEntry(me, GameObjectIds.NagaBrazier, SharedConst.InteractionDistance * 2);
if (go) if (go)
{ {
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
SetEscortPaused(true); SetEscortPaused(true);
} }
break; break;
@@ -86,7 +86,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
public override void DamageTaken(Unit pAttacker, ref uint damage) public override void DamageTaken(Unit pAttacker, ref uint damage)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NotSelectable)) if (me.HasUnitFlag(UnitFlags.NotSelectable))
damage = 0; damage = 0;
if ((GetHealthPct(0) >= 66 && GetHealthPct(damage) < 66) || if ((GetHealthPct(0) >= 66 && GetHealthPct(damage) < 66) ||
@@ -110,7 +110,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
// Channel visual // Channel visual
DoCast(me, SpellIds.InsanityVisual, true); DoCast(me, SpellIds.InsanityVisual, true);
// Unattackable // Unattackable
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
me.SetControlled(true, UnitState.Stunned); me.SetControlled(true, UnitState.Stunned);
} }
@@ -167,7 +167,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
// Cleanup // Cleanup
Summons.DespawnAll(); Summons.DespawnAll();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetControlled(false, UnitState.Stunned); me.SetControlled(false, UnitState.Stunned);
} }
@@ -231,7 +231,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
return; return;
insanityHandled = 0; insanityHandled = 0;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetControlled(false, UnitState.Stunned); me.SetControlled(false, UnitState.Stunned);
me.RemoveAurasDueToSpell(SpellIds.InsanityVisual); me.RemoveAurasDueToSpell(SpellIds.InsanityVisual);
} }
@@ -184,7 +184,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.GetMotionMaster().MovePoint(1, Misc.JedogaPosition[1]); me.GetMotionMaster().MovePoint(1, Misc.JedogaPosition[1]);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.RemoveAurasDueToSpell(SpellIds.SphereVisual); me.RemoveAurasDueToSpell(SpellIds.SphereVisual);
@@ -214,7 +214,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
{ {
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, true);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.AttackStop(); me.AttackStop();
me.RemoveAllAuras(); me.RemoveAllAuras();
@@ -350,14 +350,14 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.RemoveAurasDueToSpell(SpellIds.SphereVisual); me.RemoveAurasDueToSpell(SpellIds.SphereVisual);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
} }
else else
{ {
DoCast(me, SpellIds.SphereVisual, false); DoCast(me, SpellIds.SphereVisual, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, true);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
} }
} }
@@ -434,7 +434,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.RemoveAurasDueToSpell(SpellIds.SphereVisual); me.RemoveAurasDueToSpell(SpellIds.SphereVisual);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
float distance = me.GetDistance(Misc.JedogaPosition[1]); float distance = me.GetDistance(Misc.JedogaPosition[1]);
@@ -456,14 +456,14 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.RemoveAurasDueToSpell(SpellIds.SphereVisual); me.RemoveAurasDueToSpell(SpellIds.SphereVisual);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
} }
if (instance.GetBossState(DataTypes.JedogaShadowseeker) == EncounterState.InProgress && !me.HasAura(SpellIds.SphereVisual)) if (instance.GetBossState(DataTypes.JedogaShadowseeker) == EncounterState.InProgress && !me.HasAura(SpellIds.SphereVisual))
{ {
DoCast(me, SpellIds.SphereVisual, false); DoCast(me, SpellIds.SphereVisual, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, true);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true); me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
} }
} }
bCheckTimer = 2 * Time.InMilliseconds; bCheckTimer = 2 * Time.InMilliseconds;
@@ -262,7 +262,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram
void RemovePrison() void RemovePrison()
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.RemoveAurasDueToSpell(SpellIds.BeamVisual); me.RemoveAurasDueToSpell(SpellIds.BeamVisual);
me.SetHomePosition(me.GetPositionX(), me.GetPositionY(), Misc.DataGroundPositionZ, me.GetOrientation()); me.SetHomePosition(me.GetPositionX(), me.GetPositionY(), Misc.DataGroundPositionZ, me.GetOrientation());
DoCast(SpellIds.HoverFall); DoCast(SpellIds.HoverFall);
@@ -373,7 +373,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram
Creature PrinceTaldaram = ObjectAccessor.GetCreature(go, instance.GetGuidData(DataTypes.PrinceTaldaram)); Creature PrinceTaldaram = ObjectAccessor.GetCreature(go, instance.GetGuidData(DataTypes.PrinceTaldaram));
if (PrinceTaldaram && PrinceTaldaram.IsAlive()) if (PrinceTaldaram && PrinceTaldaram.IsAlive())
{ {
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
switch (go.GetEntry()) switch (go.GetEntry())
@@ -135,19 +135,19 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet
if (SpheresState[0] != 0) if (SpheresState[0] != 0)
{ {
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
} }
else else
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
break; break;
case GameObjectIds.Sphere2: case GameObjectIds.Sphere2:
if (SpheresState[1] != 0) if (SpheresState[1] != 0)
{ {
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
} }
else else
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
break; break;
case GameObjectIds.PrinceTaldaramGate: case GameObjectIds.PrinceTaldaramGate:
AddDoor(go, true); AddDoor(go, true);
@@ -105,7 +105,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak
public override void Reset() public override void Reset()
{ {
base.Reset(); base.Reset();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
instance.DoStopCriteriaTimer(CriteriaTimedTypes.Event, Misc.AchievGottaGoStartEvent); instance.DoStopCriteriaTimer(CriteriaTimedTypes.Event, Misc.AchievGottaGoStartEvent);
_nextSubmerge = 75; _nextSubmerge = 75;
_petCount = 0; _petCount = 0;
@@ -332,7 +332,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak
{ {
me.RemoveAurasDueToSpell(SpellIds.Submerge); me.RemoveAurasDueToSpell(SpellIds.Submerge);
me.RemoveAurasDueToSpell(SpellIds.ImpaleAura); me.RemoveAurasDueToSpell(SpellIds.ImpaleAura);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
DoCastSelf(SpellIds.Emerge); DoCastSelf(SpellIds.Emerge);
_events.SetPhase(Misc.PhaseEmerge); _events.SetPhase(Misc.PhaseEmerge);
_events.ScheduleEvent(EventIds.Pound, TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(18), 0, Misc.PhaseEmerge); _events.ScheduleEvent(EventIds.Pound, TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(18), 0, Misc.PhaseEmerge);
@@ -363,7 +363,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak
{ {
if (spell.Id == SpellIds.Submerge) if (spell.Id == SpellIds.Submerge)
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveAurasDueToSpell(SpellIds.LeechingSwarm); me.RemoveAurasDueToSpell(SpellIds.LeechingSwarm);
DoCastSelf(SpellIds.ImpaleAura, true); DoCastSelf(SpellIds.ImpaleAura, true);
@@ -356,8 +356,8 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Nadronox
public void Initialize() public void Initialize()
{ {
me.SetFloatValue(UnitFields.BoundingRadius, 9.0f); me.SetBoundingRadius(9.0f);
me.SetFloatValue(UnitFields.CombatReach, 9.0f); me.SetCombatReach(9.0f);
_enteredCombat = false; _enteredCombat = false;
_doorsWebbed = false; _doorsWebbed = false;
_lastPlayerCombatState = false; _lastPlayerCombatState = false;
@@ -242,7 +242,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.ImmuneToPc); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.ImmuneToPc);
} }
public abstract void Initialize(); public abstract void Initialize();
@@ -320,7 +320,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (player.IsAlive()) if (player.IsAlive())
{ {
temp.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.ImmuneToPc); temp.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.ImmuneToPc);
temp.SetReactState(ReactStates.Aggressive); temp.SetReactState(ReactStates.Aggressive);
temp.SetInCombatWith(player); temp.SetInCombatWith(player);
player.SetInCombatWith(temp); player.SetInCombatWith(temp);
@@ -155,7 +155,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pAnnouncer) if (pAnnouncer)
{ {
pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f); pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); pAnnouncer.AddNpcFlag(NPCFlags.Gossip);
pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.CHAMPIONS_LOOT_H : GameObjectIds.CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000); pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.CHAMPIONS_LOOT_H : GameObjectIds.CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000);
} }
} }
@@ -169,7 +169,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pBoss) if (pBoss)
{ {
pBoss.GetMotionMaster().MovePoint(0, 746.88f, 618.74f, 411.06f); pBoss.GetMotionMaster().MovePoint(0, 746.88f, 618.74f, 411.06f);
pBoss.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); pBoss.RemoveUnitFlag(UnitFlags.NonAttackable);
pBoss.SetReactState(ReactStates.Aggressive); pBoss.SetReactState(ReactStates.Aggressive);
} }
} }
@@ -181,7 +181,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pAnnouncer) if (pAnnouncer)
{ {
pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f); pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); pAnnouncer.AddNpcFlag(NPCFlags.Gossip);
pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.EADRIC_LOOT_H : GameObjectIds.EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000); pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.EADRIC_LOOT_H : GameObjectIds.EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000);
} }
} }
@@ -193,7 +193,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pAnnouncer) if (pAnnouncer)
{ {
pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f); pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); pAnnouncer.AddNpcFlag(NPCFlags.Gossip);
pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.PALETRESS_LOOT_H : GameObjectIds.PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000); pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.PALETRESS_LOOT_H : GameObjectIds.PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000);
} }
} }
@@ -170,8 +170,8 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
uiTimer = 0; uiTimer = 0;
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.AddNpcFlag(NPCFlags.Gossip);
SetGrandChampionsForEncounter(); SetGrandChampionsForEncounter();
SetArgentChampion(); SetArgentChampion();
@@ -409,7 +409,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
public void StartEncounter() public void StartEncounter()
{ {
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.RemoveNpcFlag(NPCFlags.Gossip);
if (instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.NotStarted) if (instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.NotStarted)
{ {
@@ -444,7 +444,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (player.IsAlive()) if (player.IsAlive())
{ {
temp.SetHomePosition(me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), me.GetOrientation()); temp.SetHomePosition(me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), me.GetOrientation());
temp.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); temp.RemoveUnitFlag(UnitFlags.NonAttackable);
temp.SetReactState(ReactStates.Aggressive); temp.SetReactState(ReactStates.Aggressive);
temp.SetInCombatWith(player); temp.SetInCombatWith(player);
player.SetInCombatWith(temp); player.SetInCombatWith(temp);
@@ -494,7 +494,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
{ {
if (instance.GetData((uint)Data.BOSS_GRAND_CHAMPIONS) == (uint)EncounterState.NotStarted) if (instance.GetData((uint)Data.BOSS_GRAND_CHAMPIONS) == (uint)EncounterState.NotStarted)
{ {
summon.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); summon.AddUnitFlag(UnitFlags.NonAttackable);
summon.SetReactState(ReactStates.Passive); summon.SetReactState(ReactStates.Passive);
} }
} }
@@ -106,7 +106,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
_JustReachedHome(); _JustReachedHome();
instance.SetBossState(DataTypes.BossJaraxxus, EncounterState.Fail); instance.SetBossState(DataTypes.BossJaraxxus, EncounterState.Fail);
DoCast(me, Spells.JaraxxusChains); DoCast(me, Spells.JaraxxusChains);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
} }
public override void KilledUnit(Unit who) public override void KilledUnit(Unit who)
@@ -218,7 +218,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
public override void Reset() public override void Reset()
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetInCombatWithZone(); me.SetInCombatWithZone();
DoCast(Jaraxxus.SpellLegionFlameEffect); DoCast(Jaraxxus.SpellLegionFlameEffect);
} }
@@ -247,9 +247,9 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
if (!IsHeroic()) if (!IsHeroic())
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
else else
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
_summons.DespawnAll(); _summons.DespawnAll();
} }
@@ -332,9 +332,9 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
if (!IsHeroic()) if (!IsHeroic())
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
else else
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
_summons.DespawnAll(); _summons.DespawnAll();
} }
@@ -182,7 +182,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (snobold) if (snobold)
{ {
snobold.ExitVehicle(); snobold.ExitVehicle();
snobold.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); snobold.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
snobold.ToCreature().GetAI().DoAction(Actions.DisableFireBomb); snobold.ToCreature().GetAI().DoAction(Actions.DisableFireBomb);
snobold.CastSpell(me, SpellIds.JumpToHand, true); snobold.CastSpell(me, SpellIds.JumpToHand, true);
break; break;
@@ -209,7 +209,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{ {
case 0: case 0:
instance.DoUseDoorOrButton(instance.GetGuidData(GameObjectIds.MainGateDoor)); instance.DoUseDoorOrButton(instance.GetGuidData(GameObjectIds.MainGateDoor));
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.SetInCombatWithZone(); me.SetInCombatWithZone();
break; break;
@@ -300,7 +300,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
public override void Reset() public override void Reset()
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetInCombatWithZone(); me.SetInCombatWithZone();
_events.ScheduleEvent(Events.CheckMount, TimeSpan.FromSeconds(1)); _events.ScheduleEvent(Events.CheckMount, TimeSpan.FromSeconds(1));
_events.ScheduleEvent(Events.FireBomb, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30)); _events.ScheduleEvent(Events.FireBomb, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(30));
@@ -530,7 +530,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (!Enraged && instance.GetData(DataTypes.NorthrendBeasts) == NorthrendBeasts.SnakesSpecial) if (!Enraged && instance.GetData(DataTypes.NorthrendBeasts) == NorthrendBeasts.SnakesSpecial)
{ {
me.RemoveAurasDueToSpell(SpellIds.Submerge); me.RemoveAurasDueToSpell(SpellIds.Submerge);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
DoCast(SpellIds.Enrage); DoCast(SpellIds.Enrage);
Enraged = true; Enraged = true;
Talk(TextIds.EmoteEnrage); Talk(TextIds.EmoteEnrage);
@@ -567,7 +567,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
Creature acidmaw = me.SummonCreature(CreatureIds.Acidmaw, MiscData.ToCCommonLoc[9].GetPositionX(), MiscData.ToCCommonLoc[9].GetPositionY(), MiscData.ToCCommonLoc[9].GetPositionZ(), 5, TempSummonType.ManualDespawn); Creature acidmaw = me.SummonCreature(CreatureIds.Acidmaw, MiscData.ToCCommonLoc[9].GetPositionX(), MiscData.ToCCommonLoc[9].GetPositionY(), MiscData.ToCCommonLoc[9].GetPositionZ(), 5, TempSummonType.ManualDespawn);
if (acidmaw) if (acidmaw)
{ {
acidmaw.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); acidmaw.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
acidmaw.SetReactState(ReactStates.Aggressive); acidmaw.SetReactState(ReactStates.Aggressive);
acidmaw.SetInCombatWithZone(); acidmaw.SetInCombatWithZone();
acidmaw.CastSpell(acidmaw, SpellIds.Emerge); acidmaw.CastSpell(acidmaw, SpellIds.Emerge);
@@ -603,7 +603,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetInCombatWithZone(); me.SetInCombatWithZone();
_events.SetPhase(Misc.PhaseSubmerged); _events.SetPhase(Misc.PhaseSubmerged);
_events.ScheduleEvent(Events.Emerge, TimeSpan.FromSeconds(5), 0, Misc.PhaseSubmerged); _events.ScheduleEvent(Events.Emerge, TimeSpan.FromSeconds(5), 0, Misc.PhaseSubmerged);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[1].GetPositionX() + RandomHelper.FRand(-40.0f, 40.0f), MiscData.ToCCommonLoc[1].GetPositionY() + RandomHelper.FRand(-40.0f, 40.0f), MiscData.ToCCommonLoc[1].GetPositionZ()); me.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[1].GetPositionX() + RandomHelper.FRand(-40.0f, 40.0f), MiscData.ToCCommonLoc[1].GetPositionY() + RandomHelper.FRand(-40.0f, 40.0f), MiscData.ToCCommonLoc[1].GetPositionZ());
WasMobile = !WasMobile; WasMobile = !WasMobile;
} }
@@ -615,7 +615,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetDisplayId(ModelMobile); me.SetDisplayId(ModelMobile);
me.RemoveAurasDueToSpell(SpellIds.Submerge); me.RemoveAurasDueToSpell(SpellIds.Submerge);
me.RemoveAurasDueToSpell(SpellIds.GroundVisual0); me.RemoveAurasDueToSpell(SpellIds.GroundVisual0);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
// if the worm was mobile before submerging, make him stationary now // if the worm was mobile before submerging, make him stationary now
if (WasMobile) if (WasMobile)
@@ -710,7 +710,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{ {
case 0: case 0:
instance.DoUseDoorOrButton(instance.GetGuidData(GameObjectIds.MainGateDoor)); instance.DoUseDoorOrButton(instance.GetGuidData(GameObjectIds.MainGateDoor));
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.SetInCombatWithZone(); me.SetInCombatWithZone();
break; break;
@@ -840,7 +840,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
break; break;
case 2: case 2:
instance.DoUseDoorOrButton(instance.GetGuidData(GameObjectIds.MainGateDoor)); instance.DoUseDoorOrButton(instance.GetGuidData(GameObjectIds.MainGateDoor));
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.SetInCombatWithZone(); me.SetInCombatWithZone();
break; break;
@@ -944,7 +944,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetTarget(_trampleTargetGUID); me.SetTarget(_trampleTargetGUID);
_trampleCast = false; _trampleCast = false;
SetCombatMovement(false); SetCombatMovement(false);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
me.SetControlled(true, UnitState.Root); me.SetControlled(true, UnitState.Root);
me.GetMotionMaster().Clear(); me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveIdle(); me.GetMotionMaster().MoveIdle();
@@ -1033,7 +1033,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
Talk(TextIds.EmoteTrampleFail); Talk(TextIds.EmoteTrampleFail);
} }
_movementStarted = false; _movementStarted = false;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
SetCombatMovement(true); SetCombatMovement(true);
me.GetMotionMaster().MovementExpired(); me.GetMotionMaster().MovementExpired();
me.GetMotionMaster().Clear(); me.GetMotionMaster().Clear();
@@ -254,7 +254,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
GameObject cache = instance.GetGameObject(CrusadersCacheGUID); GameObject cache = instance.GetGameObject(CrusadersCacheGUID);
if (cache) if (cache)
cache.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); cache.RemoveFlag(GameObjectFlags.NotSelectable);
EventStage = 3100; EventStage = 3100;
break; break;
default: default:
@@ -398,7 +398,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{ {
Unit announcer = instance.GetCreature(GetGuidData(CreatureIds.Barrent)); Unit announcer = instance.GetCreature(GetGuidData(CreatureIds.Barrent));
if (announcer) if (announcer)
announcer.SetFlag64(UnitFields.NpcFlags, NPCFlags.Gossip); announcer.AddNpcFlag(NPCFlags.Gossip);
Save(); Save();
} }
} }
@@ -783,14 +783,14 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
public override void Reset() public override void Reset()
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
Creature pAlly = GetClosestCreatureWithEntry(me, CreatureIds.Thrall, 300.0f); Creature pAlly = GetClosestCreatureWithEntry(me, CreatureIds.Thrall, 300.0f);
if (pAlly) if (pAlly)
pAlly.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); pAlly.AddUnitFlag(UnitFlags.NonAttackable);
pAlly = GetClosestCreatureWithEntry(me, CreatureIds.Proudmoore, 300.0f); pAlly = GetClosestCreatureWithEntry(me, CreatureIds.Proudmoore, 300.0f);
if (pAlly) if (pAlly)
pAlly.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); pAlly.AddUnitFlag(UnitFlags.NonAttackable);
} }
public override void AttackStart(Unit who) { } public override void AttackStart(Unit who) { }
@@ -846,7 +846,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (jaraxxus) if (jaraxxus)
{ {
jaraxxus.RemoveAurasDueToSpell(Spells.JaraxxusChains); jaraxxus.RemoveAurasDueToSpell(Spells.JaraxxusChains);
jaraxxus.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); jaraxxus.RemoveUnitFlag(UnitFlags.NonAttackable);
jaraxxus.SetReactState(ReactStates.Defensive); jaraxxus.SetReactState(ReactStates.Defensive);
jaraxxus.SetInCombatWithZone(); jaraxxus.SetInCombatWithZone();
} }
@@ -887,7 +887,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (creature.IsVisible()) if (creature.IsVisible())
creature.SetVisible(false); creature.SetVisible(false);
} }
creature.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.Gossip); creature.RemoveNpcFlag(NPCFlags.Gossip);
return true; return true;
} }
@@ -959,12 +959,12 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
break; break;
case 5030: case 5030:
Talk(Texts.Stage_4_04); Talk(Texts.Stage_4_04);
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.StateTalk); me.SetEmoteState(Emote.StateTalk);
_updateTimer = 10 * Time.InMilliseconds; _updateTimer = 10 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 5040); _instance.SetData(DataTypes.Event, 5040);
break; break;
case 5040: case 5040:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone); me.SetEmoteState(Emote.OneshotNone);
me.GetMotionMaster().MovePoint(1, MiscData.LichKingLoc[1]); me.GetMotionMaster().MovePoint(1, MiscData.LichKingLoc[1]);
_updateTimer = 1 * Time.InMilliseconds; _updateTimer = 1 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 0); _instance.SetData(DataTypes.Event, 0);
@@ -991,7 +991,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (go) if (go)
{ {
go.SetDisplayId(MiscData.DisplayIdDestroyedFloor); go.SetDisplayId(MiscData.DisplayIdDestroyedFloor);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.Damaged | GameObjectFlags.NoDespawn); go.AddFlag(GameObjectFlags.Damaged | GameObjectFlags.NoDespawn);
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
} }
@@ -1039,7 +1039,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
Creature temp = ObjectAccessor.GetCreature(me, _instance.GetGuidData(CreatureIds.Jaraxxus)); Creature temp = ObjectAccessor.GetCreature(me, _instance.GetGuidData(CreatureIds.Jaraxxus));
if (temp) if (temp)
{ {
temp.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); temp.RemoveUnitFlag(UnitFlags.NonAttackable);
temp.SetReactState(ReactStates.Aggressive); temp.SetReactState(ReactStates.Aggressive);
temp.SetInCombatWithZone(); temp.SetInCombatWithZone();
} }
@@ -1144,7 +1144,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
Creature temp = me.SummonCreature(CreatureIds.Jaraxxus, MiscData.ToCCommonLoc[1].GetPositionX(), MiscData.ToCCommonLoc[1].GetPositionY(), MiscData.ToCCommonLoc[1].GetPositionZ(), 5.0f, TempSummonType.CorpseTimedDespawn, MiscData.DespawnTime); Creature temp = me.SummonCreature(CreatureIds.Jaraxxus, MiscData.ToCCommonLoc[1].GetPositionX(), MiscData.ToCCommonLoc[1].GetPositionY(), MiscData.ToCCommonLoc[1].GetPositionZ(), 5.0f, TempSummonType.CorpseTimedDespawn, MiscData.DespawnTime);
if (temp) if (temp)
{ {
temp.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); temp.AddUnitFlag(UnitFlags.NonAttackable);
temp.SetReactState(ReactStates.Passive); temp.SetReactState(ReactStates.Passive);
temp.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[1].GetPositionX(), MiscData.ToCCommonLoc[1].GetPositionY() - 10, MiscData.ToCCommonLoc[1].GetPositionZ()); temp.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[1].GetPositionX(), MiscData.ToCCommonLoc[1].GetPositionY() - 10, MiscData.ToCCommonLoc[1].GetPositionZ());
} }
@@ -1233,20 +1233,20 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
switch (_instance.GetData(DataTypes.Event)) switch (_instance.GetData(DataTypes.Event))
{ {
case 110: case 110:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk); me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_01); Talk(Texts.Stage_0_01);
_updateTimer = 22 * Time.InMilliseconds; _updateTimer = 22 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 120); _instance.SetData(DataTypes.Event, 120);
break; break;
case 140: case 140:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk); me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_02); Talk(Texts.Stage_0_02);
_updateTimer = 5 * Time.InMilliseconds; _updateTimer = 5 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 150); _instance.SetData(DataTypes.Event, 150);
break; break;
case 150: case 150:
{ {
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone); me.SetEmoteState(Emote.OneshotNone);
if (_instance.GetBossState(DataTypes.BossBeasts) != EncounterState.Done) if (_instance.GetBossState(DataTypes.BossBeasts) != EncounterState.Done)
{ {
_instance.DoUseDoorOrButton(_instance.GetGuidData(GameObjectIds.MainGateDoor)); _instance.DoUseDoorOrButton(_instance.GetGuidData(GameObjectIds.MainGateDoor));
@@ -1255,7 +1255,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (temp) if (temp)
{ {
temp.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[5].GetPositionX(), MiscData.ToCCommonLoc[5].GetPositionY(), MiscData.ToCCommonLoc[5].GetPositionZ()); temp.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[5].GetPositionX(), MiscData.ToCCommonLoc[5].GetPositionY(), MiscData.ToCCommonLoc[5].GetPositionZ());
temp.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); temp.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
temp.SetReactState(ReactStates.Passive); temp.SetReactState(ReactStates.Passive);
} }
} }
@@ -1279,7 +1279,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (temp) if (temp)
{ {
temp.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[5].GetPositionX(), MiscData.ToCCommonLoc[5].GetPositionY(), MiscData.ToCCommonLoc[5].GetPositionZ()); temp.GetMotionMaster().MovePoint(0, MiscData.ToCCommonLoc[5].GetPositionX(), MiscData.ToCCommonLoc[5].GetPositionY(), MiscData.ToCCommonLoc[5].GetPositionZ());
temp.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); temp.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
temp.SetReactState(ReactStates.Passive); temp.SetReactState(ReactStates.Passive);
} }
} }
@@ -1300,7 +1300,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (temp) if (temp)
{ {
temp.GetMotionMaster().MovePoint(2, MiscData.ToCCommonLoc[5].GetPositionX(), MiscData.ToCCommonLoc[5].GetPositionY(), MiscData.ToCCommonLoc[5].GetPositionZ()); temp.GetMotionMaster().MovePoint(2, MiscData.ToCCommonLoc[5].GetPositionX(), MiscData.ToCCommonLoc[5].GetPositionY(), MiscData.ToCCommonLoc[5].GetPositionZ());
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
} }
} }
@@ -1543,13 +1543,13 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
switch (_instance.GetData(DataTypes.Event)) switch (_instance.GetData(DataTypes.Event))
{ {
case 130: case 130:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk); me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_03h); Talk(Texts.Stage_0_03h);
_updateTimer = 3 * Time.InMilliseconds; _updateTimer = 3 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 132); _instance.SetData(DataTypes.Event, 132);
break; break;
case 132: case 132:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone); me.SetEmoteState(Emote.OneshotNone);
_updateTimer = 5 * Time.InMilliseconds; _updateTimer = 5 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 140); _instance.SetData(DataTypes.Event, 140);
break; break;
@@ -1617,13 +1617,13 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
switch (_instance.GetData(DataTypes.Event)) switch (_instance.GetData(DataTypes.Event))
{ {
case 120: case 120:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk); me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_03a); Talk(Texts.Stage_0_03a);
_updateTimer = 2 * Time.InMilliseconds; _updateTimer = 2 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 122); _instance.SetData(DataTypes.Event, 122);
break; break;
case 122: case 122:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone); me.SetEmoteState(Emote.OneshotNone);
_updateTimer = 3 * Time.InMilliseconds; _updateTimer = 3 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 130); _instance.SetData(DataTypes.Event, 130);
break; break;
+1 -1
View File
@@ -59,7 +59,7 @@ namespace Scripts.Northrend
{ {
public npc_mageguard_dalaran(Creature creature) : base(creature) public npc_mageguard_dalaran(Creature creature) : base(creature)
{ {
creature.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); creature.AddUnitFlag(UnitFlags.NonAttackable);
creature.ApplySpellImmune(0, SpellImmunity.Damage, (uint)SpellSchools.Normal, true); creature.ApplySpellImmune(0, SpellImmunity.Damage, (uint)SpellSchools.Normal, true);
creature.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true); creature.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, true);
} }
@@ -30,7 +30,7 @@ namespace Scripts.Northrend.DraktharonKeep.KingDred
public const uint GrievousBite = 48920; public const uint GrievousBite = 48920;
public const uint ManglingSlash = 48873; // Cast On The Current Tank; Adds Debuf public const uint ManglingSlash = 48873; // Cast On The Current Tank; Adds Debuf
public const uint FearsomeRoar = 48849; public const uint FearsomeRoar = 48849;
public const uint PiercingSlash = 48878; // Debuff --> Armor Reduced By 75% public const uint PiercingSlash = 48878; // Debuff -. Armor Reduced By 75%
public const uint RaptorCall = 59416; // Dummy public const uint RaptorCall = 59416; // Dummy
public const uint GutRip = 49710; public const uint GutRip = 49710;
public const uint Rend = 13738; public const uint Rend = 13738;
@@ -229,15 +229,15 @@ namespace Scripts.Northrend.DraktharonKeep.Novos
_bubbled = state; _bubbled = state;
if (!state) if (!state)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (me.HasUnitFlag(UnitFlags.NonAttackable))
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
if (me.HasUnitState(UnitState.Casting)) if (me.HasUnitState(UnitState.Casting))
me.CastStop(); me.CastStop();
} }
else else
{ {
if (!me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable)) if (!me.HasUnitFlag(UnitFlags.NonAttackable))
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
DoCast(SpellIds.ArcaneField); DoCast(SpellIds.ArcaneField);
} }
} }
@@ -182,7 +182,7 @@ namespace Scripts.Northrend.DraktharonKeep.Trollgore
if (type == MovementGeneratorType.Point && pointId == Misc.PointLanding) if (type == MovementGeneratorType.Point && pointId == Misc.PointLanding)
{ {
me.Dismount(); me.Dismount();
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
DoCastAOE(SpellIds.InvaderTaunt); DoCastAOE(SpellIds.InvaderTaunt);
} }
} }
@@ -206,7 +206,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
public npc_sylvanas_fos(Creature creature) : base(creature) public npc_sylvanas_fos(Creature creature) : base(creature)
{ {
Initialize(); Initialize();
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.AddNpcFlag(NPCFlags.Gossip);
} }
void Initialize() void Initialize()
@@ -226,7 +226,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
{ {
player.CLOSE_GOSSIP_MENU(); player.CLOSE_GOSSIP_MENU();
phase = Phase.Intro; phase = Phase.Intro;
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.RemoveNpcFlag(NPCFlags.Gossip);
_events.Reset(); _events.Reset();
_events.ScheduleEvent(EventIds.Intro1, 1000); _events.ScheduleEvent(EventIds.Intro1, 1000);
@@ -290,7 +290,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
public npc_jaina_fos(Creature creature) : base(creature) public npc_jaina_fos(Creature creature) : base(creature)
{ {
Initialize(); Initialize();
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.AddNpcFlag(NPCFlags.Gossip);
} }
void Initialize() void Initialize()
@@ -310,7 +310,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
{ {
player.CLOSE_GOSSIP_MENU(); player.CLOSE_GOSSIP_MENU();
phase = Phase.Intro; phase = Phase.Intro;
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.RemoveNpcFlag(NPCFlags.Gossip);
_events.Reset(); _events.Reset();
_events.ScheduleEvent(EventIds.Intro1, 1000); _events.ScheduleEvent(EventIds.Intro1, 1000);
} }
@@ -299,7 +299,7 @@ namespace Scripts.Northrend.FrozenHalls.PitOfSaron.BossKrickAndIck
Initialize(); Initialize();
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
} }
Creature GetIck() Creature GetIck()
@@ -87,7 +87,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
if (GetData(Misc.DataIntroDone) != 0) if (GetData(Misc.DataIntroDone) != 0)
{ {
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveAura(SpellIds.FreezeAnim); me.RemoveAura(SpellIds.FreezeAnim);
} }
@@ -125,7 +125,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
me.GetMotionMaster().MoveIdle(); me.GetMotionMaster().MoveIdle();
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.AddUnitFlag(UnitFlags.ImmuneToPc);
DoCast(me, SpellIds.FreezeAnim); DoCast(me, SpellIds.FreezeAnim);
break; break;
case Misc.ActionUnfreezeColossus: case Misc.ActionUnfreezeColossus:
@@ -133,7 +133,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
return; return;
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveAura(SpellIds.FreezeAnim); me.RemoveAura(SpellIds.FreezeAnim);
me.SetInCombatWithZone(); me.SetInCombatWithZone();
@@ -146,7 +146,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
public override void DamageTaken(Unit attacker, ref uint damage) public override void DamageTaken(Unit attacker, ref uint damage)
{ {
if (me.HasFlag(UnitFields.Flags, UnitFlags.ImmuneToPc)) if (me.HasUnitFlag(UnitFlags.ImmuneToPc))
damage = 0; damage = 0;
if (phase == Misc.ColossusPhaseNormal || if (phase == Misc.ColossusPhaseNormal ||
+1 -1
View File
@@ -33,7 +33,7 @@ namespace Scripts.Northrend.Gundrak.EckTheFerocious
public const uint Berserk = 55816; // Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%. public const uint Berserk = 55816; // Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
public const uint Bite = 55813; // Eck bites down hard, inflicting 150% of his normal damage to an enemy. public const uint Bite = 55813; // Eck bites down hard, inflicting 150% of his normal damage to an enemy.
public const uint Spit = 55814; // Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec. public const uint Spit = 55814; // Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec.
public const uint Spring1 = 55815; // Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back. public const uint Spring1 = 55815; // Eck leaps at a distant target. -. Drops aggro and charges a random player. Tank can simply taunt him back.
public const uint Spring2 = 55837; // Eck leaps at a distant target. public const uint Spring2 = 55837; // Eck leaps at a distant target.
} }
@@ -163,7 +163,7 @@ namespace Scripts.Northrend.Gundrak
if (GetBossState(GDDataTypes.SladRan) == EncounterState.Done) if (GetBossState(GDDataTypes.SladRan) == EncounterState.Done)
{ {
if (SladRanStatueState == GameObjectState.Active) if (SladRanStatueState == GameObjectState.Active)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
else else
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
} }
@@ -172,7 +172,7 @@ namespace Scripts.Northrend.Gundrak
if (GetBossState(GDDataTypes.Moorabi) == EncounterState.Done) if (GetBossState(GDDataTypes.Moorabi) == EncounterState.Done)
{ {
if (MoorabiStatueState == GameObjectState.Active) if (MoorabiStatueState == GameObjectState.Active)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
else else
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
} }
@@ -181,7 +181,7 @@ namespace Scripts.Northrend.Gundrak
if (GetBossState(GDDataTypes.DrakkariColossus) == EncounterState.Done) if (GetBossState(GDDataTypes.DrakkariColossus) == EncounterState.Done)
{ {
if (DrakkariColossusStatueState == GameObjectState.Active) if (DrakkariColossusStatueState == GameObjectState.Active)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
else else
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
} }
@@ -239,7 +239,7 @@ namespace Scripts.Northrend.Gundrak
{ {
GameObject go = GetGameObject(GDDataTypes.SladRanAltar); GameObject go = GetGameObject(GDDataTypes.SladRanAltar);
if (go) if (go)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
} }
break; break;
case GDDataTypes.DrakkariColossus: case GDDataTypes.DrakkariColossus:
@@ -247,7 +247,7 @@ namespace Scripts.Northrend.Gundrak
{ {
GameObject go = GetGameObject(GDDataTypes.DrakkariColossusAltar); GameObject go = GetGameObject(GDDataTypes.DrakkariColossusAltar);
if (go) if (go)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
} }
break; break;
case GDDataTypes.Moorabi: case GDDataTypes.Moorabi:
@@ -255,7 +255,7 @@ namespace Scripts.Northrend.Gundrak
{ {
GameObject go = GetGameObject(GDDataTypes.MoorabiAltar); GameObject go = GetGameObject(GDDataTypes.MoorabiAltar);
if (go) if (go)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
} }
break; break;
default: default:
@@ -423,7 +423,7 @@ namespace Scripts.Northrend.Gundrak
public override bool OnGossipHello(Player player, GameObject go) public override bool OnGossipHello(Player player, GameObject go)
{ {
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
InstanceScript instance = go.GetInstanceScript(); InstanceScript instance = go.GetInstanceScript();
@@ -957,7 +957,7 @@ namespace Scripts.Northrend.IcecrownCitadel
public override void sGossipSelect(Player player, uint menuId, uint gossipListId) public override void sGossipSelect(Player player, uint menuId, uint gossipListId)
{ {
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.Gossip); me.RemoveNpcFlag(NPCFlags.Gossip);
me.GetTransport().EnableMovement(true); me.GetTransport().EnableMovement(true);
_events.SetPhase(GunshipMiscData.PhaseIntro); _events.SetPhase(GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroH1, 5000, 0, GunshipMiscData.PhaseIntro); _events.ScheduleEvent(GunshipEvents.IntroH1, 5000, 0, GunshipMiscData.PhaseIntro);
@@ -1202,7 +1202,7 @@ namespace Scripts.Northrend.IcecrownCitadel
public override void sGossipSelect(Player player, uint menuId, uint gossipListId) public override void sGossipSelect(Player player, uint menuId, uint gossipListId)
{ {
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.Gossip); me.RemoveNpcFlag(NPCFlags.Gossip);
me.GetTransport().EnableMovement(true); me.GetTransport().EnableMovement(true);
_events.SetPhase(GunshipMiscData.PhaseIntro); _events.SetPhase(GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroA1, 5000); _events.ScheduleEvent(GunshipEvents.IntroA1, 5000);
@@ -502,6 +502,7 @@ namespace Scripts.Northrend.IcecrownCitadel
Creature crok = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.CrokScourgebane)); Creature crok = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.CrokScourgebane));
if (crok) if (crok)
crok.GetAI().Talk(Texts.SayCrokCombatSvalna); crok.GetAI().Talk(Texts.SayCrokCombatSvalna);
DoCastSelf(InstanceSpells.DivineSurge, true);
_events.ScheduleEvent(EventTypes.SvalnaCombat, 9000); _events.ScheduleEvent(EventTypes.SvalnaCombat, 9000);
_events.ScheduleEvent(EventTypes.ImpalingSpear, RandomHelper.URand(40000, 50000)); _events.ScheduleEvent(EventTypes.ImpalingSpear, RandomHelper.URand(40000, 50000));
_events.ScheduleEvent(EventTypes.AetherShield, RandomHelper.URand(100000, 110000)); _events.ScheduleEvent(EventTypes.AetherShield, RandomHelper.URand(100000, 110000));
@@ -550,7 +551,7 @@ namespace Scripts.Northrend.IcecrownCitadel
case Actions.StartGauntlet: case Actions.StartGauntlet:
me.setActive(true); me.setActive(true);
_isEventInProgress = true; _isEventInProgress = true;
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc); me.AddUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
_events.ScheduleEvent(EventTypes.SvalnaStart, 25000); _events.ScheduleEvent(EventTypes.SvalnaStart, 25000);
break; break;
case Actions.ResurrectCaptains: case Actions.ResurrectCaptains:
@@ -584,7 +585,7 @@ namespace Scripts.Northrend.IcecrownCitadel
_isEventInProgress = false; _isEventInProgress = false;
me.setActive(false); me.setActive(false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
me.SetDisableGravity(false); me.SetDisableGravity(false);
me.SetHover(false); me.SetHover(false);
} }
@@ -602,7 +603,7 @@ namespace Scripts.Northrend.IcecrownCitadel
{ {
Talk(Texts.EmoteSvalnaImpale, target); Talk(Texts.EmoteSvalnaImpale, target);
summon.CastCustomSpell(SharedConst.VehicleSpellRideHardcoded, SpellValueMod.BasePoint0, 1, target, false); summon.CastCustomSpell(SharedConst.VehicleSpellRideHardcoded, SpellValueMod.BasePoint0, 1, target, false);
summon.SetFlag(UnitFields.Flags2, UnitFlags2.Unk1 | UnitFlags2.AllowEnemyInteract); summon.AddUnitFlag2(UnitFlags2.Unk1 | UnitFlags2.AllowEnemyInteract);
} }
break; break;
default: default:
@@ -744,6 +745,7 @@ namespace Scripts.Northrend.IcecrownCitadel
{ {
// pause pathing until trash pack is cleared // pause pathing until trash pack is cleared
case 0: case 0:
me.RemoveUnitFlag(UnitFlags.ImmuneToNpc);
Talk(Texts.SayCrokCombatWp0); Talk(Texts.SayCrokCombatWp0);
if (!_aliveTrash.Empty()) if (!_aliveTrash.Empty())
SetEscortPaused(true); SetEscortPaused(true);
@@ -1392,8 +1394,8 @@ namespace Scripts.Northrend.IcecrownCitadel
if (target) if (target)
{ {
target.SetReactState(ReactStates.Passive); target.SetReactState(ReactStates.Passive);
target.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.ImmuneToPc); target.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.ImmuneToPc);
target.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotCustomSpell02); target.SetEmoteState(Emote.OneshotCustomSpell02);
} }
} }
@@ -1403,8 +1405,8 @@ namespace Scripts.Northrend.IcecrownCitadel
if (target) if (target)
{ {
target.SetReactState(ReactStates.Aggressive); target.SetReactState(ReactStates.Aggressive);
target.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.ImmuneToPc); target.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.ImmuneToPc);
target.SetUInt32Value(UnitFields.NpcEmotestate, 0); target.SetEmoteState(Emote.StateCustomSpell02);
} }
} }
@@ -136,6 +136,7 @@ namespace Scripts.Northrend.IcecrownCitadel
public const uint ImpalingSpear = 71443; public const uint ImpalingSpear = 71443;
public const uint AetherShield = 71463; public const uint AetherShield = 71463;
public const uint HurlSpear = 71466; public const uint HurlSpear = 71466;
public const uint DivineSurge = 71465;
// Captain Arnath // Captain Arnath
public const uint DominateMind = 14515; public const uint DominateMind = 14515;
@@ -159,12 +159,12 @@ namespace Scripts.Northrend.IcecrownCitadel
{ {
if (usable) if (usable)
{ {
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
} }
else else
{ {
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Ready); go.SetGoState(GameObjectState.Ready);
} }
} }
@@ -639,7 +639,7 @@ namespace Scripts.Northrend.IcecrownCitadel
Creature valithria = instance.GetCreature(ValithriaDreamwalkerGUID); Creature valithria = instance.GetCreature(ValithriaDreamwalkerGUID);
if (valithria) if (valithria)
go.SetLootRecipient(valithria.GetLootRecipient(), valithria.GetLootRecipientGroup()); go.SetLootRecipient(valithria.GetLootRecipient(), valithria.GetLootRecipientGroup());
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked | GameObjectFlags.NotSelectable | GameObjectFlags.NoDespawn); go.RemoveFlag(GameObjectFlags.Locked | GameObjectFlags.NotSelectable | GameObjectFlags.NoDespawn);
break; break;
case GameObjectIds.ArthasPlatform: case GameObjectIds.ArthasPlatform:
ArthasPlatformGUID = go.GetGUID(); ArthasPlatformGUID = go.GetGUID();
@@ -851,7 +851,7 @@ namespace Scripts.Northrend.IcecrownCitadel
GameObject loot = instance.GetGameObject(GunshipArmoryGUID); GameObject loot = instance.GetGameObject(GunshipArmoryGUID);
if (loot) if (loot)
loot.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked | GameObjectFlags.NotSelectable | GameObjectFlags.NoDespawn); loot.RemoveFlag(GameObjectFlags.Locked | GameObjectFlags.NotSelectable | GameObjectFlags.NoDespawn);
} }
else if (state == EncounterState.Fail) else if (state == EncounterState.Fail)
_events.ScheduleEvent(TimedEvents.RespawnGunship, 30000); _events.ScheduleEvent(TimedEvents.RespawnGunship, 30000);
@@ -867,7 +867,7 @@ namespace Scripts.Northrend.IcecrownCitadel
Creature deathbringer = instance.GetCreature(DeathbringerSaurfangGUID); Creature deathbringer = instance.GetCreature(DeathbringerSaurfangGUID);
if (deathbringer) if (deathbringer)
loot.SetLootRecipient(deathbringer.GetLootRecipient(), deathbringer.GetLootRecipientGroup()); loot.SetLootRecipient(deathbringer.GetLootRecipient(), deathbringer.GetLootRecipientGroup());
loot.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked | GameObjectFlags.NotSelectable | GameObjectFlags.NoDespawn); loot.RemoveFlag(GameObjectFlags.Locked | GameObjectFlags.NotSelectable | GameObjectFlags.NoDespawn);
} }
GameObject teleporter = instance.GetGameObject(TeleporterUpperSpireGUID); GameObject teleporter = instance.GetGameObject(TeleporterUpperSpireGUID);
File diff suppressed because it is too large Load Diff
@@ -131,7 +131,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity
GameObject platform = instance.GetGameObject(platformGUID); GameObject platform = instance.GetGameObject(platformGUID);
if (platform) if (platform)
platform.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Destroyed); platform.RemoveFlag(GameObjectFlags.Destroyed);
} }
else if (state == EncounterState.Done) else if (state == EncounterState.Done)
SpawnGameObject(InstanceGameObjects.ExitPortal, exitPortalPosition); SpawnGameObject(InstanceGameObjects.ExitPortal, exitPortalPosition);
@@ -218,7 +218,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity
GameObject iris = instance.GetGameObject(irisGUID); GameObject iris = instance.GetGameObject(irisGUID);
if (iris) if (iris)
iris.SetFlag(GameObjectFields.Flags, GameObjectFlags.InUse); iris.AddFlag(GameObjectFlags.InUse);
Creature malygos = instance.GetCreature(malygosGUID); Creature malygos = instance.GetCreature(malygosGUID);
if (malygos) if (malygos)
@@ -99,7 +99,7 @@ namespace Scripts.Northrend.Nexus.Nexus
Initialize(); Initialize();
_intenseColdList.Clear(); _intenseColdList.Clear();
me.RemoveFlag(UnitFields.Flags, UnitFlags.Stunned); me.RemoveUnitFlag(UnitFlags.Stunned);
RemovePrison(CheckContainmentSpheres()); RemovePrison(CheckContainmentSpheres());
_Reset(); _Reset();
@@ -141,15 +141,15 @@ namespace Scripts.Northrend.Nexus.Nexus
{ {
if (remove) if (remove)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
if (me.HasAura(KeristraszaConst.SpellFrozenPrison)) if (me.HasAura(KeristraszaConst.SpellFrozenPrison))
me.RemoveAurasDueToSpell(KeristraszaConst.SpellFrozenPrison); me.RemoveAurasDueToSpell(KeristraszaConst.SpellFrozenPrison);
} }
else else
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); me.AddUnitFlag(UnitFlags.ImmuneToPc);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
DoCast(me, KeristraszaConst.SpellFrozenPrison, false); DoCast(me, KeristraszaConst.SpellFrozenPrison, false);
} }
} }
@@ -202,7 +202,7 @@ namespace Scripts.Northrend.Nexus.Nexus
if (pKeristrasza && pKeristrasza.IsAlive()) if (pKeristrasza && pKeristrasza.IsAlive())
{ {
// maybe these are hacks :( // maybe these are hacks :(
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
((boss_keristrasza)pKeristrasza.GetAI()).CheckContainmentSpheres(true); ((boss_keristrasza)pKeristrasza.GetAI()).CheckContainmentSpheres(true);
@@ -86,7 +86,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{ {
Initialize(); Initialize();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.NotStarted); instance.SetBossState(DataTypes.MagusTelestra, EncounterState.NotStarted);
@@ -135,7 +135,7 @@ namespace Scripts.Northrend.Nexus.Nexus
if (uiIsWaitingToAppearTimer <= diff) if (uiIsWaitingToAppearTimer <= diff)
{ {
me.CastSpell(me, 47714, true); me.CastSpell(me, 47714, true);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
bIsWaitingToAppear = false; bIsWaitingToAppear = false;
InVanish = false; InVanish = false;
me.SendAIReaction(AiReaction.Hostile); me.SendAIReaction(AiReaction.Hostile);
@@ -174,7 +174,7 @@ namespace Scripts.Northrend.Nexus.Nexus
me.CastStop(); me.CastStop();
me.RemoveAllAuras(); me.RemoveAllAuras();
me.CastSpell(me, 47710, false); me.CastSpell(me, 47710, false);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
bFireMagusDead = false; bFireMagusDead = false;
bFrostMagusDead = false; bFrostMagusDead = false;
bArcaneMagusDead = false; bArcaneMagusDead = false;
@@ -188,7 +188,7 @@ namespace Scripts.Northrend.Nexus.Nexus
Phase = 3; Phase = 3;
me.CastStop(); me.CastStop();
me.RemoveAllAuras(); me.RemoveAllAuras();
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
bFireMagusDead = false; bFireMagusDead = false;
bFrostMagusDead = false; bFrostMagusDead = false;
bArcaneMagusDead = false; bArcaneMagusDead = false;
@@ -135,17 +135,17 @@ namespace Scripts.Northrend.Nexus.Nexus
case GameObjectIds.AnomalusContainmetSphere: case GameObjectIds.AnomalusContainmetSphere:
AnomalusContainmentSphere = go.GetGUID(); AnomalusContainmentSphere = go.GetGUID();
if (GetBossState(DataTypes.Anomalus) == EncounterState.Done) if (GetBossState(DataTypes.Anomalus) == EncounterState.Done)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
break; break;
case GameObjectIds.OrmoroksContainmetSphere: case GameObjectIds.OrmoroksContainmetSphere:
OrmoroksContainmentSphere = go.GetGUID(); OrmoroksContainmentSphere = go.GetGUID();
if (GetBossState(DataTypes.Ormorok) == EncounterState.Done) if (GetBossState(DataTypes.Ormorok) == EncounterState.Done)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
break; break;
case GameObjectIds.TelestrasContainmetSphere: case GameObjectIds.TelestrasContainmetSphere:
TelestrasContainmentSphere = go.GetGUID(); TelestrasContainmentSphere = go.GetGUID();
if (GetBossState(DataTypes.MagusTelestra) == EncounterState.Done) if (GetBossState(DataTypes.MagusTelestra) == EncounterState.Done)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.RemoveFlag(GameObjectFlags.NotSelectable);
break; break;
default: default:
break; break;
@@ -164,7 +164,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{ {
GameObject sphere = instance.GetGameObject(TelestrasContainmentSphere); GameObject sphere = instance.GetGameObject(TelestrasContainmentSphere);
if (sphere) if (sphere)
sphere.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); sphere.RemoveFlag(GameObjectFlags.NotSelectable);
} }
break; break;
case DataTypes.Anomalus: case DataTypes.Anomalus:
@@ -172,7 +172,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{ {
GameObject sphere = instance.GetGameObject(AnomalusContainmentSphere); GameObject sphere = instance.GetGameObject(AnomalusContainmentSphere);
if (sphere) if (sphere)
sphere.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); sphere.RemoveFlag(GameObjectFlags.NotSelectable);
} }
break; break;
case DataTypes.Ormorok: case DataTypes.Ormorok:
@@ -180,7 +180,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{ {
GameObject sphere = instance.GetGameObject(OrmoroksContainmentSphere); GameObject sphere = instance.GetGameObject(OrmoroksContainmentSphere);
if (sphere) if (sphere)
sphere.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); sphere.RemoveFlag(GameObjectFlags.NotSelectable);
} }
break; break;
default: default:
@@ -75,7 +75,7 @@ namespace Scripts.Northrend.Nexus.Oculus
BelgaristraszGUID = creature.GetGUID(); BelgaristraszGUID = creature.GetGUID();
if (GetBossState(DATA_DRAKOS) == EncounterState.Done) if (GetBossState(DATA_DRAKOS) == EncounterState.Done)
{ {
creature.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); creature.AddNpcFlag(NPCFlags.Gossip);
creature.Relocate(BelgaristraszMove); creature.Relocate(BelgaristraszMove);
} }
break; break;
@@ -83,7 +83,7 @@ namespace Scripts.Northrend.Nexus.Oculus
EternosGUID = creature.GetGUID(); EternosGUID = creature.GetGUID();
if (GetBossState(DATA_DRAKOS) == EncounterState.Done) if (GetBossState(DATA_DRAKOS) == EncounterState.Done)
{ {
creature.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); creature.AddNpcFlag(NPCFlags.Gossip);
creature.Relocate(EternosMove); creature.Relocate(EternosMove);
} }
break; break;
@@ -91,7 +91,7 @@ namespace Scripts.Northrend.Nexus.Oculus
VerdisaGUID = creature.GetGUID(); VerdisaGUID = creature.GetGUID();
if (GetBossState(DATA_DRAKOS) == EncounterState.Done) if (GetBossState(DATA_DRAKOS) == EncounterState.Done)
{ {
creature.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip); creature.AddNpcFlag(NPCFlags.Gossip);
creature.Relocate(VerdisaMove); creature.Relocate(VerdisaMove);
} }
break; break;
@@ -232,7 +232,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
DoCast(Spells.InvisAndStealthDetect); DoCast(Spells.InvisAndStealthDetect);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Stunned); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Stunned);
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
} }
@@ -513,7 +513,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
me.SetHomePosition(Leviathan.Center); me.SetHomePosition(Leviathan.Center);
me.GetMotionMaster().MoveCharge(Leviathan.Center.GetPositionX(), Leviathan.Center.GetPositionY(), Leviathan.Center.GetPositionZ()); // position center me.GetMotionMaster().MoveCharge(Leviathan.Center.GetPositionX(), Leviathan.Center.GetPositionY(), Leviathan.Center.GetPositionZ()); // position center
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Stunned); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Stunned);
return; return;
} }
break; break;
@@ -585,8 +585,8 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Creature turret = turretPassenger.ToCreature(); Creature turret = turretPassenger.ToCreature();
if (turret) if (turret)
{ {
turret.SetFaction(me.GetVehicleBase().getFaction()); turret.SetFaction(me.GetVehicleBase().GetFaction());
turret.SetUInt32Value(UnitFields.Flags, 0); // unselectable turret.SetUnitFlags(0);
turret.GetAI().AttackStart(who); turret.GetAI().AttackStart(who);
} }
} }
@@ -596,12 +596,12 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Creature device = devicePassenger.ToCreature(); Creature device = devicePassenger.ToCreature();
if (device) if (device)
{ {
device.SetFlag64(UnitFields.NpcFlags, NPCFlags.SpellClick); device.AddNpcFlag(NPCFlags.SpellClick);
device.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); device.RemoveUnitFlag(UnitFlags.NotSelectable);
} }
} }
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
} }
else if (seatId == Seats.Turret) else if (seatId == Seats.Turret)
{ {
@@ -611,8 +611,8 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Unit device = vehicle.GetPassenger(Seats.Device); Unit device = vehicle.GetPassenger(Seats.Device);
if (device) if (device)
{ {
device.SetFlag64(UnitFields.NpcFlags, NPCFlags.SpellClick); device.AddNpcFlag(NPCFlags.SpellClick);
device.SetUInt32Value(UnitFields.Flags, 0); // unselectable device.SetUnitFlags(0); // unselectable
} }
} }
} }
@@ -694,8 +694,8 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
if (me.GetVehicle()) if (me.GetVehicle())
{ {
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.SpellClick); me.RemoveNpcFlag(NPCFlags.SpellClick);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
Unit player = me.GetVehicle().GetPassenger(Seats.Player); Unit player = me.GetVehicle().GetPassenger(Seats.Player);
if (player) if (player)
@@ -792,7 +792,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_pool_of_tar(Creature creature) public npc_pool_of_tar(Creature creature)
: base(creature) : base(creature)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
me.CastSpell(me, Spells.TarPassive, true); me.CastSpell(me, Spells.TarPassive, true);
} }
@@ -843,7 +843,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_thorims_hammer(Creature creature) public npc_thorims_hammer(Creature creature)
: base(creature) : base(creature)
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
me.CastSpell(me, Spells.DummyBlue, true); me.CastSpell(me, Spells.DummyBlue, true);
} }
@@ -872,7 +872,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_mimirons_inferno(Creature creature) public npc_mimirons_inferno(Creature creature)
: base(creature) : base(creature)
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.CastSpell(me, Spells.DummyYellow, true); me.CastSpell(me, Spells.DummyYellow, true);
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
} }
@@ -921,7 +921,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_hodirs_fury(Creature creature) public npc_hodirs_fury(Creature creature)
: base(creature) : base(creature)
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
me.CastSpell(me, Spells.DummyGreen, true); me.CastSpell(me, Spells.DummyGreen, true);
} }
@@ -1038,7 +1038,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
{ {
if (menuId == GossipIds.MenuLoreKeeper && gossipListId == GossipIds.OptionLoreKeeper) if (menuId == GossipIds.MenuLoreKeeper && gossipListId == GossipIds.OptionLoreKeeper)
{ {
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip); me.RemoveNpcFlag(NPCFlags.Gossip);
player.PlayerTalkClass.SendCloseGossip(); player.PlayerTalkClass.SendCloseGossip();
me.GetMap().LoadGrid(364, -16); // make sure leviathan is loaded me.GetMap().LoadGrid(364, -16); // make sure leviathan is loaded
@@ -1055,9 +1055,9 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Creature brann = _instance.GetCreature(InstanceData.BrannBronzebeardIntro); Creature brann = _instance.GetCreature(InstanceData.BrannBronzebeardIntro);
if (brann) if (brann)
{ {
brann.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip); brann.RemoveNpcFlag(NPCFlags.Gossip);
delorah.GetMotionMaster().MovePoint(0, brann.GetPositionX() - 4, brann.GetPositionY(), brann.GetPositionZ()); delorah.GetMotionMaster().MovePoint(0, brann.GetPositionX() - 4, brann.GetPositionY(), brann.GetPositionZ());
// @todo delorah->AI()->Talk(xxxx, brann->GetGUID()); when reached at branz // @todo delorah.AI().Talk(xxxx, brann.GetGUID()); when reached at branz
} }
} }
} }
@@ -1356,7 +1356,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
//! This could probably in the SPELL_EFFECT_SEND_EVENT handler too: //! This could probably in the SPELL_EFFECT_SEND_EVENT handler too:
owner.AddUnitState(UnitState.Stunned | UnitState.Root); owner.AddUnitState(UnitState.Stunned | UnitState.Root);
owner.SetFlag(UnitFields.Flags, UnitFlags.Stunned); owner.AddUnitFlag(UnitFlags.Stunned);
owner.RemoveAurasDueToSpell(Spells.GatheringSpeed); owner.RemoveAurasDueToSpell(Spells.GatheringSpeed);
} }
@@ -1366,7 +1366,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
if (!owner) if (!owner)
return; return;
owner.RemoveFlag(UnitFields.Flags, UnitFlags.Stunned); owner.RemoveUnitFlag(UnitFlags.Stunned);
} }
public override void Register() public override void Register()
+26 -26
View File
@@ -389,7 +389,7 @@ namespace Scripts.Northrend.Ulduar
{ {
_Reset(); _Reset();
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NonAttackable);
GameObject elevator = ObjectAccessor.GetGameObject(me, instance.GetGuidData(InstanceData.MimironElevator)); GameObject elevator = ObjectAccessor.GetGameObject(me, instance.GetGuidData(InstanceData.MimironElevator));
if (elevator) if (elevator)
@@ -406,7 +406,7 @@ namespace Scripts.Northrend.Ulduar
if (button) if (button)
{ {
button.SetGoState(GameObjectState.Ready); button.SetGoState(GameObjectState.Ready);
button.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); button.RemoveFlag(GameObjectFlags.NotSelectable);
} }
_fireFighter = false; _fireFighter = false;
@@ -457,13 +457,13 @@ namespace Scripts.Northrend.Ulduar
//PLay Sound number 15612 //PLay Sound number 15612
_EnterCombat(); _EnterCombat();
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
me.RemoveAurasDueToSpell(Spells.Weld); me.RemoveAurasDueToSpell(Spells.Weld);
DoCast(me.GetVehicleBase(), Spells.Seat6); DoCast(me.GetVehicleBase(), Spells.Seat6);
GameObject button = ObjectAccessor.GetGameObject(me, instance.GetGuidData(InstanceData.MimironButton)); GameObject button = ObjectAccessor.GetGameObject(me, instance.GetGuidData(InstanceData.MimironButton));
if (button) if (button)
button.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); button.AddFlag(GameObjectFlags.NotSelectable);
if (_fireFighter) if (_fireFighter)
_events.ScheduleEvent(Events.SummonFlames, 3000); _events.ScheduleEvent(Events.SummonFlames, 3000);
@@ -528,7 +528,7 @@ namespace Scripts.Northrend.Ulduar
{ {
DoCast(mkii, Spells.Seat7); DoCast(mkii, Spells.Seat7);
mkii.RemoveAurasDueToSpell(Spells.FreezeAnim); mkii.RemoveAurasDueToSpell(Spells.FreezeAnim);
mkii.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); mkii.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
} }
_events.ScheduleEvent(Events.Intro3, 2000); _events.ScheduleEvent(Events.Intro3, 2000);
} }
@@ -676,7 +676,7 @@ namespace Scripts.Northrend.Ulduar
if (aerial) if (aerial)
{ {
aerial.GetMotionMaster().MoveLand(0, new Position(aerial.GetPositionX(), aerial.GetPositionY(), aerial.GetPositionZMinusOffset())); aerial.GetMotionMaster().MoveLand(0, new Position(aerial.GetPositionX(), aerial.GetPositionY(), aerial.GetPositionZMinusOffset()));
aerial.SetByteValue(UnitFields.Bytes1, UnitBytes1Offsets.AnimTier, 0); aerial.SetAnimTier(UnitBytes1Flags.None, false);
aerial.CastSpell(vx001, Spells.MountVx001); aerial.CastSpell(vx001, Spells.MountVx001);
aerial.CastSpell(aerial, Spells.HalfHeal); aerial.CastSpell(aerial, Spells.HalfHeal);
} }
@@ -725,7 +725,7 @@ namespace Scripts.Northrend.Ulduar
break; break;
case Events.Outtro3: case Events.Outtro3:
DoCast(me, Spells.TeleportVisual); DoCast(me, Spells.TeleportVisual);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
me.DespawnOrUnsummon(1000); // sniffs say 6 sec after, but it doesnt matter. me.DespawnOrUnsummon(1000); // sniffs say 6 sec after, but it doesnt matter.
break; break;
default: default:
@@ -756,7 +756,7 @@ namespace Scripts.Northrend.Ulduar
void SetupEncounter() void SetupEncounter()
{ {
_Reset(); _Reset();
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
_fireFighter = false; _fireFighter = false;
_setupMine = true; _setupMine = true;
@@ -770,7 +770,7 @@ namespace Scripts.Northrend.Ulduar
if (damage >= me.GetHealth()) if (damage >= me.GetHealth())
{ {
damage = (uint)(me.GetHealth() - 1); // Let creature fall to 1 hp, but do not let it die or damage itself with SetHealth(). damage = (uint)(me.GetHealth() - 1); // Let creature fall to 1 hp, but do not let it die or damage itself with SetHealth().
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
DoCast(me, Spells.VehicleDamaged, true); DoCast(me, Spells.VehicleDamaged, true);
me.AttackStop(); me.AttackStop();
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
@@ -821,7 +821,7 @@ namespace Scripts.Northrend.Ulduar
break; break;
case Actions.AssembledCombat: case Actions.AssembledCombat:
me.SetStandState(UnitStandStateType.Stand); me.SetStandState(UnitStandStateType.Stand);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
_events.SetPhase(Phases.Vol7ron); _events.SetPhase(Phases.Vol7ron);
@@ -874,7 +874,7 @@ namespace Scripts.Northrend.Ulduar
{ {
case Waypoints.MkiiP1Idle: case Waypoints.MkiiP1Idle:
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
DoCast(me, Spells.HalfHeal); DoCast(me, Spells.HalfHeal);
Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron)); Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron));
@@ -999,7 +999,7 @@ namespace Scripts.Northrend.Ulduar
public boss_vx_001(Creature creature) : base(creature, BossIds.Mimiron) public boss_vx_001(Creature creature) : base(creature, BossIds.Mimiron)
{ {
me.SetDisableGravity(true); // This is the unfold visual state of VX-001, it has to be set on create as it requires an objectupdate if set later. me.SetDisableGravity(true); // This is the unfold visual state of VX-001, it has to be set on create as it requires an objectupdate if set later.
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.StateSpecialUnarmed); // This is a hack to force the yet to be unfolded visual state. me.SetEmoteState(Emote.StateSpecialUnarmed); // This is a hack to force the yet to be unfolded visual state.
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
_fireFighter = false; _fireFighter = false;
} }
@@ -1017,7 +1017,7 @@ namespace Scripts.Northrend.Ulduar
if (_events.IsInPhase(Phases.Vx001)) if (_events.IsInPhase(Phases.Vx001))
{ {
me.CastStop(); me.CastStop();
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
DoCast(me, Spells.HalfHeal); // has no effect, wat DoCast(me, Spells.HalfHeal); // has no effect, wat
DoCast(me, Spells.TorsoDisabled); DoCast(me, Spells.TorsoDisabled);
Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron)); Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron));
@@ -1027,7 +1027,7 @@ namespace Scripts.Northrend.Ulduar
else if (_events.IsInPhase(Phases.Vol7ron)) else if (_events.IsInPhase(Phases.Vol7ron))
{ {
me.SetStandState(UnitStandStateType.Dead); me.SetStandState(UnitStandStateType.Dead);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
if (MimironConst.IsEncounterFinished(who)) if (MimironConst.IsEncounterFinished(who))
return; return;
@@ -1050,9 +1050,9 @@ namespace Scripts.Northrend.Ulduar
_events.ScheduleEvent(Events.FlameSuppressantVx, 6000); _events.ScheduleEvent(Events.FlameSuppressantVx, 6000);
goto case Actions.StartVx001; goto case Actions.StartVx001;
case Actions.StartVx001: case Actions.StartVx001:
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveAurasDueToSpell(Spells.FreezeAnim); me.RemoveAurasDueToSpell(Spells.FreezeAnim);
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone); // Remove emotestate. me.SetEmoteState(Emote.OneshotNone); // Remove emotestate.
//me.SetuintValue(UnitFields.Bytes1, UnitBytes1Offsets.AnimTier, UnitBytes1Flags.AlwaysStand | UnitBytes1Flags.Hover); Blizzard handles hover animation like this it seems. //me.SetuintValue(UnitFields.Bytes1, UnitBytes1Offsets.AnimTier, UnitBytes1Flags.AlwaysStand | UnitBytes1Flags.Hover); Blizzard handles hover animation like this it seems.
DoCast(me, Spells.HeatWaveAura); DoCast(me, Spells.HeatWaveAura);
@@ -1063,7 +1063,7 @@ namespace Scripts.Northrend.Ulduar
break; break;
case Actions.AssembledCombat: case Actions.AssembledCombat:
me.SetStandState(UnitStandStateType.Stand); me.SetStandState(UnitStandStateType.Stand);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
_events.SetPhase(Phases.Vol7ron); _events.SetPhase(Phases.Vol7ron);
_events.ScheduleEvent(Events.RocketStrike, 20000); _events.ScheduleEvent(Events.RocketStrike, 20000);
@@ -1115,7 +1115,7 @@ namespace Scripts.Northrend.Ulduar
// Handle rotation during SPELL_SPINNING_UP, SPELL_P3WX2_LASER_BARRAGE, SPELL_RAPID_BURST, and SPELL_HAND_PULSE_LEFT/RIGHT // Handle rotation during SPELL_SPINNING_UP, SPELL_P3WX2_LASER_BARRAGE, SPELL_RAPID_BURST, and SPELL_HAND_PULSE_LEFT/RIGHT
if (me.HasUnitState(UnitState.Casting)) if (me.HasUnitState(UnitState.Casting))
{ {
List<ObjectGuid> channelObjects = me.GetChannelObjects(); List<ObjectGuid> channelObjects = me.m_unitData.ChannelObjects;
Unit channelTarget = (channelObjects.Count == 1 ? Global.ObjAccessor.GetUnit(me, channelObjects[0]) : null); Unit channelTarget = (channelObjects.Count == 1 ? Global.ObjAccessor.GetUnit(me, channelObjects[0]) : null);
if (channelTarget) if (channelTarget)
me.SetFacingToObject(channelTarget); me.SetFacingToObject(channelTarget);
@@ -1191,7 +1191,7 @@ namespace Scripts.Northrend.Ulduar
if (damage >= me.GetHealth()) if (damage >= me.GetHealth())
{ {
damage = (uint)(me.GetHealth() - 1); // Let creature fall to 1 hp, but do not let it die or damage itself with SetHealth(). damage = (uint)(me.GetHealth() - 1); // Let creature fall to 1 hp, but do not let it die or damage itself with SetHealth().
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
me.AttackStop(); me.AttackStop();
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
DoCast(me, Spells.VehicleDamaged, true); DoCast(me, Spells.VehicleDamaged, true);
@@ -1226,7 +1226,7 @@ namespace Scripts.Northrend.Ulduar
_events.ScheduleEvent(Events.SummonFireBots, 1000, 0, Phases.AerialCommandUnit); _events.ScheduleEvent(Events.SummonFireBots, 1000, 0, Phases.AerialCommandUnit);
goto case Actions.StartAerial; goto case Actions.StartAerial;
case Actions.StartAerial: case Actions.StartAerial:
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
_events.SetPhase(Phases.AerialCommandUnit); _events.SetPhase(Phases.AerialCommandUnit);
@@ -1245,7 +1245,7 @@ namespace Scripts.Northrend.Ulduar
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
break; break;
case Actions.AssembledCombat: case Actions.AssembledCombat:
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
me.SetStandState(UnitStandStateType.Stand); me.SetStandState(UnitStandStateType.Stand);
_events.SetPhase(Phases.Vol7ron); _events.SetPhase(Phases.Vol7ron);
@@ -1281,7 +1281,7 @@ namespace Scripts.Northrend.Ulduar
{ {
if (type == MovementGeneratorType.Point && point == Waypoints.AerialP4Pos) if (type == MovementGeneratorType.Point && point == Waypoints.AerialP4Pos)
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron)); Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron));
if (mimiron) if (mimiron)
@@ -1596,7 +1596,7 @@ namespace Scripts.Northrend.Ulduar
public override bool OnGossipHello(Player player, GameObject go) public override bool OnGossipHello(Player player, GameObject go)
{ {
if (go.HasFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable)) if (go.HasFlag(GameObjectFlags.NotSelectable))
return true; return true;
InstanceScript instance = go.GetInstanceScript(); InstanceScript instance = go.GetInstanceScript();
@@ -1607,7 +1607,7 @@ namespace Scripts.Northrend.Ulduar
if (computer) if (computer)
computer.GetAI().DoAction(Actions.ActivateComputer); computer.GetAI().DoAction(Actions.ActivateComputer);
go.SetGoState(GameObjectState.Active); go.SetGoState(GameObjectState.Active);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); go.AddFlag(GameObjectFlags.NotSelectable);
return true; return true;
} }
} }
@@ -1634,7 +1634,7 @@ namespace Scripts.Northrend.Ulduar
Creature target = GetHitCreature(); Creature target = GetHitCreature();
if (target) if (target)
{ {
target.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.Pacified); target.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.Pacified);
target.DespawnOrUnsummon(1000); target.DespawnOrUnsummon(1000);
} }
} }
@@ -1741,7 +1741,7 @@ namespace Scripts.Northrend.Ulduar
{ {
void FilterTargets(List<WorldObject> targets) void FilterTargets(List<WorldObject> targets)
{ {
targets.RemoveAll(obj => obj.ToUnit() && (obj.ToUnit().GetVehicleBase() || obj.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))); targets.RemoveAll(obj => obj.IsUnit() && (obj.ToUnit().GetVehicleBase() || obj.ToUnit().HasUnitFlag(UnitFlags.NonAttackable)));
} }
public override void Register() public override void Register()
+14 -14
View File
@@ -77,12 +77,12 @@ namespace Scripts.Northrend.Ulduar
{ {
case ACTION_HARPOON_BUILD: case ACTION_HARPOON_BUILD:
events.ScheduleEvent(EVENT_BUILD_HARPOON_1, 50000); events.ScheduleEvent(EVENT_BUILD_HARPOON_1, 50000);
if (me->GetMap()->GetSpawnMode() == DIFFICULTY_25_N) if (me.GetMap().GetSpawnMode() == DIFFICULTY_25_N)
events.ScheduleEvent(EVENT_BUILD_HARPOON_3, 90000); events.ScheduleEvent(EVENT_BUILD_HARPOON_3, 90000);
break; break;
case ACTION_PLACE_BROKEN_HARPOON: case ACTION_PLACE_BROKEN_HARPOON:
for (uint8 n = 0; n < RAID_MODE(2, 4); n++) for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
me->SummonGameObject(GO_RAZOR_BROKEN_HARPOON, PosHarpoon[n].GetPositionX(), PosHarpoon[n].GetPositionY(), PosHarpoon[n].GetPositionZ(), 2.286f, 0, 0, 0, 0, 180); me.SummonGameObject(GO_RAZOR_BROKEN_HARPOON, PosHarpoon[n].GetPositionX(), PosHarpoon[n].GetPositionY(), PosHarpoon[n].GetPositionZ(), 2.286f, 0, 0, 0, 0, 180);
break; break;
} }
} }
@@ -97,39 +97,39 @@ namespace Scripts.Northrend.Ulduar
{ {
case EVENT_BUILD_HARPOON_1: case EVENT_BUILD_HARPOON_1:
Talk(EMOTE_HARPOON); Talk(EMOTE_HARPOON);
if (GameObject * Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0].GetPositionX(), PosHarpoon[0].GetPositionY(), PosHarpoon[0].GetPositionZ(), 4.790f, 0.0f, 0.0f, 0.0f, 0.0f, uint32(me->GetRespawnTime()))) if (GameObject * Harpoon = me.SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0].GetPositionX(), PosHarpoon[0].GetPositionY(), PosHarpoon[0].GetPositionZ(), 4.790f, 0.0f, 0.0f, 0.0f, 0.0f, uint32(me.GetRespawnTime())))
{ {
if (GameObject * BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) //only nearest broken harpoon if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) //only nearest broken harpoon
BrokenHarpoon->RemoveFromWorld(); BrokenHarpoon.RemoveFromWorld();
events.ScheduleEvent(EVENT_BUILD_HARPOON_2, 20000); events.ScheduleEvent(EVENT_BUILD_HARPOON_2, 20000);
events.CancelEvent(EVENT_BUILD_HARPOON_1); events.CancelEvent(EVENT_BUILD_HARPOON_1);
} }
return; return;
case EVENT_BUILD_HARPOON_2: case EVENT_BUILD_HARPOON_2:
Talk(EMOTE_HARPOON); Talk(EMOTE_HARPOON);
if (GameObject * Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1].GetPositionX(), PosHarpoon[1].GetPositionY(), PosHarpoon[1].GetPositionZ(), 4.659f, 0, 0, 0, 0, uint32(me->GetRespawnTime()))) if (GameObject * Harpoon = me.SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1].GetPositionX(), PosHarpoon[1].GetPositionY(), PosHarpoon[1].GetPositionZ(), 4.659f, 0, 0, 0, 0, uint32(me.GetRespawnTime())))
{ {
if (GameObject * BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon->RemoveFromWorld(); BrokenHarpoon.RemoveFromWorld();
events.CancelEvent(EVENT_BUILD_HARPOON_2); events.CancelEvent(EVENT_BUILD_HARPOON_2);
} }
return; return;
case EVENT_BUILD_HARPOON_3: case EVENT_BUILD_HARPOON_3:
Talk(EMOTE_HARPOON); Talk(EMOTE_HARPOON);
if (GameObject * Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2].GetPositionX(), PosHarpoon[2].GetPositionY(), PosHarpoon[2].GetPositionZ(), 5.382f, 0, 0, 0, 0, uint32(me->GetRespawnTime()))) if (GameObject * Harpoon = me.SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2].GetPositionX(), PosHarpoon[2].GetPositionY(), PosHarpoon[2].GetPositionZ(), 5.382f, 0, 0, 0, 0, uint32(me.GetRespawnTime())))
{ {
if (GameObject * BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon->RemoveFromWorld(); BrokenHarpoon.RemoveFromWorld();
events.ScheduleEvent(EVENT_BUILD_HARPOON_4, 20000); events.ScheduleEvent(EVENT_BUILD_HARPOON_4, 20000);
events.CancelEvent(EVENT_BUILD_HARPOON_3); events.CancelEvent(EVENT_BUILD_HARPOON_3);
} }
return; return;
case EVENT_BUILD_HARPOON_4: case EVENT_BUILD_HARPOON_4:
Talk(EMOTE_HARPOON); Talk(EMOTE_HARPOON);
if (GameObject * Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3].GetPositionX(), PosHarpoon[3].GetPositionY(), PosHarpoon[3].GetPositionZ(), 4.266f, 0, 0, 0, 0, uint32(me->GetRespawnTime()))) if (GameObject * Harpoon = me.SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3].GetPositionX(), PosHarpoon[3].GetPositionY(), PosHarpoon[3].GetPositionZ(), 4.266f, 0, 0, 0, 0, uint32(me.GetRespawnTime())))
{ {
if (GameObject * BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon->RemoveFromWorld(); BrokenHarpoon.RemoveFromWorld();
events.CancelEvent(EVENT_BUILD_HARPOON_4); events.CancelEvent(EVENT_BUILD_HARPOON_4);
} }
return; return;
@@ -68,7 +68,7 @@ namespace Scripts.Northrend.Ulduar
if (_algalonTimer != 0 && _algalonTimer <= 60) if (_algalonTimer != 0 && _algalonTimer <= 60)
algalon.GetAI().DoAction((int)InstanceEvents.ActionInitAlgalon); algalon.GetAI().DoAction((int)InstanceEvents.ActionInitAlgalon);
else else
algalon.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); algalon.RemoveUnitFlag(UnitFlags.ImmuneToPc);
} }
// Keepers at Observation Ring // Keepers at Observation Ring
@@ -435,7 +435,7 @@ namespace Scripts.Northrend.Ulduar
case InstanceGameObjectIds.CelestialPlanetariumAccess10: case InstanceGameObjectIds.CelestialPlanetariumAccess10:
case InstanceGameObjectIds.CelestialPlanetariumAccess25: case InstanceGameObjectIds.CelestialPlanetariumAccess25:
if (_algalonSummoned) if (_algalonSummoned)
gameObject.SetFlag(GameObjectFields.Flags, GameObjectFlags.InUse); gameObject.AddFlag(GameObjectFlags.InUse);
break; break;
case InstanceGameObjectIds.DoodadUlSigildoor01: case InstanceGameObjectIds.DoodadUlSigildoor01:
AlgalonSigilDoorGUID[0] = gameObject.GetGUID(); AlgalonSigilDoorGUID[0] = gameObject.GetGUID();
@@ -610,7 +610,7 @@ namespace Scripts.Northrend.Ulduar
if (vehicle != null) if (vehicle != null)
{ {
vehicle.RemoveAllPassengers(); vehicle.RemoveAllPassengers();
vehicleCreature.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); vehicleCreature.AddUnitFlag(UnitFlags.NotSelectable);
vehicleCreature.DespawnOrUnsummon(5 * Time.Minute * Time.InMilliseconds); vehicleCreature.DespawnOrUnsummon(5 * Time.Minute * Time.InMilliseconds);
} }
} }
@@ -640,7 +640,7 @@ namespace Scripts.Northrend.Ulduar
if (gameObject) if (gameObject)
{ {
gameObject.SetRespawnTime((int)gameObject.GetRespawnDelay()); gameObject.SetRespawnTime((int)gameObject.GetRespawnDelay());
gameObject.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); gameObject.RemoveFlag(GameObjectFlags.NotSelectable);
} }
HandleGameObject(KologarnBridgeGUID, false); HandleGameObject(KologarnBridgeGUID, false);
} }
@@ -651,7 +651,7 @@ namespace Scripts.Northrend.Ulduar
GameObject HodirRareCache = instance.GetGameObject(HodirRareCacheGUID); GameObject HodirRareCache = instance.GetGameObject(HodirRareCacheGUID);
if (HodirRareCache) if (HodirRareCache)
if (GetData(InstanceData.HodirRareCache) != 0) if (GetData(InstanceData.HodirRareCache) != 0)
HodirRareCache.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable); HodirRareCache.RemoveFlag(GameObjectFlags.NotSelectable);
GameObject HodirChest = instance.GetGameObject(HodirChestGUID); GameObject HodirChest = instance.GetGameObject(HodirChestGUID);
if (HodirChest) if (HodirChest)
HodirChest.SetRespawnTime((int)HodirChest.GetRespawnDelay()); HodirChest.SetRespawnTime((int)HodirChest.GetRespawnDelay());
+16 -19
View File
@@ -24,6 +24,7 @@ using Game.Scripting;
using Game.Spells; using Game.Spells;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Game.Network.Packets;
namespace Scripts.Northrend.Ulduar.Xt002 namespace Scripts.Northrend.Ulduar.Xt002
{ {
@@ -143,7 +144,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
{ {
_Reset(); _Reset();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
DoCastSelf(SpellIds.Stand); DoCastSelf(SpellIds.Stand);
@@ -225,7 +226,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
{ {
Talk(Texts.Death); Talk(Texts.Death);
_JustDied(); _JustDied();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
} }
public override void DamageTaken(Unit attacker, ref uint damage) public override void DamageTaken(Unit attacker, ref uint damage)
@@ -306,8 +307,8 @@ namespace Scripts.Northrend.Ulduar.Xt002
heart.CastSpell(me, SpellIds.HeartLightningTether); heart.CastSpell(me, SpellIds.HeartLightningTether);
heart.CastSpell(heart, SpellIds.HeartHealToFull, true); heart.CastSpell(heart, SpellIds.HeartHealToFull, true);
heart.CastSpell(me, SpellIds.RideVehicleExposed, true); heart.CastSpell(me, SpellIds.RideVehicleExposed, true);
heart.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); heart.RemoveUnitFlag(UnitFlags.NotSelectable);
heart.SetFlag(UnitFields.Flags, UnitFlags.Unk29); heart.AddUnitFlag(UnitFlags.Unk29);
} }
_scheduler.DelayGroup(Misc.PhaseOneGroup, TimeSpan.FromSeconds(30)); _scheduler.DelayGroup(Misc.PhaseOneGroup, TimeSpan.FromSeconds(30));
@@ -330,7 +331,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
Talk(Texts.HeartClosed); Talk(Texts.HeartClosed);
Talk(Texts.EmoteHeartClosed); Talk(Texts.EmoteHeartClosed);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
DoCastSelf(SpellIds.Stand); DoCastSelf(SpellIds.Stand);
@@ -343,8 +344,8 @@ namespace Scripts.Northrend.Ulduar.Xt002
return; return;
heart.CastSpell(me, SpellIds.HeartRideVehicle, true); heart.CastSpell(me, SpellIds.HeartRideVehicle, true);
heart.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); heart.AddUnitFlag(UnitFlags.NotSelectable);
heart.RemoveFlag(UnitFields.Flags, UnitFlags.Unk29); heart.RemoveUnitFlag(UnitFlags.Unk29);
heart.RemoveAurasDueToSpell(SpellIds.ExposedHeart); heart.RemoveAurasDueToSpell(SpellIds.ExposedHeart);
if (!_hardMode) if (!_hardMode)
@@ -529,12 +530,6 @@ namespace Scripts.Northrend.Ulduar.Xt002
DoCast(SpellIds.AuraBoombot); // For achievement DoCast(SpellIds.AuraBoombot); // For achievement
// HACK/workaround:
// these values aren't confirmed - lack of data - and the values in DB are incorrect
// these values are needed for correct damage of Boom spell
me.SetFloatValue(UnitFields.MinDamage, 15000.0f);
me.SetFloatValue(UnitFields.MaxDamage, 18000.0f);
// @todo proper waypoints? // @todo proper waypoints?
Creature pXT002 = ObjectAccessor.GetCreature(me, _instance.GetGuidData(BossIds.Xt002)); Creature pXT002 = ObjectAccessor.GetCreature(me, _instance.GetGuidData(BossIds.Xt002));
if (pXT002) if (pXT002)
@@ -547,20 +542,22 @@ namespace Scripts.Northrend.Ulduar.Xt002
{ {
_boomed = true; // Prevent recursive calls _boomed = true; // Prevent recursive calls
//me.SendSpellInstakillLog(Spells.Boom, me); SpellInstakillLog instakill = new SpellInstakillLog();
instakill.Caster = me.GetGUID();
instakill.Target = me.GetGUID();
instakill.SpellID = SpellIds.Boom;
me.SendMessageToSet(instakill, false);
//me.DealDamage(me, me.GetHealth(), null, DamageEffectType.NoDamage, SpellSchoolMask.Normal, null, false); me.DealDamage(me, (uint)me.GetHealth(), null, DamageEffectType.NoDamage, SpellSchoolMask.Normal, null, false);
damage = 0; damage = 0;
me.CastSpell(me, SpellIds.Boom, false);
// Visual only seems to work if the instant kill event is delayed or the spell itself is delayed // Visual only seems to work if the instant kill event is delayed or the spell itself is delayed
// Casting done from player and caster source has the same targetinfo flags, // Casting done from player and caster source has the same targetinfo flags,
// so that can't be the issue // so that can't be the issue
// See BoomEvent class // See BoomEvent class
// Schedule 1s delayed // Schedule 1s delayed
//me.m_Events.AddEvent(new BoomEvent(me), me.m_Events.CalculateTime(1 * Time.InMilliseconds)); me.m_Events.AddEvent(new BoomEvent(me), me.m_Events.CalculateTime(1 * Time.InMilliseconds));
} }
} }
@@ -801,7 +798,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
if (!target) if (!target)
return; return;
target.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); target.AddUnitFlag(UnitFlags.NotSelectable);
target.SetStandState(UnitStandStateType.Submerged); target.SetStandState(UnitStandStateType.Submerged);
} }
+2 -2
View File
@@ -47,7 +47,7 @@ namespace Scripts.Outlands
envelopingWinds_Timer = 9000; envelopingWinds_Timer = 9000;
shock_Timer = 5000; shock_Timer = 5000;
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver); me.RemoveNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(Aeranas.FactionFriendly); me.SetFaction(Aeranas.FactionFriendly);
Talk(Aeranas.SaySummon); Talk(Aeranas.SaySummon);
@@ -72,7 +72,7 @@ namespace Scripts.Outlands
if (HealthBelowPct(30)) if (HealthBelowPct(30))
{ {
me.SetFaction(Aeranas.FactionFriendly); me.SetFaction(Aeranas.FactionFriendly);
me.SetFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver); me.AddNpcFlag(NPCFlags.QuestGiver);
me.RemoveAllAuras(); me.RemoveAllAuras();
me.DeleteThreatList(); me.DeleteThreatList();
me.CombatStop(true); me.CombatStop(true);
+2 -2
View File
@@ -142,7 +142,7 @@ namespace Scripts.Outlands
{ {
public npc_cooshcooshAI(Creature creature) : base(creature) public npc_cooshcooshAI(Creature creature) : base(creature)
{ {
m_uiNormFaction = creature.getFaction(); m_uiNormFaction = creature.GetFaction();
} }
uint m_uiNormFaction; uint m_uiNormFaction;
@@ -150,7 +150,7 @@ namespace Scripts.Outlands
public override void Reset() public override void Reset()
{ {
_events.ScheduleEvent(Event_LightningBolt, 2000); _events.ScheduleEvent(Event_LightningBolt, 2000);
if (me.getFaction() != m_uiNormFaction) if (me.GetFaction() != m_uiNormFaction)
me.SetFaction(m_uiNormFaction); me.SetFaction(m_uiNormFaction);
} }
+1 -1
View File
@@ -72,7 +72,7 @@ namespace Scripts.Pets
return; return;
// Stop Fighting // Stop Fighting
me.ApplyModFlag(UnitFields.Flags, UnitFlags.NonAttackable, true); me.AddUnitFlag(UnitFlags.NonAttackable);
// Sanctuary // Sanctuary
me.CastSpell(me, SpellSanctuary, true); me.CastSpell(me, SpellSanctuary, true);
+1 -1
View File
@@ -40,7 +40,7 @@ namespace Scripts.Pets
me.SetMaxHealth((uint)(107 * (me.getLevel() - 40) * 0.025f)); me.SetMaxHealth((uint)(107 * (me.getLevel() - 40) * 0.025f));
// Add delta to make them not all hit the same time // Add delta to make them not all hit the same time
uint delta = (RandomHelper.Rand32() % 7) * 100; uint delta = (RandomHelper.Rand32() % 7) * 100;
me.SetStatFloatValue(UnitFields.BaseAttackTime, Info.BaseAttackTime + delta); me.SetBaseAttackTime(WeaponAttackType.BaseAttack, Info.BaseAttackTime + delta);
//me.SetStatFloatValue(UnitFields.RangedAttackPower, (float)Info.AttackPower); //me.SetStatFloatValue(UnitFields.RangedAttackPower, (float)Info.AttackPower);
// Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target // Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target
+6 -6
View File
@@ -1058,8 +1058,8 @@ namespace Scripts.Spells.Generic
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode) void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{ {
Unit target = GetTarget(); Unit target = GetTarget();
target.SetFlag(ObjectFields.DynamicFlags, UnitDynFlags.Dead); target.AddDynamicFlag(UnitDynFlags.Dead);
target.SetFlag(UnitFields.Flags2, UnitFlags2.FeignDeath); target.AddUnitFlag2(UnitFlags2.FeignDeath);
if (target.IsTypeId(TypeId.Unit)) if (target.IsTypeId(TypeId.Unit))
target.ToCreature().SetReactState(ReactStates.Passive); target.ToCreature().SetReactState(ReactStates.Passive);
@@ -1068,8 +1068,8 @@ namespace Scripts.Spells.Generic
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
{ {
Unit target = GetTarget(); Unit target = GetTarget();
target.RemoveFlag(ObjectFields.DynamicFlags, UnitDynFlags.Dead); target.RemoveDynamicFlag(UnitDynFlags.Dead);
target.RemoveFlag(UnitFields.Flags2, UnitFlags2.FeignDeath); target.RemoveUnitFlag2(UnitFlags2.FeignDeath);
} }
public override void Register() public override void Register()
@@ -2873,7 +2873,7 @@ namespace Scripts.Spells.Generic
player.CombatStop(); player.CombatStop();
if (player.IsNonMeleeSpellCast(true)) if (player.IsNonMeleeSpellCast(true))
player.InterruptNonMeleeSpells(true); player.InterruptNonMeleeSpells(true);
player.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); player.AddUnitFlag(UnitFlags.NonAttackable);
// if player class = hunter || warlock remove pet if alive // if player class = hunter || warlock remove pet if alive
if ((player.GetClass() == Class.Hunter) || (player.GetClass() == Class.Warlock)) if ((player.GetClass() == Class.Hunter) || (player.GetClass() == Class.Warlock))
@@ -2898,7 +2898,7 @@ namespace Scripts.Spells.Generic
{ {
// Reset player faction + allow combat + allow duels // Reset player faction + allow combat + allow duels
player.setFactionForRace(player.GetRace()); player.setFactionForRace(player.GetRace());
player.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable); player.RemoveUnitFlag(UnitFlags.NonAttackable);
// save player // save player
player.SaveToDB(); player.SaveToDB();
} }
+1 -1
View File
@@ -246,7 +246,7 @@ namespace Scripts.Spells.Hunter
// Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this // Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this
SpellCastResult result = SpellCastResult.SpellCastOk; SpellCastResult result = SpellCastResult.SpellCastOk;
UnitFlags unitflag = (UnitFlags)pet.GetUInt32Value(UnitFields.Flags); UnitFlags unitflag = (UnitFlags)(uint)pet.m_unitData.Flags;
if (!pet.GetCharmerGUID().IsEmpty()) if (!pet.GetCharmerGUID().IsEmpty())
result = SpellCastResult.Charmed; result = SpellCastResult.Charmed;
else if (unitflag.HasAnyFlag(UnitFlags.Stunned)) else if (unitflag.HasAnyFlag(UnitFlags.Stunned))
+107
View File
@@ -3350,4 +3350,111 @@ namespace Scripts.Spells.Items
OnEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.ProcTriggerSpell, AuraEffectHandleModes.Real)); OnEffectRemove.Add(new EffectApplyHandler(OnRemove, 0, AuraType.ProcTriggerSpell, AuraEffectHandleModes.Real));
} }
} }
[Script]// 45051 - Mad Alchemist's Potion (34440)
class mad_alchemists_potion_SpellScript : SpellScript
{
void SecondaryEffect()
{
List<uint> availableElixirs = new List<uint>()
{
// Battle Elixirs
33720, // Onslaught Elixir (28102)
54452, // Adept's Elixir (28103)
33726, // Elixir of Mastery (28104)
28490, // Elixir of Major Strength (22824)
28491, // Elixir of Healing Power (22825)
28493, // Elixir of Major Frost Power (22827)
54494, // Elixir of Major Agility (22831)
28501, // Elixir of Major Firepower (22833)
28503,// Elixir of Major Shadow Power (22835)
38954, // Fel Strength Elixir (31679)
// Guardian Elixirs
39625, // Elixir of Major Fortitude (32062)
39626, // Earthen Elixir (32063)
39627, // Elixir of Draenic Wisdom (32067)
39628, // Elixir of Ironskin (32068)
28502, // Elixir of Major Defense (22834)
28514, // Elixir of Empowerment (22848)
// Other
28489, // Elixir of Camouflage (22823)
28496 // Elixir of the Searching Eye (22830)
};
Unit target = GetCaster();
if (target.GetPowerType() == PowerType.Mana)
availableElixirs.Add(28509); // Elixir of Major Mageblood (22840)
uint chosenElixir = availableElixirs.SelectRandom();
bool useElixir = true;
SpellGroup chosenSpellGroup = SpellGroup.None;
if (Global.SpellMgr.IsSpellMemberOfSpellGroup(chosenElixir, SpellGroup.ElixirBattle))
chosenSpellGroup = SpellGroup.ElixirBattle;
if (Global.SpellMgr.IsSpellMemberOfSpellGroup(chosenElixir, SpellGroup.ElixirGuardian))
chosenSpellGroup = SpellGroup.ElixirGuardian;
// If another spell of the same group is already active the elixir should not be cast
if (chosenSpellGroup != 0)
{
var Auras = target.GetAppliedAuras();
foreach (var pair in Auras)
{
uint spell_id = pair.Value.GetBase().GetId();
if (Global.SpellMgr.IsSpellMemberOfSpellGroup(spell_id, chosenSpellGroup) && spell_id != chosenElixir)
{
useElixir = false;
break;
}
}
}
if (useElixir)
target.CastSpell(target, chosenElixir, true, GetCastItem());
}
public override void Register()
{
AfterCast.Add(new CastHandler(SecondaryEffect));
}
}
[Script]// 53750 - Crazy Alchemist's Potion (40077)
class crazy_alchemists_potion_SpellScript : SpellScript
{
void SecondaryEffect()
{
List<uint> availableElixirs = new List<uint>()
{
43185, // Runic Healing Potion (33447)
53750, // Crazy Alchemist's Potion (40077)
53761, // Powerful Rejuvenation Potion (40087)
53762, // Indestructible Potion (40093)
53908, // Potion of Speed (40211)
53909, // Potion of Wild Magic (40212)
53910, // Mighty Arcane Protection Potion (40213)
53911, // Mighty Fire Protection Potion (40214)
53913, // Mighty Frost Protection Potion (40215)
53914, // Mighty Nature Protection Potion (40216)
53915 // Mighty Shadow Protection Potion (40217)
};
Unit target = GetCaster();
if (!target.IsInCombat())
availableElixirs.Add(53753); // Potion of Nightmares (40081)
if (target.GetPowerType() == PowerType.Mana)
availableElixirs.Add(43186); // Runic Mana Potion(33448)
uint chosenElixir = availableElixirs.SelectRandom();
target.CastSpell(target, chosenElixir, true, GetCastItem());
}
public override void Register()
{
AfterCast.Add(new CastHandler(SecondaryEffect));
}
}
} }
+1 -1
View File
@@ -783,7 +783,7 @@ namespace Scripts.Spells.Priest
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{ {
PreventDefaultAction(); PreventDefaultAction();
GetTarget().RemoveMovementImpairingAuras(); GetTarget().RemoveMovementImpairingAuras(true);
} }
public override void Register() public override void Register()
+4 -4
View File
@@ -435,13 +435,13 @@ namespace Scripts.Spells.Quest
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode) void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{ {
Unit target = GetTarget(); Unit target = GetTarget();
target.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); target.AddUnitFlag(UnitFlags.ImmuneToPc);
target.AddUnitState(UnitState.Root); target.AddUnitState(UnitState.Root);
} }
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode) void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
{ {
GetTarget().RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); GetTarget().RemoveUnitFlag(UnitFlags.ImmuneToPc);
} }
public override void Register() public override void Register()
@@ -789,8 +789,8 @@ namespace Scripts.Spells.Quest
if (target.HasAura(SpellIds.PermanentFeignDeath)) if (target.HasAura(SpellIds.PermanentFeignDeath))
{ {
target.RemoveAurasDueToSpell(SpellIds.PermanentFeignDeath); target.RemoveAurasDueToSpell(SpellIds.PermanentFeignDeath);
target.SetUInt32Value(ObjectFields.DynamicFlags, 0); target.SetDynamicFlags(0);
target.SetUInt32Value(UnitFields.Flags2, 0); target.SetUnitFlags2(0);
target.SetHealth(target.GetMaxHealth() / 2); target.SetHealth(target.GetMaxHealth() / 2);
target.SetPower(PowerType.Mana, (int)(target.GetMaxPower(PowerType.Mana) * 0.75f)); target.SetPower(PowerType.Mana, (int)(target.GetMaxPower(PowerType.Mana) * 0.75f));
} }
+1 -1
View File
@@ -257,7 +257,7 @@ namespace Scripts.Spells.Warlock
if (circle) if (circle)
{ {
player.NearTeleportTo(circle.GetPositionX(), circle.GetPositionY(), circle.GetPositionZ(), circle.GetOrientation()); player.NearTeleportTo(circle.GetPositionX(), circle.GetPositionY(), circle.GetPositionZ(), circle.GetOrientation());
player.RemoveMovementImpairingAuras(); player.RemoveMovementImpairingAuras(false);
} }
} }
} }
+1 -1
View File
@@ -865,7 +865,7 @@ namespace Scripts.Spells.Warrior
void HandleOnProc(AuraEffect aurEff, ProcEventInfo procInfo) void HandleOnProc(AuraEffect aurEff, ProcEventInfo procInfo)
{ {
if (procInfo.GetActor().GetTypeId() == TypeId.Player && procInfo.GetActor().GetUInt32Value(PlayerFields.CurrentSpecId) == (uint)TalentSpecialization.WarriorFury) if (procInfo.GetActor().GetTypeId() == TypeId.Player && procInfo.GetActor().ToPlayer().GetPrimarySpecialization() == (uint)TalentSpecialization.WarriorFury)
PreventDefaultAction(); PreventDefaultAction();
procInfo.GetActor().GetSpellHistory().ResetCooldown(SpellIds.ImpendingVictory, true); procInfo.GetActor().GetSpellHistory().ResetCooldown(SpellIds.ImpendingVictory, true);
+3 -3
View File
@@ -101,7 +101,7 @@ namespace Scripts.World.BossEmeraldDragons
public override void Reset() public override void Reset()
{ {
base.Reset(); base.Reset();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
DoCast(me, Spells.MarkOfNatureAura, true); DoCast(me, Spells.MarkOfNatureAura, true);
@@ -478,7 +478,7 @@ namespace Scripts.World.BossEmeraldDragons
_shades += (byte)Spells.TaerarShadeSpells.Length; _shades += (byte)Spells.TaerarShadeSpells.Length;
DoCast(Spells.Shade); DoCast(Spells.Shade);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.SetReactState(ReactStates.Passive); me.SetReactState(ReactStates.Passive);
++_stage; ++_stage;
@@ -497,7 +497,7 @@ namespace Scripts.World.BossEmeraldDragons
{ {
_banished = false; _banished = false;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable); me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.RemoveAurasDueToSpell(Spells.Shade); me.RemoveAurasDueToSpell(Spells.Shade);
me.SetReactState(ReactStates.Aggressive); me.SetReactState(ReactStates.Aggressive);
} }
+1 -1
View File
@@ -363,7 +363,7 @@ namespace Scripts.World
if (Spell != 0) if (Spell != 0)
creature.CastSpell(player, Spell, false); creature.CastSpell(player, Spell, false);
else else
Log.outError(LogFilter.Scripts, "go_ethereum_prison summoned Creature (entry {0}) but faction ({1}) are not expected by script.", creature.GetEntry(), creature.getFaction()); Log.outError(LogFilter.Scripts, "go_ethereum_prison summoned Creature (entry {0}) but faction ({1}) are not expected by script.", creature.GetEntry(), creature.GetFaction());
} }
} }
} }
+3 -3
View File
@@ -206,7 +206,7 @@ namespace Scripts.World
List<ItemPosCount> dest = new List<ItemPosCount>(); List<ItemPosCount> dest = new List<ItemPosCount>();
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 39883, 1); // Cracked Egg InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 39883, 1); // Cracked Egg
if (msg == InventoryResult.Ok) if (msg == InventoryResult.Ok)
player.StoreNewItem(dest, 39883, true, ItemEnchantment.GenerateItemRandomPropertyId(39883)); player.StoreNewItem(dest, 39883, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(39883));
return true; return true;
} }
@@ -222,7 +222,7 @@ namespace Scripts.World
List<ItemPosCount> dest = new List<ItemPosCount>(); List<ItemPosCount> dest = new List<ItemPosCount>();
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 44718, 1); // Ripe Disgusting Jar InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 44718, 1); // Ripe Disgusting Jar
if (msg == InventoryResult.Ok) if (msg == InventoryResult.Ok)
player.StoreNewItem(dest, 44718, true, ItemEnchantment.GenerateItemRandomPropertyId(44718)); player.StoreNewItem(dest, 44718, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(44718));
return true; return true;
} }
@@ -257,7 +257,7 @@ namespace Scripts.World
{ {
summon.SetVisible(false); summon.SetVisible(false);
summon.SetReactState(ReactStates.Passive); summon.SetReactState(ReactStates.Passive);
summon.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc); summon.AddUnitFlag(UnitFlags.ImmuneToPc);
} }
return false; return false;
} }
+26 -26
View File
@@ -584,7 +584,7 @@ namespace Scripts.World.NpcSpecial
{ {
Initialize(); Initialize();
me.SetFaction(NpcSpecialConst.FactionChicken); me.SetFaction(NpcSpecialConst.FactionChicken);
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver); me.RemoveNpcFlag(NPCFlags.QuestGiver);
} }
public override void EnterCombat(Unit who) { } public override void EnterCombat(Unit who) { }
@@ -592,7 +592,7 @@ namespace Scripts.World.NpcSpecial
public override void UpdateAI(uint diff) public override void UpdateAI(uint diff)
{ {
// Reset flags after a certain time has passed so that the next player has to start the 'event' again // Reset flags after a certain time has passed so that the next player has to start the 'event' again
if (me.HasFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver)) if (me.HasNpcFlag(NPCFlags.QuestGiver))
{ {
if (ResetFlagTimer <= diff) if (ResetFlagTimer <= diff)
{ {
@@ -614,7 +614,7 @@ namespace Scripts.World.NpcSpecial
case TextEmotes.Chicken: case TextEmotes.Chicken:
if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.None && RandomHelper.Rand32() % 30 == 1) if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.None && RandomHelper.Rand32() % 30 == 1)
{ {
me.SetFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver); me.AddNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(NpcSpecialConst.FactionFriendly); me.SetFaction(NpcSpecialConst.FactionFriendly);
Talk(player.GetTeam() == Team.Horde ? Texts.EmoteHelloH : Texts.EmoteHelloA); Talk(player.GetTeam() == Team.Horde ? Texts.EmoteHelloH : Texts.EmoteHelloA);
} }
@@ -622,7 +622,7 @@ namespace Scripts.World.NpcSpecial
case TextEmotes.Cheer: case TextEmotes.Cheer:
if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.Complete) if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.Complete)
{ {
me.SetFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver); me.AddNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(NpcSpecialConst.FactionFriendly); me.SetFaction(NpcSpecialConst.FactionFriendly);
Talk(Texts.EmoteCluck); Talk(Texts.EmoteCluck);
} }
@@ -881,7 +881,7 @@ namespace Scripts.World.NpcSpecial
public override void Reset() public override void Reset()
{ {
Initialize(); Initialize();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
} }
public void BeginEvent(Player player) public void BeginEvent(Player player)
@@ -906,7 +906,7 @@ namespace Scripts.World.NpcSpecial
} }
Event = true; Event = true;
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
} }
public void PatientDied(Position point) public void PatientDied(Position point)
@@ -1004,7 +1004,7 @@ namespace Scripts.World.NpcSpecial
if (Patient) if (Patient)
{ {
//303, this flag appear to be required for client side item.spell to work (TARGET_SINGLE_FRIEND) //303, this flag appear to be required for client side item.spell to work (TARGET_SINGLE_FRIEND)
Patient.SetFlag(UnitFields.Flags, UnitFlags.PvpAttackable); Patient.AddUnitFlag(UnitFlags.PvpAttackable);
Patients.Add(Patient.GetGUID()); Patients.Add(Patient.GetGUID());
((npc_injured_patient)Patient.GetAI()).DoctorGUID = me.GetGUID(); ((npc_injured_patient)Patient.GetAI()).DoctorGUID = me.GetGUID();
@@ -1072,13 +1072,13 @@ namespace Scripts.World.NpcSpecial
Initialize(); Initialize();
//no select //no select
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.RemoveUnitFlag(UnitFlags.NotSelectable);
//no regen health //no regen health
me.SetFlag(UnitFields.Flags, UnitFlags.InCombat); me.AddUnitFlag(UnitFlags.InCombat);
//to make them lay with face down //to make them lay with face down
me.SetUInt32Value(UnitFields.Bytes1, (uint)UnitStandStateType.Dead); me.SetStandState(UnitStandStateType.Dead);
uint mobId = me.GetEntry(); uint mobId = me.GetEntry();
@@ -1118,13 +1118,13 @@ namespace Scripts.World.NpcSpecial
} }
//make not selectable //make not selectable
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
//regen health //regen health
me.RemoveFlag(UnitFields.Flags, UnitFlags.InCombat); me.RemoveUnitFlag(UnitFlags.InCombat);
//stand up //stand up
me.SetUInt32Value(UnitFields.Bytes1, (uint)UnitStandStateType.Stand); me.SetStandState(UnitStandStateType.Stand);
Talk(Texts.SayDoc); Talk(Texts.SayDoc);
@@ -1154,10 +1154,10 @@ namespace Scripts.World.NpcSpecial
if (me.IsAlive() && me.GetHealth() <= 6) if (me.IsAlive() && me.GetHealth() <= 6)
{ {
me.RemoveFlag(UnitFields.Flags, UnitFlags.InCombat); me.RemoveUnitFlag(UnitFlags.InCombat);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); me.AddUnitFlag(UnitFlags.NotSelectable);
me.setDeathState(DeathState.JustDied); me.setDeathState(DeathState.JustDied);
me.SetFlag(ObjectFields.DynamicFlags, 32); me.AddDynamicFlag(UnitDynFlags.Dead);
if (!DoctorGUID.IsEmpty()) if (!DoctorGUID.IsEmpty())
{ {
@@ -1308,7 +1308,7 @@ namespace Scripts.World.NpcSpecial
public override void Reset() public override void Reset()
{ {
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable); me.AddUnitFlag(UnitFlags.NonAttackable);
} }
public override void EnterCombat(Unit who) public override void EnterCombat(Unit who)
@@ -1706,7 +1706,7 @@ namespace Scripts.World.NpcSpecial
public override bool OnGossipHello(Player player, Creature creature) public override bool OnGossipHello(Player player, Creature creature)
{ {
if (player.HasFlag(PlayerFields.Flags, PlayerFlags.NoXPGain)) // not gaining XP if (player.HasPlayerFlag(PlayerFlags.NoXPGain)) // not gaining XP
{ {
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1); player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(Texts.XpOnOff, creature.GetGUID()); player.SEND_GOSSIP_MENU(Texts.XpOnOff, creature.GetGUID());
@@ -1726,10 +1726,10 @@ namespace Scripts.World.NpcSpecial
switch (action) switch (action)
{ {
case eTradeskill.GossipActionInfoDef + 1:// XP ON selected case eTradeskill.GossipActionInfoDef + 1:// XP ON selected
player.RemoveFlag(PlayerFields.Flags, PlayerFlags.NoXPGain); // turn on XP gain player.RemovePlayerFlag(PlayerFlags.NoXPGain); // turn on XP gain
break; break;
case eTradeskill.GossipActionInfoDef + 2:// XP OFF selected case eTradeskill.GossipActionInfoDef + 2:// XP OFF selected
player.SetFlag(PlayerFields.Flags, PlayerFlags.NoXPGain); // turn off XP gain player.AddPlayerFlag(PlayerFlags.NoXPGain); // turn off XP gain
break; break;
} }
@@ -2170,7 +2170,7 @@ namespace Scripts.World.NpcSpecial
break; break;
} }
me.UpdateEntry(CreatureIds.ExultingWindUpTrainWrecker); me.UpdateEntry(CreatureIds.ExultingWindUpTrainWrecker);
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotDance); me.SetEmoteState(Emote.OneshotDance);
me.DespawnOrUnsummon(5 * Time.InMilliseconds); me.DespawnOrUnsummon(5 * Time.InMilliseconds);
_nextAction = 0; _nextAction = 0;
break; break;
@@ -2216,8 +2216,8 @@ namespace Scripts.World.NpcSpecial
}); });
_scheduler.Schedule(TimeSpan.FromSeconds(1), task => _scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
{ {
if ((me.HasAura(Spells.AuraTiredS) || me.HasAura(Spells.AuraTiredG)) && me.HasFlag(UnitFields.NpcFlags, NPCFlags.Banker | NPCFlags.Mailbox | NPCFlags.Vendor)) if ((me.HasAura(Spells.AuraTiredS) || me.HasAura(Spells.AuraTiredG)) && me.HasNpcFlag(NPCFlags.Banker | NPCFlags.Mailbox | NPCFlags.Vendor))
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Banker | NPCFlags.Mailbox | NPCFlags.Vendor); me.RemoveNpcFlag(NPCFlags.Banker | NPCFlags.Mailbox | NPCFlags.Vendor);
task.Repeat(); task.Repeat();
}); });
} }
@@ -2228,7 +2228,7 @@ namespace Scripts.World.NpcSpecial
{ {
case GossipMenus.OptionIdBank: case GossipMenus.OptionIdBank:
{ {
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Banker); me.AddNpcFlag(NPCFlags.Banker);
uint _bankAura = IsArgentSquire() ? Spells.AuraBankS : Spells.AuraBankG; uint _bankAura = IsArgentSquire() ? Spells.AuraBankS : Spells.AuraBankG;
if (!me.HasAura(_bankAura)) if (!me.HasAura(_bankAura))
DoCastSelf(_bankAura); DoCastSelf(_bankAura);
@@ -2239,7 +2239,7 @@ namespace Scripts.World.NpcSpecial
} }
case GossipMenus.OptionIdShop: case GossipMenus.OptionIdShop:
{ {
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Vendor); me.AddNpcFlag(NPCFlags.Vendor);
uint _shopAura = IsArgentSquire() ? Spells.AuraShopS : Spells.AuraShopG; uint _shopAura = IsArgentSquire() ? Spells.AuraShopS : Spells.AuraShopG;
if (!me.HasAura(_shopAura)) if (!me.HasAura(_shopAura))
DoCastSelf(_shopAura); DoCastSelf(_shopAura);
@@ -2250,7 +2250,7 @@ namespace Scripts.World.NpcSpecial
} }
case GossipMenus.OptionIdMail: case GossipMenus.OptionIdMail:
{ {
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Mailbox); me.AddNpcFlag(NPCFlags.Mailbox);
player.GetSession().SendShowMailBox(me.GetGUID()); player.GetSession().SendShowMailBox(me.GetGUID());
uint _mailAura = IsArgentSquire() ? Spells.AuraPostmanS : Spells.AuraPostmanG; uint _mailAura = IsArgentSquire() ? Spells.AuraPostmanS : Spells.AuraPostmanG;