Example #1
0
        /// <summary>
        ///     Cast the spell and returns whether the cast was
        ///     successful or not.
        /// </summary>
        /// <param name="ability"></param>
        /// <returns></returns>
        public bool CastSpell(Ability ability)
        {
            // Try to cast the spell and return false if
            // we've failed to start casting or the 
            // casting was interrupted. 
            if (EnsureCast(ability.Command))
            {
                return MonitorCast();
            }

            return false;
        }
Example #2
0
        public void UseBuffingAction(Ability action)
        {
            if (action == null) throw new ArgumentNullException(nameof(action));

            var baction = new BattleAbility
            {
                Name = action.English,
                IsEnabled = true,
                Ability = action
            };

            UseBuffingActions(new List<BattleAbility> { baction });
        }
Example #3
0
        /// <summary>
        /// Execute a single buffing type action.
        /// </summary>
        /// <param name="action"></param>
        public void UseBuffingAction(Ability action)
        {
            if (action == null) throw new ArgumentNullException(nameof(action));

            // Create new new ability and set its basic required information.
            var baction = new BattleAbility
            {
                Name = action.English,
                IsEnabled = true,
                Ability = action
            };

            // Convert ability to new battle ability object.
            UseBuffingActions(new List<BattleAbility> { baction });
        }
Example #4
0
        /// <summary>
        ///     Checks whether a spell or ability can be recasted.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="ability"></param>
        /// <returns></returns>
        public static bool IsRecastable(IMemoryAPI fface, Ability ability)
        {
            var recast = 0;

            // No recast time on weaponskills. 
            if (ability.AbilityType == AbilityType.Weaponskill) return true;

            // No recast for ranged attacks. 
            if (AbilityType.Range.HasFlag(ability.AbilityType)) return true;

            // If a spell get spell recast
            if (ResourceHelper.IsSpell(ability.AbilityType))
            {
                recast = fface.Timer.GetSpellRecast(ability.Index);
            }

            // if ability get ability recast. 
            if (ResourceHelper.IsAbility(ability.AbilityType))
            {
                recast = fface.Timer.GetAbilityRecast(ability.Id);
            }

            return recast <= 0;
        }
Example #5
0
 /// <summary>
 ///     Create a storing a reference to the given ability.
 /// </summary>
 /// <param name="ability"></param>
 public BattleAbility(Ability ability)
 {
     Ability = ability;
     Name = ability.English;
 }
Example #6
0
 private bool CastSpell(Ability ability)
 {
     if (EnsureCast(ability.Command)) return MonitorCast();
     return false;
 }
Example #7
0
 private bool CastAbility(Ability ability)
 {
     _fface.Windower.SendString(ability.Command);
     Thread.Sleep(100);
     return true;
 }
Example #8
0
 public bool CastAbility(Ability ability)
 {
     // Send the command to the game. 
     _fface.Windower.SendString(ability.Command);
     Thread.Sleep(100);
     return true;
 }
 private void CompleteSelectionButton_Click(object sender, RoutedEventArgs e)
 {
     SelectedAbility = AbilityListBox.SelectedValue as Ability;
     Close();
 }