当前位置: 首页>>代码示例>>C#>>正文


C# Obj_AI_Base.GetSpellDamage方法代码示例

本文整理汇总了C#中Obj_AI_Base.GetSpellDamage方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base.GetSpellDamage方法的具体用法?C# Obj_AI_Base.GetSpellDamage怎么用?C# Obj_AI_Base.GetSpellDamage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Obj_AI_Base的用法示例。


在下文中一共展示了Obj_AI_Base.GetSpellDamage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if ( !sender.IsEnemy || R.IsReady() || !Config.Item("autoR", true).GetValue<bool>())
                return;

            double dmg = 0;

            if (args.Target != null && args.Target.IsMe)
            {
                dmg = dmg + sender.GetSpellDamage(Player, args.SData.Name);
            }
            else
            {
                var castArea = Player.Distance(args.End) * (args.End - Player.ServerPosition).Normalized() + Player.ServerPosition;
                if (castArea.Distance(Player.ServerPosition) < Player.BoundingRadius / 2)
                {
                    dmg = dmg + sender.GetSpellDamage(Player, args.SData.Name);
                }
            }

            if (Player.Health - dmg < (Player.CountEnemiesInRange(600) * Player.Level * 20) + (Player.Level * 20))
            {
                R.Cast();
            }
        }
开发者ID:MrWenzoxfs,项目名称:elobuddy,代码行数:25,代码来源:Ekko.cs

示例2: Protector

 public static void Protector(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs spell)
 {
     if (!Program.R.IsReady() && Kindred.IsDead && Kindred.IsZombie && sender.IsAlly && !sender.IsMe && !Program.Config.Item("protector").GetValue<bool>())
     {
         return;
     }
     if (sender is Obj_AI_Hero && Program.R.IsReady() && sender.IsEnemy && !spell.SData.IsAutoAttack()
         && !sender.IsDead && !sender.IsZombie && sender.IsValidTarget(1000))
     {
         foreach (var protector in SpellDatabase.Spells.Where(x => x.spellName == spell.SData.Name
             && Program.Config.Item("hero." + x.spellName).GetValue<bool>()))
         {
             if (protector.spellType == SpellType.Circular && Kindred.Distance(spell.End) <= 200 &&
                 sender.GetSpellDamage(Kindred, protector.spellName) > Kindred.Health)
             {
                 Program.R.Cast(Kindred);
             }
             if (protector.spellType == SpellType.Cone && Kindred.Distance(spell.End) <= 200 &&
                 sender.GetSpellDamage(Kindred, protector.spellName) > Kindred.Health)
             {
                 Program.R.Cast(Kindred);
             }
             if (protector.spellType == SpellType.Line && Kindred.Distance(spell.End) <= 200
                 && sender.GetSpellDamage(Kindred, protector.spellName) > Kindred.Health)
             {
                 Program.R.Cast(Kindred);
             }
         }
     }
 }
开发者ID:JelloBeans,项目名称:LeagueSharp,代码行数:30,代码来源:Helper.cs

示例3: Obj_AI_Base_OnProcessSpellCast

 public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (args.Target == null)
         return;
     var dmg = sender.GetSpellDamage(ObjectManager.Player, args.SData.Name);
     double HpLeft = ObjectManager.Player.Health - dmg;
     double HpPercentage = (dmg * 100) / ObjectManager.Player.Health;
     if (sender.IsValid<Obj_AI_Hero>() && HpPercentage >= Config.Item("Edmg").GetValue<Slider>().Value && !sender.IsValid<Obj_AI_Turret>() && sender.IsEnemy && args.Target.IsMe && !args.SData.IsAutoAttack() && Config.Item("autoE").GetValue<bool>() && E.IsReady())
     {
         E.Cast();
         //Game.PrintChat("" + HpPercentage);
     }
 }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:13,代码来源:Program.cs

