示例#1
0
        /// <summary>
        ///     Sets the characters target to the specified unit
        ///     <para>SetTargetTo will only work if we arent moving (Backup, ForceBackup, FixFacing)</para>
        ///     Only working once each Fight() pulse
        /// </summary>
        /// <param name="parUnit">The unit.</param>
        /// <param name="parStopCastingOnChange">(Optional) if true the current cast will be aborted on succcessful target change</param>
        /// <returns>
        ///     Returns <c>true</c> if the target got changed successfully
        /// </returns>
        /// <seealso cref="CustomClass.Fight" />
        public bool SetTargetTo(_Unit parUnit, bool parStopCastingOnChange = false)
        {
            try
            {
                if (parUnit.Ptr == null)
                {
                    return(false);
                }

                if (!Grinder.Access.Info.Combat.IsMoving &&
                    CanChangeTarget && (CCManager._Target.IsNull || CCManager._Target.Guid != parUnit.Guid))
                {
                    ObjectManager.Player.SetTarget(parUnit.Ptr);
                    ObjectManager.Player.Face(parUnit.Ptr);
                    CCManager.UpdateTarget(parUnit.Ptr);
                    CanChangeTarget = false;
                    if (parStopCastingOnChange)
                    {
                        StopCasting();
                    }
                    return(true);
                }
            }
            catch
            {
            }
            return(false);
        }
示例#2
0
 private static bool PrepareFightPulse(WoWUnit parTarget)
 {
     try
     {
         _Attackers.Clear();
         var units = Grinder.Access.Info.Combat.Attackers;
         foreach (WoWUnit t in units)
         {
             var tmp = new obj._Unit {
                 Ptr = t
             };
             _Attackers.Add(tmp);
         }
         CurrentCC.Target.Update(parTarget);
         CurrentCC.Player.CanChangeTarget = true;
         return(true);
     }
     catch
     {
         return(false);
     }
 }
示例#3
0
 /// <summary>
 ///     Casts the specified spell at the units position (fe: Blizzard)
 /// </summary>
 /// <param name="parSpell">The spell</param>
 /// <param name="parUnit">The unit</param>
 /// <returns>
 ///     Currently not working and always returning false (will be changed)
 /// </returns>
 public bool CastAoe(string parSpell, _Unit parUnit)
 {
     return(ObjectManager.Player.Spells.CastAoe(parSpell, parUnit.Ptr));
 }