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.
/// </summary>
/// <returns></returns>
uint GetRepeatCounter()
public uint GetRepeatCounter()
{
return _task._repeated;
}
+1 -1
View File
@@ -365,7 +365,7 @@ namespace Game.AI
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 void SetData(uint id, uint value) { }
public virtual void SetGUID(ObjectGuid guid, int id = 0) { }
@@ -402,7 +402,7 @@ namespace Game.Network.Packets
public int OverEnergize;
}
class SpellInstakillLog : ServerPacket
public class SpellInstakillLog : ServerPacket
{
public SpellInstakillLog() : base(ServerOpcodes.SpellInstakillLog, ConnectionType.Instance) { }
@@ -35,271 +35,339 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight
struct TextIds
{
public const uint SayMidnightKill = 0;
public const uint SayAppear = 1;
public const uint SayMount = 2;
public const uint SayKill = 0;
public const uint SayDisarmed = 1;
public const uint SayDeath = 2;
public const uint SayRandom = 3;
public const uint SayRandom = 1;
public const uint SayDisarmed = 2;
public const uint SayMidnightKill = 3;
public const uint SayAppear = 4;
public const uint SayMount = 5;
public const uint SayDeath = 3;
// Midnight
public const uint EmoteCallAttumen = 0;
public const uint EmoteMountUp = 1;
}
struct SpellIds
{
public const uint Shadowcleave = 29832;
public const uint IntangiblePresence = 29833;
public const uint BerserkerCharge = 26561; //Only When Mounted
public const uint SpawnSmoke = 10389;
public const uint Charge = 29847;
// Midnight
public const uint Knockdown = 29711;
public const uint SummonAttumen = 29714;
public const uint Mount = 29770;
public const uint SummonAttumenMounted = 29799;
}
enum Phases
{
None,
AttumenEngages,
Mounted
}
[Script]
public class boss_attumen : ScriptedAI
public class boss_attumen : BossAI
{
public boss_attumen(Creature creature) : base(creature)
public boss_attumen(Creature creature) : base(creature, DataTypes.Attumen)
{
CleaveTimer = RandomHelper.URand(10000, 15000);
CurseTimer = 30000;
RandomYellTimer = RandomHelper.URand(30000, 60000); //Occasionally yell
ChargeTimer = 20000;
ResetTimer = 0;
Initialize();
}
void Initialize()
{
_midnightGUID.Clear();
_phase = Phases.None;
}
public override void Reset()
{
ResetTimer = 0;
Midnight.Clear();
Initialize();
base.Reset();
}
public override void EnterEvadeMode(EvadeReason why)
{
base.EnterEvadeMode(why);
ResetTimer = 2000;
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
if (midnight != null)
_DespawnAtEvade(10, midnight);
me.DespawnOrUnsummon();
}
public override void EnterCombat(Unit who) { }
public override void ScheduleTasks()
{
_scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25), task =>
{
DoCastVictim(SpellIds.Shadowcleave);
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25));
});
_scheduler.Schedule(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(45), task =>
{
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
if (target != null)
DoCast(target, SpellIds.IntangiblePresence);
task.Repeat(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(45));
});
_scheduler.Schedule(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60), task =>
{
Talk(TextIds.SayRandom);
task.Repeat(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60));
});
}
public override void DamageTaken(Unit attacker, ref uint damage)
{
// Attumen does not die until he mounts Midnight, let health fall to 1 and prevent further damage.
if (damage >= me.GetHealth() && _phase != Phases.Mounted)
damage = (uint)(me.GetHealth() - 1);
if (_phase == Phases.AttumenEngages && me.HealthBelowPctDamaged(25, damage))
{
_phase = Phases.None;
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
if (midnight != null)
midnight.GetAI().DoCastAOE(SpellIds.Mount, true);
}
}
public override void KilledUnit(Unit victim)
{
Talk(TextIds.SayKill);
}
public override void JustSummoned(Creature summon)
{
if (summon.GetEntry() == CreatureIds.AttumenMounted)
{
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
if (midnight != null)
{
if (midnight.GetHealth() > me.GetHealth())
summon.SetHealth(midnight.GetHealth());
else
summon.SetHealth(me.GetHealth());
summon.GetAI().DoZoneInCombat();
summon.GetAI().SetGUID(_midnightGUID, (int)CreatureIds.Midnight);
}
}
base.JustSummoned(summon);
}
public override void IsSummonedBy(Unit summoner)
{
if (summoner.GetEntry() == CreatureIds.Midnight)
_phase = Phases.AttumenEngages;
if (summoner.GetEntry() == CreatureIds.AttumenUnmounted)
{
_phase = Phases.Mounted;
DoCastSelf(SpellIds.SpawnSmoke);
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25), task =>
{
Unit target = null;
var t_list = me.GetThreatManager().getThreatList();
List<Unit> target_list = new List<Unit>();
foreach (var itr in t_list)
{
target = Global.ObjAccessor.GetUnit(me, itr.getUnitGuid());
if (target && !target.IsWithinDist(me, 8.00f, false) && target.IsWithinDist(me, 25.0f, false))
target_list.Add(target);
target = null;
}
if (!target_list.Empty())
target = target_list.SelectRandom();
DoCast(target, SpellIds.Charge);
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
});
_scheduler.Schedule(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(35), task =>
{
DoCastVictim(SpellIds.Knockdown);
task.Repeat(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(35));
});
}
}
public override void JustDied(Unit killer)
{
Talk(TextIds.SayDeath);
Unit midnight = Global.ObjAccessor.GetUnit(me, Midnight);
Unit midnight = Global.ObjAccessor.GetUnit(me, _midnightGUID);
if (midnight)
midnight.KillSelf();
base.JustDied(killer);
}
public override void SetGUID(ObjectGuid guid, int id = 0)
{
if (id == CreatureIds.Midnight)
_midnightGUID = guid;
}
public override void UpdateAI(uint diff)
{
if (ResetTimer != 0)
{
if (ResetTimer <= diff)
{
ResetTimer = 0;
Unit pMidnight = Global.ObjAccessor.GetUnit(me, Midnight);
if (pMidnight)
{
pMidnight.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
pMidnight.SetVisible(true);
}
Midnight.Clear();
me.SetVisible(false);
me.KillSelf();
}
else ResetTimer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
if (!UpdateVictim() && _phase != Phases.None)
return;
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable))
return;
if (CleaveTimer <= diff)
{
DoCastVictim(SpellIds.Shadowcleave);
CleaveTimer = RandomHelper.URand(10000, 15000);
}
else CleaveTimer -= diff;
if (CurseTimer <= diff)
{
DoCastVictim(SpellIds.IntangiblePresence);
CurseTimer = 30000;
}
else CurseTimer -= diff;
if (RandomYellTimer <= diff)
{
Talk(TextIds.SayRandom);
RandomYellTimer = RandomHelper.URand(30000, 60000);
}
else RandomYellTimer -= diff;
if (me.GetUInt32Value(UnitFields.DisplayId) == Misc.MountedDisplayid)
{
if (ChargeTimer <= diff)
{
var t_list = me.GetThreatManager().getThreatList();
List<Unit> target_list = new List<Unit>();
foreach (var hostileRefe in t_list)
{
var unit = Global.ObjAccessor.GetUnit(me, hostileRefe.getUnitGuid());
if (unit && !unit.IsWithinDist(me, SharedConst.AttackDistance, false))
target_list.Add(unit);
unit = null;
}
Unit target = null;
if (!target_list.Empty())
target = target_list.SelectRandom();
DoCast(target, SpellIds.BerserkerCharge);
ChargeTimer = 20000;
}
else ChargeTimer -= diff;
}
else
{
if (HealthBelowPct(25))
{
Creature pMidnight = ObjectAccessor.GetCreature(me, Midnight);
if (pMidnight && pMidnight.IsTypeId(TypeId.Unit))
{
((boss_midnight)pMidnight.GetAI()).Mount(me);
me.SetHealth(pMidnight.GetHealth());
DoResetThreat();
}
}
}
DoMeleeAttackIfReady();
_scheduler.Update(diff, DoMeleeAttackIfReady);
}
public override void SpellHit(Unit source, SpellInfo spell)
{
if (spell.Mechanic == Mechanics.Disarm)
Talk(TextIds.SayDisarmed);
if (spell.Id == SpellIds.Mount)
{
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
if (midnight != null)
{
_phase = Phases.None;
_scheduler.CancelAll();
midnight.AttackStop();
midnight.RemoveAllAttackers();
midnight.SetReactState(ReactStates.Passive);
midnight.GetMotionMaster().MoveChase(me);
midnight.GetAI().Talk(TextIds.EmoteMountUp);
me.AttackStop();
me.RemoveAllAttackers();
me.SetReactState(ReactStates.Passive);
me.GetMotionMaster().MoveChase(midnight);
Talk(TextIds.SayMount);
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
{
Creature midnight1 = ObjectAccessor.GetCreature(me, _midnightGUID);
if (midnight1 != null)
{
if (me.IsWithinMeleeRange(midnight1))
{
DoCastAOE(SpellIds.SummonAttumenMounted);
me.SetVisible(false);
midnight1.SetVisible(false);
}
else
{
midnight1.GetMotionMaster().MoveChase(me);
me.GetMotionMaster().MoveChase(midnight1);
task.Repeat(TimeSpan.FromSeconds(3));
}
}
});
}
}
}
public ObjectGuid Midnight;
uint CleaveTimer;
uint CurseTimer;
uint RandomYellTimer;
uint ChargeTimer; //only when mounted
uint ResetTimer;
ObjectGuid _midnightGUID;
Phases _phase;
}
[Script]
public class boss_midnight : ScriptedAI
public class boss_midnight : BossAI
{
public boss_midnight(Creature creature) : base(creature) { }
public boss_midnight(Creature creature) : base(creature, DataTypes.Attumen)
{
Initialize();
}
void Initialize()
{
_phase = Phases.None;
}
public override void Reset()
{
Phase = 1;
Attumen.Clear();
mountTimer = 0;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
Initialize();
base.Reset();
me.SetVisible(true);
me.SetReactState(ReactStates.Defensive);
}
public override void EnterCombat(Unit who) { }
public override void DamageTaken(Unit attacker, ref uint damage)
{
// Midnight never dies, let health fall to 1 and prevent further damage.
if (damage >= me.GetHealth())
damage = (uint)(me.GetHealth() - 1);
if (_phase == Phases.None && me.HealthBelowPctDamaged(95, damage))
{
_phase = Phases.AttumenEngages;
Talk(TextIds.EmoteCallAttumen);
DoCastAOE(SpellIds.SummonAttumen);
}
else if (_phase == Phases.AttumenEngages && me.HealthBelowPctDamaged(25, damage))
{
_phase = Phases.Mounted;
DoCastAOE(SpellIds.Mount, true);
}
}
public override void JustSummoned(Creature summon)
{
if (summon.GetEntry() == CreatureIds.AttumenUnmounted)
{
_attumenGUID = summon.GetGUID();
summon.GetAI().SetGUID(me.GetGUID(), (int)CreatureIds.Midnight);
summon.GetAI().AttackStart(me.GetVictim());
summon.GetAI().Talk(TextIds.SayAppear);
}
base.JustSummoned(summon);
}
public override void EnterCombat(Unit who)
{
base.EnterCombat(who);
_scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25), task =>
{
DoCastVictim(SpellIds.Knockdown);
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25));
});
}
public override void EnterEvadeMode(EvadeReason why = EvadeReason.Other)
{
base._DespawnAtEvade(10);
}
public override void KilledUnit(Unit victim)
{
if (Phase == 2)
if (_phase == Phases.AttumenEngages)
{
Unit unit = Global.ObjAccessor.GetUnit(me, Attumen);
if (unit)
Unit unit = Global.ObjAccessor.GetUnit(me, _attumenGUID);
if (unit != null)
Talk(TextIds.SayMidnightKill, unit);
}
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
if (!UpdateVictim() || _phase == Phases.Mounted)
return;
if (Phase == 1 && HealthBelowPct(95))
{
Phase = 2;
Creature attumen = me.SummonCreature(Misc.SummonAttumen, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedOrDeadDespawn, 30000);
if (attumen)
{
Attumen = attumen.GetGUID();
attumen.GetAI().AttackStart(me.GetVictim());
SetMidnight(attumen, me.GetGUID());
Talk(TextIds.SayAppear, attumen);
}
}
else if (Phase == 2 && HealthBelowPct(25))
{
Unit pAttumen = Global.ObjAccessor.GetUnit(me, Attumen);
if (pAttumen)
Mount(pAttumen);
}
else if (Phase == 3)
{
if (mountTimer != 0)
{
if (mountTimer <= diff)
{
mountTimer = 0;
me.SetVisible(false);
me.GetMotionMaster().MoveIdle();
Unit pAttumen = Global.ObjAccessor.GetUnit(me, Attumen);
if (pAttumen)
{
pAttumen.SetDisplayId(Misc.MountedDisplayid);
pAttumen.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
if (pAttumen.GetVictim())
{
pAttumen.GetMotionMaster().MoveChase(pAttumen.GetVictim());
pAttumen.SetTarget(pAttumen.GetVictim().GetGUID());
}
pAttumen.SetObjectScale(1);
}
}
else mountTimer -= diff;
}
}
if (Phase != 3)
DoMeleeAttackIfReady();
_scheduler.Update(diff, DoMeleeAttackIfReady);
}
public void Mount(Unit pAttumen)
{
Talk(TextIds.SayMount, pAttumen);
Phase = 3;
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
pAttumen.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
float angle = me.GetAngle(pAttumen);
float distance = me.GetDistance2d(pAttumen);
float newX = me.GetPositionX() + (float)Math.Cos(angle) * (distance / 2);
float newY = me.GetPositionY() + (float)Math.Sin(angle) * (distance / 2);
float newZ = 50;
me.GetMotionMaster().Clear();
me.GetMotionMaster().MovePoint(0, newX, newY, newZ);
distance += 10;
newX = me.GetPositionX() + (float)Math.Cos(angle) * (distance / 2);
newY = me.GetPositionY() + (float)Math.Sin(angle) * (distance / 2);
pAttumen.GetMotionMaster().Clear();
pAttumen.GetMotionMaster().MovePoint(0, newX, newY, newZ);
mountTimer = 1000;
}
void SetMidnight(Creature pAttumen, ObjectGuid value)
{
((boss_attumen)pAttumen.GetAI()).Midnight = value;
}
ObjectGuid Attumen;
byte Phase;
uint mountTimer;
ObjectGuid _attumenGUID;
Phases _phase;
}
}
@@ -35,124 +35,135 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
struct SpellIds
{
//Flare spell info
public const uint AstralFlarePassive = 30234; //Visual effect + Flare damage
//Curator spell info
public const uint HatefulBolt = 30383;
public const uint Evocation = 30254;
public const uint Enrage = 30403; //Arcane Infusion: Transforms Curator and adds damage.
public const uint ArcaneInfusion = 30403;
public const uint Berserk = 26662;
public const uint SummonAstralFlareNE = 30236;
public const uint SummonAstralFlareNW = 30239;
public const uint SummonAstralFlareSE = 30240;
public const uint SummonAstralFlareSW = 30241;
}
struct EventIds
{
public const uint HatefulBolt = 1;
public const uint SummonAstralFlare = 2;
public const uint ArcaneInfusion = 3;
public const uint Berserk = 4;
}
[Script]
class boss_curator : ScriptedAI
class boss_curator : BossAI
{
public boss_curator(Creature creature) : base(creature)
{
Initialize();
}
void Initialize()
{
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
{
//Summon Astral Flare
Creature AstralFlare = DoSpawnCreature(17096, RandomHelper.Rand32() % 37, RandomHelper.Rand32() % 37, 0, 0, TempSummonType.TimedDespawnOOC, 5000);
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
if (AstralFlare && target)
{
AstralFlare.CastSpell(AstralFlare, SpellIds.AstralFlarePassive, false);
AstralFlare.GetAI().AttackStart(target);
}
//Reduce Mana by 10% of max health
int mana = me.GetMaxPower(PowerType.Mana);
if (mana != 0)
{
mana /= 10;
me.ModifyPower(PowerType.Mana, -mana);
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
{
Talk(TextIds.SayEvocate);
me.InterruptNonMeleeSpells(false);
DoCast(me, SpellIds.Evocation);
_scheduler.DelayAll(TimeSpan.FromSeconds(20));
//Evocating = true;
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
return;
}
else
{
if (RandomHelper.URand(0, 1) == 0)
{
Talk(TextIds.SaySummon);
}
}
}
task.Repeat();
});
_scheduler.Schedule(TimeSpan.FromSeconds(15), task =>
{
if (Enraged)
task.Repeat(TimeSpan.FromSeconds(7));
else
task.Repeat();
Unit target = SelectTarget(SelectAggroTarget.TopAggro, 1);
if (target)
DoCast(target, SpellIds.HatefulBolt);
});
Enraged = false;
}
public boss_curator(Creature creature) : base(creature, DataTypes.Curator) { }
public override void Reset()
{
Initialize();
_Reset();
_infused = false;
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Arcane, true);
}
public override void KilledUnit(Unit victim)
{
Talk(TextIds.SayKill);
if (victim.GetTypeId() == TypeId.Player)
Talk(TextIds.SayKill);
}
public override void JustDied(Unit killer)
{
_JustDied();
Talk(TextIds.SayDeath);
}
public override void EnterCombat(Unit victim)
{
_EnterCombat();
Talk(TextIds.SayAggro);
_events.ScheduleEvent(EventIds.HatefulBolt, TimeSpan.FromSeconds(12));
_events.ScheduleEvent(EventIds.SummonAstralFlare, TimeSpan.FromSeconds(10));
_events.ScheduleEvent(EventIds.Berserk, TimeSpan.FromMinutes(12));
}
public override void DamageTaken(Unit attacker, ref uint damage)
{
if (!HealthAbovePct(15) && !_infused)
{
_infused = true;
_events.ScheduleEvent(EventIds.ArcaneInfusion, TimeSpan.FromMilliseconds(1));
_events.CancelEvent(EventIds.SummonAstralFlare);
}
}
public override void ExecuteEvent(uint eventId)
{
switch (eventId)
{
case EventIds.HatefulBolt:
Unit target = SelectTarget(SelectAggroTarget.TopAggro, 1);
if (target != null)
DoCast(target, SpellIds.HatefulBolt);
_events.Repeat(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(15));
break;
case EventIds.ArcaneInfusion:
DoCastSelf(SpellIds.ArcaneInfusion, true);
break;
case EventIds.SummonAstralFlare:
if (RandomHelper.randChance(50))
Talk(TextIds.SaySummon);
DoCastSelf(RandomHelper.RAND(SpellIds.SummonAstralFlareNE, SpellIds.SummonAstralFlareNW, SpellIds.SummonAstralFlareSE, SpellIds.SummonAstralFlareSW), true);
int mana = me.GetMaxPower(PowerType.Mana) / 10;
if (mana != 0)
{
me.ModifyPower(PowerType.Mana, -mana);
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
{
Talk(TextIds.SayEvocate);
me.InterruptNonMeleeSpells(false);
DoCastSelf(SpellIds.Evocation);
}
}
_events.Repeat(TimeSpan.FromSeconds(10));
break;
case EventIds.Berserk:
Talk(TextIds.SayEnrage);
DoCastSelf(SpellIds.Berserk, true);
break;
default:
break;
}
}
bool _infused;
}
[Script]
class npc_curator_astral_flareAI : ScriptedAI
{
public npc_curator_astral_flareAI(Creature creature) : base(creature)
{
me.SetReactState(ReactStates.Passive);
}
public override void Reset()
{
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
{
me.SetReactState(ReactStates.Aggressive);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
DoZoneInCombat();
});
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff);
if (!Enraged)
{
if (!HealthAbovePct(15))
{
Enraged = true;
DoCast(me, SpellIds.Enrage);
Talk(TextIds.SayEnrage);
}
}
}
bool Enraged;
}
}
@@ -28,19 +28,6 @@ namespace Scripts.EasternKingdoms.Karazhan
{
public const uint MaxEncounter = 12;
public const uint BossAttumen = 1;
public const uint BossMoroes = 2;
public const uint BossMaiden = 3;
public const uint OptionalBoss = 4;
public const uint BossOpera = 5;
public const uint Curator = 6;
public const uint Aran = 7;
public const uint Terestian = 8;
public const uint Netherspite = 9;
public const uint Chess = 10;
public const uint Malchezzar = 11;
public const uint Nightbane = 12;
public static Dialogue[] OzDialogue =
{
new Dialogue(0, 6000),
@@ -108,6 +95,15 @@ namespace Scripts.EasternKingdoms.Karazhan
public const uint NpcArcanagos = 17652;
public const uint NpcSpotlight = 19525;
public static Position[] OptionalSpawn =
{
new Position(-10960.981445f, -1940.138428f, 46.178097f, 4.12f), // Hyakiss the Lurker
new Position(-10945.769531f, -2040.153320f, 49.474438f, 0.077f), // Shadikith the Glider
new Position(-10899.903320f, -2085.573730f, 49.474449f, 1.38f) // Rokad the Ravager
};
public const uint OptionalBossRequiredDeathCount = 50;
}
struct Dialogue
@@ -124,12 +120,22 @@ namespace Scripts.EasternKingdoms.Karazhan
struct DataTypes
{
public const uint OperaPerformance = 13;
public const uint Attumen = 1;
public const uint Moroes = 2;
public const uint MaidenOfVirtue = 3;
public const uint OptionalBoss = 4;
public const uint OperaPerformance = 5;
public const uint Curator = 6;
public const uint Aran = 7;
public const uint Terestian = 8;
public const uint Netherspite = 9;
public const uint Chess = 10;
public const uint Malchezzar = 11;
public const uint Nightbane = 12;
public const uint OperaOzDeathcount = 14;
public const uint Kilrek = 15;
public const uint Terestian = 16;
public const uint Moroes = 17;
public const uint GoCurtains = 18;
public const uint GoStagedoorleft = 19;
public const uint GoStagedoorright = 20;
@@ -143,6 +149,7 @@ namespace Scripts.EasternKingdoms.Karazhan
public const uint MastersTerraceDoor1 = 27;
public const uint MastersTerraceDoor2 = 28;
public const uint GoSideEntranceDoor = 29;
public const uint GoBlackenedUrn = 30;
}
struct OperaEvents
@@ -152,6 +159,47 @@ namespace Scripts.EasternKingdoms.Karazhan
public const uint RAJ = 3;
}
struct CreatureIds
{
public const uint HyakissTheLurker = 16179;
public const uint RokadTheRavager = 16181;
public const uint ShadikithTheGlider = 16180;
public const uint TerestianIllhoof = 15688;
public const uint Moroes = 15687;
public const uint Nightbane = 17225;
public const uint AttumenUnmounted = 15550;
public const uint AttumenMounted = 16152;
public const uint Midnight = 16151;
// Trash
public const uint ColdmistWidow = 16171;
public const uint ColdmistStalker = 16170;
public const uint Shadowbat = 16173;
public const uint VampiricShadowbat = 16175;
public const uint GreaterShadowbat = 16174;
public const uint PhaseHound = 16178;
public const uint Dreadbeast = 16177;
public const uint Shadowbeast = 16176;
public const uint Kilrek = 17229;
}
struct GameObjectIds
{
public const uint StageCurtain = 183932;
public const uint StageDoorLeft = 184278;
public const uint StageDoorRight = 184279;
public const uint PrivateLibraryDoor = 184517;
public const uint MassiveDoor = 185521;
public const uint GamesmanHallDoor = 184276;
public const uint GamesmanHallExitDoor = 184277;
public const uint NetherspaceDoor = 185134;
public const uint MastersTerraceDoor = 184274;
public const uint MastersTerraceDoor2 = 184280;
public const uint SideEntranceDoor = 184275;
public const uint DustCoveredChest = 185119;
public const uint BlackenedUrn = 194092;
}
[Script]
public class instance_karazhan : InstanceMapScript
{
@@ -162,33 +210,70 @@ namespace Scripts.EasternKingdoms.Karazhan
public instance_karazhan_InstanceMapScript(InstanceMap map) : base(map)
{
SetHeaders("KZ");
SetBossNumber(karazhanConst.MaxEncounter);
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
m_uiOperaEvent = RandomHelper.URand(1, 3);
m_uiOzDeathCount = 0;
}
public override bool IsEncounterInProgress()
{
for (byte i = 0; i < karazhanConst.MaxEncounter; ++i)
if (m_auiEncounter[i] == (uint)EncounterState.InProgress)
return true;
return false;
OperaEvent = RandomHelper.URand(1, 3);
OzDeathCount = 0;
OptionalBossCount = 0;
}
public override void OnCreatureCreate(Creature creature)
{
switch (creature.GetEntry())
{
case 17229:
m_uiKilrekGUID = creature.GetGUID();
case CreatureIds.Kilrek:
KilrekGUID = creature.GetGUID();
break;
case 15688:
m_uiTerestianGUID = creature.GetGUID();
case CreatureIds.TerestianIllhoof:
TerestianGUID = creature.GetGUID();
break;
case 15687:
m_uiMoroesGUID = creature.GetGUID();
case CreatureIds.Moroes:
MoroesGUID = creature.GetGUID();
break;
case CreatureIds.Nightbane:
NightbaneGUID = creature.GetGUID();
break;
}
}
public override void OnUnitDeath(Unit unit)
{
Creature creature = unit.ToCreature();
if (creature == null)
return;
switch (creature.GetEntry())
{
case CreatureIds.ColdmistWidow:
case CreatureIds.ColdmistStalker:
case CreatureIds.Shadowbat:
case CreatureIds.VampiricShadowbat:
case CreatureIds.GreaterShadowbat:
case CreatureIds.PhaseHound:
case CreatureIds.Dreadbeast:
case CreatureIds.Shadowbeast:
if (GetBossState(DataTypes.OptionalBoss) == EncounterState.ToBeDecided)
{
++OptionalBossCount;
if (OptionalBossCount == karazhanConst.OptionalBossRequiredDeathCount)
{
switch (RandomHelper.URand(CreatureIds.HyakissTheLurker, CreatureIds.RokadTheRavager))
{
case CreatureIds.HyakissTheLurker:
instance.SummonCreature(CreatureIds.HyakissTheLurker, karazhanConst.OptionalSpawn[0]);
break;
case CreatureIds.ShadikithTheGlider:
instance.SummonCreature(CreatureIds.ShadikithTheGlider, karazhanConst.OptionalSpawn[1]);
break;
case CreatureIds.RokadTheRavager:
instance.SummonCreature(CreatureIds.RokadTheRavager, karazhanConst.OptionalSpawn[2]);
break;
}
}
}
break;
default:
break;
}
}
@@ -197,67 +282,42 @@ namespace Scripts.EasternKingdoms.Karazhan
{
switch (type)
{
case karazhanConst.BossAttumen:
m_auiEncounter[0] = uiData;
break;
case karazhanConst.BossMoroes:
if (m_auiEncounter[1] == (uint)EncounterState.Done)
break;
m_auiEncounter[1] = uiData;
break;
case karazhanConst.BossMaiden:
m_auiEncounter[2] = uiData;
break;
case karazhanConst.OptionalBoss:
m_auiEncounter[3] = uiData;
break;
case karazhanConst.BossOpera:
m_auiEncounter[4] = uiData;
if (uiData == (uint)EncounterState.Done)
UpdateEncounterStateForKilledCreature(16812, null);
break;
case karazhanConst.Curator:
m_auiEncounter[5] = uiData;
break;
case karazhanConst.Aran:
m_auiEncounter[6] = uiData;
break;
case karazhanConst.Terestian:
m_auiEncounter[7] = uiData;
break;
case karazhanConst.Netherspite:
m_auiEncounter[8] = uiData;
break;
case karazhanConst.Chess:
if (uiData == (uint)EncounterState.Done)
DoRespawnGameObject(DustCoveredChest, Time.Day);
m_auiEncounter[9] = uiData;
break;
case karazhanConst.Malchezzar:
m_auiEncounter[10] = uiData;
break;
case karazhanConst.Nightbane:
if (m_auiEncounter[11] != (uint)EncounterState.Done)
m_auiEncounter[11] = uiData;
break;
case DataTypes.OperaOzDeathcount:
if (uiData == (uint)EncounterState.Special)
++m_uiOzDeathCount;
++OzDeathCount;
else if (uiData == (uint)EncounterState.InProgress)
m_uiOzDeathCount = 0;
OzDeathCount = 0;
break;
}
}
public override bool SetBossState(uint id, EncounterState state)
{
if (!base.SetBossState(id, state))
return false;
switch (id)
{
case DataTypes.OperaPerformance:
if (state == EncounterState.Done)
{
HandleGameObject(StageDoorLeftGUID, true);
HandleGameObject(StageDoorRightGUID, true);
GameObject sideEntrance = instance.GetGameObject(SideEntranceDoor);
if (sideEntrance != null)
sideEntrance.RemoveFlag(GameObjectFlags.Locked);
UpdateEncounterStateForKilledCreature(16812, null);
}
break;
case DataTypes.Chess:
if (state == EncounterState.Done)
DoRespawnGameObject(DustCoveredChest, Time.Day);
break;
default:
break;
}
if (uiData == (uint)EncounterState.Done)
{
OUT_SAVE_INST_DATA();
strSaveData =
$"{m_auiEncounter[0]} {m_auiEncounter[1]} {m_auiEncounter[2]} {m_auiEncounter[3]} {m_auiEncounter[4]} {m_auiEncounter[5]} {m_auiEncounter[6]} {m_auiEncounter[7]} {m_auiEncounter[8]} {m_auiEncounter[9]} {m_auiEncounter[10]} {m_auiEncounter[11]}";
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE();
}
return true;
}
public override void SetGuidData(uint identifier, ObjectGuid data)
@@ -270,53 +330,56 @@ namespace Scripts.EasternKingdoms.Karazhan
{
switch (go.GetEntry())
{
case 183932:
m_uiCurtainGUID = go.GetGUID();
case GameObjectIds.StageCurtain:
CurtainGUID = go.GetGUID();
break;
case 184278:
m_uiStageDoorLeftGUID = go.GetGUID();
if (m_auiEncounter[4] == (uint)EncounterState.Done)
case GameObjectIds.StageDoorLeft:
StageDoorLeftGUID = go.GetGUID();
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
go.SetGoState(GameObjectState.Active);
break;
case 184279:
m_uiStageDoorRightGUID = go.GetGUID();
if (m_auiEncounter[4] == (uint)EncounterState.Done)
case GameObjectIds.StageDoorRight:
StageDoorRightGUID = go.GetGUID();
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
go.SetGoState(GameObjectState.Active);
break;
case 184517:
m_uiLibraryDoor = go.GetGUID();
case GameObjectIds.PrivateLibraryDoor:
LibraryDoor = go.GetGUID();
break;
case 185521:
m_uiMassiveDoor = go.GetGUID();
case GameObjectIds.MassiveDoor:
MassiveDoor = go.GetGUID();
break;
case 184276:
m_uiGamesmansDoor = go.GetGUID();
case GameObjectIds.GamesmanHallDoor:
GamesmansDoor = go.GetGUID();
break;
case 184277:
m_uiGamesmansExitDoor = go.GetGUID();
case GameObjectIds.GamesmanHallExitDoor:
GamesmansExitDoor = go.GetGUID();
break;
case 185134:
m_uiNetherspaceDoor = go.GetGUID();
case GameObjectIds.NetherspaceDoor:
NetherspaceDoor = go.GetGUID();
break;
case 184274:
case GameObjectIds.MastersTerraceDoor:
MastersTerraceDoor[0] = go.GetGUID();
break;
case 184280:
case GameObjectIds.MastersTerraceDoor2:
MastersTerraceDoor[1] = go.GetGUID();
break;
case 184275:
m_uiSideEntranceDoor = go.GetGUID();
if (m_auiEncounter[4] == (uint)EncounterState.Done)
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
case GameObjectIds.SideEntranceDoor:
SideEntranceDoor = go.GetGUID();
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
go.AddFlag(GameObjectFlags.Locked);
else
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
go.RemoveFlag(GameObjectFlags.Locked);
break;
case 185119:
case GameObjectIds.DustCoveredChest:
DustCoveredChest = go.GetGUID();
break;
case GameObjectIds.BlackenedUrn:
BlackenedUrnGUID = go.GetGUID();
break;
}
switch (m_uiOperaEvent)
switch (OperaEvent)
{
// @todo Set Object visibilities for Opera based on performance
case OperaEvents.Oz:
@@ -330,43 +393,14 @@ namespace Scripts.EasternKingdoms.Karazhan
}
}
public override string GetSaveData()
{
return strSaveData;
}
public override uint GetData(uint uiData)
{
switch (uiData)
{
case karazhanConst.BossAttumen:
return m_auiEncounter[0];
case karazhanConst.BossMoroes:
return m_auiEncounter[1];
case karazhanConst.BossMaiden:
return m_auiEncounter[2];
case karazhanConst.OptionalBoss:
return m_auiEncounter[3];
case karazhanConst.BossOpera:
return m_auiEncounter[4];
case karazhanConst.Curator:
return m_auiEncounter[5];
case karazhanConst.Aran:
return m_auiEncounter[6];
case karazhanConst.Terestian:
return m_auiEncounter[7];
case karazhanConst.Netherspite:
return m_auiEncounter[8];
case karazhanConst.Chess:
return m_auiEncounter[9];
case karazhanConst.Malchezzar:
return m_auiEncounter[10];
case karazhanConst.Nightbane:
return m_auiEncounter[11];
case DataTypes.OperaPerformance:
return m_uiOperaEvent;
return OperaEvent;
case DataTypes.OperaOzDeathcount:
return m_uiOzDeathCount;
return OzDeathCount;
}
return 0;
@@ -377,82 +411,64 @@ namespace Scripts.EasternKingdoms.Karazhan
switch (uiData)
{
case DataTypes.Kilrek:
return m_uiKilrekGUID;
return KilrekGUID;
case DataTypes.Terestian:
return m_uiTerestianGUID;
return TerestianGUID;
case DataTypes.Moroes:
return m_uiMoroesGUID;
return MoroesGUID;
case DataTypes.Nightbane:
return NightbaneGUID;
case DataTypes.GoStagedoorleft:
return m_uiStageDoorLeftGUID;
return StageDoorLeftGUID;
case DataTypes.GoStagedoorright:
return m_uiStageDoorRightGUID;
return StageDoorRightGUID;
case DataTypes.GoCurtains:
return m_uiCurtainGUID;
return CurtainGUID;
case DataTypes.GoLibraryDoor:
return m_uiLibraryDoor;
return LibraryDoor;
case DataTypes.GoMassiveDoor:
return m_uiMassiveDoor;
return MassiveDoor;
case DataTypes.GoSideEntranceDoor:
return m_uiSideEntranceDoor;
return SideEntranceDoor;
case DataTypes.GoGameDoor:
return m_uiGamesmansDoor;
return GamesmansDoor;
case DataTypes.GoGameExitDoor:
return m_uiGamesmansExitDoor;
return GamesmansExitDoor;
case DataTypes.GoNetherDoor:
return m_uiNetherspaceDoor;
return NetherspaceDoor;
case DataTypes.MastersTerraceDoor1:
return MastersTerraceDoor[0];
case DataTypes.MastersTerraceDoor2:
return MastersTerraceDoor[1];
case DataTypes.ImageOfMedivh:
return ImageGUID;
case DataTypes.GoBlackenedUrn:
return BlackenedUrnGUID;
}
return ObjectGuid.Empty;
}
public override void Load(string str)
{
if (string.IsNullOrEmpty(str))
{
OUT_LOAD_INST_DATA_FAIL();
return;
}
OUT_LOAD_INST_DATA(str);
StringArguments loadStream = new StringArguments(str);
for (byte i = 0; i < karazhanConst.MaxEncounter; ++i)
{
var state = (EncounterState)loadStream.NextUInt32();
// Do not load an encounter as "In Progress" - reset it instead.
m_auiEncounter[i] = (uint)(state == EncounterState.InProgress ? EncounterState.NotStarted : state);
}
OUT_LOAD_INST_DATA_COMPLETE();
}
uint[] m_auiEncounter = new uint[karazhanConst.MaxEncounter];
string strSaveData;
uint m_uiOperaEvent;
uint m_uiOzDeathCount;
ObjectGuid m_uiCurtainGUID;
ObjectGuid m_uiStageDoorLeftGUID;
ObjectGuid m_uiStageDoorRightGUID;
ObjectGuid m_uiKilrekGUID;
ObjectGuid m_uiTerestianGUID;
ObjectGuid m_uiMoroesGUID;
ObjectGuid m_uiLibraryDoor; // Door at Shade of Aran
ObjectGuid m_uiMassiveDoor; // Door at Netherspite
ObjectGuid m_uiSideEntranceDoor; // Side Entrance
ObjectGuid m_uiGamesmansDoor; // Door before Chess
ObjectGuid m_uiGamesmansExitDoor; // Door after Chess
ObjectGuid m_uiNetherspaceDoor; // Door at Malchezaar
uint OperaEvent;
uint OzDeathCount;
uint OptionalBossCount;
ObjectGuid CurtainGUID;
ObjectGuid StageDoorLeftGUID;
ObjectGuid StageDoorRightGUID;
ObjectGuid KilrekGUID;
ObjectGuid TerestianGUID;
ObjectGuid MoroesGUID;
ObjectGuid NightbaneGUID;
ObjectGuid LibraryDoor; // Door at Shade of Aran
ObjectGuid MassiveDoor; // Door at Netherspite
ObjectGuid SideEntranceDoor; // Side Entrance
ObjectGuid GamesmansDoor; // Door before Chess
ObjectGuid GamesmansExitDoor; // Door after Chess
ObjectGuid NetherspaceDoor; // Door at Malchezaar
ObjectGuid[] MastersTerraceDoor = new ObjectGuid[2];
ObjectGuid ImageGUID;
ObjectGuid DustCoveredChest;
ObjectGuid BlackenedUrnGUID;
}
public override InstanceScript GetInstanceScript(InstanceMap map)
@@ -112,12 +112,12 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
if (me.IsAlive())
SpawnAdds();
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.NotStarted);
instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
}
void StartEvent()
{
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.InProgress);
instance.SetBossState(DataTypes.Moroes, EncounterState.InProgress);
DoZoneInCombat();
}
@@ -140,7 +140,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
{
Talk(TextIds.Death);
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.Done);
instance.SetBossState(DataTypes.Moroes, EncounterState.Done);
DeSpawnAdds();
@@ -229,7 +229,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
if (!UpdateVictim())
return;
if (instance.GetData(karazhanConst.BossMoroes) == 0)
if (instance.GetData(DataTypes.Moroes) == 0)
{
EnterEvadeMode();
return;
@@ -338,7 +338,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
public override void Reset()
{
instance.SetData(karazhanConst.BossMoroes, (uint)EncounterState.NotStarted);
instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
}
public void AcquireGUID()
@@ -371,7 +371,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
public override void UpdateAI(uint diff)
{
if (instance.GetData(karazhanConst.BossMoroes) == 0)
if (instance.GetData(DataTypes.Moroes) == 0)
EnterEvadeMode();
DoMeleeAttackIfReady();
@@ -25,8 +25,7 @@ using System.Collections.Generic;
namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
#region Wizard of Oz
struct WizardOfOz
struct TextIds
{
public const uint SayDorotheeDeath = 0;
public const uint SayDorotheeSummon = 1;
@@ -49,52 +48,70 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public const uint SayCroneAggro = 0;
public const uint SayCroneDeath = 1;
public const uint SayCroneSlay = 2;
// Dorothee
public const uint SpellWaterbolt = 31012;
public const uint SpellScream = 31013;
public const uint SpellSummontito = 31014;
// Tito
public const uint SpellYipping = 31015;
// Strawman
public const uint SpellBrainBash = 31046;
public const uint SpellBrainWipe = 31069;
public const uint SpellBurningStraw = 31075;
// Tinhead
public const uint SpellCleave = 31043;
public const uint SpellRust = 31086;
// Roar
public const uint SpellMangle = 31041;
public const uint SpellShred = 31042;
public const uint SpellFrightenedScream = 31013;
// Crone
public const uint SpellChainLightning = 32337;
// Cyclone
public const uint SpellKnockback = 32334;
public const uint SpellCycloneVisual = 32332;
public const uint NpcTito = 17548;
public const uint NpcCyclone = 18412;
public const uint NpcCrone = 18168;
}
public class WizardofOzBase : ScriptedAI
struct SpellIds
{
public WizardofOzBase(Creature creature) : base(creature) { }
// Dorothee
public const uint Waterbolt = 31012;
public const uint Scream = 31013;
public const uint Summontito = 31014;
// Tito
public const uint Yipping = 31015;
// Strawman
public const uint BrainBash = 31046;
public const uint BrainWipe = 31069;
public const uint BurningStraw = 31075;
// Tinhead
public const uint Cleave = 31043;
public const uint Rust = 31086;
// Roar
public const uint Mangle = 31041;
public const uint Shred = 31042;
public const uint FrightenedScream = 31013;
// Crone
public const uint ChainLightning = 32337;
// Cyclone
public const uint Knockback = 32334;
public const uint CycloneVisual = 32332;
}
struct CreatureIds
{
public const uint Tito = 17548;
public const uint Cyclone = 18412;
public const uint Crone = 18168;
}
#region Wizard of Oz
public abstract class WizardofOzBase : ScriptedAI
{
public WizardofOzBase(Creature creature) : base(creature)
{
Initialize();
instance = creature.GetInstanceScript();
}
public abstract void Initialize();
public override void Reset()
{
Initialize();
}
public void SummonCroneIfReady(InstanceScript instance, Creature creature)
{
instance.SetData(DataTypes.OperaOzDeathcount, (uint)EncounterState.Special); // Increment DeathCount
instance.SetBossState(DataTypes.OperaOzDeathcount, EncounterState.Special); // Increment DeathCount
if (instance.GetData(DataTypes.OperaOzDeathcount) == 4)
{
Creature pCrone = creature.SummonCreature(WizardOfOz.NpcCrone, -10891.96f, -1755.95f, creature.GetPositionZ(), 4.64f, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
Creature pCrone = creature.SummonCreature(CreatureIds.Crone, -10891.96f, -1755.95f, creature.GetPositionZ(), 4.64f, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
if (pCrone)
{
if (creature.GetVictim())
@@ -106,17 +123,16 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public bool TitoDied;
public ObjectGuid DorotheeGUID;
public uint AggroTimer;
public InstanceScript instance;
}
[Script]
public class boss_dorothee : WizardofOzBase
{
public boss_dorothee(Creature creature) : base(creature)
{
instance = creature.GetInstanceScript();
}
public boss_dorothee(Creature creature) : base(creature) { }
public override void Reset()
public override void Initialize()
{
AggroTimer = 500;
@@ -130,7 +146,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void EnterCombat(Unit who)
{
Talk(WizardOfOz.SayDorotheeAggro);
Talk(TextIds.SayDorotheeAggro);
}
public override void JustReachedHome()
@@ -140,14 +156,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer)
{
Talk(WizardOfOz.SayDorotheeDeath);
Talk(TextIds.SayDorotheeDeath);
SummonCroneIfReady(instance, me);
}
public override void AttackStart(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.AttackStart(who);
@@ -155,7 +171,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
@@ -167,7 +183,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
if (AggroTimer <= diff)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0;
}
else AggroTimer -= diff;
@@ -178,14 +194,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (WaterBoltTimer <= diff)
{
DoCast(SelectTarget(SelectAggroTarget.Random, 0), WizardOfOz.SpellWaterbolt);
DoCast(SelectTarget(SelectAggroTarget.Random, 0), SpellIds.Waterbolt);
WaterBoltTimer = (uint)(TitoDied ? 1500 : 5000);
}
else WaterBoltTimer -= diff;
if (FearTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellScream);
DoCastVictim(SpellIds.Scream);
FearTimer = 30000;
}
else FearTimer -= diff;
@@ -202,10 +218,10 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
void SummonTito()
{
Creature pTito = me.SummonCreature(WizardOfOz.NpcTito, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedDespawnOOC, 30000);
Creature pTito = me.SummonCreature(CreatureIds.Tito, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedDespawnOOC, 30000);
if (pTito)
{
Talk(WizardOfOz.SayDorotheeSummon);
Talk(TextIds.SayDorotheeSummon);
DorotheeGUID = me.GetGUID();
pTito.GetAI().AttackStart(me.GetVictim());
SummonedTito = true;
@@ -213,8 +229,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
}
}
InstanceScript instance;
uint WaterBoltTimer;
uint FearTimer;
uint SummonTitoTimer;
@@ -225,9 +239,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
[Script]
public class npc_tito : WizardofOzBase
{
public npc_tito(Creature creature) : base(creature) { }
public npc_tito(Creature creature) : base(creature)
{
Initialize();
}
public override void Reset()
public override void Initialize()
{
DorotheeGUID.Clear();
YipTimer = 10000;
@@ -243,7 +260,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (Dorothee && Dorothee.IsAlive())
{
TitoDied = true;
Talk(WizardOfOz.SayDorotheeTitoDeath, Dorothee);
Talk(TextIds.SayDorotheeTitoDeath, Dorothee);
}
}
}
@@ -255,7 +272,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (YipTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellYipping);
DoCastVictim(SpellIds.Yipping);
YipTimer = 10000;
}
else YipTimer -= diff;
@@ -271,10 +288,11 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
public boss_strawman(Creature creature) : base(creature)
{
Initialize();
instance = creature.GetInstanceScript();
}
public override void Reset()
public override void Initialize()
{
AggroTimer = 13000;
BrainBashTimer = 5000;
@@ -283,7 +301,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void AttackStart(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.AttackStart(who);
@@ -291,7 +309,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
@@ -299,27 +317,27 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void EnterCombat(Unit who)
{
Talk(WizardOfOz.SayStrawmanAggro);
Talk(TextIds.SayStrawmanAggro);
}
public override void SpellHit(Unit caster, SpellInfo Spell)
{
if ((Spell.SchoolMask == SpellSchoolMask.Fire) && ((RandomHelper.randChance() % 10) == 0))
{
DoCast(me, WizardOfOz.SpellBurningStraw, true);
DoCast(me, SpellIds.BurningStraw, true);
}
}
public override void JustDied(Unit killer)
{
Talk(WizardOfOz.SayStrawmanDeath);
Talk(TextIds.SayStrawmanDeath);
SummonCroneIfReady(instance, me);
}
public override void KilledUnit(Unit victim)
{
Talk(WizardOfOz.SayStrawmanSlay);
Talk(TextIds.SayStrawmanSlay);
}
public override void UpdateAI(uint diff)
@@ -328,7 +346,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
if (AggroTimer <= diff)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0;
}
else AggroTimer -= diff;
@@ -339,7 +357,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (BrainBashTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellBrainBash);
DoCastVictim(SpellIds.BrainBash);
BrainBashTimer = 15000;
}
else BrainBashTimer -= diff;
@@ -348,7 +366,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
if (target)
DoCast(target, WizardOfOz.SpellBrainWipe);
DoCast(target, SpellIds.BrainWipe);
BrainWipeTimer = 20000;
}
else BrainWipeTimer -= diff;
@@ -356,8 +374,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady();
}
InstanceScript instance;
uint BrainBashTimer;
uint BrainWipeTimer;
}
@@ -365,12 +381,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
[Script]
class boss_tinhead : WizardofOzBase
{
public boss_tinhead(Creature creature) : base(creature)
{
instance = creature.GetInstanceScript();
}
public boss_tinhead(Creature creature) : base(creature) { }
public override void Reset()
public override void Initialize()
{
AggroTimer = 15000;
CleaveTimer = 5000;
@@ -381,7 +394,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void EnterCombat(Unit who)
{
Talk(WizardOfOz.SayTinheadAggro);
Talk(TextIds.SayTinheadAggro);
}
public override void JustReachedHome()
@@ -391,7 +404,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void AttackStart(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.AttackStart(who);
@@ -399,7 +412,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
@@ -407,14 +420,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer)
{
Talk(WizardOfOz.SayTinheadDeath);
Talk(TextIds.SayTinheadDeath);
SummonCroneIfReady(instance, me);
}
public override void KilledUnit(Unit victim)
{
Talk(WizardOfOz.SayTinheadSlay);
Talk(TextIds.SayTinheadSlay);
}
public override void UpdateAI(uint diff)
@@ -423,7 +436,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
if (AggroTimer <= diff)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0;
}
else AggroTimer -= diff;
@@ -434,7 +447,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (CleaveTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellCleave);
DoCastVictim(SpellIds.Cleave);
CleaveTimer = 5000;
}
else CleaveTimer -= diff;
@@ -444,8 +457,8 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (RustTimer <= diff)
{
++RustCount;
Talk(WizardOfOz.EmoteRust);
DoCast(me, WizardOfOz.SpellRust);
Talk(TextIds.EmoteRust);
DoCast(me, SpellIds.Rust);
RustTimer = 6000;
}
else RustTimer -= diff;
@@ -454,8 +467,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady();
}
InstanceScript instance;
uint CleaveTimer;
uint RustTimer;
@@ -465,12 +476,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
[Script]
class boss_roar : WizardofOzBase
{
public boss_roar(Creature creature) : base(creature)
{
instance = creature.GetInstanceScript();
}
public boss_roar(Creature creature) : base(creature) { }
public override void Reset()
public override void Initialize()
{
AggroTimer = 20000;
MangleTimer = 5000;
@@ -478,25 +486,25 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
ScreamTimer = 15000;
}
public override void MoveInLineOfSight(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
}
public override void AttackStart(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.AttackStart(who);
}
public override void MoveInLineOfSight(Unit who)
{
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
}
public override void EnterCombat(Unit who)
{
Talk(WizardOfOz.SayRoarAggro);
Talk(TextIds.SayRoarAggro);
}
public override void JustReachedHome()
@@ -506,14 +514,14 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer)
{
Talk(WizardOfOz.SayRoarDeath);
Talk(TextIds.SayRoarDeath);
SummonCroneIfReady(instance, me);
}
public override void KilledUnit(Unit victim)
{
Talk(WizardOfOz.SayRoarSlay);
Talk(TextIds.SayRoarSlay);
}
public override void UpdateAI(uint diff)
@@ -522,7 +530,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
if (AggroTimer <= diff)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
AggroTimer = 0;
}
else AggroTimer -= diff;
@@ -533,21 +541,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (MangleTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellMangle);
DoCastVictim(SpellIds.Mangle);
MangleTimer = RandomHelper.URand(5000, 8000);
}
else MangleTimer -= diff;
if (ShredTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellShred);
DoCastVictim(SpellIds.Shred);
ShredTimer = RandomHelper.URand(10000, 15000);
}
else ShredTimer -= diff;
if (ScreamTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellFrightenedScream);
DoCastVictim(SpellIds.FrightenedScream);
ScreamTimer = RandomHelper.URand(20000, 30000);
}
else ScreamTimer -= diff;
@@ -555,8 +563,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady();
}
InstanceScript instance;
uint MangleTimer;
uint ShredTimer;
uint ScreamTimer;
@@ -570,8 +576,9 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
instance = creature.GetInstanceScript();
}
public override void Reset()
public override void Initialize()
{
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.NonAttackable);
CycloneTimer = 30000;
ChainLightningTimer = 10000;
}
@@ -583,27 +590,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void KilledUnit(Unit victim)
{
Talk(WizardOfOz.SayCroneSlay);
Talk(TextIds.SayCroneSlay);
}
public override void EnterCombat(Unit who)
{
Talk(WizardOfOz.SayCroneAggro);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
Talk(TextIds.SayCroneAggro);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
}
public override void JustDied(Unit killer)
{
Talk(WizardOfOz.SayCroneDeath);
Talk(TextIds.SayCroneDeath);
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
if (pSideEntrance)
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
}
public override void UpdateAI(uint diff)
@@ -611,21 +612,21 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (!UpdateVictim())
return;
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
if (me.HasUnitFlag(UnitFlags.NonAttackable))
me.RemoveUnitFlag(UnitFlags.NonAttackable);
if (CycloneTimer <= diff)
{
Creature Cyclone = DoSpawnCreature(WizardOfOz.NpcCyclone, RandomHelper.FRand(0, 9), RandomHelper.FRand(0, 9), 0, 0, TempSummonType.TimedDespawn, 15000);
Creature Cyclone = DoSpawnCreature(CreatureIds.Cyclone, RandomHelper.FRand(0, 9), RandomHelper.FRand(0, 9), 0, 0, TempSummonType.TimedDespawn, 15000);
if (Cyclone)
Cyclone.CastSpell(Cyclone, WizardOfOz.SpellCycloneVisual, true);
Cyclone.CastSpell(Cyclone, SpellIds.CycloneVisual, true);
CycloneTimer = 30000;
}
else CycloneTimer -= diff;
if (ChainLightningTimer <= diff)
{
DoCastVictim(WizardOfOz.SpellChainLightning);
DoCastVictim(SpellIds.ChainLightning);
ChainLightningTimer = 15000;
}
else ChainLightningTimer -= diff;
@@ -633,8 +634,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
DoMeleeAttackIfReady();
}
InstanceScript instance;
uint CycloneTimer;
uint ChainLightningTimer;
}
@@ -655,8 +654,8 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void UpdateAI(uint diff)
{
if (!me.HasAura(WizardOfOz.SpellKnockback))
DoCast(me, WizardOfOz.SpellKnockback, true);
if (!me.HasAura(SpellIds.Knockback))
DoCast(me, SpellIds.Knockback, true);
if (MoveTimer <= diff)
{
@@ -746,14 +745,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer)
{
DoPlaySoundToSet(me, RedRidingHood.SoundWolfDeath);
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
if (pSideEntrance)
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
}
public override void UpdateAI(uint diff)
@@ -884,7 +876,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void MoveInLineOfSight(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.MoveInLineOfSight(who);
@@ -895,7 +887,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
me.InterruptNonMeleeSpells(true);
me.RemoveAllAuras();
me.SetHealth(0);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
me.GetMotionMaster().MovementExpired(false);
me.GetMotionMaster().MoveIdle();
me.SetStandState(UnitStandStateType.Dead);
@@ -903,7 +895,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public void Resurrect(Creature target)
{
target.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
target.RemoveUnitFlag(UnitFlags.NotSelectable);
target.SetFullHealth();
target.SetStandState(UnitStandStateType.Stand);
target.CastSpell(target, JulianneRomulo.SpellResVisual, true);
@@ -972,7 +964,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void AttackStart(Unit who)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
if (me.HasUnitFlag(UnitFlags.NonAttackable))
return;
base.AttackStart(who);
@@ -1026,12 +1018,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
Romulo = ObjectAccessor.GetCreature(me, RomuloGUID);
if (Romulo)
{
Romulo.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
Romulo.RemoveUnitFlag(UnitFlags.NotSelectable);
Romulo.GetMotionMaster().Clear();
Romulo.setDeathState(DeathState.JustDied);
Romulo.CombatStop(true);
Romulo.DeleteThreatList();
Romulo.SetUInt32Value(ObjectFields.DynamicFlags, (uint)UnitDynFlags.Lootable);
Romulo.SetDynamicFlags(UnitDynFlags.Lootable);
}
return;
@@ -1055,14 +1047,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer)
{
Talk(JulianneRomulo.SayJulianneDeath02);
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
if (pSideEntrance)
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
}
public override void KilledUnit(Unit victim)
@@ -1087,7 +1072,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (AggroYellTimer <= diff)
{
Talk(JulianneRomulo.SayJulianneAggro);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
me.SetFaction(16);
AggroYellTimer = 0;
}
@@ -1271,12 +1256,12 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
Julianne = ObjectAccessor.GetCreature(me, JulianneGUID);
if (Julianne)
{
Julianne.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
Julianne.RemoveUnitFlag(UnitFlags.NotSelectable);
Julianne.GetMotionMaster().Clear();
Julianne.setDeathState(DeathState.JustDied);
Julianne.CombatStop(true);
Julianne.DeleteThreatList();
Julianne.SetUInt32Value(ObjectFields.DynamicFlags, (uint)UnitDynFlags.Lootable);
Julianne.SetDynamicFlags(UnitDynFlags.Lootable);
}
return;
}
@@ -1313,14 +1298,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public override void JustDied(Unit killer)
{
Talk(JulianneRomulo.SayRomuloDeath);
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.Done);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorleft), true);
instance.HandleGameObject(instance.GetGuidData(DataTypes.GoStagedoorright), true);
GameObject pSideEntrance = instance.instance.GetGameObject(instance.GetGuidData(DataTypes.GoSideEntranceDoor));
if (pSideEntrance)
pSideEntrance.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Locked);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.Done);
}
public override void KilledUnit(Unit victim)
@@ -1428,7 +1406,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public void StartEvent()
{
instance.SetData(karazhanConst.BossOpera, (uint)EncounterState.InProgress);
instance.SetBossState(DataTypes.OperaPerformance, EncounterState.InProgress);
//resets count for this event, in case earlier failed
if (m_uiEventId == OperaEvents.Oz)
@@ -1454,7 +1432,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
Creature spotlight = me.SummonCreature(karazhanConst.NpcSpotlight, me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), 0.0f, TempSummonType.TimedOrDeadDespawn, 60000);
if (spotlight)
{
spotlight.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
spotlight.AddUnitFlag(UnitFlags.NotSelectable);
spotlight.CastSpell(spotlight, karazhanConst.SpellSpotlight, false);
m_uiSpotlightGUID = spotlight.GetGUID();
}
@@ -1530,11 +1508,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
Creature creature = me.SummonCreature(entry, PosX, karazhanConst.SPAWN_Y, karazhanConst.SPAWN_Z, karazhanConst.SPAWN_O, TempSummonType.TimedOrDeadDespawn, Time.Hour * 2 * Time.InMilliseconds);
if (creature)
{
// In case database has bad flags
creature.SetUInt32Value(UnitFields.Flags, 0);
creature.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
}
creature.AddUnitFlag(UnitFlags.NonAttackable);
}
RaidWiped = false;
@@ -1654,7 +1628,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
if (instance != null)
{
// Check for death of Moroes and if opera event is not done already
if (instance.GetData(karazhanConst.BossMoroes) == (uint)EncounterState.Done && instance.GetData(karazhanConst.BossOpera) != (uint)EncounterState.Done)
if (instance.GetBossState(DataTypes.Moroes) == EncounterState.Done && instance.GetBossState(DataTypes.OperaPerformance) != EncounterState.Done)
{
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
@@ -153,7 +153,7 @@ namespace Scripts.EasternKingdoms
Initialize();
_events.Reset();
me.SetFaction(7);
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.AddUnitFlag(UnitFlags.ImmuneToPc);
me.SetStandState(UnitStandStateType.Kneel);
me.LoadEquipment(0, true);
}
@@ -261,7 +261,7 @@ namespace Scripts.EasternKingdoms
else
{
me.SetFaction(14);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
phase = UnworthyInitiatePhase.Attacking;
Player target = Global.ObjAccessor.GetPlayer(me, playerGUID);
@@ -468,7 +468,7 @@ namespace Scripts.EasternKingdoms
me.RestoreFaction();
base.Reset();
me.SetFlag(UnitFields.Flags, UnitFlags.Unk15);
me.AddUnitFlag(UnitFlags.Unk15);
}
public override void SpellHit(Unit pCaster, SpellInfo pSpell)
@@ -569,8 +569,8 @@ namespace Scripts.EasternKingdoms
return true;
}
creature.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
creature.RemoveFlag(UnitFields.Flags, UnitFlags.Unk15);
creature.RemoveUnitFlag(UnitFlags.ImmuneToPc);
creature.RemoveUnitFlag(UnitFlags.Unk15);
player.CastSpell(creature, SpellIds.Duel, false);
player.CastSpell(player, SpellIds.DuelFlag, true);
@@ -703,7 +703,7 @@ namespace Scripts.EasternKingdoms
if (charmer.HasAura(SpellIds.EffectStolenHorse))
{
charmer.RemoveAurasDueToSpell(SpellIds.EffectStolenHorse);
caster.RemoveFlag(UnitFields.NpcFlags, NPCFlags.SpellClick);
caster.RemoveNpcFlag(NPCFlags.SpellClick);
caster.SetFaction(35);
DoCast(caster, SpellIds.CallDarkRider, true);
Creature Dark_Rider = me.FindNearestCreature(CreatureIds.DarkRiderOfAcherus, 15);
@@ -765,8 +765,8 @@ namespace Scripts.EasternKingdoms
return;
deathcharger.RestoreFaction();
deathcharger.RemoveFlag(UnitFields.NpcFlags, NPCFlags.SpellClick);
deathcharger.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
deathcharger.RemoveNpcFlag(NPCFlags.SpellClick);
deathcharger.AddUnitFlag(UnitFlags.NotSelectable);
if (!me.GetVehicle() && deathcharger.IsVehicle() && deathcharger.GetVehicleKit().HasEmptySeat(0))
me.EnterVehicle(deathcharger);
}
@@ -779,8 +779,8 @@ namespace Scripts.EasternKingdoms
if (killer.IsTypeId(TypeId.Player) && deathcharger.IsTypeId(TypeId.Unit) && deathcharger.IsVehicle())
{
deathcharger.SetFlag(UnitFields.NpcFlags, NPCFlags.SpellClick);
deathcharger.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
deathcharger.AddNpcFlag(NPCFlags.SpellClick);
deathcharger.RemoveUnitFlag(UnitFlags.NotSelectable);
deathcharger.SetFaction(2096);
}
}
+2 -2
View File
@@ -147,7 +147,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale
switch (waypointId)
{
case 0:
me.SetUInt32Value(UnitFields.Bytes1, 0);
me.SetStandState(UnitStandStateType.Stand);
GameObject cage = me.FindNearestGameObject(GameObjectIds.Cage, 20);
if (cage)
cage.SetGoState(GameObjectState.Active);
@@ -244,7 +244,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale
GameObject go = GetClosestGameObjectWithEntry(me, GameObjectIds.NagaBrazier, SharedConst.InteractionDistance * 2);
if (go)
{
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
SetEscortPaused(true);
}
break;
@@ -86,7 +86,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
public override void DamageTaken(Unit pAttacker, ref uint damage)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NotSelectable))
if (me.HasUnitFlag(UnitFlags.NotSelectable))
damage = 0;
if ((GetHealthPct(0) >= 66 && GetHealthPct(damage) < 66) ||
@@ -110,7 +110,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
// Channel visual
DoCast(me, SpellIds.InsanityVisual, true);
// Unattackable
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
me.SetControlled(true, UnitState.Stunned);
}
@@ -167,7 +167,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
// Cleanup
Summons.DespawnAll();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetControlled(false, UnitState.Stunned);
}
@@ -231,7 +231,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.HeraldVolazj
return;
insanityHandled = 0;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetControlled(false, UnitState.Stunned);
me.RemoveAurasDueToSpell(SpellIds.InsanityVisual);
}
@@ -184,7 +184,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.GetMotionMaster().MovePoint(1, Misc.JedogaPosition[1]);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, 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);
@@ -214,7 +214,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
{
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, 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.RemoveAllAuras();
@@ -350,14 +350,14 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.RemoveAurasDueToSpell(SpellIds.SphereVisual);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Magic, false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
}
else
{
DoCast(me, SpellIds.SphereVisual, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, 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.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, 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]);
@@ -456,14 +456,14 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.JedogaShadowseeker
me.RemoveAurasDueToSpell(SpellIds.SphereVisual);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, 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))
{
DoCast(me, SpellIds.SphereVisual, false);
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Normal, 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;
@@ -262,7 +262,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram
void RemovePrison()
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.RemoveAurasDueToSpell(SpellIds.BeamVisual);
me.SetHomePosition(me.GetPositionX(), me.GetPositionY(), Misc.DataGroundPositionZ, me.GetOrientation());
DoCast(SpellIds.HoverFall);
@@ -373,7 +373,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram
Creature PrinceTaldaram = ObjectAccessor.GetCreature(go, instance.GetGuidData(DataTypes.PrinceTaldaram));
if (PrinceTaldaram && PrinceTaldaram.IsAlive())
{
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
switch (go.GetEntry())
@@ -135,19 +135,19 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet
if (SpheresState[0] != 0)
{
go.SetGoState(GameObjectState.Active);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
}
else
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
break;
case GameObjectIds.Sphere2:
if (SpheresState[1] != 0)
{
go.SetGoState(GameObjectState.Active);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
}
else
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
break;
case GameObjectIds.PrinceTaldaramGate:
AddDoor(go, true);
@@ -105,7 +105,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak
public override void Reset()
{
base.Reset();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
instance.DoStopCriteriaTimer(CriteriaTimedTypes.Event, Misc.AchievGottaGoStartEvent);
_nextSubmerge = 75;
_petCount = 0;
@@ -332,7 +332,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak
{
me.RemoveAurasDueToSpell(SpellIds.Submerge);
me.RemoveAurasDueToSpell(SpellIds.ImpaleAura);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
DoCastSelf(SpellIds.Emerge);
_events.SetPhase(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)
{
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveAurasDueToSpell(SpellIds.LeechingSwarm);
DoCastSelf(SpellIds.ImpaleAura, true);
@@ -356,8 +356,8 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Nadronox
public void Initialize()
{
me.SetFloatValue(UnitFields.BoundingRadius, 9.0f);
me.SetFloatValue(UnitFields.CombatReach, 9.0f);
me.SetBoundingRadius(9.0f);
me.SetCombatReach(9.0f);
_enteredCombat = false;
_doorsWebbed = false;
_lastPlayerCombatState = false;
@@ -242,7 +242,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
me.SetReactState(ReactStates.Passive);
// 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();
@@ -320,7 +320,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (player.IsAlive())
{
temp.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.ImmuneToPc);
temp.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.ImmuneToPc);
temp.SetReactState(ReactStates.Aggressive);
temp.SetInCombatWith(player);
player.SetInCombatWith(temp);
@@ -155,7 +155,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pAnnouncer)
{
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);
}
}
@@ -169,7 +169,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pBoss)
{
pBoss.GetMotionMaster().MovePoint(0, 746.88f, 618.74f, 411.06f);
pBoss.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
pBoss.RemoveUnitFlag(UnitFlags.NonAttackable);
pBoss.SetReactState(ReactStates.Aggressive);
}
}
@@ -181,7 +181,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pAnnouncer)
{
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);
}
}
@@ -193,7 +193,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (pAnnouncer)
{
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);
}
}
@@ -170,8 +170,8 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
uiTimer = 0;
me.SetReactState(ReactStates.Passive);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.AddUnitFlag(UnitFlags.NonAttackable);
me.AddNpcFlag(NPCFlags.Gossip);
SetGrandChampionsForEncounter();
SetArgentChampion();
@@ -409,7 +409,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
public void StartEncounter()
{
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.RemoveNpcFlag(NPCFlags.Gossip);
if (instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.NotStarted)
{
@@ -444,7 +444,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
if (player.IsAlive())
{
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.SetInCombatWith(player);
player.SetInCombatWith(temp);
@@ -494,7 +494,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
{
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);
}
}
@@ -106,7 +106,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
_JustReachedHome();
instance.SetBossState(DataTypes.BossJaraxxus, EncounterState.Fail);
DoCast(me, Spells.JaraxxusChains);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
}
public override void KilledUnit(Unit who)
@@ -218,7 +218,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
public override void Reset()
{
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetInCombatWithZone();
DoCast(Jaraxxus.SpellLegionFlameEffect);
}
@@ -247,9 +247,9 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetReactState(ReactStates.Passive);
if (!IsHeroic())
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
else
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
_summons.DespawnAll();
}
@@ -332,9 +332,9 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetReactState(ReactStates.Passive);
if (!IsHeroic())
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
else
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Pacified);
_summons.DespawnAll();
}
@@ -182,7 +182,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (snobold)
{
snobold.ExitVehicle();
snobold.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
snobold.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
snobold.ToCreature().GetAI().DoAction(Actions.DisableFireBomb);
snobold.CastSpell(me, SpellIds.JumpToHand, true);
break;
@@ -209,7 +209,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{
case 0:
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.SetInCombatWithZone();
break;
@@ -300,7 +300,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
public override void Reset()
{
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetInCombatWithZone();
_events.ScheduleEvent(Events.CheckMount, TimeSpan.FromSeconds(1));
_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)
{
me.RemoveAurasDueToSpell(SpellIds.Submerge);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
DoCast(SpellIds.Enrage);
Enraged = true;
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);
if (acidmaw)
{
acidmaw.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
acidmaw.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
acidmaw.SetReactState(ReactStates.Aggressive);
acidmaw.SetInCombatWithZone();
acidmaw.CastSpell(acidmaw, SpellIds.Emerge);
@@ -603,7 +603,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetInCombatWithZone();
_events.SetPhase(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());
WasMobile = !WasMobile;
}
@@ -615,7 +615,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetDisplayId(ModelMobile);
me.RemoveAurasDueToSpell(SpellIds.Submerge);
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 (WasMobile)
@@ -710,7 +710,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{
case 0:
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.SetInCombatWithZone();
break;
@@ -840,7 +840,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
break;
case 2:
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.SetInCombatWithZone();
break;
@@ -944,7 +944,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
me.SetTarget(_trampleTargetGUID);
_trampleCast = false;
SetCombatMovement(false);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
me.SetControlled(true, UnitState.Root);
me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveIdle();
@@ -1033,7 +1033,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
Talk(TextIds.EmoteTrampleFail);
}
_movementStarted = false;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
SetCombatMovement(true);
me.GetMotionMaster().MovementExpired();
me.GetMotionMaster().Clear();
@@ -254,7 +254,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
GameObject cache = instance.GetGameObject(CrusadersCacheGUID);
if (cache)
cache.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
cache.RemoveFlag(GameObjectFlags.NotSelectable);
EventStage = 3100;
break;
default:
@@ -398,7 +398,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{
Unit announcer = instance.GetCreature(GetGuidData(CreatureIds.Barrent));
if (announcer)
announcer.SetFlag64(UnitFields.NpcFlags, NPCFlags.Gossip);
announcer.AddNpcFlag(NPCFlags.Gossip);
Save();
}
}
@@ -783,14 +783,14 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
public override void Reset()
{
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
Creature pAlly = GetClosestCreatureWithEntry(me, CreatureIds.Thrall, 300.0f);
if (pAlly)
pAlly.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
pAlly.AddUnitFlag(UnitFlags.NonAttackable);
pAlly = GetClosestCreatureWithEntry(me, CreatureIds.Proudmoore, 300.0f);
if (pAlly)
pAlly.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
pAlly.AddUnitFlag(UnitFlags.NonAttackable);
}
public override void AttackStart(Unit who) { }
@@ -846,7 +846,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (jaraxxus)
{
jaraxxus.RemoveAurasDueToSpell(Spells.JaraxxusChains);
jaraxxus.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
jaraxxus.RemoveUnitFlag(UnitFlags.NonAttackable);
jaraxxus.SetReactState(ReactStates.Defensive);
jaraxxus.SetInCombatWithZone();
}
@@ -887,7 +887,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (creature.IsVisible())
creature.SetVisible(false);
}
creature.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.Gossip);
creature.RemoveNpcFlag(NPCFlags.Gossip);
return true;
}
@@ -959,12 +959,12 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
break;
case 5030:
Talk(Texts.Stage_4_04);
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.StateTalk);
me.SetEmoteState(Emote.StateTalk);
_updateTimer = 10 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 5040);
break;
case 5040:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone);
me.SetEmoteState(Emote.OneshotNone);
me.GetMotionMaster().MovePoint(1, MiscData.LichKingLoc[1]);
_updateTimer = 1 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 0);
@@ -991,7 +991,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (go)
{
go.SetDisplayId(MiscData.DisplayIdDestroyedFloor);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.Damaged | GameObjectFlags.NoDespawn);
go.AddFlag(GameObjectFlags.Damaged | GameObjectFlags.NoDespawn);
go.SetGoState(GameObjectState.Active);
}
@@ -1039,7 +1039,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
Creature temp = ObjectAccessor.GetCreature(me, _instance.GetGuidData(CreatureIds.Jaraxxus));
if (temp)
{
temp.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
temp.RemoveUnitFlag(UnitFlags.NonAttackable);
temp.SetReactState(ReactStates.Aggressive);
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);
if (temp)
{
temp.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
temp.AddUnitFlag(UnitFlags.NonAttackable);
temp.SetReactState(ReactStates.Passive);
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))
{
case 110:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk);
me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_01);
_updateTimer = 22 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 120);
break;
case 140:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk);
me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_02);
_updateTimer = 5 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 150);
break;
case 150:
{
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone);
me.SetEmoteState(Emote.OneshotNone);
if (_instance.GetBossState(DataTypes.BossBeasts) != EncounterState.Done)
{
_instance.DoUseDoorOrButton(_instance.GetGuidData(GameObjectIds.MainGateDoor));
@@ -1255,7 +1255,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (temp)
{
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);
}
}
@@ -1279,7 +1279,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (temp)
{
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);
}
}
@@ -1300,7 +1300,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
if (temp)
{
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);
}
}
@@ -1543,13 +1543,13 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
switch (_instance.GetData(DataTypes.Event))
{
case 130:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk);
me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_03h);
_updateTimer = 3 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 132);
break;
case 132:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone);
me.SetEmoteState(Emote.OneshotNone);
_updateTimer = 5 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 140);
break;
@@ -1617,13 +1617,13 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
switch (_instance.GetData(DataTypes.Event))
{
case 120:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotTalk);
me.SetEmoteState(Emote.OneshotTalk);
Talk(Texts.Stage_0_03a);
_updateTimer = 2 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 122);
break;
case 122:
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotNone);
me.SetEmoteState(Emote.OneshotNone);
_updateTimer = 3 * Time.InMilliseconds;
_instance.SetData(DataTypes.Event, 130);
break;
+1 -1
View File
@@ -59,7 +59,7 @@ namespace Scripts.Northrend
{
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, SpellSchoolMask.Magic, true);
}
@@ -30,7 +30,7 @@ namespace Scripts.Northrend.DraktharonKeep.KingDred
public const uint GrievousBite = 48920;
public const uint ManglingSlash = 48873; // Cast On The Current Tank; Adds Debuf
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 GutRip = 49710;
public const uint Rend = 13738;
@@ -229,15 +229,15 @@ namespace Scripts.Northrend.DraktharonKeep.Novos
_bubbled = state;
if (!state)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
if (me.HasUnitFlag(UnitFlags.NonAttackable))
me.RemoveUnitFlag(UnitFlags.NonAttackable);
if (me.HasUnitState(UnitState.Casting))
me.CastStop();
}
else
{
if (!me.HasFlag(UnitFields.Flags, UnitFlags.NonAttackable))
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
if (!me.HasUnitFlag(UnitFlags.NonAttackable))
me.AddUnitFlag(UnitFlags.NonAttackable);
DoCast(SpellIds.ArcaneField);
}
}
@@ -182,7 +182,7 @@ namespace Scripts.Northrend.DraktharonKeep.Trollgore
if (type == MovementGeneratorType.Point && pointId == Misc.PointLanding)
{
me.Dismount();
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
DoCastAOE(SpellIds.InvaderTaunt);
}
}
@@ -206,7 +206,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
public npc_sylvanas_fos(Creature creature) : base(creature)
{
Initialize();
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.AddNpcFlag(NPCFlags.Gossip);
}
void Initialize()
@@ -226,7 +226,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
{
player.CLOSE_GOSSIP_MENU();
phase = Phase.Intro;
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.RemoveNpcFlag(NPCFlags.Gossip);
_events.Reset();
_events.ScheduleEvent(EventIds.Intro1, 1000);
@@ -290,7 +290,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
public npc_jaina_fos(Creature creature) : base(creature)
{
Initialize();
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.AddNpcFlag(NPCFlags.Gossip);
}
void Initialize()
@@ -310,7 +310,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
{
player.CLOSE_GOSSIP_MENU();
phase = Phase.Intro;
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.RemoveNpcFlag(NPCFlags.Gossip);
_events.Reset();
_events.ScheduleEvent(EventIds.Intro1, 1000);
}
@@ -299,7 +299,7 @@ namespace Scripts.Northrend.FrozenHalls.PitOfSaron.BossKrickAndIck
Initialize();
me.SetReactState(ReactStates.Passive);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
}
Creature GetIck()
@@ -87,7 +87,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
if (GetData(Misc.DataIntroDone) != 0)
{
me.SetReactState(ReactStates.Aggressive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveAura(SpellIds.FreezeAnim);
}
@@ -125,7 +125,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
me.GetMotionMaster().MoveIdle();
me.SetReactState(ReactStates.Passive);
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.AddUnitFlag(UnitFlags.ImmuneToPc);
DoCast(me, SpellIds.FreezeAnim);
break;
case Misc.ActionUnfreezeColossus:
@@ -133,7 +133,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
return;
me.SetReactState(ReactStates.Aggressive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveAura(SpellIds.FreezeAnim);
me.SetInCombatWithZone();
@@ -146,7 +146,7 @@ namespace Scripts.Northrend.Gundrak.DrakkariColossus
public override void DamageTaken(Unit attacker, ref uint damage)
{
if (me.HasFlag(UnitFields.Flags, UnitFlags.ImmuneToPc))
if (me.HasUnitFlag(UnitFlags.ImmuneToPc))
damage = 0;
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 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 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.
}
@@ -163,7 +163,7 @@ namespace Scripts.Northrend.Gundrak
if (GetBossState(GDDataTypes.SladRan) == EncounterState.Done)
{
if (SladRanStatueState == GameObjectState.Active)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
else
go.SetGoState(GameObjectState.Active);
}
@@ -172,7 +172,7 @@ namespace Scripts.Northrend.Gundrak
if (GetBossState(GDDataTypes.Moorabi) == EncounterState.Done)
{
if (MoorabiStatueState == GameObjectState.Active)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
else
go.SetGoState(GameObjectState.Active);
}
@@ -181,7 +181,7 @@ namespace Scripts.Northrend.Gundrak
if (GetBossState(GDDataTypes.DrakkariColossus) == EncounterState.Done)
{
if (DrakkariColossusStatueState == GameObjectState.Active)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
else
go.SetGoState(GameObjectState.Active);
}
@@ -239,7 +239,7 @@ namespace Scripts.Northrend.Gundrak
{
GameObject go = GetGameObject(GDDataTypes.SladRanAltar);
if (go)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
}
break;
case GDDataTypes.DrakkariColossus:
@@ -247,7 +247,7 @@ namespace Scripts.Northrend.Gundrak
{
GameObject go = GetGameObject(GDDataTypes.DrakkariColossusAltar);
if (go)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
}
break;
case GDDataTypes.Moorabi:
@@ -255,7 +255,7 @@ namespace Scripts.Northrend.Gundrak
{
GameObject go = GetGameObject(GDDataTypes.MoorabiAltar);
if (go)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
}
break;
default:
@@ -423,7 +423,7 @@ namespace Scripts.Northrend.Gundrak
public override bool OnGossipHello(Player player, GameObject go)
{
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
InstanceScript instance = go.GetInstanceScript();
@@ -957,7 +957,7 @@ namespace Scripts.Northrend.IcecrownCitadel
public override void sGossipSelect(Player player, uint menuId, uint gossipListId)
{
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.Gossip);
me.RemoveNpcFlag(NPCFlags.Gossip);
me.GetTransport().EnableMovement(true);
_events.SetPhase(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)
{
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.Gossip);
me.RemoveNpcFlag(NPCFlags.Gossip);
me.GetTransport().EnableMovement(true);
_events.SetPhase(GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroA1, 5000);
@@ -502,6 +502,7 @@ namespace Scripts.Northrend.IcecrownCitadel
Creature crok = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.CrokScourgebane));
if (crok)
crok.GetAI().Talk(Texts.SayCrokCombatSvalna);
DoCastSelf(InstanceSpells.DivineSurge, true);
_events.ScheduleEvent(EventTypes.SvalnaCombat, 9000);
_events.ScheduleEvent(EventTypes.ImpalingSpear, RandomHelper.URand(40000, 50000));
_events.ScheduleEvent(EventTypes.AetherShield, RandomHelper.URand(100000, 110000));
@@ -550,7 +551,7 @@ namespace Scripts.Northrend.IcecrownCitadel
case Actions.StartGauntlet:
me.setActive(true);
_isEventInProgress = true;
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
me.AddUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
_events.ScheduleEvent(EventTypes.SvalnaStart, 25000);
break;
case Actions.ResurrectCaptains:
@@ -584,7 +585,7 @@ namespace Scripts.Northrend.IcecrownCitadel
_isEventInProgress = false;
me.setActive(false);
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
me.SetDisableGravity(false);
me.SetHover(false);
}
@@ -602,7 +603,7 @@ namespace Scripts.Northrend.IcecrownCitadel
{
Talk(Texts.EmoteSvalnaImpale, target);
summon.CastCustomSpell(SharedConst.VehicleSpellRideHardcoded, SpellValueMod.BasePoint0, 1, target, false);
summon.SetFlag(UnitFields.Flags2, UnitFlags2.Unk1 | UnitFlags2.AllowEnemyInteract);
summon.AddUnitFlag2(UnitFlags2.Unk1 | UnitFlags2.AllowEnemyInteract);
}
break;
default:
@@ -744,6 +745,7 @@ namespace Scripts.Northrend.IcecrownCitadel
{
// pause pathing until trash pack is cleared
case 0:
me.RemoveUnitFlag(UnitFlags.ImmuneToNpc);
Talk(Texts.SayCrokCombatWp0);
if (!_aliveTrash.Empty())
SetEscortPaused(true);
@@ -1392,8 +1394,8 @@ namespace Scripts.Northrend.IcecrownCitadel
if (target)
{
target.SetReactState(ReactStates.Passive);
target.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.ImmuneToPc);
target.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotCustomSpell02);
target.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.ImmuneToPc);
target.SetEmoteState(Emote.OneshotCustomSpell02);
}
}
@@ -1403,8 +1405,8 @@ namespace Scripts.Northrend.IcecrownCitadel
if (target)
{
target.SetReactState(ReactStates.Aggressive);
target.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.ImmuneToPc);
target.SetUInt32Value(UnitFields.NpcEmotestate, 0);
target.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.ImmuneToPc);
target.SetEmoteState(Emote.StateCustomSpell02);
}
}
@@ -136,6 +136,7 @@ namespace Scripts.Northrend.IcecrownCitadel
public const uint ImpalingSpear = 71443;
public const uint AetherShield = 71463;
public const uint HurlSpear = 71466;
public const uint DivineSurge = 71465;
// Captain Arnath
public const uint DominateMind = 14515;
@@ -159,12 +159,12 @@ namespace Scripts.Northrend.IcecrownCitadel
{
if (usable)
{
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
}
else
{
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Ready);
}
}
@@ -639,7 +639,7 @@ namespace Scripts.Northrend.IcecrownCitadel
Creature valithria = instance.GetCreature(ValithriaDreamwalkerGUID);
if (valithria)
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;
case GameObjectIds.ArthasPlatform:
ArthasPlatformGUID = go.GetGUID();
@@ -851,7 +851,7 @@ namespace Scripts.Northrend.IcecrownCitadel
GameObject loot = instance.GetGameObject(GunshipArmoryGUID);
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)
_events.ScheduleEvent(TimedEvents.RespawnGunship, 30000);
@@ -867,7 +867,7 @@ namespace Scripts.Northrend.IcecrownCitadel
Creature deathbringer = instance.GetCreature(DeathbringerSaurfangGUID);
if (deathbringer)
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);
File diff suppressed because it is too large Load Diff
@@ -131,7 +131,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity
GameObject platform = instance.GetGameObject(platformGUID);
if (platform)
platform.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.Destroyed);
platform.RemoveFlag(GameObjectFlags.Destroyed);
}
else if (state == EncounterState.Done)
SpawnGameObject(InstanceGameObjects.ExitPortal, exitPortalPosition);
@@ -218,7 +218,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity
GameObject iris = instance.GetGameObject(irisGUID);
if (iris)
iris.SetFlag(GameObjectFields.Flags, GameObjectFlags.InUse);
iris.AddFlag(GameObjectFlags.InUse);
Creature malygos = instance.GetCreature(malygosGUID);
if (malygos)
@@ -99,7 +99,7 @@ namespace Scripts.Northrend.Nexus.Nexus
Initialize();
_intenseColdList.Clear();
me.RemoveFlag(UnitFields.Flags, UnitFlags.Stunned);
me.RemoveUnitFlag(UnitFlags.Stunned);
RemovePrison(CheckContainmentSpheres());
_Reset();
@@ -141,15 +141,15 @@ namespace Scripts.Northrend.Nexus.Nexus
{
if (remove)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
if (me.HasAura(KeristraszaConst.SpellFrozenPrison))
me.RemoveAurasDueToSpell(KeristraszaConst.SpellFrozenPrison);
}
else
{
me.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.ImmuneToPc);
me.AddUnitFlag(UnitFlags.NonAttackable);
DoCast(me, KeristraszaConst.SpellFrozenPrison, false);
}
}
@@ -202,7 +202,7 @@ namespace Scripts.Northrend.Nexus.Nexus
if (pKeristrasza && pKeristrasza.IsAlive())
{
// maybe these are hacks :(
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
((boss_keristrasza)pKeristrasza.GetAI()).CheckContainmentSpheres(true);
@@ -86,7 +86,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{
Initialize();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
instance.SetBossState(DataTypes.MagusTelestra, EncounterState.NotStarted);
@@ -135,7 +135,7 @@ namespace Scripts.Northrend.Nexus.Nexus
if (uiIsWaitingToAppearTimer <= diff)
{
me.CastSpell(me, 47714, true);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
bIsWaitingToAppear = false;
InVanish = false;
me.SendAIReaction(AiReaction.Hostile);
@@ -174,7 +174,7 @@ namespace Scripts.Northrend.Nexus.Nexus
me.CastStop();
me.RemoveAllAuras();
me.CastSpell(me, 47710, false);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
bFireMagusDead = false;
bFrostMagusDead = false;
bArcaneMagusDead = false;
@@ -188,7 +188,7 @@ namespace Scripts.Northrend.Nexus.Nexus
Phase = 3;
me.CastStop();
me.RemoveAllAuras();
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
bFireMagusDead = false;
bFrostMagusDead = false;
bArcaneMagusDead = false;
@@ -135,17 +135,17 @@ namespace Scripts.Northrend.Nexus.Nexus
case GameObjectIds.AnomalusContainmetSphere:
AnomalusContainmentSphere = go.GetGUID();
if (GetBossState(DataTypes.Anomalus) == EncounterState.Done)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
break;
case GameObjectIds.OrmoroksContainmetSphere:
OrmoroksContainmentSphere = go.GetGUID();
if (GetBossState(DataTypes.Ormorok) == EncounterState.Done)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
break;
case GameObjectIds.TelestrasContainmetSphere:
TelestrasContainmentSphere = go.GetGUID();
if (GetBossState(DataTypes.MagusTelestra) == EncounterState.Done)
go.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.RemoveFlag(GameObjectFlags.NotSelectable);
break;
default:
break;
@@ -164,7 +164,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{
GameObject sphere = instance.GetGameObject(TelestrasContainmentSphere);
if (sphere)
sphere.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
sphere.RemoveFlag(GameObjectFlags.NotSelectable);
}
break;
case DataTypes.Anomalus:
@@ -172,7 +172,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{
GameObject sphere = instance.GetGameObject(AnomalusContainmentSphere);
if (sphere)
sphere.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
sphere.RemoveFlag(GameObjectFlags.NotSelectable);
}
break;
case DataTypes.Ormorok:
@@ -180,7 +180,7 @@ namespace Scripts.Northrend.Nexus.Nexus
{
GameObject sphere = instance.GetGameObject(OrmoroksContainmentSphere);
if (sphere)
sphere.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
sphere.RemoveFlag(GameObjectFlags.NotSelectable);
}
break;
default:
@@ -75,7 +75,7 @@ namespace Scripts.Northrend.Nexus.Oculus
BelgaristraszGUID = creature.GetGUID();
if (GetBossState(DATA_DRAKOS) == EncounterState.Done)
{
creature.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
creature.AddNpcFlag(NPCFlags.Gossip);
creature.Relocate(BelgaristraszMove);
}
break;
@@ -83,7 +83,7 @@ namespace Scripts.Northrend.Nexus.Oculus
EternosGUID = creature.GetGUID();
if (GetBossState(DATA_DRAKOS) == EncounterState.Done)
{
creature.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
creature.AddNpcFlag(NPCFlags.Gossip);
creature.Relocate(EternosMove);
}
break;
@@ -91,7 +91,7 @@ namespace Scripts.Northrend.Nexus.Oculus
VerdisaGUID = creature.GetGUID();
if (GetBossState(DATA_DRAKOS) == EncounterState.Done)
{
creature.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
creature.AddNpcFlag(NPCFlags.Gossip);
creature.Relocate(VerdisaMove);
}
break;
@@ -232,7 +232,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
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);
}
@@ -513,7 +513,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
me.SetHomePosition(Leviathan.Center);
me.GetMotionMaster().MoveCharge(Leviathan.Center.GetPositionX(), Leviathan.Center.GetPositionY(), Leviathan.Center.GetPositionZ()); // position center
me.SetReactState(ReactStates.Aggressive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Stunned);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable | UnitFlags.Stunned);
return;
}
break;
@@ -585,8 +585,8 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Creature turret = turretPassenger.ToCreature();
if (turret)
{
turret.SetFaction(me.GetVehicleBase().getFaction());
turret.SetUInt32Value(UnitFields.Flags, 0); // unselectable
turret.SetFaction(me.GetVehicleBase().GetFaction());
turret.SetUnitFlags(0);
turret.GetAI().AttackStart(who);
}
}
@@ -596,12 +596,12 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Creature device = devicePassenger.ToCreature();
if (device)
{
device.SetFlag64(UnitFields.NpcFlags, NPCFlags.SpellClick);
device.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
device.AddNpcFlag(NPCFlags.SpellClick);
device.RemoveUnitFlag(UnitFlags.NotSelectable);
}
}
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
}
else if (seatId == Seats.Turret)
{
@@ -611,8 +611,8 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
Unit device = vehicle.GetPassenger(Seats.Device);
if (device)
{
device.SetFlag64(UnitFields.NpcFlags, NPCFlags.SpellClick);
device.SetUInt32Value(UnitFields.Flags, 0); // unselectable
device.AddNpcFlag(NPCFlags.SpellClick);
device.SetUnitFlags(0); // unselectable
}
}
}
@@ -694,8 +694,8 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
if (me.GetVehicle())
{
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.SpellClick);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveNpcFlag(NPCFlags.SpellClick);
me.AddUnitFlag(UnitFlags.NotSelectable);
Unit player = me.GetVehicle().GetPassenger(Seats.Player);
if (player)
@@ -792,7 +792,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_pool_of_tar(Creature creature)
: base(creature)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Passive);
me.CastSpell(me, Spells.TarPassive, true);
}
@@ -843,7 +843,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_thorims_hammer(Creature creature)
: base(creature)
{
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
me.CastSpell(me, Spells.DummyBlue, true);
}
@@ -872,7 +872,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_mimirons_inferno(Creature creature)
: base(creature)
{
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.CastSpell(me, Spells.DummyYellow, true);
me.SetReactState(ReactStates.Passive);
}
@@ -921,7 +921,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
public npc_hodirs_fury(Creature creature)
: base(creature)
{
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
me.CastSpell(me, Spells.DummyGreen, true);
}
@@ -1038,7 +1038,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
{
if (menuId == GossipIds.MenuLoreKeeper && gossipListId == GossipIds.OptionLoreKeeper)
{
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
me.RemoveNpcFlag(NPCFlags.Gossip);
player.PlayerTalkClass.SendCloseGossip();
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);
if (brann)
{
brann.RemoveFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
brann.RemoveNpcFlag(NPCFlags.Gossip);
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:
owner.AddUnitState(UnitState.Stunned | UnitState.Root);
owner.SetFlag(UnitFields.Flags, UnitFlags.Stunned);
owner.AddUnitFlag(UnitFlags.Stunned);
owner.RemoveAurasDueToSpell(Spells.GatheringSpeed);
}
@@ -1366,7 +1366,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
if (!owner)
return;
owner.RemoveFlag(UnitFields.Flags, UnitFlags.Stunned);
owner.RemoveUnitFlag(UnitFlags.Stunned);
}
public override void Register()
+26 -26
View File
@@ -389,7 +389,7 @@ namespace Scripts.Northrend.Ulduar
{
_Reset();
me.SetReactState(ReactStates.Passive);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NonAttackable);
GameObject elevator = ObjectAccessor.GetGameObject(me, instance.GetGuidData(InstanceData.MimironElevator));
if (elevator)
@@ -406,7 +406,7 @@ namespace Scripts.Northrend.Ulduar
if (button)
{
button.SetGoState(GameObjectState.Ready);
button.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
button.RemoveFlag(GameObjectFlags.NotSelectable);
}
_fireFighter = false;
@@ -457,13 +457,13 @@ namespace Scripts.Northrend.Ulduar
//PLay Sound number 15612
_EnterCombat();
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
me.RemoveAurasDueToSpell(Spells.Weld);
DoCast(me.GetVehicleBase(), Spells.Seat6);
GameObject button = ObjectAccessor.GetGameObject(me, instance.GetGuidData(InstanceData.MimironButton));
if (button)
button.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
button.AddFlag(GameObjectFlags.NotSelectable);
if (_fireFighter)
_events.ScheduleEvent(Events.SummonFlames, 3000);
@@ -528,7 +528,7 @@ namespace Scripts.Northrend.Ulduar
{
DoCast(mkii, Spells.Seat7);
mkii.RemoveAurasDueToSpell(Spells.FreezeAnim);
mkii.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
mkii.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
}
_events.ScheduleEvent(Events.Intro3, 2000);
}
@@ -676,7 +676,7 @@ namespace Scripts.Northrend.Ulduar
if (aerial)
{
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(aerial, Spells.HalfHeal);
}
@@ -725,7 +725,7 @@ namespace Scripts.Northrend.Ulduar
break;
case Events.Outtro3:
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.
break;
default:
@@ -756,7 +756,7 @@ namespace Scripts.Northrend.Ulduar
void SetupEncounter()
{
_Reset();
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Passive);
_fireFighter = false;
_setupMine = true;
@@ -770,7 +770,7 @@ namespace Scripts.Northrend.Ulduar
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().
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
DoCast(me, Spells.VehicleDamaged, true);
me.AttackStop();
me.SetReactState(ReactStates.Passive);
@@ -821,7 +821,7 @@ namespace Scripts.Northrend.Ulduar
break;
case Actions.AssembledCombat:
me.SetStandState(UnitStandStateType.Stand);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive);
_events.SetPhase(Phases.Vol7ron);
@@ -874,7 +874,7 @@ namespace Scripts.Northrend.Ulduar
{
case Waypoints.MkiiP1Idle:
{
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
DoCast(me, Spells.HalfHeal);
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)
{
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);
_fireFighter = false;
}
@@ -1017,7 +1017,7 @@ namespace Scripts.Northrend.Ulduar
if (_events.IsInPhase(Phases.Vx001))
{
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.TorsoDisabled);
Creature mimiron = ObjectAccessor.GetCreature(me, instance.GetGuidData(BossIds.Mimiron));
@@ -1027,7 +1027,7 @@ namespace Scripts.Northrend.Ulduar
else if (_events.IsInPhase(Phases.Vol7ron))
{
me.SetStandState(UnitStandStateType.Dead);
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
if (MimironConst.IsEncounterFinished(who))
return;
@@ -1050,9 +1050,9 @@ namespace Scripts.Northrend.Ulduar
_events.ScheduleEvent(Events.FlameSuppressantVx, 6000);
goto 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.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.
DoCast(me, Spells.HeatWaveAura);
@@ -1063,7 +1063,7 @@ namespace Scripts.Northrend.Ulduar
break;
case Actions.AssembledCombat:
me.SetStandState(UnitStandStateType.Stand);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
_events.SetPhase(Phases.Vol7ron);
_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
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);
if (channelTarget)
me.SetFacingToObject(channelTarget);
@@ -1191,7 +1191,7 @@ namespace Scripts.Northrend.Ulduar
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().
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
me.AttackStop();
me.SetReactState(ReactStates.Passive);
DoCast(me, Spells.VehicleDamaged, true);
@@ -1226,7 +1226,7 @@ namespace Scripts.Northrend.Ulduar
_events.ScheduleEvent(Events.SummonFireBots, 1000, 0, Phases.AerialCommandUnit);
goto case Actions.StartAerial;
case Actions.StartAerial:
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive);
_events.SetPhase(Phases.AerialCommandUnit);
@@ -1245,7 +1245,7 @@ namespace Scripts.Northrend.Ulduar
me.SetReactState(ReactStates.Aggressive);
break;
case Actions.AssembledCombat:
me.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NonAttackable | UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive);
me.SetStandState(UnitStandStateType.Stand);
_events.SetPhase(Phases.Vol7ron);
@@ -1281,7 +1281,7 @@ namespace Scripts.Northrend.Ulduar
{
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));
if (mimiron)
@@ -1596,7 +1596,7 @@ namespace Scripts.Northrend.Ulduar
public override bool OnGossipHello(Player player, GameObject go)
{
if (go.HasFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable))
if (go.HasFlag(GameObjectFlags.NotSelectable))
return true;
InstanceScript instance = go.GetInstanceScript();
@@ -1607,7 +1607,7 @@ namespace Scripts.Northrend.Ulduar
if (computer)
computer.GetAI().DoAction(Actions.ActivateComputer);
go.SetGoState(GameObjectState.Active);
go.SetFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
go.AddFlag(GameObjectFlags.NotSelectable);
return true;
}
}
@@ -1634,7 +1634,7 @@ namespace Scripts.Northrend.Ulduar
Creature target = GetHitCreature();
if (target)
{
target.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.Pacified);
target.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.Pacified);
target.DespawnOrUnsummon(1000);
}
}
@@ -1741,7 +1741,7 @@ namespace Scripts.Northrend.Ulduar
{
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()
+14 -14
View File
@@ -77,12 +77,12 @@ namespace Scripts.Northrend.Ulduar
{
case ACTION_HARPOON_BUILD:
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);
break;
case ACTION_PLACE_BROKEN_HARPOON:
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;
}
}
@@ -97,39 +97,39 @@ namespace Scripts.Northrend.Ulduar
{
case EVENT_BUILD_HARPOON_1:
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
BrokenHarpoon->RemoveFromWorld();
if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) //only nearest broken harpoon
BrokenHarpoon.RemoveFromWorld();
events.ScheduleEvent(EVENT_BUILD_HARPOON_2, 20000);
events.CancelEvent(EVENT_BUILD_HARPOON_1);
}
return;
case EVENT_BUILD_HARPOON_2:
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))
BrokenHarpoon->RemoveFromWorld();
if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon.RemoveFromWorld();
events.CancelEvent(EVENT_BUILD_HARPOON_2);
}
return;
case EVENT_BUILD_HARPOON_3:
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))
BrokenHarpoon->RemoveFromWorld();
if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon.RemoveFromWorld();
events.ScheduleEvent(EVENT_BUILD_HARPOON_4, 20000);
events.CancelEvent(EVENT_BUILD_HARPOON_3);
}
return;
case EVENT_BUILD_HARPOON_4:
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))
BrokenHarpoon->RemoveFromWorld();
if (GameObject * BrokenHarpoon = Harpoon.FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon.RemoveFromWorld();
events.CancelEvent(EVENT_BUILD_HARPOON_4);
}
return;
@@ -68,7 +68,7 @@ namespace Scripts.Northrend.Ulduar
if (_algalonTimer != 0 && _algalonTimer <= 60)
algalon.GetAI().DoAction((int)InstanceEvents.ActionInitAlgalon);
else
algalon.RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
algalon.RemoveUnitFlag(UnitFlags.ImmuneToPc);
}
// Keepers at Observation Ring
@@ -435,7 +435,7 @@ namespace Scripts.Northrend.Ulduar
case InstanceGameObjectIds.CelestialPlanetariumAccess10:
case InstanceGameObjectIds.CelestialPlanetariumAccess25:
if (_algalonSummoned)
gameObject.SetFlag(GameObjectFields.Flags, GameObjectFlags.InUse);
gameObject.AddFlag(GameObjectFlags.InUse);
break;
case InstanceGameObjectIds.DoodadUlSigildoor01:
AlgalonSigilDoorGUID[0] = gameObject.GetGUID();
@@ -610,7 +610,7 @@ namespace Scripts.Northrend.Ulduar
if (vehicle != null)
{
vehicle.RemoveAllPassengers();
vehicleCreature.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
vehicleCreature.AddUnitFlag(UnitFlags.NotSelectable);
vehicleCreature.DespawnOrUnsummon(5 * Time.Minute * Time.InMilliseconds);
}
}
@@ -640,7 +640,7 @@ namespace Scripts.Northrend.Ulduar
if (gameObject)
{
gameObject.SetRespawnTime((int)gameObject.GetRespawnDelay());
gameObject.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
gameObject.RemoveFlag(GameObjectFlags.NotSelectable);
}
HandleGameObject(KologarnBridgeGUID, false);
}
@@ -651,7 +651,7 @@ namespace Scripts.Northrend.Ulduar
GameObject HodirRareCache = instance.GetGameObject(HodirRareCacheGUID);
if (HodirRareCache)
if (GetData(InstanceData.HodirRareCache) != 0)
HodirRareCache.RemoveFlag(GameObjectFields.Flags, GameObjectFlags.NotSelectable);
HodirRareCache.RemoveFlag(GameObjectFlags.NotSelectable);
GameObject HodirChest = instance.GetGameObject(HodirChestGUID);
if (HodirChest)
HodirChest.SetRespawnTime((int)HodirChest.GetRespawnDelay());
+16 -19
View File
@@ -24,6 +24,7 @@ using Game.Scripting;
using Game.Spells;
using System;
using System.Collections.Generic;
using Game.Network.Packets;
namespace Scripts.Northrend.Ulduar.Xt002
{
@@ -143,7 +144,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
{
_Reset();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive);
DoCastSelf(SpellIds.Stand);
@@ -225,7 +226,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
{
Talk(Texts.Death);
_JustDied();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
}
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(heart, SpellIds.HeartHealToFull, true);
heart.CastSpell(me, SpellIds.RideVehicleExposed, true);
heart.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
heart.SetFlag(UnitFields.Flags, UnitFlags.Unk29);
heart.RemoveUnitFlag(UnitFlags.NotSelectable);
heart.AddUnitFlag(UnitFlags.Unk29);
}
_scheduler.DelayGroup(Misc.PhaseOneGroup, TimeSpan.FromSeconds(30));
@@ -330,7 +331,7 @@ namespace Scripts.Northrend.Ulduar.Xt002
Talk(Texts.HeartClosed);
Talk(Texts.EmoteHeartClosed);
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
me.SetReactState(ReactStates.Aggressive);
DoCastSelf(SpellIds.Stand);
@@ -343,8 +344,8 @@ namespace Scripts.Northrend.Ulduar.Xt002
return;
heart.CastSpell(me, SpellIds.HeartRideVehicle, true);
heart.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
heart.RemoveFlag(UnitFields.Flags, UnitFlags.Unk29);
heart.AddUnitFlag(UnitFlags.NotSelectable);
heart.RemoveUnitFlag(UnitFlags.Unk29);
heart.RemoveAurasDueToSpell(SpellIds.ExposedHeart);
if (!_hardMode)
@@ -529,12 +530,6 @@ namespace Scripts.Northrend.Ulduar.Xt002
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?
Creature pXT002 = ObjectAccessor.GetCreature(me, _instance.GetGuidData(BossIds.Xt002));
if (pXT002)
@@ -547,20 +542,22 @@ namespace Scripts.Northrend.Ulduar.Xt002
{
_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;
me.CastSpell(me, SpellIds.Boom, false);
// 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,
// so that can't be the issue
// See BoomEvent class
// 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)
return;
target.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
target.AddUnitFlag(UnitFlags.NotSelectable);
target.SetStandState(UnitStandStateType.Submerged);
}
+2 -2
View File
@@ -47,7 +47,7 @@ namespace Scripts.Outlands
envelopingWinds_Timer = 9000;
shock_Timer = 5000;
me.RemoveFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver);
me.RemoveNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(Aeranas.FactionFriendly);
Talk(Aeranas.SaySummon);
@@ -72,7 +72,7 @@ namespace Scripts.Outlands
if (HealthBelowPct(30))
{
me.SetFaction(Aeranas.FactionFriendly);
me.SetFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver);
me.AddNpcFlag(NPCFlags.QuestGiver);
me.RemoveAllAuras();
me.DeleteThreatList();
me.CombatStop(true);
+2 -2
View File
@@ -142,7 +142,7 @@ namespace Scripts.Outlands
{
public npc_cooshcooshAI(Creature creature) : base(creature)
{
m_uiNormFaction = creature.getFaction();
m_uiNormFaction = creature.GetFaction();
}
uint m_uiNormFaction;
@@ -150,7 +150,7 @@ namespace Scripts.Outlands
public override void Reset()
{
_events.ScheduleEvent(Event_LightningBolt, 2000);
if (me.getFaction() != m_uiNormFaction)
if (me.GetFaction() != m_uiNormFaction)
me.SetFaction(m_uiNormFaction);
}
+1 -1
View File
@@ -72,7 +72,7 @@ namespace Scripts.Pets
return;
// Stop Fighting
me.ApplyModFlag(UnitFields.Flags, UnitFlags.NonAttackable, true);
me.AddUnitFlag(UnitFlags.NonAttackable);
// Sanctuary
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));
// Add delta to make them not all hit the same time
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);
// 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)
{
Unit target = GetTarget();
target.SetFlag(ObjectFields.DynamicFlags, UnitDynFlags.Dead);
target.SetFlag(UnitFields.Flags2, UnitFlags2.FeignDeath);
target.AddDynamicFlag(UnitDynFlags.Dead);
target.AddUnitFlag2(UnitFlags2.FeignDeath);
if (target.IsTypeId(TypeId.Unit))
target.ToCreature().SetReactState(ReactStates.Passive);
@@ -1068,8 +1068,8 @@ namespace Scripts.Spells.Generic
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.RemoveFlag(ObjectFields.DynamicFlags, UnitDynFlags.Dead);
target.RemoveFlag(UnitFields.Flags2, UnitFlags2.FeignDeath);
target.RemoveDynamicFlag(UnitDynFlags.Dead);
target.RemoveUnitFlag2(UnitFlags2.FeignDeath);
}
public override void Register()
@@ -2873,7 +2873,7 @@ namespace Scripts.Spells.Generic
player.CombatStop();
if (player.IsNonMeleeSpellCast(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.GetClass() == Class.Hunter) || (player.GetClass() == Class.Warlock))
@@ -2898,7 +2898,7 @@ namespace Scripts.Spells.Generic
{
// Reset player faction + allow combat + allow duels
player.setFactionForRace(player.GetRace());
player.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
player.RemoveUnitFlag(UnitFlags.NonAttackable);
// save player
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
SpellCastResult result = SpellCastResult.SpellCastOk;
UnitFlags unitflag = (UnitFlags)pet.GetUInt32Value(UnitFields.Flags);
UnitFlags unitflag = (UnitFlags)(uint)pet.m_unitData.Flags;
if (!pet.GetCharmerGUID().IsEmpty())
result = SpellCastResult.Charmed;
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));
}
}
[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)
{
PreventDefaultAction();
GetTarget().RemoveMovementImpairingAuras();
GetTarget().RemoveMovementImpairingAuras(true);
}
public override void Register()
+4 -4
View File
@@ -435,13 +435,13 @@ namespace Scripts.Spells.Quest
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
target.AddUnitFlag(UnitFlags.ImmuneToPc);
target.AddUnitState(UnitState.Root);
}
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
{
GetTarget().RemoveFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
GetTarget().RemoveUnitFlag(UnitFlags.ImmuneToPc);
}
public override void Register()
@@ -789,8 +789,8 @@ namespace Scripts.Spells.Quest
if (target.HasAura(SpellIds.PermanentFeignDeath))
{
target.RemoveAurasDueToSpell(SpellIds.PermanentFeignDeath);
target.SetUInt32Value(ObjectFields.DynamicFlags, 0);
target.SetUInt32Value(UnitFields.Flags2, 0);
target.SetDynamicFlags(0);
target.SetUnitFlags2(0);
target.SetHealth(target.GetMaxHealth() / 2);
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)
{
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)
{
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();
procInfo.GetActor().GetSpellHistory().ResetCooldown(SpellIds.ImpendingVictory, true);
+3 -3
View File
@@ -101,7 +101,7 @@ namespace Scripts.World.BossEmeraldDragons
public override void Reset()
{
base.Reset();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.SetReactState(ReactStates.Aggressive);
DoCast(me, Spells.MarkOfNatureAura, true);
@@ -478,7 +478,7 @@ namespace Scripts.World.BossEmeraldDragons
_shades += (byte)Spells.TaerarShadeSpells.Length;
DoCast(Spells.Shade);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.SetReactState(ReactStates.Passive);
++_stage;
@@ -497,7 +497,7 @@ namespace Scripts.World.BossEmeraldDragons
{
_banished = false;
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.RemoveAurasDueToSpell(Spells.Shade);
me.SetReactState(ReactStates.Aggressive);
}
+1 -1
View File
@@ -363,7 +363,7 @@ namespace Scripts.World
if (Spell != 0)
creature.CastSpell(player, Spell, false);
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>();
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 39883, 1); // Cracked Egg
if (msg == InventoryResult.Ok)
player.StoreNewItem(dest, 39883, true, ItemEnchantment.GenerateItemRandomPropertyId(39883));
player.StoreNewItem(dest, 39883, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(39883));
return true;
}
@@ -222,7 +222,7 @@ namespace Scripts.World
List<ItemPosCount> dest = new List<ItemPosCount>();
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 44718, 1); // Ripe Disgusting Jar
if (msg == InventoryResult.Ok)
player.StoreNewItem(dest, 44718, true, ItemEnchantment.GenerateItemRandomPropertyId(44718));
player.StoreNewItem(dest, 44718, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(44718));
return true;
}
@@ -257,7 +257,7 @@ namespace Scripts.World
{
summon.SetVisible(false);
summon.SetReactState(ReactStates.Passive);
summon.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
summon.AddUnitFlag(UnitFlags.ImmuneToPc);
}
return false;
}
+26 -26
View File
@@ -584,7 +584,7 @@ namespace Scripts.World.NpcSpecial
{
Initialize();
me.SetFaction(NpcSpecialConst.FactionChicken);
me.RemoveFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver);
me.RemoveNpcFlag(NPCFlags.QuestGiver);
}
public override void EnterCombat(Unit who) { }
@@ -592,7 +592,7 @@ namespace Scripts.World.NpcSpecial
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
if (me.HasFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver))
if (me.HasNpcFlag(NPCFlags.QuestGiver))
{
if (ResetFlagTimer <= diff)
{
@@ -614,7 +614,7 @@ namespace Scripts.World.NpcSpecial
case TextEmotes.Chicken:
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);
Talk(player.GetTeam() == Team.Horde ? Texts.EmoteHelloH : Texts.EmoteHelloA);
}
@@ -622,7 +622,7 @@ namespace Scripts.World.NpcSpecial
case TextEmotes.Cheer:
if (player.GetQuestStatus(QuestConst.Cluck) == QuestStatus.Complete)
{
me.SetFlag(UnitFields.NpcFlags, NPCFlags.QuestGiver);
me.AddNpcFlag(NPCFlags.QuestGiver);
me.SetFaction(NpcSpecialConst.FactionFriendly);
Talk(Texts.EmoteCluck);
}
@@ -881,7 +881,7 @@ namespace Scripts.World.NpcSpecial
public override void Reset()
{
Initialize();
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
}
public void BeginEvent(Player player)
@@ -906,7 +906,7 @@ namespace Scripts.World.NpcSpecial
}
Event = true;
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
}
public void PatientDied(Position point)
@@ -1004,7 +1004,7 @@ namespace Scripts.World.NpcSpecial
if (Patient)
{
//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());
((npc_injured_patient)Patient.GetAI()).DoctorGUID = me.GetGUID();
@@ -1072,13 +1072,13 @@ namespace Scripts.World.NpcSpecial
Initialize();
//no select
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.NotSelectable);
//no regen health
me.SetFlag(UnitFields.Flags, UnitFlags.InCombat);
me.AddUnitFlag(UnitFlags.InCombat);
//to make them lay with face down
me.SetUInt32Value(UnitFields.Bytes1, (uint)UnitStandStateType.Dead);
me.SetStandState(UnitStandStateType.Dead);
uint mobId = me.GetEntry();
@@ -1118,13 +1118,13 @@ namespace Scripts.World.NpcSpecial
}
//make not selectable
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.AddUnitFlag(UnitFlags.NotSelectable);
//regen health
me.RemoveFlag(UnitFields.Flags, UnitFlags.InCombat);
me.RemoveUnitFlag(UnitFlags.InCombat);
//stand up
me.SetUInt32Value(UnitFields.Bytes1, (uint)UnitStandStateType.Stand);
me.SetStandState(UnitStandStateType.Stand);
Talk(Texts.SayDoc);
@@ -1154,10 +1154,10 @@ namespace Scripts.World.NpcSpecial
if (me.IsAlive() && me.GetHealth() <= 6)
{
me.RemoveFlag(UnitFields.Flags, UnitFlags.InCombat);
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
me.RemoveUnitFlag(UnitFlags.InCombat);
me.AddUnitFlag(UnitFlags.NotSelectable);
me.setDeathState(DeathState.JustDied);
me.SetFlag(ObjectFields.DynamicFlags, 32);
me.AddDynamicFlag(UnitDynFlags.Dead);
if (!DoctorGUID.IsEmpty())
{
@@ -1308,7 +1308,7 @@ namespace Scripts.World.NpcSpecial
public override void Reset()
{
me.SetFlag(UnitFields.Flags, UnitFlags.NonAttackable);
me.AddUnitFlag(UnitFlags.NonAttackable);
}
public override void EnterCombat(Unit who)
@@ -1706,7 +1706,7 @@ namespace Scripts.World.NpcSpecial
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.SEND_GOSSIP_MENU(Texts.XpOnOff, creature.GetGUID());
@@ -1726,10 +1726,10 @@ namespace Scripts.World.NpcSpecial
switch (action)
{
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;
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;
}
@@ -2170,7 +2170,7 @@ namespace Scripts.World.NpcSpecial
break;
}
me.UpdateEntry(CreatureIds.ExultingWindUpTrainWrecker);
me.SetUInt32Value(UnitFields.NpcEmotestate, (uint)Emote.OneshotDance);
me.SetEmoteState(Emote.OneshotDance);
me.DespawnOrUnsummon(5 * Time.InMilliseconds);
_nextAction = 0;
break;
@@ -2216,8 +2216,8 @@ namespace Scripts.World.NpcSpecial
});
_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))
me.RemoveFlag(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.RemoveNpcFlag(NPCFlags.Banker | NPCFlags.Mailbox | NPCFlags.Vendor);
task.Repeat();
});
}
@@ -2228,7 +2228,7 @@ namespace Scripts.World.NpcSpecial
{
case GossipMenus.OptionIdBank:
{
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Banker);
me.AddNpcFlag(NPCFlags.Banker);
uint _bankAura = IsArgentSquire() ? Spells.AuraBankS : Spells.AuraBankG;
if (!me.HasAura(_bankAura))
DoCastSelf(_bankAura);
@@ -2239,7 +2239,7 @@ namespace Scripts.World.NpcSpecial
}
case GossipMenus.OptionIdShop:
{
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Vendor);
me.AddNpcFlag(NPCFlags.Vendor);
uint _shopAura = IsArgentSquire() ? Spells.AuraShopS : Spells.AuraShopG;
if (!me.HasAura(_shopAura))
DoCastSelf(_shopAura);
@@ -2250,7 +2250,7 @@ namespace Scripts.World.NpcSpecial
}
case GossipMenus.OptionIdMail:
{
me.SetFlag(UnitFields.NpcFlags, NPCFlags.Mailbox);
me.AddNpcFlag(NPCFlags.Mailbox);
player.GetSession().SendShowMailBox(me.GetGUID());
uint _mailAura = IsArgentSquire() ? Spells.AuraPostmanS : Spells.AuraPostmanG;