示例4: OnProcessSpellCast

 private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs spell)
 {
     if (sender is Obj_AI_Hero && Spells.W.IsReady() && sender.IsEnemy && !spell.SData.IsAutoAttack()
         && !sender.IsDead && sender.IsValidTarget(1000))
     {
         foreach (var ally in from ally in HeroManager.Allies.Where(x=> x.IsAlly && SpellDatabase.Spells.Any(y=> y.spellName == spell.SData.Name))
                              .Where(ally => ally.Distance(ObjectManager.Player) < Spells.W.Range) 
                              let exist = SpellDatabase.Spells.FirstOrDefault(y => y.spellName == spell.SData.Name) where exist != null && 
                              (exist.spellType == SpellType.Cone || exist.spellType == SpellType.Circular || exist.spellType == SpellType.Line)
                              && sender.GetSpellDamage(ally,exist.spellName) > ally.Health
                              && LuxMenu.Config.Item("hero." + exist.spellName).GetValue<bool>()
                              select ally)
         {
             Spells.W.Cast(ally.Position);
         }
     }
 }
开发者ID:Sthephanfelix,项目名称:LeagueSharp-4,代码行数:17,代码来源:Lux.cs

示例5: GetIncomingDamage_OnProcessSpellCast

 private void GetIncomingDamage_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     foreach (var damage in Damages)
     {
         foreach (IncomingDamage incomingDamage in damage.Value.ToArray())
         {
             if (incomingDamage.TimeHit < Game.Time)
                 damage.Value.Remove(incomingDamage);
         }
         if (sender.NetworkId == damage.Key.NetworkId)
             continue;
         //if (args.Target.Type == GameObjectType.obj_LampBulb || args.Target.Type == GameObjectType.Unknown)
         //    //No target, find it later
         //{
         //    try
         //    {
         //        double spellDamage = sender.GetSpellDamage((Obj_AI_Base) args.Target, args.SData.Name);
         //        if (spellDamage != 0.0f)
         //            Damages[Damages.Last().Key].Add(new IncomingDamage(args.SData.Name, sender, args.Start,
         //                args.End, spellDamage,
         //                IncomingDamage.CalcTimeHit(args.TimeCast, sender, damage.Key, args.End)));
         //    }
         //    catch (InvalidOperationException)
         //    {
         //        //Cannot find spell
         //    }
         //    catch (InvalidCastException)
         //    {
         //        //TODO Need a workaround to get the spelldamage for args.Target
         //        return;
         //    }
         //}
         if (args.SData.Name.ToLower().Contains("attack") && args.Target.NetworkId == damage.Key.NetworkId)
         {
             double aaDamage = sender.GetAutoAttackDamage((Obj_AI_Base)args.Target);
             if (aaDamage != 0.0f)
                 if (sender.Type == GameObjectType.obj_AI_Minion)
                 {
                     Damages[damage.Key].Add(new IncomingDamage(args.SData.Name, sender, args.Start, args.End,
                         aaDamage, IncomingDamage.CalcTimeHit(args.TimeCast, sender, damage.Key, args.End),
                         args.Target, false, true));
                 }
                 else if (sender.Type == GameObjectType.obj_AI_Turret)
                 {
                     Damages[damage.Key].Add(new IncomingDamage(args.SData.Name, sender, args.Start, args.End,
                         aaDamage, IncomingDamage.CalcTimeHit(args.TimeCast, sender, damage.Key, args.End),
                         args.Target, true));
                 }
                 else
                 {
                     Damages[damage.Key].Add(new IncomingDamage(args.SData.Name, sender, args.Start, args.End,
                         aaDamage, IncomingDamage.CalcTimeHit(args.TimeCast, sender, damage.Key, args.End),
                         args.Target));
                 }
             continue;
         }
         if (sender.Type == GameObjectType.obj_AI_Hero && args.Target.NetworkId == damage.Key.NetworkId)
         {
             try
             {
                 double spellDamage = sender.GetSpellDamage((Obj_AI_Base)args.Target, args.SData.Name);
                 if (spellDamage != 0.0f)
                     Damages[damage.Key].Add(new IncomingDamage(args.SData.Name, sender, args.Start, args.End,
                         spellDamage, IncomingDamage.CalcTimeHit(args.TimeCast, sender, damage.Key, args.End),
                         args.Target));
             }
             catch (InvalidOperationException)
             {
                 //Cannot find spell
             }
         }
         if (sender.Type == GameObjectType.obj_AI_Turret && args.Target.NetworkId == damage.Key.NetworkId)
             Damages[damage.Key].Add(new IncomingDamage(args.SData.Name, sender, args.Start, args.End, 300,
                 IncomingDamage.CalcTimeHit(args.TimeCast, sender, damage.Key, args.End), args.Target, true));
     }
 }
