Some refactoring of code. and some cleanups
This commit is contained in:
@@ -511,7 +511,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak
|
||||
|
||||
if (diff >= _backstabTimer)
|
||||
{
|
||||
if (me.GetVictim() && me.GetVictim().isInBack(me))
|
||||
if (me.GetVictim() && me.GetVictim().IsInBack(me))
|
||||
DoCastVictim(SpellIds.Backstab);
|
||||
_backstabTimer = 6 * Time.InMilliseconds;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher
|
||||
{
|
||||
@@ -624,7 +623,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(9), task =>
|
||||
{
|
||||
if (me.GetVictim() && me.GetVictim().isInBack(me))
|
||||
if (me.GetVictim() && me.GetVictim().IsInBack(me))
|
||||
DoCastVictim(SpellIds.Backstab);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(13));
|
||||
});
|
||||
@@ -704,7 +703,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher
|
||||
Creature gatewatcher = me.GetInstanceScript().GetCreature(ANDataTypes.KrikthirTheGatewatcher);
|
||||
if (gatewatcher)
|
||||
{
|
||||
Unit target = gatewatcher.getAttackerForHelper();
|
||||
Unit target = gatewatcher.GetAttackerForHelper();
|
||||
if (target)
|
||||
AttackStart(target);
|
||||
gatewatcher.GetAI().JustSummoned(me);
|
||||
@@ -723,7 +722,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher
|
||||
Creature gatewatcher = me.GetInstanceScript().GetCreature(ANDataTypes.KrikthirTheGatewatcher);
|
||||
if (gatewatcher)
|
||||
{
|
||||
Unit target = gatewatcher.getAttackerForHelper();
|
||||
Unit target = gatewatcher.GetAttackerForHelper();
|
||||
if (target)
|
||||
AttackStart(target);
|
||||
gatewatcher.GetAI().JustSummoned(me);
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Nadronox
|
||||
task.Repeat(TimeSpan.FromSeconds(1));
|
||||
});
|
||||
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
}
|
||||
|
||||
public override void DoAction(int action)
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ using Game.Scripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Game.AI;
|
||||
|
||||
namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
|
||||
{
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Scripts.Northrend
|
||||
{
|
||||
if (GetClosestCreatureWithEntry(me, DalaranConst.NpcAplleboughA, 32.0f))
|
||||
{
|
||||
if (me.isInBackInMap(who, 12.0f)) // In my line of sight, "outdoors", and behind me
|
||||
if (me.IsInBackInMap(who, 12.0f)) // In my line of sight, "outdoors", and behind me
|
||||
DoCast(who, DalaranConst.SpellTrespasserA); // Teleport the Horde unit out
|
||||
}
|
||||
else // In my line of sight, and "indoors"
|
||||
@@ -105,7 +105,7 @@ namespace Scripts.Northrend
|
||||
{
|
||||
if (GetClosestCreatureWithEntry(me, DalaranConst.NpcSweetberryH, 32.0f))
|
||||
{
|
||||
if (me.isInBackInMap(who, 12.0f)) // In my line of sight, "outdoors", and behind me
|
||||
if (me.IsInBackInMap(who, 12.0f)) // In my line of sight, "outdoors", and behind me
|
||||
DoCast(who, DalaranConst.SpellTrespasserH); // Teleport the Alliance unit out
|
||||
}
|
||||
else // In my line of sight, and "indoors"
|
||||
@@ -125,7 +125,7 @@ namespace Scripts.Northrend
|
||||
{
|
||||
public npc_minigob_manabonk(Creature creature) : base(creature)
|
||||
{
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
|
||||
@@ -554,7 +554,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
Index = 0xFFFFFFFF;
|
||||
|
||||
BurningPitchId = Instance.GetData(DataTypes.TeamInInstance) == (uint)Team.Horde ? GunshipSpells.BurningPitchA : GunshipSpells.BurningPitchH;
|
||||
me.setRegeneratingHealth(false);
|
||||
me.SetRegeneratingHealth(false);
|
||||
}
|
||||
|
||||
public override void SetData(uint type, uint data)
|
||||
@@ -680,7 +680,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
_summonedFirstMage = false;
|
||||
_died = false;
|
||||
|
||||
me.setRegeneratingHealth(false);
|
||||
me.SetRegeneratingHealth(false);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit source, ref uint damage)
|
||||
@@ -845,7 +845,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
|
||||
_controller.ResetSlots(Team.Horde);
|
||||
_controller.SetTransport(creature.GetTransport());
|
||||
me.setRegeneratingHealth(false);
|
||||
me.SetRegeneratingHealth(false);
|
||||
me.m_CombatDistance = 70.0f;
|
||||
}
|
||||
|
||||
@@ -1075,10 +1075,10 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
|
||||
if (me.IsWithinMeleeRange(me.GetVictim()))
|
||||
DoMeleeAttackIfReady();
|
||||
else if (me.isAttackReady())
|
||||
else if (me.IsAttackReady())
|
||||
{
|
||||
DoCastVictim(GunshipSpells.RendingThrow);
|
||||
me.resetAttackTimer();
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1104,7 +1104,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
|
||||
_controller.ResetSlots(Team.Alliance);
|
||||
_controller.SetTransport(creature.GetTransport());
|
||||
me.setRegeneratingHealth(false);
|
||||
me.SetRegeneratingHealth(false);
|
||||
me.m_CombatDistance = 70.0f;
|
||||
}
|
||||
|
||||
@@ -1325,10 +1325,10 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
|
||||
if (me.IsWithinMeleeRange(me.GetVictim()))
|
||||
DoMeleeAttackIfReady();
|
||||
else if (me.isAttackReady())
|
||||
else if (me.IsAttackReady())
|
||||
{
|
||||
DoCastVictim(GunshipSpells.RendingThrow);
|
||||
me.resetAttackTimer();
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1710,7 +1710,7 @@ Fall Time: 824
|
||||
|
||||
void HandlePeriodic(AuraEffect aurEff)
|
||||
{
|
||||
if (GetTarget().moveSpline.Finalized())
|
||||
if (GetTarget().MoveSpline.Finalized())
|
||||
Remove(AuraRemoveMode.Expire);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Scripts.Northrend.IcecrownCitadel
|
||||
{
|
||||
@@ -157,13 +156,13 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
Creature factionNPC = me.FindNearestCreature(_instance.GetData(DataTypes.TeamInInstance) == (uint)Team.Horde ? CreatureIds.SeHighOverlordSaurfang : CreatureIds.SeMuradinBronzebeard, 50.0f);
|
||||
if (factionNPC)
|
||||
{
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
_theLichKing = theLichKing.GetGUID();
|
||||
theLichKing.setActive(true);
|
||||
theLichKing.SetActive(true);
|
||||
_bolvarFordragon = bolvarFordragon.GetGUID();
|
||||
bolvarFordragon.setActive(true);
|
||||
bolvarFordragon.SetActive(true);
|
||||
_factionNPC = factionNPC.GetGUID();
|
||||
factionNPC.setActive(true);
|
||||
factionNPC.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,7 +260,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
if (temp)
|
||||
{
|
||||
temp.GetAI().Talk(Texts.SayBolvarIntro1);
|
||||
temp.setActive(false);
|
||||
temp.SetActive(false);
|
||||
}
|
||||
break;
|
||||
case EventTypes.LkIntro5:
|
||||
@@ -269,7 +268,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
if (temp)
|
||||
{
|
||||
temp.GetAI().Talk(Texts.SayLkIntro5);
|
||||
temp.setActive(false);
|
||||
temp.SetActive(false);
|
||||
}
|
||||
break;
|
||||
case EventTypes.SaurfangIntro1:
|
||||
@@ -300,7 +299,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
Creature factionNPC = ObjectAccessor.GetCreature(me, _factionNPC);
|
||||
if (factionNPC)
|
||||
factionNPC.GetMotionMaster().MovePath((uint)(factionNPC.GetSpawnId() * 10), false);
|
||||
me.setActive(false);
|
||||
me.SetActive(false);
|
||||
_damnedKills = 3;
|
||||
break;
|
||||
case EventTypes.MuradinIntro1:
|
||||
@@ -549,7 +548,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
me.CastCustomSpell(InstanceSpells.CaressOfDeath, SpellValueMod.MaxTargets, 1, me, true);
|
||||
break;
|
||||
case Actions.StartGauntlet:
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
_isEventInProgress = true;
|
||||
me.AddUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
|
||||
_events.ScheduleEvent(EventTypes.SvalnaStart, 25000);
|
||||
@@ -561,7 +560,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
Talk(Texts.SaySvalnaCaptainDeath);
|
||||
break;
|
||||
case Actions.ResetEvent:
|
||||
me.setActive(false);
|
||||
me.SetActive(false);
|
||||
Reset();
|
||||
break;
|
||||
default:
|
||||
@@ -584,7 +583,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
return;
|
||||
|
||||
_isEventInProgress = false;
|
||||
me.setActive(false);
|
||||
me.SetActive(false);
|
||||
me.RemoveUnitFlag(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc);
|
||||
me.SetDisableGravity(false);
|
||||
me.SetHover(false);
|
||||
@@ -700,7 +699,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
_events.ScheduleEvent(EventTypes.ArnathIntro2, 7000);
|
||||
_events.ScheduleEvent(EventTypes.CrokIntro3, 14000);
|
||||
_events.ScheduleEvent(EventTypes.StartPathing, 37000);
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
for (uint i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature crusader = ObjectAccessor.GetCreature(me, _instance.GetGuidData(DataTypes.CaptainArnath + i));
|
||||
@@ -712,7 +711,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
{
|
||||
_isEventActive = false;
|
||||
_isEventDone = _instance.GetBossState(Bosses.SisterSvalna) == EncounterState.Done;
|
||||
me.setActive(false);
|
||||
me.SetActive(false);
|
||||
_aliveTrash.Clear();
|
||||
_currentWPid = 0;
|
||||
}
|
||||
@@ -729,7 +728,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
if (_currentWPid == 4 && _isEventActive)
|
||||
{
|
||||
_isEventActive = false;
|
||||
me.setActive(false);
|
||||
me.SetActive(false);
|
||||
Talk(Texts.SayCrokFinalWp);
|
||||
Creature svalna = ObjectAccessor.GetCreature(me, _instance.GetGuidData(Bosses.SisterSvalna));
|
||||
if (svalna)
|
||||
@@ -759,7 +758,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
if (_aliveTrash.Empty() && _isEventActive)
|
||||
{
|
||||
_isEventActive = false;
|
||||
me.setActive(false);
|
||||
me.SetActive(false);
|
||||
Talk(Texts.SayCrokFinalWp);
|
||||
Creature svalna = ObjectAccessor.GetCreature(me, _instance.GetGuidData(Bosses.SisterSvalna));
|
||||
if (svalna)
|
||||
@@ -980,7 +979,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
me.GetMotionMaster().MoveFollow(crok, FollowDist, FollowAngle, MovementSlot.Idle);
|
||||
}
|
||||
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
}
|
||||
else if (action == Actions.ResetEvent)
|
||||
{
|
||||
@@ -1029,7 +1028,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
if (spell.Id == InstanceSpells.ReviveChampion && !IsUndead)
|
||||
{
|
||||
IsUndead = true;
|
||||
me.setDeathState(DeathState.JustRespawned);
|
||||
me.SetDeathState(DeathState.JustRespawned);
|
||||
uint newEntry = 0;
|
||||
switch (me.GetEntry())
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
using Framework.Constants;
|
||||
using Framework.IO;
|
||||
using Game;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
@@ -1009,11 +1008,11 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
// note: "active" gameobjects do not block grid unloading
|
||||
GameObject precipice = instance.GetGameObject(ArthasPrecipiceGUID);
|
||||
if (precipice)
|
||||
precipice.setActive(state == EncounterState.InProgress);
|
||||
precipice.SetActive(state == EncounterState.InProgress);
|
||||
|
||||
GameObject platform = instance.GetGameObject(ArthasPlatformGUID);
|
||||
if (platform)
|
||||
platform.setActive(state == EncounterState.InProgress);
|
||||
platform.SetActive(state == EncounterState.InProgress);
|
||||
|
||||
if (instance.IsHeroic())
|
||||
{
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
}
|
||||
|
||||
me.SetCombatPulseDelay(5);
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
DoZoneInCombat();
|
||||
_phase = Phases.One;
|
||||
_scheduler.CancelGroup(GroupIds.Intro);
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
{
|
||||
Talk(Texts.SayAggro);
|
||||
|
||||
me.setActive(true);
|
||||
me.SetActive(true);
|
||||
DoZoneInCombat();
|
||||
instance.SetBossState(Bosses.LordMarrowgar, EncounterState.InProgress);
|
||||
}
|
||||
|
||||
@@ -526,13 +526,13 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
|
||||
//! I also removed the spellInfo check
|
||||
void DoBatteringRamIfReady()
|
||||
{
|
||||
if (me.isAttackReady())
|
||||
if (me.IsAttackReady())
|
||||
{
|
||||
Unit target = Global.ObjAccessor.GetUnit(me, _pursueTarget);
|
||||
if (me.IsWithinCombatRange(target, 30.0f))
|
||||
{
|
||||
DoCast(target, Spells.BatteringRam);
|
||||
me.resetAttackTimer();
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.IO;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
|
||||
Reference in New Issue
Block a user