Some refactoring of code. and some cleanups
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user