开发者ID:kampfi,项目名称:SAwarenessBeta,代码行数:76,代码来源:Activator.cs

示例6: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!R.IsReady() || !sender.IsEnemy || sender.IsMinion || !sender.IsValidTarget(1500) || !Config.Item("autoR").GetValue<bool>())
                return;

            double dmg = 0;

            foreach (var ally in Program.Allies.Where(ally => Config.Item("Rally" + ally.ChampionName).GetValue<bool>() && ally.IsValid && !ally.IsDead && Player.Distance(ally.ServerPosition) < R.Range))
            {
                if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                {
                    dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                }
                else if (ally.Distance(args.End) <= 300f)
                {
                    if (!OktwCommon.CanMove(ObjectManager.Player) || ObjectManager.Player.Distance(sender.Position) < 300f)
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                    else if (Player.Distance(args.End) < 100f)
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                }

                if (ally.Health - dmg < ally.CountEnemiesInRange(900) * ally.Level * 20)
                    R.Cast(ally);
                else if (ally.Health - dmg <  ally.Level * 5)
                    R.Cast(ally);
            }
        }
开发者ID:0s0speedy,项目名称:LeagueRepo,代码行数:27,代码来源:Kayle.cs

示例7: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!E.IsReady() || args.Target == null || !sender.IsEnemy || !args.Target.IsMe || !sender.IsValid<Obj_AI_Hero>() || args.SData.Name == "TormentedSoil")
                return;

            if (Config.Item("spell" + args.SData.Name) != null && !Config.Item("spell" + args.SData.Name).GetValue<bool>())
                return;

            var dmg = sender.GetSpellDamage(ObjectManager.Player, args.SData.Name);
            double HpLeft = ObjectManager.Player.Health - dmg;
            double HpPercentage = (dmg * 100) / Player.Health;

            if ( HpPercentage >= Config.Item("Edmg", true).GetValue<Slider>().Value && sender.IsEnemy && args.Target.IsMe && !args.SData.IsAutoAttack() && Config.Item("autoE", true).GetValue<bool>() )
            {
                E.Cast();
            }
        }
开发者ID:47110572,项目名称:LeagueRepo,代码行数:17,代码来源:Sivir.cs

示例8: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (evade != null && evade.Item("EVADEENABLE").GetValue<bool>() && sender.Type == GameObjectType.obj_AI_Hero && sender.IsEnemy)
            {
                Vector2 sender_pos = sender.ServerPosition.To2D();
                var item = evade.Items.FirstOrDefault(q => q.Name == args.SData.Name);
                if (item != null && item.GetValue<bool>())
                {
                    var spell = SpellDatabase.EvadeableSpells.FirstOrDefault(p => p.SpellName == args.SData.Name);
                    if (spell != null)
                    {
                        if (spell.IsSkillshot)
                        {
                            DetectedSpellData dcspell = m_spell_pool.GetObject();
                            dcspell.Set(spell, sender_pos, args.End.To2D(), sender, args);
                            m_spell_queue.Enqueue(dcspell);
                        }
                    }
                }

                //to do: ally check
                if (item == null && args.Target != null && args.Target.IsMe && args != null && args.SData != null && !args.SData.IsAutoAttack() && sender.IsChampion())
                {
                    if(sender.GetSpellDamage(ObjectManager.Player, args.SData.Name) * 2 >= ObjectManager.Player.Health)
                        OnSpellHitDetected(sender_pos, ObjectManager.Player);
                }
            }
        }
开发者ID:47110572,项目名称:LeagueSharp,代码行数:28,代码来源:Evader.cs

