Core/Creatures: Moved autoattack handling from scripts to game
Port From (https://github.com/TrinityCore/TrinityCore/commit/605e5f94c0d71cad8e83fa5a07eaec4e6bed9cc3)
This commit is contained in:
@@ -71,8 +71,6 @@ namespace Game.AI
|
||||
if (info != null)
|
||||
_events.ScheduleEvent(spellId, info.cooldown, info.cooldown * 2);
|
||||
}
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override void SpellInterrupted(uint spellId, uint unTimeMs)
|
||||
@@ -87,10 +85,7 @@ namespace Game.AI
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,6 +188,7 @@ namespace Game.AI
|
||||
_minRange = spellInfo != null ? spellInfo.GetMinRange(false) : 0;
|
||||
creature.m_CombatDistance = spellInfo != null ? spellInfo.GetMaxRange(false) : 0;
|
||||
creature.m_SightDistance = creature.m_CombatDistance;
|
||||
creature.SetCanMelee(false);
|
||||
}
|
||||
|
||||
public override bool CanAIAttack(Unit victim)
|
||||
@@ -234,6 +230,7 @@ namespace Game.AI
|
||||
LoadConditions();
|
||||
_doDismiss = false;
|
||||
_dismissTimer = VEHICLE_DISMISS_TIME;
|
||||
me.SetCanMelee(false);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -315,10 +312,7 @@ namespace Game.AI
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,7 @@ namespace Game.AI
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
public override bool CanSeeAlways(WorldObject obj)
|
||||
|
||||
@@ -11,7 +11,8 @@ namespace Game.AI
|
||||
{
|
||||
public PassiveAI(Creature creature) : base(creature)
|
||||
{
|
||||
creature.SetReactState(ReactStates.Passive);
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
me.SetCanMelee(false);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
@@ -43,8 +44,6 @@ namespace Game.AI
|
||||
{
|
||||
if (!me.IsValidAttackTarget(me.GetVictim()))
|
||||
me.AttackStop();
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,15 +50,6 @@ namespace Game.AI
|
||||
StopAttack();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check before attacking to prevent pets from leaving stay position
|
||||
if (me.GetCharmInfo().HasCommandState(CommandStates.Stay))
|
||||
{
|
||||
if (me.GetCharmInfo().IsCommandAttack() || (me.GetCharmInfo().IsAtStay() && me.IsWithinMeleeRange(me.GetVictim())))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -52,41 +52,6 @@ namespace Game.AI
|
||||
targets.Sort(new ObjectDistanceOrderPred(me, ascending));
|
||||
}
|
||||
|
||||
public void DoMeleeAttackIfReady()
|
||||
{
|
||||
if (me.IsCreature() && !me.ToCreature().CanMelee())
|
||||
return;
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
{
|
||||
Spell channeledSpell = me.GetCurrentSpell(CurrentSpellTypes.Channeled);
|
||||
if (channeledSpell == null || !channeledSpell.GetSpellInfo().HasAttribute(SpellAttr5.AllowActionsDuringChannel))
|
||||
return;
|
||||
}
|
||||
|
||||
Unit victim = me.GetVictim();
|
||||
|
||||
if (!me.IsWithinMeleeRange(victim))
|
||||
return;
|
||||
|
||||
// Check that the victim is in front of the unit
|
||||
if (!me.HasInArc(2 * MathF.PI / 3, victim))
|
||||
return;
|
||||
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
if (me.IsAttackReady())
|
||||
{
|
||||
me.AttackerStateUpdate(victim);
|
||||
me.ResetAttackTimer();
|
||||
}
|
||||
|
||||
if (me.HaveOffhandWeapon() && me.IsAttackReady(WeaponAttackType.OffAttack))
|
||||
{
|
||||
me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
|
||||
me.ResetAttackTimer(WeaponAttackType.OffAttack);
|
||||
}
|
||||
}
|
||||
|
||||
public bool DoSpellAttackIfReady(uint spellId)
|
||||
{
|
||||
if (me.HasUnitState(UnitState.Casting) || !me.IsAttackReady())
|
||||
|
||||
@@ -573,8 +573,6 @@ namespace Game.AI
|
||||
{
|
||||
if (IsRangedAttacker())
|
||||
DoRangedAttackIfReady();
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public void CancelAllShapeshifts()
|
||||
|
||||
@@ -45,10 +45,7 @@ namespace Game.AI
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
//Check if we have a current target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
//Start movement toward victim
|
||||
@@ -655,8 +652,6 @@ namespace Game.AI
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
});
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public void _DespawnAtEvade()
|
||||
@@ -766,8 +761,6 @@ namespace Game.AI
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
});
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
// Hook used to execute events scheduled into EventMap without the need
|
||||
|
||||
@@ -261,10 +261,7 @@ namespace Game.AI
|
||||
|
||||
public virtual void UpdateEscortAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
public override void MovementInform(MovementGeneratorType moveType, uint Id)
|
||||
|
||||
@@ -158,10 +158,7 @@ namespace Game.AI
|
||||
|
||||
void UpdateFollowerAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
public void StartFollow(Player player, uint factionForFollower = 0, Quest quest = null)
|
||||
|
||||
@@ -310,21 +310,13 @@ namespace Game.AI
|
||||
|
||||
CheckConditions(diff);
|
||||
|
||||
bool hasVictim = UpdateVictim();
|
||||
UpdateVictim();
|
||||
|
||||
GetScript().OnUpdate(diff);
|
||||
|
||||
UpdatePath(diff);
|
||||
UpdateFollow(diff);
|
||||
UpdateDespawn(diff);
|
||||
|
||||
if (!IsAIControlled())
|
||||
return;
|
||||
|
||||
if (!hasVictim)
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool IsEscortInvokerInRange()
|
||||
|
||||
@@ -554,6 +554,10 @@ namespace Game.Entities
|
||||
|
||||
AIUpdateTick(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
// creature can be dead after UpdateAI call
|
||||
// CORPSE/DEAD state will processed at next tick (in other case death timer will be updated unexpectedly)
|
||||
if (!IsAlive())
|
||||
break;
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Game.Entities
|
||||
uint m_titanGripPenaltySpellId;
|
||||
uint m_deathTimer;
|
||||
long m_deathExpireTime;
|
||||
byte m_swingErrorMsg;
|
||||
AttackSwingErr? m_swingErrorMsg;
|
||||
DateTime m_regenInterruptTimestamp;
|
||||
uint m_regenTimerCount;
|
||||
uint m_foodEmoteTimerCount;
|
||||
|
||||
@@ -421,69 +421,7 @@ namespace Game.Entities
|
||||
|
||||
m_achievementSys.UpdateTimedCriteria(TimeSpan.FromMilliseconds(diff));
|
||||
|
||||
if (HasUnitState(UnitState.MeleeAttacking) && !HasUnitState(UnitState.Casting | UnitState.Charging))
|
||||
{
|
||||
Unit victim = GetVictim();
|
||||
if (victim != null)
|
||||
{
|
||||
// default combat reach 10
|
||||
// TODO add weapon, skill check
|
||||
|
||||
if (IsAttackReady(WeaponAttackType.BaseAttack))
|
||||
{
|
||||
if (!IsWithinMeleeRange(victim))
|
||||
{
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, 100);
|
||||
if (m_swingErrorMsg != 1) // send single time (client auto repeat)
|
||||
{
|
||||
SendAttackSwingNotInRange();
|
||||
m_swingErrorMsg = 1;
|
||||
}
|
||||
}
|
||||
//120 degrees of radiant range, if player is not in boundary radius
|
||||
else if (!IsWithinBoundaryRadius(victim) && !HasInArc(2 * MathFunctions.PI / 3, victim))
|
||||
{
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, 100);
|
||||
if (m_swingErrorMsg != 2) // send single time (client auto repeat)
|
||||
{
|
||||
SendAttackSwingBadFacingAttack();
|
||||
m_swingErrorMsg = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_swingErrorMsg = 0; // reset swing error state
|
||||
|
||||
// prevent base and off attack in same time, delay attack at 0.2 sec
|
||||
if (HaveOffhandWeapon())
|
||||
if (GetAttackTimer(WeaponAttackType.OffAttack) < SharedConst.AttackDisplayDelay)
|
||||
SetAttackTimer(WeaponAttackType.OffAttack, SharedConst.AttackDisplayDelay);
|
||||
|
||||
// do attack
|
||||
AttackerStateUpdate(victim, WeaponAttackType.BaseAttack);
|
||||
ResetAttackTimer(WeaponAttackType.BaseAttack);
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsInFeralForm() && HaveOffhandWeapon() && IsAttackReady(WeaponAttackType.OffAttack))
|
||||
{
|
||||
if (!IsWithinMeleeRange(victim))
|
||||
SetAttackTimer(WeaponAttackType.OffAttack, 100);
|
||||
else if (!IsWithinBoundaryRadius(victim) && !HasInArc(2 * MathFunctions.PI / 3, victim))
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, 100);
|
||||
else
|
||||
{
|
||||
// prevent base and off attack in same time, delay attack at 0.2 sec
|
||||
if (GetAttackTimer(WeaponAttackType.BaseAttack) < SharedConst.AttackDisplayDelay)
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, SharedConst.AttackDisplayDelay);
|
||||
|
||||
// do attack
|
||||
AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
|
||||
ResetAttackTimer(WeaponAttackType.OffAttack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
if (HasPlayerFlag(PlayerFlags.Resting))
|
||||
_restMgr.Update(diff);
|
||||
@@ -7707,11 +7645,19 @@ namespace Game.Entities
|
||||
|
||||
public bool CanTameExoticPets() { return IsGameMaster() || HasAuraType(AuraType.AllowTamePetType); }
|
||||
|
||||
void SendAttackSwingCantAttack() { SendPacket(new AttackSwingError(AttackSwingErr.CantAttack)); }
|
||||
public void SendAttackSwingCancelAttack() { SendPacket(new CancelCombat()); }
|
||||
void SendAttackSwingDeadTarget() { SendPacket(new AttackSwingError(AttackSwingErr.DeadTarget)); }
|
||||
public void SendAttackSwingNotInRange() { SendPacket(new AttackSwingError(AttackSwingErr.NotInRange)); }
|
||||
void SendAttackSwingBadFacingAttack() { SendPacket(new AttackSwingError(AttackSwingErr.BadFacing)); }
|
||||
public void SendAttackSwingCancelAttack()
|
||||
{
|
||||
SendPacket(new CancelCombat());
|
||||
}
|
||||
|
||||
public void SetAttackSwingError(AttackSwingErr? err)
|
||||
{
|
||||
if (err.HasValue && err.Value != m_swingErrorMsg)
|
||||
SendPacket(new AttackSwingError(err.Value));
|
||||
|
||||
m_swingErrorMsg = err;
|
||||
}
|
||||
|
||||
public void SendAutoRepeatCancel(Unit target)
|
||||
{
|
||||
CancelAutoRepeat cancelAutoRepeat = new();
|
||||
|
||||
@@ -281,14 +281,8 @@ namespace Game.Entities
|
||||
|
||||
Creature creature = ToCreature();
|
||||
// creatures cannot attack while evading
|
||||
if (creature != null)
|
||||
{
|
||||
if (creature.IsInEvadeMode())
|
||||
return false;
|
||||
|
||||
if (creature.CanMelee())
|
||||
meleeAttack = false;
|
||||
}
|
||||
if (creature != null && creature.IsInEvadeMode())
|
||||
return false;
|
||||
|
||||
// nobody can attack GM in GM-mode
|
||||
if (victim.IsTypeId(TypeId.Player))
|
||||
@@ -522,12 +516,15 @@ namespace Game.Entities
|
||||
return m_baseAttackSpeed[(int)att];
|
||||
}
|
||||
|
||||
public void AttackerStateUpdate(Unit victim, WeaponAttackType attType = WeaponAttackType.BaseAttack, bool extra = false)
|
||||
public void DoMeleeAttackIfReady()
|
||||
{
|
||||
if (HasUnitFlag(UnitFlags.Pacified))
|
||||
if (!HasUnitState(UnitState.MeleeAttacking))
|
||||
return;
|
||||
|
||||
if (HasUnitState(UnitState.CannotAutoattack) && !extra)
|
||||
if (HasUnitState(UnitState.Charging))
|
||||
return;
|
||||
|
||||
if (IsCreature() && !ToCreature().CanMelee())
|
||||
return;
|
||||
|
||||
if (HasUnitState(UnitState.Casting))
|
||||
@@ -537,6 +534,70 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
Unit victim = GetVictim();
|
||||
if (victim == null)
|
||||
return;
|
||||
|
||||
AttackSwingErr? getAutoAttackError()
|
||||
{
|
||||
if (!IsWithinMeleeRange(victim))
|
||||
return AttackSwingErr.NotInRange;
|
||||
|
||||
//120 degrees of radiant range, if player is not in boundary radius
|
||||
if (!IsWithinBoundaryRadius(victim) && !HasInArc(2 * MathF.PI / 3, victim))
|
||||
return AttackSwingErr.BadFacing;
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
if (IsAttackReady(WeaponAttackType.BaseAttack))
|
||||
{
|
||||
AttackSwingErr? autoAttackError = getAutoAttackError();
|
||||
if (!autoAttackError.HasValue)
|
||||
{
|
||||
// prevent base and off attack in same time, delay attack at 0.2 sec
|
||||
if (HaveOffhandWeapon())
|
||||
if (GetAttackTimer(WeaponAttackType.OffAttack) < SharedConst.AttackDisplayDelay)
|
||||
SetAttackTimer(WeaponAttackType.OffAttack, SharedConst.AttackDisplayDelay);
|
||||
|
||||
// do attack
|
||||
AttackerStateUpdate(victim, WeaponAttackType.BaseAttack);
|
||||
ResetAttackTimer(WeaponAttackType.BaseAttack);
|
||||
}
|
||||
else
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, 100);
|
||||
|
||||
Player attackerPlayer = ToPlayer();
|
||||
if (attackerPlayer != null)
|
||||
attackerPlayer.SetAttackSwingError(autoAttackError);
|
||||
}
|
||||
|
||||
if (!IsInFeralForm() && HaveOffhandWeapon() && IsAttackReady(WeaponAttackType.OffAttack))
|
||||
{
|
||||
AttackSwingErr? autoAttackError = getAutoAttackError();
|
||||
if (!autoAttackError.HasValue)
|
||||
{
|
||||
// prevent base and off attack in same time, delay attack at 0.2 sec
|
||||
if (GetAttackTimer(WeaponAttackType.BaseAttack) < SharedConst.AttackDisplayDelay)
|
||||
SetAttackTimer(WeaponAttackType.BaseAttack, SharedConst.AttackDisplayDelay);
|
||||
|
||||
// do attack
|
||||
AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
|
||||
ResetAttackTimer(WeaponAttackType.OffAttack);
|
||||
}
|
||||
else
|
||||
SetAttackTimer(WeaponAttackType.OffAttack, 100);
|
||||
}
|
||||
}
|
||||
|
||||
public void AttackerStateUpdate(Unit victim, WeaponAttackType attType = WeaponAttackType.BaseAttack, bool extra = false)
|
||||
{
|
||||
if (HasUnitFlag(UnitFlags.Pacified))
|
||||
return;
|
||||
|
||||
if (HasUnitState(UnitState.CannotAutoattack) && !extra)
|
||||
return;
|
||||
|
||||
if (HasAuraType(AuraType.DisableAttackingExceptAbilities))
|
||||
return;
|
||||
|
||||
|
||||
@@ -1236,7 +1236,6 @@ namespace Game.Entities
|
||||
case UnitState.Confused:
|
||||
if (!HasUnitState(UnitState.Stunned))
|
||||
{
|
||||
ClearUnitState(UnitState.MeleeAttacking);
|
||||
SendMeleeAttackStop();
|
||||
// SendAutoRepeatCancel ?
|
||||
SetConfused(true);
|
||||
@@ -1245,7 +1244,6 @@ namespace Game.Entities
|
||||
case UnitState.Fleeing:
|
||||
if (!HasUnitState(UnitState.Stunned | UnitState.Confused))
|
||||
{
|
||||
ClearUnitState(UnitState.MeleeAttacking);
|
||||
SendMeleeAttackStop();
|
||||
// SendAutoRepeatCancel ?
|
||||
SetFeared(true);
|
||||
|
||||
@@ -672,7 +672,7 @@ namespace Game.Entities
|
||||
public void RemoveAllDynObjects()
|
||||
{
|
||||
while (!m_dynObj.Empty())
|
||||
m_dynObj.First().Remove();
|
||||
m_dynObj.Last().Remove();
|
||||
}
|
||||
|
||||
public GameObject GetGameObject(uint spellId)
|
||||
|
||||
@@ -408,9 +408,7 @@ namespace Scripts.Argus.AntorusTheBurningThrone.Argus
|
||||
});
|
||||
|
||||
|
||||
if (me.GetVictim() != null && me.GetVictim().IsWithinMeleeRange(me))
|
||||
DoMeleeAttackIfReady();
|
||||
else
|
||||
if (me.GetVictim() == null && !me.GetVictim().IsWithinMeleeRange(me))
|
||||
DoSpellAttackIfReady(SpellIds.Carnage);
|
||||
}
|
||||
|
||||
|
||||
@@ -538,8 +538,6 @@ namespace Scripts.BrokenIsles.ZoneMardum
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Scripts.DragonIsles.AzureVault.Leymor
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Scripts.DragonIsles.AzureVault.Leymor
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,10 +131,7 @@ namespace Scripts.EasternKingdoms.AlteracValley
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -141,8 +141,7 @@ namespace Scripts.EasternKingdoms.AlteracValley.Balinda
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -91,8 +91,7 @@ namespace Scripts.EasternKingdoms.AlteracValley.Drekthar
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -92,8 +92,7 @@ namespace Scripts.EasternKingdoms.AlteracValley.Galvangar
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,8 +75,7 @@ namespace Scripts.EasternKingdoms.AlteracValley.Vanndar
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -248,8 +248,6 @@ namespace Scripts.EasternKingdoms.BaradinHold.Alizabal
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,8 +125,6 @@ namespace Scripts.EasternKingdoms.BaradinHold.Occuthar
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Scripts.EasternKingdoms.BaradinHold.PitLordArgaloth
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.AscendantLo
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.Beauty
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.Corla
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -64,8 +64,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.KarshSteelb
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -102,7 +102,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockCaverns.RomoggBonec
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.AmbassadorFl
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.CorenDirebre
|
||||
if (!UpdateVictim() && phase != DirebrewPhases.Intro)
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.CorenDirebre
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,5 +513,4 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.CorenDirebre
|
||||
OnEffectApply.Add(new EffectApplyHandler(OnApply, 1, AuraType.PeriodicDummy, AuraEffectHandleModes.Real));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -79,7 +79,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.Draganthauri
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.GeneralAnger
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.HighInterrog
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.Magmus
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.TombOfSeven
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
public override bool OnGossipSelect(Player player, uint menuId, uint gossipListId)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Drakkisath
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.GizrulTheSlav
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Gyth
|
||||
SummonedRend = true;
|
||||
}
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Halycon
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.HighlordOmokk
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,9 +94,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire
|
||||
frenzy15 = true;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.MotherSmolder
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -98,8 +98,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.OverlordWyrmt
|
||||
}
|
||||
}
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-3
@@ -214,8 +214,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.PyroguardEmbe
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +259,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.PyroguardEmbe
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Quartermaster
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +502,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.RendBlackhand
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
});
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.ShadowHunterV
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Thebeast
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.UrokDoomhowl
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.WarmasterVoon
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Broodlord
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,8 +156,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair
|
||||
Breath2_Spell = SpellIds.Igniteflesh;
|
||||
break;
|
||||
}
|
||||
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
@@ -243,8 +241,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair
|
||||
DoCast(me, SpellIds.Enrage);
|
||||
Enraged = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Ebonroc
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Firemaw
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Flamegor
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -570,9 +570,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.VictorNefarius
|
||||
Phase3 = true;
|
||||
Talk(TextIds.SayRaiseSkeletons);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -123,7 +123,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Razorgore
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,8 +164,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackwingLair.Vaelastrasz
|
||||
Talk(TextIds.SayHalflife);
|
||||
HasYelled = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override bool OnGossipSelect(Player player, uint menuId, uint gossipListId)
|
||||
|
||||
@@ -72,8 +72,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.BaronGeddon
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Garr
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Garr
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Gehennas
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Golemagg
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Golemagg
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Lucifron
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Magmadar
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,8 +103,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Majordomo
|
||||
|
||||
if (HealthBelowPct(50))
|
||||
DoCast(me, SpellIds.AegisOfRagnaros, new CastSpellExtraArgs(true));
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -294,9 +294,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,14 +312,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore
|
||||
{
|
||||
instance.SetData(MCMiscConst.DataRagnarosAdds, 1);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,9 +96,6 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Shazzrah
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
});
|
||||
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Sulfuron
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.MoltenCore.Sulfuron
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,8 +175,6 @@ namespace Scripts.EasternKingdoms.Deadmines
|
||||
}
|
||||
else uiTimer -= uiDiff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override void MovementInform(MovementGeneratorType uiType, uint uiId)
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
bool _infused;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Scripts.EasternKingdoms.Karazhan.MaidenOfVirtue
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight
|
||||
if (!UpdateVictim() && _phase != Phases.None)
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
public override void SpellHit(WorldObject caster, SpellInfo spellInfo)
|
||||
@@ -346,7 +346,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight
|
||||
if (!UpdateVictim() || _phase == Phases.Mounted)
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,6 +137,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(30), MiscConst.GroupNonEnrage, task =>
|
||||
{
|
||||
DoCast(me, SpellIds.Vanish);
|
||||
me.SetCanMelee(false);
|
||||
InVanish = true;
|
||||
|
||||
task.Schedule(TimeSpan.FromSeconds(5), garroteTask =>
|
||||
@@ -148,6 +149,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
target.CastSpell(target, SpellIds.Garrote, true);
|
||||
|
||||
InVanish = false;
|
||||
me.SetCanMelee(true);
|
||||
});
|
||||
|
||||
task.Repeat();
|
||||
@@ -263,11 +265,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
_scheduler.CancelGroup(MiscConst.GroupNonEnrage);
|
||||
}
|
||||
|
||||
_scheduler.Update(diff, () =>
|
||||
{
|
||||
if (!InVanish)
|
||||
DoMeleeAttackIfReady();
|
||||
});
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,8 +316,6 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
{
|
||||
if (instance.GetBossState(DataTypes.Moroes) != EncounterState.InProgress)
|
||||
EnterEvadeMode();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -337,8 +337,6 @@ namespace Scripts.EasternKingdoms.Karazhan.Netherspite
|
||||
}
|
||||
else PhaseTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,7 +318,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Nightbane
|
||||
if (!UpdateVictim() && phase != NightbanePhases.Intro)
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,8 +284,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
SummonTito();
|
||||
else SummonTitoTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void SummonTito()
|
||||
@@ -350,8 +348,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
YipTimer = 10000;
|
||||
}
|
||||
else YipTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,8 +452,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
BrainWipeTimer = 20000;
|
||||
}
|
||||
else BrainWipeTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,8 +557,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
}
|
||||
else RustTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,8 +663,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
ScreamTimer = RandomHelper.URand(20000, 30000);
|
||||
}
|
||||
else ScreamTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,8 +739,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
ChainLightningTimer = 15000;
|
||||
}
|
||||
else ChainLightningTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -880,8 +868,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
if (ChaseTimer <= diff)
|
||||
{
|
||||
if (!IsChasing)
|
||||
@@ -1235,8 +1221,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
EternalAffectionTimer = RandomHelper.URand(45000, 60000);
|
||||
}
|
||||
else EternalAffectionTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1432,8 +1416,6 @@ namespace Scripts.EasternKingdoms.Karazhan.EsOpera
|
||||
PoisonThrustTimer = RandomHelper.URand(10000, 20000);
|
||||
}
|
||||
else PoisonThrustTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -513,8 +513,6 @@ namespace Scripts.EasternKingdoms.Karazhan.PrinceMalchezaar
|
||||
|
||||
if (phase == 2)
|
||||
DoMeleeAttacksIfReady();
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void DoMeleeAttacksIfReady()
|
||||
|
||||
@@ -138,6 +138,7 @@ namespace Scripts.EasternKingdoms.Karazhan.ShadeOfAran
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
me.SetCanMelee(true);
|
||||
|
||||
// Not in progress
|
||||
instance.SetBossState(DataTypes.Aran, EncounterState.NotStarted);
|
||||
@@ -462,8 +463,7 @@ namespace Scripts.EasternKingdoms.Karazhan.ShadeOfAran
|
||||
else FlameWreathCheckTime -= diff;
|
||||
}
|
||||
|
||||
if (ArcaneCooldown != 0 && FireCooldown != 0 && FrostCooldown != 0)
|
||||
DoMeleeAttackIfReady();
|
||||
me.SetCanMelee(ArcaneCooldown != 0 && FireCooldown != 0 && FrostCooldown != 0);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit pAttacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Scripts.EasternKingdoms.Karazhan.TerestianIllhoof
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,10 +153,7 @@ namespace Scripts.EasternKingdoms.Karazhan.TerestianIllhoof
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () =>
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
});
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +236,7 @@ namespace Scripts.EasternKingdoms.Karazhan.TerestianIllhoof
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.FelbloodKaelthas
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,6 +497,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
AddThreat(unit, 1000.0f);
|
||||
|
||||
InVanish = true;
|
||||
me.SetCanMelee(false);
|
||||
task.Repeat(TimeSpan.FromSeconds(30));
|
||||
task.Schedule(TimeSpan.FromSeconds(10), waitTask =>
|
||||
{
|
||||
@@ -505,6 +506,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
DoCastVictim(SpellIds.Backstab, new CastSpellExtraArgs(true));
|
||||
DoCastVictim(SpellIds.KidneyShot, new CastSpellExtraArgs(true));
|
||||
me.SetVisible(true); // ...? Hacklike
|
||||
me.SetCanMelee(true);
|
||||
InVanish = false;
|
||||
}
|
||||
waitTask.Repeat();
|
||||
@@ -523,6 +525,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
{
|
||||
Initialize();
|
||||
me.SetVisible(true);
|
||||
me.SetCanMelee(true);
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
@@ -535,9 +538,6 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
base.UpdateAI(diff);
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (!InVanish)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -740,7 +740,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
HasIceBlocked = true;
|
||||
}
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,7 +908,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (me.IsWithinDistInMap(me.GetVictim(), SharedConst.AttackDistance))
|
||||
_meleeScheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_meleeScheduler.Update(diff);
|
||||
else
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
@@ -973,7 +973,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.PriestessDelrissa
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,8 +231,6 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.SelinFireheart
|
||||
_events.ScheduleEvent(EventIds.DrainCrystal, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(25), 0, PhaseIds.Normal);
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,5 +250,4 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.SelinFireheart
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace Scripts.EasternKingdoms.MagistersTerrace.Vexallus
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace Scripts.Events.LunarFestival
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace Scripts.Events.ZalazaneFall
|
||||
if (_tigerGuid.IsEmpty())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,8 +97,6 @@ namespace Scripts.Pets.Hunter
|
||||
else
|
||||
_spellTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,6 @@ namespace Scripts.Pets.Shaman
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +72,7 @@ namespace Scripts.Pets.Shaman
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,8 +134,6 @@ namespace Scripts.World.Achievements
|
||||
Unit target = SelectTarget(SelectTargetMethod.MaxThreat, 0, -50.0f, true);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.SummonPlayer);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,12 +107,9 @@ namespace Scripts.World.NpcGuard
|
||||
{
|
||||
me.ResetAttackTimer();
|
||||
DoCastVictim(spellInfo.Id);
|
||||
meleeContext.Repeat();
|
||||
return;
|
||||
}
|
||||
}
|
||||
me.AttackerStateUpdate(victim);
|
||||
me.ResetAttackTimer();
|
||||
meleeContext.Repeat();
|
||||
}).Schedule(TimeSpan.FromSeconds(5), spellContext =>
|
||||
{
|
||||
@@ -183,7 +180,7 @@ namespace Scripts.World.NpcGuard
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
void ScheduleVanish()
|
||||
|
||||
@@ -207,8 +207,7 @@ namespace Scripts.World.NpcsSpecial
|
||||
ResetFlagTimer -= diff;
|
||||
}
|
||||
|
||||
if (UpdateVictim())
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
public override void ReceiveEmote(Player player, TextEmotes emote)
|
||||
|
||||
Reference in New Issue
Block a user