示例#1
0
        public override void Pull(WoWUnit target)
        {
            if (!target.CanBeKilled() || Player.IsCasting())
            {
                return;
            }

            if (Player.IsInCombat && SpellBook.IsSpellReady(SpellNames.EarthShock) && target.InRange(20))
            {
                SpellBook.Cast(SpellNames.EarthShock);
                return;
            }

            if (!Player.IsInCombat && Player.ManaPercent > 60 && SpellBook.IsSpellReady(SpellNames.LightningBolt) && target.InRange(28))
            {
                SpellBook.Cast(SpellNames.LightningBolt);
                return;
            }

            _combatPosition = Enums.CombatPosition.Before;
            SpellBook.Attack();
        }
示例#2
0
        public override void Fight(IEnumerable <WoWUnit> possibleTargets)
        {
            if (possibleTargets == null)
            {
                return;
            }

            var target = possibleTargets.FirstOrDefault();

            if (!target.CanBeKilled() || Player.IsCasting())
            {
                return;
            }

            if (!target.Equals(Target))
            {
                Player.SetTarget(target);
            }

            //if (target.InRange(15))
            //{
            //    SuppressBotMovement = true;
            //}

            if (Player.HealthPercent <= 10)
            {
                var potion = Bag
                             .GetPotionsSortedByPriority()
                             .Where(item => item.Info.RequiredLevel < Player.Level)
                             .FirstOrDefault();

                if (potion?.CanUse() == true)
                {
                    potion.Use();
                    return;
                }
            }

            if (Player.HealthPercent < 50 && SpellBook.IsSpellReady(SpellNames.HealingWave))
            {
                SpellBook.Cast(SpellNames.HealingWave);
                return;
            }

            if (World.GetAttackers().Count() >= 1)
            {
                if (HasTotem(ItemNames.Totems.EarthTotem) && Player.CanCastSpell(SpellNames.StoneclawTotem))
                {
                    SpellBook.Cast(SpellNames.StoneclawTotem);
                    return;
                }

                if (HasTotem(ItemNames.Totems.EarthTotem) && IsTotemSpawned(SpellNames.StoneskinTotem) && Player.CanCastSpell(SpellNames.StoneskinTotem))
                {
                    SpellBook.Cast(SpellNames.StoneskinTotem);
                    return;
                }

                if (HasTotem(ItemNames.Totems.WaterTotem) && IsTotemSpawned(SpellNames.HealingStreamTotem) && Player.CanCastSpell(SpellNames.HealingStreamTotem))
                {
                    SpellBook.Cast(SpellNames.HealingStreamTotem);
                    return;
                }
            }

            if (target.CanBeKilled() &&
                target.DistanceToPlayer > 20 &&
                target.DistanceToPlayer < 30 &&
                Player.ManaPercent > 50 &&
                SpellBook.IsSpellReady(SpellNames.LightningBolt))
            {
                SpellBook.Cast(SpellNames.LightningBolt);
                return;
            }

            // if target cast something we prefer to interrupt it
            if (target.CanBeKilled() && target.IsCasting() && Player.CanCastSpell(SpellNames.EarthShock))
            {
                SpellBook.Cast(SpellNames.EarthShock);
                return;
            }

            if (Player.CanCastSpell(SpellNames.Stormstrike))
            {
                SpellBook.Cast(SpellNames.Stormstrike);
                return;
            }

            if (target.CanBeKilled() && target.InRange(20) && Player.ManaPercent > 40)
            {
                if (!target.GotDebuff(SpellNames.FlameShock) && Player.CanCastSpell(SpellNames.FlameShock))
                {
                    SpellBook.Cast(SpellNames.FlameShock);
                    return;
                }

                if (Player.CanCastSpell(SpellNames.FrostShock))
                {
                    SpellBook.Cast(SpellNames.FrostShock);
                    return;
                }

                // or earth
                if (Player.CanCastSpell(SpellNames.EarthShock))
                {
                    SpellBook.Cast(SpellNames.EarthShock);
                    return;
                }
            }

            if (HasTotem(ItemNames.Totems.FireTotem) && Player.CanCastSpell(SpellNames.SearingTotem) && IsTotemSpawned(SpellNames.SearingTotem))
            {
                SpellBook.Cast(SpellNames.SearingTotem);
                return;
            }

            _combatPosition = Enums.CombatPosition.Before;
            SpellBook.Attack();
        }