示例9: SpellDetector

        static void SpellDetector(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            // return if ally or non hero spell

            if (Player.IsDead || (!zhonyaready() && !seraphready()) || !(sender is Obj_AI_Hero) || sender.IsAlly || !args.Target.IsMe || args.SData.IsAutoAttack() || sender.IsMe)
            {
                return;
            }
            DangerousSpells.Data Spellinfo = null;
            try
            {
                Spellinfo = DangerousSpells.GetByName(args.SData.Name);
            }
            catch (Exception e)
            {
                Console.WriteLine(e + e.StackTrace);
            }

            if (Spellinfo != null)
            {
                Console.WriteLine(Spellinfo.DisplayName);
                if (Menu.Item("Enabled" + Spellinfo.DisplayName).GetValue<bool>())
                {
                    Game.PrintChat("Attempting to Zhonya: " + args.SData.Name);
                    var delay = Spellinfo.BaseDelay * 1000;
                    if (zhonyaready())
                    {
                        Utility.DelayAction.Add((int) delay, () => Zhonya.Cast());
                        return;
                    }
                    if (seraphready() && Menu.Item("enableseraph").GetValue<bool>())
                    {
                        Utility.DelayAction.Add((int) delay, () => Seraph.Cast());
                    }
                    return;
                }
            }

            if (Menu.Item("enablehpzhonya").GetValue<bool>() && (zhonyaready() || seraphready()))
                {
                    var calcdmg = sender.GetSpellDamage(Player, args.SData.Name);
                    var remaininghealth = Player.Health - calcdmg;
                    var slidervalue = Menu.Item("minspelldmg").GetValue<Slider>().Value / 100f;
                    var hptozhonya = Menu.Item("hptozhonya").GetValue<Slider>().Value;
                    var remaininghealthslider = Menu.Item("remaininghealth").GetValue<Slider>().Value / 100f;
                    if ((calcdmg / Player.Health) >= slidervalue || Player.HealthPercent <= hptozhonya || remaininghealth <= remaininghealthslider * Player.Health)
                    {
                        Console.WriteLine("Attempting to Zhonya because incoming spell costs " + calcdmg / Player.Health
                            + " of our health.");
                        if (zhonyaready())
                        {
                            Zhonya.Cast();
                            return;
                        }
                        if (seraphready() && Menu.Item("enableseraph").GetValue<bool>())
                        {
                            Seraph.Cast();
                        }
                    }
                }
        }
开发者ID:werdbrian,项目名称:LeagueSharp-17,代码行数:61,代码来源:Program.cs

