Exemple #1
0
 public bool CastAbility(Ability ability)
 {
     // Send the command to the game.
     _fface.Windower.SendString(ability.ToString());
     Thread.Sleep(100);
     return true;
 }
Exemple #2
0
 public void TestToString()
 {
     var test = new Ability
     {
         Prefix = "/magic",
         English = "Cure",
         Targets = "Self"
     };
     var cure = new AbilityService("resources").CreateAbility("Cure");
     Assert.Equals(test.ToString(), cure.ToString());
 }
Exemple #3
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)
        {
            // Call for player to stop.
            while (_player.IsMoving)
            {
                _fface.Navigator.Reset();
                Thread.Sleep(100);
            }

            // Try to cast the spell and return false if
            // we've failed to start casting or the
            // casting was interrupted.
            if (EnsureCast(ability.ToString()))
            {
                return MonitorCast();
            }

            return false;
        }