Exemplo n.º 1
0
        public async Task Pull()
        {
            inBlock = false;

            //Log.Info("Rest Called===============");
            if (profile.attackTarget)
            {
                //PULL
                Actor target = null;
                try
                {
                    target = GameManager.LocalPlayer.CurrentTarget;

                    if (target == null)
                    {
                        target = CombatUtils.ClosestEnemy(true);
                    }

                    if (CombatUtils.ValidateTarget(target))
                    {
                    }
                    else
                    {
                        return;
                    }

                    CombatUtils.TurnToActor(target);

                    Log.Info("Init Combat to " + target.Name + " Dis:" + (target.Distance / 50));

                    if ((target.Distance / 50) < profile.gapCloseRange)
                    {
                        Log.Info("Try to PULL Close for range " + (target.Distance / 50));
                        foreach (SkillInfo skill in profile.skillList.Where(i => i.type.Equals(SkillType.PULL)).ToList())
                        {
                            if (await CombatUtils.ValidateConditions(skill, target, inBlock))
                            {
                                _nextSkill = skill;
                                await FireNextSkill();

                                return;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    //Log.Error("NO TARGET FOUND (pull)= " + ex.Message);
                }
            }
        }