示例10: Obj_AI_Base_OnProcessSpellCast

        public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs args)
        {
            if (Config.Item("Cassiopeia.AutoSeraphsEmbrace").GetValue<bool>() && SeraphsEmbrace.IsReady() && Player.HealthPercent <= Config.Item("Cassiopeia.AutoSeraphsEmbraceMiniHP").GetValue<Slider>().Value && (unit.IsValid<Obj_AI_Hero>() || unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe)
            {
                SeraphsEmbrace.Cast();
            }

            if ((unit.IsValid<Obj_AI_Hero>() || unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe && Config.Item("Cassiopeia.useZhonyasHourglass").GetValue<bool>() && ZhonyasHourglass.IsReady() && Player.HealthPercent <= Config.Item("Cassiopeia.MinimumHPtoZhonyasHourglass").GetValue<Slider>().Value)
            {
                if (Player.CountEnemiesInRange(1300) > 1)
                {
                    if (Player.CountAlliesInRange(1300) >= 1 + 1)
                    {
                        ZhonyasHourglass.Cast();
                        return;
                    }
                    if (Player.CountAlliesInRange(1300) == 0 + 1)
                    {
                        if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                        {
                            ZhonyasHourglass.Cast();
                            return;
                        }
                    }
                }
                if (Player.CountEnemiesInRange(1300) == 1)
                {
                    if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                    {
                        ZhonyasHourglass.Cast();
                        return;
                    }
                }

            }

            if ((unit.IsValid<Obj_AI_Hero>() || unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe && Config.Item("Cassiopeia.useWoogletsWitchcap").GetValue<bool>() && WoogletsWitchcap.IsReady() && Player.HealthPercent <= Config.Item("Cassiopeia.MinimumHPtoWoogletsWitchcap").GetValue<Slider>().Value)
            {
                if (Player.CountEnemiesInRange(1300) > 1)
                {
                    if (Player.CountAlliesInRange(1300) >= 1 + 1)
                    {
                        WoogletsWitchcap.Cast();
                        return;
                    }
                    if (Player.CountAlliesInRange(1300) == 0 + 1)
                    {
                        if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                        {
                            WoogletsWitchcap.Cast();
                            return;
                        }
                    }
                }
                if (Player.CountEnemiesInRange(1300) == 1)
                {
                    if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                    {
                        WoogletsWitchcap.Cast();
                        return;
                    }
                }

            }

            double InterruptOn = SpellToInterrupt(args.SData.Name);
            if (Config.Item(unit.BaseSkinName + "INT").GetValue<bool>() && Config.Item("Cassiopeia.InterruptSpells").GetValue<bool>() && unit.Team != ObjectManager.Player.Team && InterruptOn >= 0f && unit.IsValidTarget(R.Range))
            {
                if (R.IsReady() && Player.Mana > RMANA && Player.Distance(unit) < R.Range - 50 && unit.IsFacing(Player))
                {
                    R.CastIfHitchanceEquals(unit, HitChance.High, true);
                }
            }

            if (Config.Item("Cassiopeia.HarassActive").GetValue<KeyBind>().Active || Config.Item("Cassiopeia.HarassActiveT").GetValue<KeyBind>().Active)
            {
                if (Config.Item("Cassiopeia.AutoQWhenEnemyCastHarass").GetValue<bool>() && Player.ManaPercent >= Config.Item("Cassiopeia.QEnemyAttackMiniManaHarass").GetValue<Slider>().Value && (unit.IsValid<Obj_AI_Hero>() && !unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe && Q.IsReady() && Player.Distance(unit) <= Q.Range)
                {
                    Q.CastIfHitchanceEquals(unit, HitChance.High, true);
                }

                if (Config.Item("Cassiopeia.AutoWWhenEnemyCastHarass").GetValue<bool>() && Player.ManaPercent >= Config.Item("Cassiopeia.WEnemyAttackMiniManaHarass").GetValue<Slider>().Value && (unit.IsValid<Obj_AI_Hero>() && !unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe && W.IsReady() && Player.Distance(unit) <= W.Range)
                {
                    W.CastIfHitchanceEquals(unit, HitChance.High, true);
                }
            }

            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
            var useQ = Config.Item("Cassiopeia.UseQCombo").GetValue<bool>();
            var useW = Config.Item("Cassiopeia.UseWCombo").GetValue<bool>();

            if (unit.NetworkId == target.NetworkId)
            {
                if (useQ && Q.IsReady() && Player.Mana >= QMANA)
                {
                    if (unit.BaseSkinName.Equals("Katarina", StringComparison.CurrentCultureIgnoreCase) || unit.BaseSkinName.Equals("Talon", StringComparison.CurrentCultureIgnoreCase) || unit.BaseSkinName.Equals("Zed", StringComparison.CurrentCultureIgnoreCase))
                    {

                        if (args.Target.IsMe && (args.SData.Name.Contains("KatarinaE") || args.SData.Name.Contains("TalonCutthroat") || args.SData.Name.Contains("zedult")))
                        {
//.........这里部分代码省略.........
开发者ID:0s0speedy,项目名称:LeagueSharp,代码行数:101,代码来源:Program.cs

示例11: Obj_AI_Base_OnProcessSpellCast

 private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (args.Target == null || !sender.IsEnemy || !args.Target.IsMe || !Config.Item("autoW").GetValue<bool>() || W.IsReady() || Player.Mana > RMANA + WMANA)
         return;
     var dmg = sender.GetSpellDamage(Player, args.SData.Name);
     double HpLeft = Player.Health - dmg;
     double HpPercentage = (dmg * 100) / Player.Health;
     double shieldValue = 20 + W.Level * 40 + 0.08 * Player.MaxMana + 0.8 * Player.FlatMagicDamageMod;
     if (Player.Health - dmg < dmg)
     {
         if (HpPercentage >= Config.Item("Wdmg").GetValue<Slider>().Value)
             W.Cast();
         else if (dmg > shieldValue)
             W.Cast();
         //Game.PrintChat("" + HpPercentage);
     }
 }
开发者ID:0s0speedy,项目名称:LeagueRepo,代码行数:17,代码来源:Urgot.cs

示例12: Obj_AI_Base_OnProcessSpellCast

        public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs args)
        {
            double ShouldUseOn = ShouldUse(args.SData.Name);
            if (unit.Team != ObjectManager.Player.Team && ShouldUseOn >= 0f && unit.IsValidTarget(Q.Range))
            {

                if (Config.Item("Ekko.WInterrupt").GetValue<bool>() && W.IsReady() && Player.Mana >= WMANA && Player.Distance(unit) <= W.Range)
                {
                    W.CastIfHitchanceEquals(unit, HitChance.High, true);
                }

            }

            if (Config.Item("Ekko.RAuto").GetValue<bool>() && R.IsReady())
            {
                if (Config.Item("Ekko.UseSafeRComboAuto").GetValue<bool>() && Player.HealthPercent <= Config.Item("Ekko.MinimumHPSafeRAuto").GetValue<Slider>().Value)
                {
                    if ((unit.IsValid<Obj_AI_Hero>() || unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe)
                    {
                        if (Player.CountEnemiesInRange(1300) > 1)
                        {
                            if (Player.CountAlliesInRange(1300) >= 1 + 1)
                            {
                                R.Cast();
                                return;
                            }
                            if (Player.CountAlliesInRange(1300) == 0 + 1)
                            {
                                if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                                {
                                    R.Cast();
                                    return;
                                }
                            }
                        }
                        else if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                        {
                            R.Cast();
                            return;
                        }
                    }
                }

            }

            if ((unit.IsValid<Obj_AI_Hero>() || unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe && Config.Item("Ekko.useZhonyasHourglass").GetValue<bool>() && ZhonyasHourglass.IsReady() && Player.HealthPercent <= Config.Item("Ekko.MinimumHPtoZhonyasHourglass").GetValue<Slider>().Value)
            {
                if (Player.CountEnemiesInRange(1300) > 1)
                {
                    if (Player.CountAlliesInRange(1300) >= 1 + 1)
                    {
                        ZhonyasHourglass.Cast();
                        return;
                    }
                    if (Player.CountAlliesInRange(1300) == 0 + 1)
                    {
                        if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                        {
                            ZhonyasHourglass.Cast();
                            return;
                        }
                    }
                }
                if (Player.CountEnemiesInRange(1300) == 1)
                {
                    if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                    {
                        ZhonyasHourglass.Cast();
                        return;
                    }
                }

            }

            if ((unit.IsValid<Obj_AI_Hero>() || unit.IsValid<Obj_AI_Turret>()) && unit.IsEnemy && args.Target.IsMe && Config.Item("Ekko.useWoogletsWitchcap").GetValue<bool>() && WoogletsWitchcap.IsReady() && Player.HealthPercent <= Config.Item("Ekko.MinimumHPtoWoogletsWitchcap").GetValue<Slider>().Value)
            {
                if (Player.CountEnemiesInRange(1300) > 1)
                {
                    if (Player.CountAlliesInRange(1300) >= 1 + 1)
                    {
                        WoogletsWitchcap.Cast();
                        return;
                    }
                    if (Player.CountAlliesInRange(1300) == 0 + 1)
                    {
                        if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                        {
                            WoogletsWitchcap.Cast();
                            return;
                        }
                    }
                }
                if (Player.CountEnemiesInRange(1300) == 1)
                {
                    if (unit.GetSpellDamage(Player, args.SData.Name) >= Player.Health || (unit.GetAutoAttackDamage(Player) >= Player.Health && args.SData.IsAutoAttack()))
                    {
                        WoogletsWitchcap.Cast();
                        return;
                    }
                }
//.........这里部分代码省略.........
开发者ID:0s0speedy,项目名称:LeagueSharp,代码行数:101,代码来源:Program.cs

示例13: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {

            if (sender.IsMe && args.SData.Name == "OrianaIzunaCommand")
                BallPos = args.End;

             if (!E.IsReady() || !sender.IsEnemy || !Config.Item("autoW", true).GetValue<bool>() || Player.Mana < EMANA + RMANA || sender.Distance(Player.Position) > 1600)
                return;

            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && Player.Distance(ally.ServerPosition) < E.Range))
            {
                double dmg = 0;
                if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                {
                    dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                }
                else
                {
                    var castArea = ally.Distance(args.End) * (args.End - ally.ServerPosition).Normalized() + ally.ServerPosition;
                    if (castArea.Distance(ally.ServerPosition) < ally.BoundingRadius / 2)
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                    else
                        continue;
                }

                double HpLeft = ally.Health - dmg;
                double HpPercentage = (dmg * 100) / ally.Health;
                double shieldValue = 60 + E.Level * 40 + 0.4 * Player.FlatMagicDamageMod;

                if (HpPercentage >= Config.Item("Wdmg", true).GetValue<Slider>().Value || dmg > shieldValue)
                    E.CastOnUnit(ally);
            }   
        }
开发者ID:MrWenzoxfs,项目名称:elobuddy,代码行数:33,代码来源:Orianna.cs

示例14: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy)
                return;

            if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !Seraph.IsReady() && !Zhonya.IsReady() && !CanUse(barrier) && !CanUse(heal) && !CanUse(exhaust))
                return;

            if (sender.Distance(Player.Position) > 1600)
                return;

            foreach (var ally in Program.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 51 && Player.Distance(ally.ServerPosition) < 700))
            {
                double dmg = 0;
                if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                {
                    dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                }
                else
                {
                    var castArea = ally.Distance(args.End) * (args.End - ally.ServerPosition).Normalized() + ally.ServerPosition;
                    if (castArea.Distance(ally.ServerPosition) < ally.BoundingRadius / 2)
                        dmg = dmg + sender.GetSpellDamage(ally, args.SData.Name);
                    else
                        continue;
                }

                if (CanUse(exhaust) && Config.Item("Exhaust").GetValue<bool>() )
                {
                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 40)
                        TryCast(() => Player.Spellbook.CastSpell(exhaust, sender));
                }

                if (CanUse(heal) && Config.Item("Heal").GetValue<bool>())
                {
                    if (!Config.Item("AllyHeal").GetValue<bool>() && !ally.IsMe)
                        return;

                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                        TryCast(() => Player.Spellbook.CastSpell(heal, ally));
                    else if (ally.Health - dmg < ally.Level * 10)
                        TryCast(() => Player.Spellbook.CastSpell(heal, ally));
                }

                if (Config.Item("Solari").GetValue<bool>() && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range)
                {
                    var value = 75 + (15 * Player.Level);
                    if (dmg > value && Player.HealthPercent < 50)
                        Solari.Cast();
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                        Solari.Cast();
                    else if (ally.Health - dmg < ally.Level * 10)
                        Solari.Cast();
                }

                if (Config.Item("FaceOfTheMountain").GetValue<bool>() && FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range)
                {
                    var value = 0.1 *  Player.MaxHealth ;
                    if (dmg > value && Player.HealthPercent < 50)
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15)
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                    else if (ally.Health - dmg < ally.Level * 10)
                        TryCast(() => FaceOfTheMountain.Cast(ally));
                }

                if (!ally.IsMe)
                    continue;

                if (CanUse(barrier) && Config.Item("Barrier").GetValue<bool>() )
                {
                    var value = 95 + Player.Level * 20;
                    if (dmg > value && Player.HealthPercent < 50)
                        TryCast(() => Player.Spellbook.CastSpell(barrier, Player));
                    else if (Player.Health - dmg < Player.CountEnemiesInRange(700) * Player.Level * 15)
                        TryCast(() => Player.Spellbook.CastSpell(barrier, Player));
                    else if (ally.Health - dmg < ally.Level * 10)
                        TryCast(() => Seraph.Cast());
                }

                if (Seraph.IsReady() && Config.Item("Seraph").GetValue<bool>())
                {
                    var value = Player.Mana * 0.2 + 150;
                    if (dmg > value && Player.HealthPercent < 50)
                        TryCast(() => Seraph.Cast());
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                        TryCast(() => Seraph.Cast());
                    else if (ally.Health - dmg < ally.Level * 10)
                        TryCast(() => Seraph.Cast());
                }

                if (Zhonya.IsReady() && Config.Item("Zhonya").GetValue<bool>())
                {
                    if (dmg > Player.Level * 30)
                        TryCast(() => Zhonya.Cast());
                    else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10)
                    {
                        TryCast(() => Zhonya.Cast());
                    }
                    else if (ally.Health - dmg < ally.Level * 10)
//.........这里部分代码省略.........
开发者ID:ngothaison,项目名称:HuyNKSDK,代码行数:101,代码来源:Activator.cs

示例15: Obj_AI_Base_OnProcessSpellCast

        // ���� ���� Ż�� ���� Spell E Passvie Mode (FPS Drop)
        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            bool bCriticalSpell = false;
            if ( !sender.IsEnemy || sender.IsMinion || !sender.IsValid<Obj_AI_Hero>() || Player.Distance(sender.ServerPosition) > 1800) return;

            var foundSpell = Spells.Find(x => args.SData.Name.ToLower() == x.ToLower());
            if (foundSpell != null)
            {
                Entry.PrintChat(string.Format("<font color=\"#FFAA00\" >Critical Skill ({0})!!!!!!</font>", args.SData.Name));
                bCriticalSpell = true;
            }

            if (args.Target.IsMe)
            {
                var dmg = sender.GetSpellDamage(Player, args.SData.Name);     // ���� ������
                double HpPercentage = (dmg * 100) / Player.MaxHealth;         // ���� ������% (��üHP)

                Entry.PrintChat(string.Format("{0}({1}): {2:F2}/{3}({4})", args.SData.Name, args.SData.TargettingType, HpPercentage, g_nDamageCritical, _e.IsReady()));

                if (!g_bPassiveModeE || !_e.IsReady()) return;

                // PassiveMode�� Ȱ��ȭ �Ǿ� ������
                if(bCriticalSpell)
                {
                    if (args.Target != null && args.Target.NetworkId == Player.NetworkId)
                    {
                        Entry.PrintChat(string.Format("Help Pix Lulu! Targeted Critical = {0}({1:F2})", args.SData.Name, HpPercentage));
                        _e.CastOnUnit(Player);
                    }
                    else
                    {
                        var castArea = Player.Distance(args.End) * (args.End - Player.ServerPosition).Normalized() + Player.ServerPosition;
                        if (castArea.Distance(Player.ServerPosition) <= _e.Range/2)
                        {
                            Entry.PrintChat(string.Format("Help Pix Lulu! Location Critical = {0}({1:F2})", args.SData.Name, HpPercentage));
                            _e.CastOnUnit(Player);
                        }
                    }
                }
                else if (HpPercentage > g_nDamageCritical)
                {
                    Entry.PrintChat(string.Format("Help Pix Lulu! High Damage = {0:F2} > {1} / {2}", HpPercentage, g_nDamageCritical, args.SData.Name));
                    _e.CastOnUnit(Player);
                }

            }
            else if (args.Target.IsAlly && args.Target.IsValid<Obj_AI_Hero>() && !string.IsNullOrEmpty(g_strMyADC))         // My ADC�� ��ȣ��
            {
                var MyADC = HeroManager.Allies.Where(ally => ally.IsValid && Player.Distance(ally.ServerPosition) < _e.Range).Find(ally => ally.CharData.BaseSkinName == g_strMyADC);

                var dmg = sender.GetSpellDamage(MyADC, args.SData.Name);     // ���� ������
                double HpPercentage = (dmg * 100) / MyADC.MaxHealth;         // ���� ������% (��üHP)

                Entry.PrintChat(string.Format("{0}: {1:F2}/{2}({3})", MyADC.CharData.BaseSkinName, HpPercentage, g_nMyADCDamagePercent, _e.IsReady()));

                if (!g_bPassiveModeE || !_e.IsReady()) return;

                if (MyADC != null && MyADC.NetworkId == args.Target.NetworkId)
                {
                    if (bCriticalSpell)
                    {
                        Entry.PrintChat(string.Format("Help Pix {0}! Targeted Critical = {1}({2:F2})", MyADC.CharData.BaseSkinName, args.SData.Name, HpPercentage));
                        _e.CastOnUnit(MyADC);
                    }
                    else if (HpPercentage > g_nMyADCDamagePercent)
                    {
                        Entry.PrintChat(string.Format("Help Pix {0}! = {1:F2} > {2} / {3}", MyADC.CharData.BaseSkinName, HpPercentage, g_nMyADCDamagePercent, args.SData.Name));
                        _e.CastOnUnit(MyADC);
                    }
                }
                else
                {
                    if (bCriticalSpell)
                    {
                        var castArea = Player.Distance(args.End) * (args.End - Player.ServerPosition).Normalized() + Player.ServerPosition;
                        if (castArea.Distance(Player.ServerPosition) <= Player.BoundingRadius / 2)
                        {
                            Entry.PrintChat(string.Format("Help Pix {0}! Location Critical = {1}({2:F2})", MyADC.CharData.BaseSkinName, args.SData.Name, HpPercentage));
                            _e.CastOnUnit(Player);
                        }
                    }
                }

            }
        }
开发者ID:VictoriousSupport,项目名称:VictoriousSeries,代码行数:86,代码来源:Lulu.cs


注:本文中的Obj_AI_Base.GetSpellDamage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。