Esempio n. 1
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    if (this.SpellObject.IsInRange(target))
                    {
                        if (this.SpellObject.GetDamage(target) > target.Health)
                        {
                            this.SpellObject.CastOnUnit(target);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellE.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     The is the spell active method.
        /// </summary>
        /// <param name="spellSlot">
        ///     The spell slot.
        /// </param>
        /// <param name="orbwalkingMode">
        ///     The orbwalking mode.
        /// </param>
        /// <returns>
        ///     <see cref="bool" />
        /// </returns>
        private static bool IsSpellActive(SpellSlot spellSlot, Orbwalking.OrbwalkingMode orbwalkingMode)
        {
            if (Program.Orbwalker.ActiveMode != orbwalkingMode || !spellSlot.IsReady())
            {
                return(false);
            }

            try
            {
                var orbwalkerModeLower = Program.Orbwalker.ActiveMode.ToString().ToLower();
                var spellSlotNameLower = spellSlot.ToString().ToLower();

                if ((orbwalkerModeLower.Equals("lasthit") &&
                     (spellSlotNameLower.Equals("e") || spellSlotNameLower.Equals("w") ||
                      spellSlotNameLower.Equals("r"))) || (orbwalkerModeLower.Equals("laneclear") && (spellSlotNameLower.Equals("r"))))
                {
                    return(false);
                }

                return(MyMenu.RootMenu.Item(orbwalkerModeLower + spellSlotNameLower + "use").GetValue <bool>());
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellManager.cs: Can not get spell active state for slot {0} - {1}", spellSlot.ToString(), e);
                throw;
            }
        }
Esempio n. 3
0
 private void ChampionSpellSmite(float damage, Obj_AI_Base mob)
 {
     try
     {
         foreach (var spell in
                  Spells.Where(
                      x =>
                      x.ChampionName.Equals(this.Player.ChampionName, StringComparison.InvariantCultureIgnoreCase)))
         {
             if (this.Player.GetSpellDamage(mob, spell.Slot, spell.Stage) + damage >= mob.Health && !mob.CharData.BaseSkinName.ToLower().Contains("crab") && this.Player.Spellbook.GetSpell(spell.Slot).State == SpellState.Ready)
             {
                 if (mob.IsValidTarget(this.SmiteSpell.Range))
                 {
                     if (spell.TargetType == SpellDataTargetType.Unit)
                     {
                         this.Player.Spellbook.CastSpell(spell.Slot, mob);
                     }
                     else if (spell.TargetType == SpellDataTargetType.Self)
                     {
                         this.Player.Spellbook.CastSpell(spell.Slot);
                     }
                     else if (spell.TargetType == SpellDataTargetType.Location)
                     {
                         this.Player.Spellbook.CastSpell(spell.Slot, mob.ServerPosition);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         Logging.AddEntry(LoggingEntryType.Error, "@Smite.cs: An error occurred: {0}", e);
         throw;
     }
 }
Esempio n. 4
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    var closeAlly =
                        HeroManager.Allies.Where(a => this.SpellObject.IsInRange(a) && !a.IsMe)
                        .OrderByDescending(h => (h.PhysicalDamageDealtPlayer + h.MagicDamageDealtPlayer))
                        .FirstOrDefault();

                    if (closeAlly != null)
                    {
                        this.SpellObject.CastOnUnit(closeAlly);
                    }

                    if (ObjectManager.Player.CountAlliesInRange(700f) == 0)
                    {
                        this.SpellObject.CastOnUnit(ObjectManager.Player);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellE.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 5
0
        /// <summary>
        ///     The on update callback.
        /// </summary>
        internal override void OnUpdate()
        {
            try
            {
                if (this.SpellObject == null || this.SpellObject.Instance.ToggleState != 2)
                {
                    return;
                }

                var missile =
                    ObjectManager.Get <MissileClient>()
                    .FirstOrDefault(obj => obj.SData.Name == "FlashFrostSpell" && obj.SpellCaster.IsMe);

                if (missile != null)
                {
                    if (
                        HeroManager.Enemies.Any(
                            hero => hero.IsValidTarget() & hero.ServerPosition.Distance(missile.Position) <= this.Width))
                    {
                        this.SpellObject.Cast();
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellQ.cs: Can not run OnUpdate - {0}", e);
                throw;
            }
        }
Esempio n. 6
0
        /// <summary>
        ///     Fired when the game is updated.
        /// </summary>
        /// <param name="args">The <see cref="System.EventArgs" /> instance containing the event data.</param>
        private void OnUpdate(EventArgs args)
        {
            try
            {
                if (this.Player.IsDead || this.Player.HasBuff("ChronoShift") || !this.BarrierSpell.IsReady() || this.Player.InFountain() || this.Player.IsRecalling() || !this.Menu.Item("Barrier.Activated").IsActive())
                {
                    return;
                }

                var enemies     = this.Player.CountEnemiesInRange(750f);
                var totalDamage = IncomingDamageManager.GetDamage(this.Player) * 1.1f;

                if (this.Player.HealthPercent <= this.Menu.Item("barrier.min-health").GetValue <Slider>().Value&&
                    this.BarrierSpell.IsInRange(this.Player) && enemies >= 1)
                {
                    if ((int)(totalDamage / this.Player.Health) > this.Menu.Item("barrier.min-damage").GetValue <Slider>().Value ||
                        this.Player.HealthPercent < this.Menu.Item("barrier.min-health").GetValue <Slider>().Value)
                    {
                        this.Player.Spellbook.CastSpell(this.BarrierSpell.Slot);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@Barrier.cs: An error occurred: {0}", e);
            }
        }
Esempio n. 7
0
        private void OnObjAiBaseProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                if (!this.Menu.Item("wardtracker.Enabled").IsActive())
                {
                    return;
                }

                if (sender.IsAlly)
                {
                    return;
                }

                foreach (var ward in this._wardStructs)
                {
                    if (args.SData.Name.Equals(ward.SpellName, StringComparison.OrdinalIgnoreCase))
                    {
                        var wObj = new WardObject(
                            ward,
                            ObjectManager.Player.GetPath(args.End).LastOrDefault(),
                            (int)Game.Time);
                        this.CheckDuplicateWards(wObj);
                        this._wardObjects.Add(wObj);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@WardTracker.cs: An error occurred: {0}", e);
            }
        }
Esempio n. 8
0
        /// <summary>
        ///     Fired when a spell has been casted
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnObjAiBaseIssueOrder(Obj_AI_Base sender, GameObjectIssueOrderEventArgs args)
        {
            try
            {
                if (!this.Menu.Item("TurnAround").IsActive())
                {
                    return;
                }

                if (sender.IsMe)
                {
                    if (args.Order == GameObjectOrder.MoveTo)
                    {
                        this.lastMove = args.TargetPosition;
                    }
                    if (this.blockMovementTime > Game.Time)
                    {
                        args.Process = false;
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@TurnAround.cs: An error occurred: {0}", e);
            }
        }
Esempio n. 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnDash(Obj_AI_Base sender, Dash.DashItem args)
        {
            try
            {
                if (!sender.IsEnemy)
                {
                    return;
                }

                if (!MyMenu.RootMenu.Item("interrupt.e.dash").IsActive())
                {
                    return;
                }

                if (MyMenu.RootMenu.Item("interrupt.e.dash.mana").GetValue <Slider>().Value
                    <= ObjectManager.Player.ManaPercent)
                {
                    if (Misc.SpellE.SpellSlot.IsReady())
                    {
                        if (ObjectManager.Player.Distance(sender) <= Misc.SpellE.Range)
                        {
                            if (!args.IsBlink)
                            {
                                Misc.SpellE.SpellObject.Cast();
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellManager.cs: OnDash - {0}", e);
                throw;
            }
        }
Esempio n. 10
0
        /// <summary>
        ///     Initialize Ezreal Spells
        /// </summary>
        public Spells()
        {
            try
            {
                Q = new Spell.Skillshot(SpellSlot.Q, 1150, SkillShotType.Linear, 250, 2000, 60, DamageType.Physical)
                {
                    AllowedCollisionCount = 0
                };
                W = new Spell.Skillshot(SpellSlot.W, 1000, SkillShotType.Linear, 250, 1600, 80, DamageType.Magical)
                {
                    AllowedCollisionCount = Int32.MaxValue
                };
                E = new Spell.Skillshot(SpellSlot.E, 475, SkillShotType.Linear);
                R = new Spell.Skillshot(SpellSlot.R, 1500, SkillShotType.Linear, 1100, 2000, 160, DamageType.Magical)
                {
                    AllowedCollisionCount = Int32.MaxValue
                };

                SpellList.AddRange(new[] { Q, W, E, R });

                Logging.AddEntry(LoggingEntryType.Debug, "@Spells.cs: Spell class initialized");
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@Spells.cs: Can't initialize spell class - {0}", e);
                throw;
            }
        }
Esempio n. 11
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    if (MyMenu.RootMenu.Item("combo.mode").GetValue <StringList>().SelectedIndex == 0)
                    {
                        this.SpellObject.Cast(target);
                    }
                    else
                    {
                        var prediction = this.SpellObject.GetPrediction(target);
                        if (prediction.Hitchance >= HitChance.VeryHigh)
                        {
                            this.SpellObject.Cast(prediction.CastPosition.To2D());
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellQ.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 12
0
        /// <summary>
        ///     The is the spell active method.
        /// </summary>
        /// <param name="spellSlot">
        ///     The spell slot.
        /// </param>
        /// <param name="orbwalkingMode">
        ///     The orbwalking mode.
        /// </param>
        /// <returns>
        ///     <see cref="bool" />
        /// </returns>
        private static bool IsSpellActive(SpellSlot spellSlot, Orbwalking.OrbwalkingMode orbwalkingMode)
        {
            if (Program.Orbwalker.ActiveMode != orbwalkingMode || !spellSlot.IsReady())
            {
                return(false);
            }

            try
            {
                var orbwalkerModeLower = Program.Orbwalker.ActiveMode.ToString().ToLower();
                var spellSlotNameLower = spellSlot.ToString().ToLower();

                if ((orbwalkerModeLower.Equals("mixed") &&
                     (spellSlotNameLower.Equals("r"))))
                {
                    return(false);
                }

                return(MyMenu.RootMenu.Item(orbwalkerModeLower + spellSlotNameLower + "use").GetValue <bool>() &&
                       MyMenu.RootMenu.Item(orbwalkerModeLower + spellSlotNameLower + "mana")
                       .GetValue <Slider>()
                       .Value <= ObjectManager.Player.ManaPercent);
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellManager.cs: Can not get spell active state for slot {0} - {1}", spellSlot.ToString(), e);
                throw;
            }
        }
Esempio n. 13
0
        /// <summary>
        ///     OnInterruptableTarget.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            try
            {
                if (!Misc.SpellQ.SpellSlot.IsReady() || !MyMenu.RootMenu.Item("interrupt.q").IsActive())
                {
                    return;
                }

                if (ObjectManager.Player.ManaPercent
                    <= MyMenu.RootMenu.Item("interrupt.q.mana").GetValue <Slider>().Value)
                {
                    return;
                }

                if (args.DangerLevel != Interrupter2.DangerLevel.High || !sender.IsValidTarget(Misc.SpellQ.Range))
                {
                    return;
                }

                Misc.SpellQ.SpellObject.Cast(sender);
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellManager.cs: OnInterruptableTarget - {0}", e);
                throw;
            }
        }
Esempio n. 14
0
        /// <summary>
        ///        Called on gapcloser.
        /// </summary>
        /// <param name="gapcloser"></param>
        private void OnEnemyGapcloser(ActiveGapcloser gapcloser)
        {
            try
            {
                if (!Misc.SpellQ.SpellSlot.IsReady() || !MyMenu.RootMenu.Item("gapcloser.q").IsActive())
                {
                    return;
                }

                if (ObjectManager.Player.ManaPercent
                    <= MyMenu.RootMenu.Item("interrupt.q.mana").GetValue <Slider>().Value)
                {
                    return;
                }

                if (gapcloser.End.Distance(ObjectManager.Player.Position) <= Misc.SpellQ.Range)
                {
                    Misc.SpellQ.SpellObject.Cast(gapcloser.End);
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellManager.cs: AntiGapcloser - {0}", e);
                throw;
            }
        }
Esempio n. 15
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                if (BuffManager.HasUltimate)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    if (Misc.GetFerocityStacks() == 4 &&
                        MyMenu.RootMenu.Item("combo.prio").GetValue <StringList>().SelectedIndex != 1)
                    {
                        return;
                    }

                    if (ObjectManager.Player.Distance(target) < this.Range + this.Width)
                    {
                        this.SpellObject.Cast();
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellW.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="gapcloser"></param>
        private void OnEnemyGapcloser(ActiveGapcloser gapcloser)
        {
            try
            {
                var qSpell = new SpellQ();
                if (qSpell.SpellObject.IsCharging)
                {
                    return;
                }

                var eSpell = new SpellE();
                if (MyMenu.RootMenu.Item("gapclosereuse").IsActive() && eSpell.SpellSlot.IsReady())
                {
                    if (gapcloser.End.Distance(ObjectManager.Player.Position) <= eSpell.Range)
                    {
                        eSpell.SpellObject.Cast(gapcloser.End);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellManager.cs: AntiGapcloser - {0}", e);
                throw;
            }
        }
Esempio n. 17
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                if (ObjectManager.Player.IsChannelingImportantSpell())
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    if (!Misc.SpellE.SpellObject.IsReady())
                    {
                        this.SpellObject.Cast();
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellW.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 18
0
        /// <summary>
        ///     Fired when a game object is created
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            try
            {
                if (!sender.IsEnemy || !this.Menu.Item("AntiStealthActive").IsActive())
                {
                    return;
                }

                if (this.rengar != null)
                {
                    if (sender.Name.ToLower().Contains("Rengar_Base_R_Alert"))
                    {
                        if (this.Player.HasBuff("rengarralertsound") && !this.rengar.IsVisible && !this.rengar.IsDead)
                        {
                            var item = this.GetBestWardItem();
                            if (item != null)
                            {
                                this.Player.Spellbook.CastSpell(item.Slot, this.Player.Position);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@AntiStealth.cs: An error occurred: {0}", e);
            }
        }
Esempio n. 19
0
        private void OnAttackableUnitEnterVisiblityClient(GameObject sender, EventArgs args)
        {
            try
            {
                if (!this.Menu.Item("wardtracker.Enabled").IsActive())
                {
                    return;
                }

                if (!sender.IsValid || sender.IsDead || !sender.IsEnemy)
                {
                    return;
                }

                var hero = sender as AIHeroClient;
                if (hero != null)
                {
                    if (ItemData.Sightstone.GetItem().IsOwned(hero) || ItemData.Ruby_Sightstone.GetItem().IsOwned(hero) ||
                        ItemData.Vision_Ward.GetItem().IsOwned(hero))
                    {
                        this._heroNoWards.RemoveAll(h => h.Hero.NetworkId == hero.NetworkId);
                    }
                    else
                    {
                        this._heroNoWards.Add(new HeroWard(hero));
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@WardTracker.cs: An error occurred: {0}", e);
            }
        }
Esempio n. 20
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    var potentialTarget =
                        HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget(this.Range) &&
                                                           !x.IsDead && !x.IsZombie && this.SpellObject.GetDamage(x) > x.Health);

                    if (potentialTarget?.CountAlliesInRange(850) == 0 && ObjectManager.Player.Distance(target) > 900)
                    {
                        this.SpellObject.Cast(potentialTarget);
                    }

                    if (MyMenu.RootMenu.Item("raoe").IsActive() && ObjectManager.Player.CountEnemiesInRange(1150) == 0)
                    {
                        this.SpellObject.CastIfWillHit(target, MyMenu.RootMenu.Item("rifcanhit").GetValue <Slider>().Value);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellR.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 21
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="SpellManager" /> class.
        /// </summary>
        internal SpellManager()
        {
            try
            {
                this.LoadSpells(new List <ISpell>()
                {
                    new SpellQ(), new SpellW(), new SpellE(), new SpellR()
                });
                Misc.SpellQ = new SpellQ();
                Misc.SpellW = new SpellW();
                Misc.SpellE = new SpellE();
                Misc.SpellR = new SpellR();
                Game.PrintChat("[00:01] <font color='#CC0000'>BATTLERITE!</font> Join http://aimtec.io for Battlerite scripts! SUPER FUN");
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellManager.cs: Can not initialize the spells - {0}", e);
                throw;
            }

            Drawing.OnDraw                 += OnDraw;
            Game.OnUpdate                  += this.Game_OnUpdate;
            GameObject.OnCreate            += DaggerManager.OnCreate;
            GameObject.OnDelete            += DaggerManager.OnDelete;
            Obj_AI_Base.OnIssueOrder       += Obj_AI_Base_OnIssueOrder;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
        }
Esempio n. 22
0
        /// <summary>
        ///     The on update callback.
        /// </summary>
        internal override void OnUpdate()
        {
            try
            {
                if (this.SpellObject == null || this.SpellObject.Instance.ToggleState != 2)
                {
                    return;
                }

                if (
                    !ObjectManager.Get <Obj_AI_Base>()
                    .Any(
                        obj =>
                        obj.IsValidTarget() && obj.Distance(this.lastCastPosition) <= this.Width * 2 &&
                        obj.HasBuff("chilled")))
                {
                    this.SpellObject.Cast();
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellR.cs: Can not run OnUpdate - {0}", e);
                throw;
            }
        }
Esempio n. 23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="gapcloser"></param>
        private void OnEnemyGapcloser(ActiveGapcloser gapcloser)
        {
            try
            {
                if (Misc.SpellQ.SpellObject.IsCharging)
                {
                    return;
                }


                if (!MyMenu.RootMenu.Item("gapcloser" + gapcloser.Sender.CharData.BaseSkinName + "use").IsActive())
                {
                    return;
                }

                if (MyMenu.RootMenu.Item("gapclosereuse").IsActive() && Misc.SpellE.SpellSlot.IsReady())
                {
                    if (gapcloser.End.Distance(ObjectManager.Player.Position) <= Misc.SpellE.Range)
                    {
                        Misc.SpellE.SpellObject.Cast(gapcloser.End);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellManager.cs: AntiGapcloser - {0}", e);
                throw;
            }
        }
Esempio n. 24
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    var enemiesCount =
                        HeroManager.Enemies.Count(
                            x => x.IsValidTarget(this.Range + this.Width) && !x.IsDead && !x.IsZombie);

                    if (enemiesCount < MyMenu.RootMenu.Item("countrenemies").GetValue <Slider>().Value)
                    {
                        return;
                    }

                    // do other stuff..
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellR.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 25
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="SpellManager" /> class.
        /// </summary>
        internal SpellManager()
        {
            try
            {
                Misc.SpellQ = new SpellQ();
                Misc.SpellW = new SpellW();
                Misc.SpellE = new SpellE();
                Misc.SpellR = new SpellR();

                this.LoadSpells(new List <ISpell>()
                {
                    new SpellQ(), new SpellW(), new SpellE(), new SpellR()
                });
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellManager.cs: Can not initialize the spells - {0}", e);
                throw;
            }

            Game.OnUpdate                  += this.Game_OnUpdate;
            Obj_AI_Base.OnBuffAdd          += PassiveManager.Obj_AI_Base_OnBuffAdd;
            Obj_AI_Base.OnBuffRemove       += PassiveManager.Obj_AI_Base_OnBuffRemove;
            Obj_AI_Base.OnProcessSpellCast += PassiveManager.Obj_AI_Base_OnProcessSpellCast1;
        }
Esempio n. 26
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                var target = TargetSelector.GetTarget(this.Range);

                if (Misc.HasDevouredBuff && Misc.LastDevouredType == DevourType.Enemy)
                {
                    target = null;
                }

                if (Game.TickCount - Misc.LastDevourer <= 500) //Misc.GetPassiveStacks(target) != 3
                {
                    return;
                }

                if (target != null)
                {
                    if (ObjectManager.GetLocalPlayer().Distance(target) <= this.Range)
                    {
                        var prediction = this.SpellObject.GetPrediction(target);
                        if (prediction.HitChance >= HitChance.Medium)
                        {
                            this.SpellObject.Cast(target);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellQ.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 27
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                var target = HeroManager.Enemies.Where(x => x.Distance(ObjectManager.Player) <= this.Range + x.BoundingRadius)
                             .OrderBy(obj => obj.Distance(ObjectManager.Player.ServerPosition))
                             .FirstOrDefault();

                if (Misc.HasDevouredBuff && Misc.LastDevouredType == DevourType.Enemy)
                {
                    target = null;
                }
                if (target != null)
                {
                    if (ObjectManager.Player.Distance(target) <= this.Range)
                    {
                        var prediction = this.SpellObject.GetPrediction(target);
                        if (prediction.Hitchance >= HitChance.High)
                        {
                            this.SpellObject.Cast(prediction.CastPosition);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellQ.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
Esempio n. 28
0
        internal ISpell()
        {
            try
            {
                this.SpellObject = new Spell(this.SpellSlot, this.Range, this.DamageType);

                if (this.Targeted)
                {
                    this.SpellObject.SetTargetted(this.Delay, this.Speed);
                }
                else if (this.Charged)
                {
                    this.SpellObject.SetCharged(this.MinRange, this.MaxRange, this.DeltaT);
                }
                else
                {
                    this.SpellObject.SetSkillshot(
                        this.Delay,
                        this.Width,
                        this.Speed,
                        this.Collision,
                        this.SkillshotType);
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@ISpell.cs: Can not initialize the base class - {0}", e);
                throw;
            }
        }
Esempio n. 29
0
        /// <summary>
        ///     Called when the game updates
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void Game_OnUpdate(EventArgs args)
        {
            try
            {
                if (!ItemData.Seraphs_Embrace.GetItem().IsOwned() || !this.Menu.Item("UseSeraphsCombo").IsActive())
                {
                    return;
                }

                if (this.Menu.Item("Mode-seraphs").GetValue <StringList>().SelectedIndex == 1 && !this.ComboModeActive)
                {
                    return;
                }

                var enemies     = this.Player.CountEnemiesInRange(800);
                var totalDamage = IncomingDamageManager.GetDamage(this.Player) * 1.1f;

                if (this.Player.HealthPercent <= this.Menu.Item("seraphs-min-health").GetValue <Slider>().Value&& enemies >= 1)
                {
                    if ((int)(totalDamage / this.Player.Health)
                        > this.Menu.Item("seraphs-min-damage").GetValue <Slider>().Value ||
                        this.Player.HealthPercent < this.Menu.Item("seraphs-min-health").GetValue <Slider>().Value)
                    {
                        Items.UseItem((int)this.Id, this.Player);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@Seraphs.cs: An error occurred: {0}", e);
            }
        }
Esempio n. 30
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                var target = Misc.GetTarget(this.Range, this.DamageType);
                if (target != null)
                {
                    var prediction = this.SpellObject.GetPrediction(target);
                    if (prediction.Hitchance >= HitChance.VeryHigh || prediction.Hitchance == HitChance.Immobile || !target.CanMove)
                    {
                        this.SpellObject.Cast(target);
                    }

                    if (MyMenu.RootMenu.Item("waoe").IsActive())
                    {
                        this.SpellObject.CastIfWillHit(target, MyMenu.RootMenu.Item("wifcanhit").GetValue <Slider>().Value);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellW.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }