示例#1
0
        public bool Fight(int id, Combat.Mode mode)
        {
            bool result = false;

            // If we're in Ambuscade, let people know it's time to fight.
            if (_Leader && fface.Player.Zone == Zone.Maquette_Abdhaljs_Legion)
            {
                client.Send("RELAY TASK 3 " + id);
            }

            Combat.FailType fail = Combat.FailType.NoFail;
            result = Combat.Fight(id, ambuscadeTargetMonster, mode, out fail);

            if (result == false)
            {
                Combat.AddBlacklist(id);
            }
            return(result);
        }
示例#2
0
        public override bool Position(int id, Monster monster, Combat.Mode mode)
        {
            if (DistanceTo(id) > monster.HitBox && CanStillAttack(id))
            {
                if (mode == Combat.Mode.Meshing && !Combat.IsPositionSafe(_fface.NPC.PosX(id), _fface.NPC.PosZ(id)))
                {
                    return(false);
                }

                _fface.Navigator.Reset();
                _fface.Navigator.DistanceTolerance = monster.HitBox * 0.95;
                _fface.Navigator.Goto(_fface.NPC.PosX(id), _fface.NPC.PosZ(id), false);
            }

            bool wasLocked = true;

            if (_fface.Player.Zone != Zone.Cape_Teriggan)
            {
                var difference = GetSADifference(id);
                while ((difference < 66 || difference > 89) && _fface.NPC.HPPCurrent(id) > 0)
                {
                    if (!_fface.Target.IsLocked)
                    {
                        wasLocked = false;
                        _fface.Windower.SendString("/lockon");
                    }
                    _fface.Windower.SendKey(KeyCode.NP_Number6, true);
                    Thread.Sleep(80);
                    _fface.Windower.SendKey(KeyCode.NP_Number6, false);
                    difference = GetSADifference(id);
                }
                if (!wasLocked && _fface.Target.IsLocked)
                {
                    _fface.Windower.SendString("/lockon");
                }
            }
            return(true);
        }
示例#3
0
文件: Jobs.cs 项目: xathei/flipper
        /// <summary>
        /// Called continually during battle to ensure characters are in the correct position.
        /// </summary>
        public virtual bool Position(int id, Monster monster, Combat.Mode mode)
        {
            // move closer to the mob
            if (DistanceTo(id) > monster.HitBox && CanStillAttack(id))
            {
                if (mode == Combat.Mode.Meshing && !Combat.IsPositionSafe(_fface.NPC.PosX(id), _fface.NPC.PosZ(id)))
                {
                    return(false);
                }

                _fface.Navigator.Reset();
                _fface.Navigator.DistanceTolerance = (double)(monster.HitBox * 0.95);
                _fface.Navigator.Goto(_fface.NPC.PosX(id), _fface.NPC.PosZ(id), false);
            }

            // move back from the target
            if (DistanceTo(id) < (monster.HitBox * 0.65) && CanStillAttack(id) && _fface.Player.Status == Status.Fighting)
            {
                _fface.Windower.SendKey(KeyCode.NP_Number2, true);
                Thread.Sleep(50);
                _fface.Windower.SendKey(KeyCode.NP_Number2, false);
            }
            return(true);
        }
示例#4
0
文件: Ranger.cs 项目: xathei/flipper
        public override bool Position(int id, Monster monster, Combat.Mode mode)
        {
            //if (_content == Content.Ambuscade)
            //{
            //double aim = 0;

            //try
            //{
            //    aim = Convert.ToDouble(Program.mainform.rngAimForDistance.Text);
            //}
            //catch (Exception e)
            //{
            //    aim = 5.9;
            //}

            //var min = aim*0.95;
            //var max = aim*1.05;


            //    int fail = 100;
            //    while (_fface.NPC.Distance(id) < min && fail > 0)
            //    {
            //        if (!_fface.Target.IsLocked)
            //        {
            //            _fface.Windower.SendString("/lockon");
            //            Thread.Sleep(500);
            //        }
            //        fail--;
            //        _fface.Windower.SendKey(KeyCode.NP_Number2, true);
            //        Thread.Sleep(50);
            //        _fface.Windower.SendKey(KeyCode.NP_Number2, false);
            //    }
            //    fail = 1000;
            //    while (_fface.NPC.Distance(id) > max && fail > 0)
            //    {
            //        if (!_fface.Target.IsLocked)
            //        {
            //            _fface.Windower.SendString("/lockon");
            //            Thread.Sleep(500);
            //        }
            //        fail--;
            //        _fface.Windower.SendKey(KeyCode.NP_Number8, true);
            //        Thread.Sleep(50);
            //        _fface.Windower.SendKey(KeyCode.NP_Number8, false);
            //    }
            //    if (_fface.Target.IsLocked)
            //    {
            //        _fface.Windower.SendString("/lockon");
            //        Thread.Sleep(500);
            //    }

            //    bool wasLocked = true;
            //    var difference = GetSADifference(id);
            //    while (difference < 66 || difference > 89 && DistanceTo(id) <= 7)
            //    {
            //        if (!_fface.Target.IsLocked)
            //        {
            //            wasLocked = false;
            //            _fface.Windower.SendString("/lockon");
            //        }
            //        _fface.Windower.SendKey(KeyCode.NP_Number6, true);
            //        Thread.Sleep(80);
            //        _fface.Windower.SendKey(KeyCode.NP_Number6, false);
            //        difference = GetSADifference(id);
            //    }
            //    if (!wasLocked && _fface.Target.IsLocked)
            //    {
            //        _fface.Windower.SendString("/lockon");
            //    }
            //}
            //else
            //{
            //    if (DistanceTo(id) > monster.HitBox && CanStillAttack(id))
            //    {
            //        if (mode == Combat.Mode.Meshing && !Combat.IsPositionSafe(_fface.NPC.PosX(id), _fface.NPC.PosZ(id)))
            //            return false;

            //        _fface.Navigator.Reset();
            //        _fface.Navigator.DistanceTolerance = (double)(monster.HitBox * 0.95);
            //        _fface.Navigator.Goto(_fface.NPC.PosX(id), _fface.NPC.PosZ(id), false);
            //    }

            //    // move back from the target
            //    if (DistanceTo(id) < (monster.HitBox * 0.65) && CanStillAttack(id))
            //    {
            //        _fface.Windower.SendKey(KeyCode.NP_Number2, true);
            //        Thread.Sleep(50);
            //        _fface.Windower.SendKey(KeyCode.NP_Number2, false);

            //    }
            //}
            return(true);
        }