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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user