Example #1
0
 public override PullResult Pull(PUnit target)
 {
     //Logging.Debug("Pull started");
     Buff();
     PrePull(target);
     if (Behavior.UseAutoAttack)
     {
         target.InteractWithTarget();
     }
     if (!MoveHelper.MoveToUnit(target, Behavior.PullDistance))
     {
         return(PullResult.CouldNotPull);
     }
     if (Behavior.SendPet)
     {
         PetAttackKey.SendKey();
     }
     foreach (Rule rule in Behavior.PullController.GetRules.Where(rule => rule.IsOk))
     {
         target.Face();
         rule.ExecuteAction(Behavior.GlobalCooldown);
     }
     // Logging.Debug("Pull done");
     if (PPullBlackList.IsBlacklisted(target))
     {
         return(PullResult.CouldNotPull);
     }
     return(PullResult.Success);
 }
Example #2
0
        /*
         * ConsiderAvoidAdds - Avoid Adds
         */

        internal void ConsiderAvoidAdds(PUnit target)
        {
            bool         petattacking = false;
            List <PUnit> closeUnits   = ObjectManager.CheckForMobsAtLoc(target.Location,
                                                                        PveBehaviorSettings.SkipAddsDis + 5, false);

            if (closeUnits.Count == 0)
            {
                return;
            }
            PUnit closestAdd = GetClosestBesides(closeUnits, target);

            if (closestAdd == null)
            {
                return;
            }
            if (closestAdd.GUID == target.GUID)
            {
                return;
            }
            // Somebody is close enough to maybe jump in.  If the monster is in front of us and close
            // enough, might be time to back it up.
            if (closestAdd.DistanceToSelf < Avoidaddsdistance)
            {
                Logging.Write("Possible add: " + closestAdd.Name + ": " + closestAdd.DistanceToSelf);
                _addBackup.Reset();
                var futility = new Ticker(3000);
                closestAdd.Face();
                MoveHelper.Backwards(true);
                if (ObjectManager.MyPlayer.HasLivePet)
                {
                    petattacking = ObjectManager.MyPlayer.Pet.Target.IsValid;
                    PetFollow.SendKey();
                }

                while (!futility.IsReady)
                {
                    Thread.Sleep(10);
                    closestAdd.Face();
                    if (closestAdd.DistanceToSelf > Avoidaddsdistance + 6.0) // Slack space.
                    {
                        break;
                    }
                }
                MoveHelper.Backwards(false);
                if (ObjectManager.MyPlayer.HasLivePet && petattacking)
                {
                    PetAttackKey.SendKey();
                }
                _addBackup.Reset();
            }
        }
Example #3
0
 public void SendItem()
 {
     _wrap.SendKey();
 }