Misc Fixes

This commit is contained in:
hondacrx
2017-10-04 12:32:33 -04:00
parent 911e039571
commit e45c13a8dc
8 changed files with 25 additions and 15 deletions
+11 -2
View File
@@ -73,16 +73,25 @@ namespace Game.AI
if (!me.IsWithinMeleeRange(victim))
return;
bool sparAttack = me.GetFactionTemplateEntry().ShouldSparAttack() && victim.GetFactionTemplateEntry().ShouldSparAttack();
//Make sure our attack is ready and we aren't currently casting before checking distance
if (me.isAttackReady())
{
me.AttackerStateUpdate(victim);
if (sparAttack)
me.FakeAttackerStateUpdate(victim);
else
me.AttackerStateUpdate(victim);
me.resetAttackTimer();
}
if (me.haveOffhandWeapon() && me.isAttackReady(WeaponAttackType.OffAttack))
{
me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
if (sparAttack)
me.FakeAttackerStateUpdate(victim, WeaponAttackType.OffAttack);
else
me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack);
me.resetAttackTimer(WeaponAttackType.OffAttack);
}
}
+2 -1
View File
@@ -594,6 +594,7 @@ namespace Game.AI
if (!who)
who = me;
TempSummon whoSummon = who.ToTempSummon();
if (whoSummon)
{
@@ -602,7 +603,7 @@ namespace Game.AI
return;
}
me.DespawnOrUnsummon(0, TimeSpan.FromSeconds(delayToRespawn));
who.DespawnOrUnsummon(0, TimeSpan.FromSeconds(delayToRespawn));
if (instance != null && who == me)
instance.SetBossState(_bossId, EncounterState.Fail);
+1 -6
View File
@@ -1069,12 +1069,7 @@ namespace Game.AI
if (obj.IsTypeId(TypeId.Unit))
{
Creature target = obj.ToCreature();
if (target.IsAlive() && IsSmart(target))
{
((SmartAI)target.GetAI()).SetDespawnTime(e.Action.forceDespawn.delay + 1, e.Action.forceDespawn.respawn); // Next tick
((SmartAI)target.GetAI()).StartDespawn();
}
else
if (target)
target.DespawnOrUnsummon(e.Action.forceDespawn.delay, TimeSpan.FromSeconds(e.Action.forceDespawn.respawn));
}
else if (obj.IsTypeId(TypeId.GameObject))