Some refactoring of code. and some cleanups
This commit is contained in:
@@ -16,11 +16,9 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.IO;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using Game.AI;
|
||||
|
||||
namespace Scripts.EasternKingdoms.Karazhan
|
||||
{
|
||||
|
||||
@@ -1020,7 +1020,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
Romulo.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
Romulo.GetMotionMaster().Clear();
|
||||
Romulo.setDeathState(DeathState.JustDied);
|
||||
Romulo.SetDeathState(DeathState.JustDied);
|
||||
Romulo.CombatStop(true);
|
||||
Romulo.DeleteThreatList();
|
||||
Romulo.SetDynamicFlags(UnitDynFlags.Lootable);
|
||||
@@ -1258,7 +1258,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
|
||||
{
|
||||
Julianne.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
Julianne.GetMotionMaster().Clear();
|
||||
Julianne.setDeathState(DeathState.JustDied);
|
||||
Julianne.SetDeathState(DeathState.JustDied);
|
||||
Julianne.CombatStop(true);
|
||||
Julianne.DeleteThreatList();
|
||||
Julianne.SetDynamicFlags(UnitDynFlags.Lootable);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
@@ -839,8 +838,8 @@ namespace Scripts.EasternKingdoms
|
||||
|
||||
foreach (TempSummon summon in MinionList)
|
||||
if (summon.GetOwnerGUID() == me.GetOwnerGUID())
|
||||
if (summon.IsInCombat() && summon.getAttackerForHelper())
|
||||
AttackStart(summon.getAttackerForHelper());
|
||||
if (summon.IsInCombat() && summon.GetAttackerForHelper())
|
||||
AttackStart(summon.GetAttackerForHelper());
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -853,8 +852,8 @@ namespace Scripts.EasternKingdoms
|
||||
Player plrOwner = owner.ToPlayer();
|
||||
if (plrOwner && plrOwner.IsInCombat())
|
||||
{
|
||||
if (plrOwner.getAttackerForHelper() && plrOwner.getAttackerForHelper().GetEntry() == CreatureIds.Ghosts)
|
||||
AttackStart(plrOwner.getAttackerForHelper());
|
||||
if (plrOwner.GetAttackerForHelper() && plrOwner.GetAttackerForHelper().GetEntry() == CreatureIds.Ghosts)
|
||||
AttackStart(plrOwner.GetAttackerForHelper());
|
||||
else
|
||||
FindMinions(owner);
|
||||
}
|
||||
@@ -868,13 +867,13 @@ namespace Scripts.EasternKingdoms
|
||||
//Check if we have a current target
|
||||
if (me.GetVictim().GetEntry() == CreatureIds.Ghosts)
|
||||
{
|
||||
if (me.isAttackReady())
|
||||
if (me.IsAttackReady())
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (me.IsWithinMeleeRange(me.GetVictim()))
|
||||
{
|
||||
me.AttackerStateUpdate(me.GetVictim());
|
||||
me.resetAttackTimer();
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -20,7 +20,6 @@ using Game;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.PvP;
|
||||
|
||||
namespace Scripts.Outlands
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Scripts.Pets
|
||||
|
||||
_isViper = Info.Entry == NpcViper ? true : false;
|
||||
|
||||
me.SetMaxHealth((uint)(107 * (me.getLevel() - 40) * 0.025f));
|
||||
me.SetMaxHealth((uint)(107 * (me.GetLevel() - 40) * 0.025f));
|
||||
// Add delta to make them not all hit the same time
|
||||
uint delta = (RandomHelper.Rand32() % 7) * 100;
|
||||
me.SetBaseAttackTime(WeaponAttackType.BaseAttack, Info.BaseAttackTime + delta);
|
||||
@@ -48,8 +48,8 @@ namespace Scripts.Pets
|
||||
{
|
||||
Unit owner = me.ToTempSummon().GetSummoner();
|
||||
if (owner)
|
||||
if (owner.getAttackerForHelper())
|
||||
AttackStart(owner.getAttackerForHelper());
|
||||
if (owner.GetAttackerForHelper())
|
||||
AttackStart(owner.GetAttackerForHelper());
|
||||
}
|
||||
|
||||
if (!_isViper)
|
||||
@@ -69,7 +69,7 @@ namespace Scripts.Pets
|
||||
{
|
||||
if ((RandomHelper.Rand32() % 5) == 0)
|
||||
{
|
||||
me.setAttackTimer(WeaponAttackType.BaseAttack, (RandomHelper.Rand32() % 10) * 100);
|
||||
me.SetAttackTimer(WeaponAttackType.BaseAttack, (RandomHelper.Rand32() % 10) * 100);
|
||||
_spellTimer = (RandomHelper.Rand32() % 10) * 100;
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace Scripts.Pets
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
Unit target = owner.getAttackerForHelper();
|
||||
Unit target = owner.GetAttackerForHelper();
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.Spells.DemonHunter
|
||||
{
|
||||
|
||||
@@ -732,7 +732,7 @@ namespace Scripts.Spells.Druid
|
||||
if (player.IsInWater()) // Aquatic form
|
||||
triggeredSpellId = SpellIds.FormAquatic;
|
||||
else if (player.GetSkillValue(SkillType.Riding) >= 225 && CheckLocationForForm(SpellIds.FormFlight) == SpellCastResult.SpellCastOk) // Flight form
|
||||
triggeredSpellId = player.getLevel() >= 71 ? SpellIds.FormSwiftFlight : SpellIds.FormFlight;
|
||||
triggeredSpellId = player.GetLevel() >= 71 ? SpellIds.FormSwiftFlight : SpellIds.FormFlight;
|
||||
else // Stag form (riding skill already checked in CheckCast)
|
||||
triggeredSpellId = SpellIds.FormStag;
|
||||
|
||||
|
||||
@@ -2067,8 +2067,8 @@ namespace Scripts.Spells.Generic
|
||||
if (newPet.LoadPetFromDB(player, 0, player.GetLastPetNumber(), true))
|
||||
{
|
||||
// revive the pet if it is dead
|
||||
if (newPet.getDeathState() == DeathState.Dead)
|
||||
newPet.setDeathState(DeathState.Alive);
|
||||
if (newPet.GetDeathState() == DeathState.Dead)
|
||||
newPet.SetDeathState(DeathState.Alive);
|
||||
|
||||
newPet.SetFullHealth();
|
||||
newPet.SetFullPower(newPet.GetPowerType());
|
||||
@@ -2897,7 +2897,7 @@ namespace Scripts.Spells.Generic
|
||||
if (player)
|
||||
{
|
||||
// Reset player faction + allow combat + allow duels
|
||||
player.setFactionForRace(player.GetRace());
|
||||
player.SetFactionForRace(player.GetRace());
|
||||
player.RemoveUnitFlag(UnitFlags.NonAttackable);
|
||||
// save player
|
||||
player.SaveToDB();
|
||||
|
||||
@@ -569,7 +569,7 @@ namespace Scripts.Spells.Hunter
|
||||
if (playerTarget)
|
||||
{
|
||||
int baseAmount = aurEff.GetBaseAmount();
|
||||
int amount = playerTarget.isMoving() ?
|
||||
int amount = playerTarget.IsMoving() ?
|
||||
playerTarget.CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff.GetEffIndex(), baseAmount) :
|
||||
aurEff.GetAmount() - 1;
|
||||
aurEff.SetAmount(amount);
|
||||
@@ -624,7 +624,7 @@ namespace Scripts.Spells.Hunter
|
||||
Creature target = GetExplTargetUnit().ToCreature();
|
||||
if (target)
|
||||
{
|
||||
if (target.getLevel() > caster.getLevel())
|
||||
if (target.GetLevel() > caster.GetLevel())
|
||||
return SpellCastResult.Highlevel;
|
||||
|
||||
// use SMSG_PET_TAME_FAILURE?
|
||||
|
||||
@@ -626,7 +626,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
int diff = (int)GetUnitOwner().getLevel() - 60;
|
||||
int diff = (int)GetUnitOwner().GetLevel() - 60;
|
||||
if (diff > 0)
|
||||
amount += 2 * diff;
|
||||
}
|
||||
@@ -1619,7 +1619,7 @@ namespace Scripts.Spells.Items
|
||||
break;
|
||||
}
|
||||
|
||||
if (caster.getLevel() > maxSafeLevel)
|
||||
if (caster.GetLevel() > maxSafeLevel)
|
||||
{
|
||||
caster.CastSpell(caster, SpellIds.Lost, true);
|
||||
|
||||
@@ -1840,7 +1840,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||
{
|
||||
int diff = (int)GetUnitOwner().getLevel() - 60;
|
||||
int diff = (int)GetUnitOwner().GetLevel() - 60;
|
||||
if (diff > 0)
|
||||
amount += diff;
|
||||
}
|
||||
@@ -2165,7 +2165,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
Creature target = GetHitCreature();
|
||||
if (target)
|
||||
target.setDeathState(DeathState.JustRespawned);
|
||||
target.SetDeathState(DeathState.JustRespawned);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
|
||||
@@ -496,7 +496,7 @@ namespace Scripts.Spells.Paladin
|
||||
if (!caster.IsValidAttackTarget(target))
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
if (!caster.isInFront(target))
|
||||
if (!caster.IsInFront(target))
|
||||
return SpellCastResult.NotInfront;
|
||||
}
|
||||
}
|
||||
@@ -715,7 +715,7 @@ namespace Scripts.Spells.Paladin
|
||||
Unit target = GetExplTargetUnit();
|
||||
if (target)
|
||||
{
|
||||
if (!target.IsFriendlyTo(caster) || target.getAttackers().Empty())
|
||||
if (!target.IsFriendlyTo(caster) || target.GetAttackers().Empty())
|
||||
return SpellCastResult.BadTargets;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace Scripts.Spells.Priest
|
||||
if (aegis != null)
|
||||
absorb += aegis.GetAmount();
|
||||
|
||||
absorb = (int)Math.Min(absorb, eventInfo.GetProcTarget().getLevel() * 125);
|
||||
absorb = (int)Math.Min(absorb, eventInfo.GetProcTarget().GetLevel() * 125);
|
||||
|
||||
GetTarget().CastCustomSpell(SpellIds.DivineAegis, SpellValueMod.BasePoint0, absorb, eventInfo.GetProcTarget(), true, null, aurEff);
|
||||
}
|
||||
@@ -748,7 +748,7 @@ namespace Scripts.Spells.Priest
|
||||
if (!caster.IsValidAttackTarget(target))
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
if (!caster.isInFront(target))
|
||||
if (!caster.IsInFront(target))
|
||||
return SpellCastResult.NotInfront;
|
||||
}
|
||||
else
|
||||
@@ -757,7 +757,7 @@ namespace Scripts.Spells.Priest
|
||||
if (!caster.HasAura(SpellIds.ThePenitentAura))
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
if (!caster.isInFront(target))
|
||||
if (!caster.IsInFront(target))
|
||||
return SpellCastResult.UnitNotInfront;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace Scripts.Spells.Warlock
|
||||
if (removeMode != AuraRemoveMode.Death || !IsExpired())
|
||||
return;
|
||||
|
||||
if (GetCaster().ToPlayer().isHonorOrXPTarget(GetTarget()))
|
||||
if (GetCaster().ToPlayer().IsHonorOrXPTarget(GetTarget()))
|
||||
GetCaster().CastSpell(GetTarget(), SpellIds.BaneOfDoomEffect, true, null, aurEff);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace Scripts.Spells.Warrior
|
||||
for (uint i = 0; i < 5; ++i)
|
||||
{
|
||||
int timeOffset = (int)(6 * i * aurEff.GetPeriod() / 25);
|
||||
Vector4 loc = GetTarget().moveSpline.ComputePosition(timeOffset);
|
||||
Vector4 loc = GetTarget().MoveSpline.ComputePosition(timeOffset);
|
||||
GetTarget().SendPlaySpellVisual(new Vector3(loc.X, loc.Y, loc.Z), 0.0f, Misc.SpellVisualBlazingCharge, 0, 0, 1.0f, true);
|
||||
}
|
||||
}
|
||||
@@ -550,7 +550,7 @@ namespace Scripts.Spells.Warrior
|
||||
bool CheckProc(ProcEventInfo eventInfo)
|
||||
{
|
||||
// check attack comes not from behind and warrior is not stunned
|
||||
return GetTarget().isInFront(eventInfo.GetProcTarget(), MathFunctions.PI) && !GetTarget().HasUnitState(UnitState.Stunned);
|
||||
return GetTarget().IsInFront(eventInfo.GetProcTarget(), MathFunctions.PI) && !GetTarget().HasUnitState(UnitState.Stunned);
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Scripts.World
|
||||
|
||||
public override bool OnCheck(Player player, Unit target)
|
||||
{
|
||||
return target && player.isHonorOrXPTarget(target);
|
||||
return target && player.IsHonorOrXPTarget(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ namespace Scripts.World
|
||||
{
|
||||
GameObject go = player.FindNearestGameObject(AreaTriggerConst.GoCoilfangWaterfall, 35.0f);
|
||||
if (go)
|
||||
if (go.getLootState() == LootState.Ready)
|
||||
if (go.GetLootState() == LootState.Ready)
|
||||
go.UseDoorOrButton();
|
||||
|
||||
return false;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Scripts.World
|
||||
{
|
||||
if (me.GetEntry() == CreatureIds.CenarionHoldIndantry)
|
||||
Talk(GuardsConst.SaySilAggro, who);
|
||||
SpellInfo spell = me.reachWithSpellAttack(who);
|
||||
SpellInfo spell = me.ReachWithSpellAttack(who);
|
||||
if (spell != null)
|
||||
DoCast(who, spell.Id);
|
||||
}
|
||||
@@ -103,7 +103,7 @@ namespace Scripts.World
|
||||
return;
|
||||
|
||||
// Make sure our attack is ready and we arn't currently casting
|
||||
if (me.isAttackReady() && !me.IsNonMeleeSpellCast(false))
|
||||
if (me.IsAttackReady() && !me.IsNonMeleeSpellCast(false))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (me.IsWithinMeleeRange(me.GetVictim()))
|
||||
@@ -136,7 +136,7 @@ namespace Scripts.World
|
||||
else
|
||||
me.AttackerStateUpdate(me.GetVictim());
|
||||
|
||||
me.resetAttackTimer();
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace Scripts.World
|
||||
public override bool OnCastItemCombatSpell(Player player, Unit victim, SpellInfo spellInfo, Item item)
|
||||
{
|
||||
// spell proc chance gets severely reduced on victims > 60 (formula unknown)
|
||||
if (victim.getLevel() > 60)
|
||||
if (victim.GetLevel() > 60)
|
||||
{
|
||||
// gives ~0.1% proc chance at lvl 70
|
||||
float lvlPenaltyFactor = 9.93f;
|
||||
|
||||
@@ -950,7 +950,7 @@ namespace Scripts.World.NpcSpecial
|
||||
{
|
||||
Creature patient = ObjectAccessor.GetCreature(me, guid);
|
||||
if (patient)
|
||||
patient.setDeathState(DeathState.JustDied);
|
||||
patient.SetDeathState(DeathState.JustDied);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1156,7 +1156,7 @@ namespace Scripts.World.NpcSpecial
|
||||
{
|
||||
me.RemoveUnitFlag(UnitFlags.InCombat);
|
||||
me.AddUnitFlag(UnitFlags.NotSelectable);
|
||||
me.setDeathState(DeathState.JustDied);
|
||||
me.SetDeathState(DeathState.JustDied);
|
||||
me.AddDynamicFlag(UnitDynFlags.Dead);
|
||||
|
||||
if (!DoctorGUID.IsEmpty())
|
||||
@@ -1320,10 +1320,10 @@ namespace Scripts.World.NpcSpecial
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me.isAttackReady())
|
||||
if (me.IsAttackReady())
|
||||
{
|
||||
DoCastVictim(Spells.Deathtouch, true);
|
||||
me.resetAttackTimer();
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1501,7 +1501,7 @@ namespace Scripts.World.NpcSpecial
|
||||
if (ExplosionTimer <= diff)
|
||||
{
|
||||
DoCast(me, Spells.TonkMineDetonate, true);
|
||||
me.setDeathState(DeathState.Dead); // unsummon it
|
||||
me.SetDeathState(DeathState.Dead); // unsummon it
|
||||
}
|
||||
else
|
||||
ExplosionTimer -= diff;
|
||||
@@ -1582,7 +1582,7 @@ namespace Scripts.World.NpcSpecial
|
||||
{
|
||||
Unit unit = Global.ObjAccessor.GetUnit(me, pair.Key);
|
||||
if (unit)
|
||||
unit.getHostileRefManager().deleteReference(me);
|
||||
unit.GetHostileRefManager().deleteReference(me);
|
||||
|
||||
_damageTimes.Remove(pair.Key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user