Exemplo n.º 1
0
 public static void Target(object targeted)
 {
     if (targeted == null)
     {
         return;
     }
     if (TargetManager.IsActive)
     {
         BaseTargetHandler active = TargetManager.Active;
         if (active is ServerTargetHandler && !TargetManager.TargetIsInRange(targeted) || !active.Target(targeted))
         {
             return;
         }
         if (active is ServerTargetHandler)
         {
             TargetManager.queuedTarget = (object)null;
         }
         Mobile mobile = targeted as Mobile;
         if (mobile != null && mobile.Player)
         {
             return;
         }
         TargetManager.lastTarget = targeted;
         if (mobile == null)
         {
             return;
         }
         if (active is AcquireTargetHandler && (mobile.IsFriend || mobile.IsInParty))
         {
             TargetManager.lastDefensive = mobile;
         }
         else if (active.IsOffensive)
         {
             TargetManager.lastOffensive = mobile;
         }
         else
         {
             if (!active.IsDefensive)
             {
                 return;
             }
             TargetManager.lastDefensive = mobile;
         }
     }
     else
     {
         if (!Options.Current.QueueTargets)
         {
             return;
         }
         TargetManager.Queue(targeted);
     }
 }
Exemplo n.º 2
0
 public static bool TargetIsInRange()
 {
     return(TargetManager.TargetIsInRange(TargetManager.LastTarget));
 }