Exemplo n.º 1
0
        private static bool ValidateCombatObject()
        {
            if (ObjectCacheManager.ShouldUpdateObjectCollection)
            {
                ObjectCacheManager.UpdateCache();
            }

            if (!TargetManager.ShouldKill)
            {
                ResetCombat();
                return(false);
            }

            if (TargetManager.CombatObject == null)
            {
                TargetManager.UpdateCombatTarget();
                if (TargetManager.CombatObject == null)
                {
                    ResetCombat();
                    return(false);
                }
            }

            if (!TargetManager.CombatObject.ValidForCombat)
            {
                GarrisonBase.Debug("EngageObject no longer valid for combat!");
                TargetManager.UpdateCombatTarget();


                //Clear and update lootable object
                TargetManager.LootableObject = null;
                LootBehavior.ResetLoot();
                TargetManager.UpdateLootableTarget();

                ResetCombat();
                return(false);
            }

            if (TargetManager.CombatObject.IsEvadeRunningBack)
            {
                GarrisonBase.Debug("EngageObject is evading!");
                TargetManager.CombatObject.IgnoredTimer = WaitTimer.TenSeconds;
                TargetManager.CombatObject.IgnoredTimer.Reset();
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 internal static void ResetCommonBehaviors()
 {
     ResetVendoring();
     LootBehavior.ResetLoot();
     CombatBehavior.ResetCombat();
 }