Ejemplo n.º 1
0
        public override void DoMacro()
        {
            if (IsCurrentValid() && DoAttack())
            {
                return;
            }

            ClearEnemyList();

            var vision = Vision.ToList();

            foreach (var enemy in vision)
            {
                if (enemy.Index < 1000)
                {
                    continue;
                }

                double distance = W2Helper.GetDistance(enemy.Position, Player.Position);
                if (distance > Player.Range)
                {
                    continue;
                }

                AddEnemyList(enemy.Index, (ushort)distance);
            }

            if (SelectEnemy())
            {
                DoAttack();
            }
        }
Ejemplo n.º 2
0
        public bool IsCurrentValid()
        {
            var mobs = Vision.Where(x => x.Index == CurrentEnemy);

            if (mobs.Count() <= 0)
            {
                return(false);
            }

            var mob = mobs.First();

            if (W2Helper.GetDistance(mob.Position, Player.Position) > Player.Range)
            {
                return(false);
            }

            if (mob.Score.CurrHp <= 0 || mob.Index < 1000)
            {
                return(false);
            }

            return(true);
        }