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


C# Hero.ClosestToMouseTarget方法代码示例

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


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

示例1: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args)
        {
            if (target == null) return;
            if (!_loaded)
            {
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_PhantomAssassin)
                {
                    return;
                }
            }
                _loaded = true;

                Game.PrintMessage(
                "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName + " By Bopby" +
                " loaded!</font> <font color='#aa0000'>v" + Assembly.GetExecutingAssembly().GetName().Version,
                MessageType.LogMessage);

            me = ObjectMgr.LocalHero;
            target = me.ClosestToMouseTarget(Menu.Item("targetsearchrange").GetValue<Slider>().Value);
            var handle = me.Handle;
            var distance = me.Distance2D(target);
            var inv = me.Inventory.Items;
            var enumerable = inv as Item[] ?? inv.ToArray();
            var dagger = enumerable.Any(x => x.Name == "item_blink" && x.Cooldown == 0);
            if (!me.IsAlive) return
                    ;
            if (target != null && Menu.Item("keyBind").GetValue<KeyBind>().Active == true)
            {
                SpellsUsage(me, target, distance, dagger);
            }
        }
开发者ID:binhbumpro,项目名称:ensagexxx,代码行数:31,代码来源:Program.cs

示例2: Game_OnUpdate

 public static void Game_OnUpdate(EventArgs args)
 {
     if (!Game.IsInGame) return;
     _me = ObjectMgr.LocalHero;
     if (_me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Morphling)
     {
         return;
     }
     if (!_activated) return;
     if ((_target == null || !_target.IsVisible) && !_me.IsChanneling())
         _me.Move(Game.MousePosition);
     if (_target == null || _me.Distance2D(_target) > 500)
         _target = _me.ClosestToMouseTarget(1000);
     //Skills & Items
     waveform = _me.Spellbook.Spell1;
     adapt = _me.Spellbook.Spell2;
     eblade = _me.FindItem("item_ethereal_blade");
     bkb = _me.FindItem("item_black_king_bar");
     if (_target != null && _target.IsAlive && !_target.IsInvul())
     {
         if (!Utils.SleepCheck("Morph_Wait")) return;
         var targetDistance = _me.Distance2D(_target);
         var attackRange = 1000;
         if (targetDistance <= attackRange && waveform != null && waveform.CanBeCasted() && Utils.SleepCheck("waveform"))
         {
             waveform.UseAbility(_target.Position);
             Utils.Sleep(150 + Game.Ping, "waveform");
         }
         else if (bkb !=null && _bkbToggle && Utils.SleepCheck("BKB"))
         {
             bkb.UseAbility();
             Utils.Sleep(150 + Game.Ping, "BKB");
         }
         else if (eblade != null && eblade.CanBeCasted() && Utils.SleepCheck("eblade"))
         {
             eblade.UseAbility(_target);
             Utils.Sleep(150 + Game.Ping, "eblade");
         }
         else if (adapt != null && adapt.CanBeCasted() && Utils.SleepCheck("adapt"))
         {
             adapt.UseAbility(_target);
             Utils.Sleep(150 + Game.Ping, "adapt");
         }
     }
 }
开发者ID:potassiumsquare,项目名称:Morph,代码行数:45,代码来源:Program.cs

示例3: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectMgr.LocalHero;
            if (!menuadded) return;
            lens = me.Modifiers.Any(x => x.Name == "modifier_item_aether_lens");
            if (lens)
            {
                Wrange = 900;
                Qrange = 1050;
                blinkrange = 1400;
                realWrange = Menu.Item("Wrealrange").GetValue<Slider>().Value + 200;
            }
            else
            {
                Wrange = 700;
                Qrange = 850;
                blinkrange = 1200;
                realWrange = Menu.Item("Wrealrange").GetValue<Slider>().Value;
            }
            target = me.ClosestToMouseTarget(Menu.Item("targetsearchrange").GetValue<Slider>().Value);
            if (target != null && target.IsMagicImmune())
            {
                var enemylist2 =
                    ObjectMgr.GetEntities<Hero>()
                        .Where(
                            e =>
                                e.Team != me.Team && e.IsAlive && e.IsVisible && !e.IsIllusion &&
                                !e.UnitState.HasFlag(UnitState.MagicImmune) && me.Distance2D(e) < realWrange);
                if (enemylist2.Count() != 0) target = enemylist2.MinOrDefault(x => x.Health);
            }
            var enemylist =
                ObjectMgr.GetEntities<Hero>()
                    .Where(
                        e =>
                            e.Team != me.Team && e.IsAlive && e.IsVisible && !e.IsIllusion &&
                            !e.UnitState.HasFlag(UnitState.MagicImmune) && e.IsChanneling());
            foreach (var channeling in enemylist)
            {
                if (me.Distance2D(channeling) < realWrange && channeling.GetChanneledAbility().ChannelTime() > 1)
                    target = channeling;
            }
            // Items
            orchid = me.FindItem("item_orchid");
            sheepstick = me.FindItem("item_sheepstick");
            veil = me.FindItem("item_veil_of_discord");
            soulring = me.FindItem("item_soul_ring");
            arcane = me.FindItem("item_arcane_boots");
            blink = me.FindItem("item_blink");
            shiva = me.FindItem("item_shivas_guard");
            halberd = me.FindItem("item_heavens_halberd");
            dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            refresher = me.FindItem("item_refresher");
            ethereal = me.FindItem("item_ethereal_blade");

            var refresherComboManacost = me.Spellbook.Spell4.ManaCost + me.Spellbook.Spell2.ManaCost +
                                         me.Spellbook.Spell1.ManaCost;

            // Manacost calculation
            if (veil != null)
                refresherComboManacost += veil.ManaCost;

            if (orchid != null)
                refresherComboManacost += orchid.ManaCost;

            if (sheepstick != null)
                refresherComboManacost += sheepstick.ManaCost;

            if (shiva != null)
                refresherComboManacost += shiva.ManaCost;

            if (halberd  != null)
                refresherComboManacost += halberd.ManaCost;

            if (dagon != null)
                refresherComboManacost += dagon.ManaCost;

            if (ethereal != null)
                refresherComboManacost += ethereal.ManaCost;

            if (refresher != null)
                refresherComboManacost += refresher.ManaCost;
            var qlvl = me.Spellbook.SpellQ.Level;
            var wlvl = me.Spellbook.SpellW.Level;
            var elvl = me.Spellbook.SpellE.Level;

            if (arcane != null && arcane.CanBeCasted() && me.MaximumMana > me.Mana + 135 && Utils.SleepCheck("arcane") && Menu.Item("arcaneauto").GetValue<bool>())
            {
                arcane.UseAbility();
                Utils.Sleep(Game.Ping+150, "arcane");
            }

            var creepQ =
                ObjectMgr.GetEntities<Unit>()
                    .Where(
                        creep =>
                            (creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
                             creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
                             creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral ||
                             creep.ClassID == ClassID.CDOTA_Unit_SpiritBear ||
                             creep.ClassID == ClassID.CDOTA_BaseNPC_Invoker_Forged_Spirit ||
//.........这里部分代码省略.........
开发者ID:Evervolv1337,项目名称:Ensage,代码行数:101,代码来源:Program.cs

示例4: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            _source = ObjectMgr.LocalHero;

            if (!Game.IsInGame||Game.IsPaused||Game.IsWatchingGame)
            {
                return;
            }
            if (_source.ClassID != ClassID.CDOTA_Unit_Hero_Bristleback)
            {
                return;
            }
            var _enemy = ObjectMgr.GetEntities<Hero>().Where(hero => hero.IsAlive && !hero.IsIllusion && hero.IsVisible && hero.Team != _source.Team);
            var _creep = ObjectMgr.GetEntities<Creep>().Where(x => (x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege) && x.IsAlive && x.IsSpawned && x.IsVisible).ToList();
            if (_source == null)
            {
                return;
            }
            if (Quill == null)
            {
                Quill = _source.Spellbook.Spell2;
            }
            if (Goo == null)
            {
                Goo = _source.Spellbook.Spell1;
            }
            if (abyssal == null)
            {
                abyssal = _source.FindItem("item_abyssal_blade");
            }
            if (dust == null)
            {
                dust = _source.FindItem("item_dust");
            }
            if (atos == null)
            {
                atos = _source.FindItem("item_rod_of_atos");
            }
            if (solar == null)
            {
                solar = _source.FindItem("item_solar_crest");
            }
            if (medallion == null)
            {
                medallion = _source.FindItem("item_medallion_of_courage");
            }
            if (halberd == null)
            {
                halberd = _source.FindItem("item_heavens_halberd");
            }
            if (Menu.Item("Quill").GetValue<StringList>().SelectedIndex == 3 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
            {

                foreach (var x in _creep)
                {
                    if (x.Team == _source.GetEnemyTeam() && x.Health > 0 && x.Health < (Quilldmg[Quill.Level-1] * (1-x.DamageResist)+20) && GetDistance2D(x.Position, _source.Position) < Quill.CastRange && Utils.SleepCheck("quill"))
                    {
                        Quill.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "quill");
                    }
                }
            }
            if (Menu.Item("Quill").GetValue<StringList>().SelectedIndex == 0 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
            {
                Quill.UseAbility();
                Utils.Sleep(150 + Game.Ping, "quill");
            }
            if (Menu.Item("Quill").GetValue<StringList>().SelectedIndex == 1 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
            {
                foreach (var enemy in _enemy)
                {
                    if (GetDistance2D(enemy.Position, _source.Position) < Quill.CastRange)
                    {
                        Quill.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "quill");
                    }
                }

            }
            if (chase && Menu.Item("enable").GetValue<bool>())
            {
                _target = _source.ClosestToMouseTarget(1000);
                if (_source.CanAttack() && _source.CanCast())
                {
                    var linken = _target.Modifiers.Any(x => x.Name == "modifier_item_spheretarget") || _target.Inventory.Items.Any(x => x.Name == "item_sphere");
                    if (abyssal != null && abyssal.CanBeCasted() && Utils.SleepCheck("item_abyssal") && !linken)
                    {
                        abyssal.UseAbility(_target);
                        Utils.Sleep(400 + Game.Ping, "item_abyssal");
                    }
                    if (abyssal != null)
                    {
                        Utils.ChainStun(_source, 310, null, false);
                    }
                    if (medallion != null && medallion.CanBeCasted() && Utils.SleepCheck("item_medal") && !linken)
                    {
                        medallion.UseAbility(_target);
                        Utils.Sleep(150 + Game.Ping, "item_medal");
                    }
                    if (atos != null && atos.CanBeCasted() && Utils.SleepCheck("item_atos") && !linken)
//.........这里部分代码省略.........
开发者ID:spyware293,项目名称:Ensage,代码行数:101,代码来源:Program.cs

示例5: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectMgr.LocalHero;

            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;

            if (me.ClassID != ClassID.CDOTA_Unit_Hero_Legion_Commander)
                return;

            if (me == null)
                return;

            if (Duel == null)
                Duel = me.Spellbook.Spell4;
            if (Heal == null)
                Heal = me.Spellbook.Spell2;
            if (Odds == null)
                Odds = me.Spellbook.Spell1;

            if (Blink == null)
                Blink = me.FindItem("item_blink");
            if (armlet == null)
                armlet = me.FindItem("item_armlet");
            if (mjollnir == null)
                mjollnir = me.FindItem("item_mjollnir");
            if (medallion == null)
                medallion = me.FindItem("item_medallion_of_courage");
            if (solar == null)
                solar = me.FindItem("item_solar_crest");
            if (soulRing == null)
                soulRing = me.FindItem("item_soul_ring");
            if (bkb == null)
                bkb = me.FindItem("item_black_king_bar");
            if (abyssal == null)
                abyssal = me.FindItem("item_abyssal_blade");
            if (dust == null)
                dust = me.FindItem("item_dust");
            if (bladeMail == null)
                bladeMail = me.FindItem("item_blade_mail");

            var duelManacost = Heal.ManaCost + Duel.ManaCost;

            // Main combo

            if (active && toggle)
            {
                target = me.ClosestToMouseTarget(1000);
                if (target != null && target.IsAlive && !target.IsInvul() && !target.IsIllusion)
                {
                    if (me.CanAttack() && me.CanCast()) {

                        var linkens = target.Modifiers.Any(x => x.Name == "modifier_item_spheretarget") || target.Inventory.Items.Any(x => x.Name == "item_sphere");

                        // here allied skills & items

                        if (soulRing != null && soulRing.CanBeCasted() && me.Mana < duelManacost && me.Health > 300 && Utils.SleepCheck("soulring"))
                        {
                            soulRing.UseAbility();
                            Utils.Sleep(150 + Game.Ping, "soulring");
                        }

                        if (bladeMail != null && bladeMail.CanBeCasted() && Utils.SleepCheck("blademail"))
                        {
                            bladeMail.UseAbility();
                            Utils.Sleep(150 + Game.Ping, "blademail");
                        }

                        if (armlet != null && armlet.CanBeCasted() && Utils.SleepCheck("armlet1") && !armlet.IsToggled)
                        {
                            armlet.ToggleAbility();
                            Utils.Sleep(150 + Game.Ping, "armlet1");
                        }

                        if (mjollnir != null && mjollnir.CanBeCasted() && Utils.SleepCheck("mjollnir"))
                        {
                            mjollnir.UseAbility(me);
                            Utils.Sleep(150 + Game.Ping, "mjollnir");
                        }

                        if (Heal.CanBeCasted() && Utils.SleepCheck("heal") && (!bkb.CanBeCasted() || !me.IsMagicImmune()))
                        {
                            Heal.UseAbility(me);
                            Utils.Sleep(150 + Game.Ping, "heal");
                        }
                        Utils.ChainStun(me, 100, null, false);

                        if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck("bkb") && bkbToggle)
                        {
                            bkb.UseAbility();
                            Utils.Sleep(150 + Game.Ping, "bkb");
                        }

                        Utils.ChainStun(me, 200, null, false);

                        // Blink

                        if (Blink != null && Blink.CanBeCasted() && me.Distance2D(target) > 300 && Utils.SleepCheck("blink1"))
                        {
                            Blink.UseAbility(target.Position);
//.........这里部分代码省略.........
开发者ID:unsteeled101,项目名称:EnsageSharp-3,代码行数:101,代码来源:Program.cs

示例6: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;

            if (!Game.IsInGame || Game.IsWatchingGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Pugna) return;
            if (!Menu.Item("enabled").IsActive())
                return;
            e = me.ClosestToMouseTarget(2000);
            if (e == null) return;

            //spell
            Q = me.Spellbook.SpellQ;

            W = me.Spellbook.SpellW;

            E = me.Spellbook.SpellE;

            R = me.Spellbook.SpellR;

            // Item
            ethereal = me.FindItem("item_ethereal_blade");

            sheep = e.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");

            vail = me.FindItem("item_veil_of_discord");

            cheese = me.FindItem("item_cheese");

            ghost = me.FindItem("item_ghost");

            orchid = me.FindItem("item_orchid");

            atos = me.FindItem("item_rod_of_atos");

            soulring = me.FindItem("item_soul_ring");

            arcane = me.FindItem("item_arcane_boots");

            blink = me.FindItem("item_blink");

            shiva = me.FindItem("item_shivas_guard");

            dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            //var ModifRod = e.Modifiers.Any(y => y.Name == "modifier_rod_of_atos_debuff");
            var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);

            if (Active && me.IsAlive && e.IsAlive && Utils.SleepCheck("Active"))
            {
                var noBlade = e.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");

                if (stoneModif) return;
                if (R.IsInAbilityPhase || me.Modifiers.Any(y => y.Name == "modifier_pugna_life_drain")) return;
                if (e.IsVisible && me.Distance2D(e) <= 2300 && !noBlade)
                {
                    if ((!me.IsChanneling() && !me.AghanimState()) || (me.AghanimState() && Menu.Item("agh").IsActive()))
                    {
                        if ( // atos Blade
                            atos != null
                            && atos.CanBeCasted()
                            && me.CanCast()
                            && !e.IsLinkensProtected()
                            && !e.IsMagicImmune()
                            && Utils.SleepCheck("atos")
                            && me.Distance2D(e) <= 2000
                            )
                        {
                            atos.UseAbility(e);
                            Utils.Sleep(250, "atos");
                        } // atos Item end
                        float angle = me.FindAngleBetween(e.Position, true);
                        Vector3 pos = new Vector3((float)(e.Position.X - 350 * Math.Cos(angle)), (float)(e.Position.Y - 350 * Math.Sin(angle)), 0);
                        if (
                            blink != null
                            && Q.CanBeCasted()
                            && me.CanCast()
                            && blink.CanBeCasted()
                            && me.Distance2D(e) >= 590
                            && me.Distance2D(pos) <= 1190
                            && Utils.SleepCheck("blink")
                            )
                        {
                            blink.UseAbility(pos);
                            Utils.Sleep(250, "blink");
                        }
                        if (
                            W != null
                            && W.CanBeCasted()
                            && (Q.CanBeCasted()
                            || R.CanBeCasted())
                            && me.CanCast()
                            && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(W.Name)
                            && me.Distance2D(e) < 1400
                            && Utils.SleepCheck("W")
                            )
                        {
                            W.UseAbility(e);
                            Utils.Sleep(200, "W");
                        }

//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例7: OnLoadEvent

        private static void OnLoadEvent(object sender, EventArgs args)
        {
            if (ObjectManager.LocalHero.ClassID != ClassID.CDOTA_Unit_Hero_ArcWarden) return;

            me = ObjectManager.LocalHero;
            e = me.ClosestToMouseTarget(1900);
            Print.LogMessage.Success("This beginning marks their end!");

            Menu.AddItem(new MenuItem("Combo Key", "Combo Key").SetValue(new KeyBind('D', KeyBindType.Press)));
            Menu.AddItem(new MenuItem("ComboAutoKey", "AutoKillTargetIllusion").SetValue(new KeyBind('F', KeyBindType.Toggle)));
            Menu.AddSubMenu(skills);
            Menu.AddSubMenu(items);
            Menu.AddSubMenu(ult);
            skills.AddItem(new MenuItem("Skills", "Skills").SetValue(new AbilityToggler(new Dictionary<string, bool>
            {
                {"arc_warden_flux",true},
                {"arc_warden_magnetic_field",true},
                {"arc_warden_spark_wraith",true},
                {"arc_warden_tempest_double",true}
            })));
            items.AddItem(new MenuItem("Items", ":").SetValue(new AbilityToggler(new Dictionary<string, bool>
            {
                {"item_necronomicon",true},
                {"item_orchid",true},
                {"item_black_king_bar", true},
                {"item_ethereal_blade",true},
                {"item_veil_of_discord",true},
                {"item_rod_of_atos",true},
                {"item_sheepstick",true},
                {"item_arcane_boots",true},
                {"item_blink",true},
                {"item_soul_ring",true},
                {"item_ghost",true},
                {"item_shivas_guard",true},
                {"item_cheese",true}
            })));
            ult.AddItem(new MenuItem("AutoMagnetic", "AutoMagnetic(W)").SetValue(new AbilityToggler(new Dictionary<string, bool>
            {
                {"arc_warden_magnetic_field",true}
            })));
            items.AddItem(new MenuItem("Heel", "Min targets to BKB").SetValue(new Slider(2, 1, 5)));
            items.AddItem(
                new MenuItem("BKB", "Options BKB.").SetValue(new StringList(new[]
                {
                    "Me",
                    "Clone",
                    "All",
                    "NoOne"
                }, 2))).SetTooltip("All include ally heroes too");
            items.AddItem(
                new MenuItem("Diff", "Options Diffusal").SetValue(new StringList(new[]
                {
                    "ME",
                    "CLONE",
                    "No One"
                }, 1)));
            items.AddItem(
                new MenuItem("Diffusal.Debuff", "Diffusal.Debuff").SetValue(new StringList(new[]
                {
                    "OnlyOneTarget",
                    "AllEnemiesInCastRange",
                    "No"
                }, 1)));
            items.AddItem(new MenuItem("nec", "Use Necronomicon").SetValue(true));
            //	skills.AddItem(new MenuItem("Link: ", "Auto triggre Linken").SetValue(new AbilityToggler(Link)));
            Menu.AddToMainMenu();
            Game.OnUpdate += Game_OnUpdate;
            Console.WriteLine("Zet combo loaded!");
        }
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:69,代码来源:Program.cs

示例8: Tick

        public static void Tick(EventArgs args)
        {
            // initial things
            me = ObjectMgr.LocalHero;
            if ((Game.IsKeyDown(Menu.Item("2001").GetValue<KeyBind>().Key)) || (Game.IsKeyDown(Menu.Item("2002").GetValue<KeyBind>().Key)) || target == null || Utils.SleepCheck("selected"))
            {
                target = me.ClosestToMouseTarget(1000);
                Utils.Sleep(1200,"selected");
            }
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame || Game.IsChatOpen)
                return;
            if (me.ClassID != ClassID.CDOTA_Unit_Hero_Necrolyte)
                return;
            if (me == null || target == null)
                return;
            // skills
            if (Qskill == null)
                Qskill = me.Spellbook.Spell1;
            if (Rskill == null)
                Rskill = me.Spellbook.Spell4;
            // itens
            Blink = me.FindItem("item_blink");
            shadow = me.FindItem("item_invis_sword");
            silveredge = me.FindItem("item_silver_edge");
            dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
            ethereal = me.FindItem("item_ethereal_blade");
            veil = me.FindItem("item_veil_of_discord");
            euls = me.FindItem("item_cyclone");
            shivas = me.FindItem("item_shivas_guard");
            malevo = me.FindItem("item_orchid");
            forcestaff = me.FindItem("item_force_staff");
            int ComboDamage = 0;
            if (target != null && !target.IsIllusion)
                ComboDamage = Damagetokill();
            else
                ComboDamage = 0;
            //Starting Combo
            var blinkposition = ((me.Position - target.Position) * 300 / me.Distance2D(target) + target.Position);
            var IsLinkensProtected = (target.Modifiers.Any(x => x.Name == "modifier_item_sphere_target") || (target.FindItem("item_sphere") != null && (target.FindItem("item_sphere").Cooldown <= 0)));
            var _Is_in_Advantage = (target.Modifiers.Any(x => x.Name == "modifier_item_blade_mail_reflect") || target.Modifiers.Any(x => x.Name == "modifier_item_lotus_orb_active") || target.Modifiers.Any(x => x.Name == "modifier_nyx_assassin_spiked_carapace") || target.Modifiers.Any(x => x.Name == "modifier_templar_assassin_refraction_damage") || target.Modifiers.Any(x => x.Name == "modifier_ursa_enrage") || target.Modifiers.Any(x => x.Name == "modifier_abaddon_borrowed_time") || (target.Modifiers.Any(x => x.Name == "modifier_dazzle_shallow_grave")));
            var WindWalkMod = me.Modifiers.Any(x => x.Name == "modifier_item_silver_edge_windwalk" || x.Name == "modifier_item_invisibility_edge_windwalk");
            if (((Game.IsKeyDown(Menu.Item("2001").GetValue<KeyBind>().Key) && (ComboDamage <= 0 || stage == 1) && me.Distance2D(target) <= 1000 && target.IsVisible && target.IsAlive && !target.IsMagicImmune() && !target.IsIllusion && target != null && !_Is_in_Advantage) || ( me.Distance2D(target) <= 1000 && target.IsVisible && target.IsAlive && !target.IsMagicImmune() && !target.IsIllusion && target != null && Game.IsKeyDown(Menu.Item("2002").GetValue<KeyBind>().Key))) && Utils.SleepCheck("combo"))
            {
                stage = 1;
                if (me.CanCast() && !me.IsChanneling())
                {
                    if (WindWalkMod)
                    {
                        me.Attack(target);
                        Utils.ChainStun(me, Game.Ping + shadow.GetCastDelay(me, target, true, true), null, false);
                    }
                    else
                    {
                        if (IsLinkensProtected && (!WindWalkMod))
                        {
                            if (euls != null && euls.Cooldown <= 0 && IsLinkensProtected && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(euls.Name))
                            {
                                euls.UseAbility(target);
                                Utils.ChainStun(me,Game.Ping+euls.GetCastDelay(me,target,true,true),null,false);
                            }
                            else if (forcestaff != null && forcestaff.Cooldown <= 0 && IsLinkensProtected && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(forcestaff.Name))
                            {
                                forcestaff.UseAbility(target);
                                Utils.ChainStun(me, Game.Ping + forcestaff.GetCastDelay(me, target, true, true), null, false);
                            }
                            else if (dagon != null && dagon.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_dagon"))
                            {
                                dagon.UseAbility(target);
                                Utils.ChainStun(me, Game.Ping + dagon.GetCastDelay(me, target, true, true), null, false);
                            }
                            else if (ethereal != null && ethereal.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name))
                            {
                                ethereal.UseAbility(target);
                                Utils.ChainStun(me, Game.Ping + ethereal.GetCastDelay(me, target, true, true), null, false);
                            }
                        }
                        else if (!IsLinkensProtected && (!WindWalkMod))
                        {
                            if (Blink != null && Blink.Cooldown <= 0 && me.Distance2D(blinkposition) > 300 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Blink.Name))
                            {
                                Blink.UseAbility(blinkposition);
                                Utils.ChainStun(me, Game.Ping + Blink.GetCastDelay(me, target, true, true), null, false);
                            }
                            if (malevo != null && malevo.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(malevo.Name))
                            {
                                malevo.UseAbility(target);
                                Utils.ChainStun(me, Game.Ping + malevo.GetCastDelay(me, target, true, true), null, false);
                            }
                            if (Rskill.Cooldown <= 0 && Menu.Item("Abilities: ").GetValue<AbilityToggler>().IsEnabled(Rskill.Name))
                            {
                                Rskill.UseAbility(target);
                                Utils.ChainStun(me, Game.Ping + Rskill.GetCastDelay(me, target, true, true), null, false);
                            }
                            if (ethereal != null && ethereal.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name))
                            {
                                ethereal.UseAbility(target);
                                Utils.ChainStun(me, Game.Ping + ethereal.GetCastDelay(me, target, true, true), null, false);
                                ethereal_used = true;
                                ethereal_used2 = true;
                            }
//.........这里部分代码省略.........
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:101,代码来源:Necrophos.cs

示例9: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectMgr.LocalHero;
            var targets = ObjectMgr.GetEntities<Hero>().Where(enemy => enemy.Team == me.GetEnemyTeam() && !enemy.IsIllusion() && enemy.IsVisible && enemy.IsAlive && enemy.Health > 0).ToList();
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;

            if (me.ClassID != ClassID.CDOTA_Unit_Hero_AntiMage)
                return;

            if (me == null)
                return;
            if (ulti == null)
                ulti = me.Spellbook.Spell4;

            if (Menu.Item("Killsteal").GetValue<bool>())
            {
                double modif = 0;
                switch (ulti.Level)
                {
                    case 1:
                        modif = .6;
                        break;

                    case 2:
                        modif = .85;
                        break;

                    case 3:
                        modif = 1.1;
                        break;
                    default:
                        break;
                }

                foreach (var target in targets)
                {
                    double damage = 0;
                    damage = Math.Floor((target.MaximumMana - target.Mana) * modif);
                    double damagefinal = target.DamageTaken((float)damage, DamageType.Magical, me, false);
                    double damageNeeded = target.Health - damagefinal + ulti.GetCastPoint(ulti.Level) * target.HealthRegeneration;
                    if (damageNeeded < 0 && ulti.CanBeCasted() && Utils.SleepCheck("ulti") && GetDistance2D(target.Position, me.Position) < 600)
                    {
                        ulti.UseAbility(target);
                        Utils.Sleep(150 + Game.Ping, "ulti");
                    }
                }
            }

            if (blink == null)
                blink = me.Spellbook.Spell2;

            if (armlet == null)
                armlet = me.FindItem("item_armlet");
            if (manta == null)
                manta = me.FindItem("item_manta");
            if (mjollnir == null)
                mjollnir = me.FindItem("item_mjollnir");
            if (dust == null)
                dust = me.FindItem("item_dust");
            if (bladeMail == null)
                bladeMail = me.FindItem("item_blade_mail");
            if (mom == null)
                mom = me.FindItem("item_mask_of_madness");
            if (medallion == null)
                medallion = me.FindItem("item_medallion_of_courage");
            if (solar == null)
                solar = me.FindItem("item_solar_crest");
            if (abyssal == null)
                abyssal = me.FindItem("item_abyssal_blade");

            if (manta != null && manta.CanBeCasted() && Menu.Item("Manta").GetValue<bool>() && me.IsSilenced())
            {
                manta.UseAbility();
                Utils.Sleep(150 + Game.Ping, "manta");
            }

            var illus = ObjectMgr.GetEntities<Hero>().Where(x => x.IsAlive && x.IsControllable && x.Team == me.Team && x.IsIllusion && x.Modifiers.Any(y => y.Name != "modifier_kill")).ToList();

            if (Menu.Item("Illusion").GetValue<bool>())
            {
                foreach (var enemy in targets)
                {
                    if (enemy.Health > 0)
                    {
                        foreach (var illusion in illus)
                        {
                            if (GetDistance2D(enemy.Position, illusion.Position) < 400 && Utils.SleepCheck(illusion.Handle.ToString()))
                            {
                                illusion.Attack(enemy);
                                Utils.Sleep(1000, illusion.Handle.ToString());
                            }
                        }
                    }
                }
            }
            if (combo && Menu.Item("enable").GetValue<bool>())
            {
                target = me.ClosestToMouseTarget(1000);

//.........这里部分代码省略.........
开发者ID:spyware293,项目名称:Ensage,代码行数:101,代码来源:Program.cs

示例10: Tinker_In_Madness

 public static void Tinker_In_Madness(EventArgs args)
 {
     if (!Game.IsInGame || Game.IsWatchingGame)
         return;
     me = ObjectMgr.LocalHero;
     if (me == null)
         return;
     if (me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
         return;
     if ((Game.IsKeyDown(Menu.Item("Combo Key").GetValue<KeyBind>().Key)) && !Game.IsChatOpen)
     {
         target = me.ClosestToMouseTarget(1000);
         if (target != null && target.IsAlive && !target.IsIllusion && !me.IsChanneling())
         {
             autoattack(true);
             FindItems();
             if (target.IsLinkensProtected())
             {
                 if (euls != null && euls.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(euls.Name))
                 {
                     if (Utils.SleepCheck("TimingToLinkens"))
                     {
                         euls.UseAbility(target);
                         Utils.Sleep(200, "TimingToLinkens");
                     }
                 }
                 else if (forcestaff != null && forcestaff.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(forcestaff.Name))
                 {
                     if (Utils.SleepCheck("TimingToLinkens"))
                     {
                         forcestaff.UseAbility(target);
                         Utils.Sleep(200, "TimingToLinkens");
                     }
                 }
                 else if (Ethereal != null && Ethereal.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Ethereal.Name))
                 {
                     if (Utils.SleepCheck("TimingToLinkens"))
                     {
                         Ethereal.UseAbility(target);
                         Utils.Sleep(200, "TimingToLinkens");
                         Utils.Sleep((me.NetworkPosition.Distance2D(target.NetworkPosition) / 650) * 1000, "TimingToLinkens");
                     }
                 }
                 else if (Laser != null && Laser.CanBeCasted() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Laser.Name))
                 {
                     if (Utils.SleepCheck("TimingToLinkens"))
                     {
                         Laser.UseAbility(target);
                         Utils.Sleep(200, "TimingToLinkens");
                     }
                 }
                 else if (Dagon != null && Dagon.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_dagon"))
                 {
                     if (Utils.SleepCheck("TimingToLinkens"))
                     {
                         Dagon.UseAbility(target);
                         Utils.Sleep(200, "TimingToLinkens");
                     }
                 }
                 else if (Hex != null && Hex.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Hex.Name))
                 {
                     if (Utils.SleepCheck("TimingToLinkens"))
                     {
                         Hex.UseAbility(target);
                         Utils.Sleep(200, "TimingToLinkens");
                     }
                 }
             }
             else
             {
                 uint elsecount = 0;
                 bool magicimune = (!target.IsMagicImmune() && !target.Modifiers.Any(x => x.Name == "modifier_eul_cyclone"));
                 if (Utils.SleepCheck("combo"))
                 {
                     // glimmer -> ghost -> soulring -> hex -> laser -> ethereal -> dagon -> rocket -> shivas -> euls -> refresh
                     if (glimmer != null && glimmer.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(glimmer.Name) && Utils.SleepCheck("Rearm"))
                         glimmer.UseAbility(me);
                     else
                         elsecount += 1;
                     if (ghost != null && Ethereal == null && ghost.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(ghost.Name) && Utils.SleepCheck("Rearm"))
                         ghost.UseAbility();
                     else
                         elsecount += 1;
                     if (Soulring != null && Soulring.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Soulring.Name) && Utils.SleepCheck("Rearm"))
                         Soulring.UseAbility();
                     else
                         elsecount += 1;
                     if (Hex != null && Hex.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Hex.Name) && magicimune && Utils.SleepCheck("Rearm"))
                         Hex.UseAbility(target);
                     else
                         elsecount += 1;
                     if (Laser != null && Laser.CanBeCasted() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Laser.Name) && magicimune && Utils.SleepCheck("Rearm"))
                         Laser.UseAbility(target);
                     else
                         elsecount += 1;
                     if (Ethereal != null && Ethereal.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Ethereal.Name) && magicimune && Utils.SleepCheck("Rearm"))
                     {
                         Ethereal.UseAbility(target);
                         if (Utils.SleepCheck("EtherealTime") && me.Distance2D(target) <= Ethereal.CastRange)
                             Utils.Sleep((me.NetworkPosition.Distance2D(target.NetworkPosition) / 620) * 1000, "EtherealTime");
//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:EnsageSharp-4,代码行数:101,代码来源:Tinker_Perfect_type.cs

示例11: markedfordeath

 static void markedfordeath(EventArgs args)
 {
     if (!Game.IsInGame || Game.IsWatchingGame)
         return;
     me = ObjectMgr.LocalHero;
     if (me == null)
         return;
     if (me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
         return;
     target = me.ClosestToMouseTarget(50000);
     if (target != null && !target.IsIllusion && target.IsAlive)
     {
         Vector2 target_health_bar = HeroPositionOnScreen(target);
         Drawing.DrawText("Marked for Death", target_health_bar, new Vector2(18, 200), me.Distance2D(target) < 1200 ? Color.Red : Color.Azure, FontFlags.AntiAlias | FontFlags.Additive | FontFlags.DropShadow);
     }
 }
开发者ID:VickTheRock,项目名称:EnsageSharp-4,代码行数:16,代码来源:Tinker_Perfect_type.cs

示例12: Working

 public static void Working(EventArgs args)
 {
     if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
         return;
     me = ObjectMgr.LocalHero;
     if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Legion_Commander)
         return;
     if (Game.IsKeyDown(Menu.Item("Black King Bar Toggle").GetValue<KeyBind>().Key) && !Game.IsChatOpen && Utils.SleepCheck("BKBTOGGLE"))
     {
         defensive_items["item_black_king_bar"] = !Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled("item_black_king_bar");
         Utils.Sleep(750, "BKBTOGGLE");
     }
         if (Game.IsKeyDown(Menu.Item("DUEL!").GetValue<KeyBind>().Key) && !Game.IsChatOpen)
     {
         FindItems();
         target = me.ClosestToMouseTarget(1000);
         if (target != null && target.IsAlive && !target.IsIllusion && !target.IsInvul() && (blink != null ? me.Distance2D(target) <= 1300 : me.Distance2D(target) <= 600))
         {
             if (me.CanAttack() && me.CanCast())
             {
                 if (CanInvisCrit(me))
                     me.Attack(target);
                 else
                 {
                     manacheck();
                     if (target.IsLinkensProtected())
                     {
                         if ((cyclone.CanBeCasted() || force.CanBeCasted() || halberd.CanBeCasted() || vyse.CanBeCasted() || abyssal.CanBeCasted()) && Utils.SleepCheck("Combo2"))
                         {
                             if (blademail != null && blademail.Cooldown <= 0 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(blademail.Name) && me.Mana - blademail.ManaCost >= 75)
                                 blademail.UseAbility();
                             if (satanic != null && satanic.Cooldown <= 0 && me.Health <= me.MaximumHealth * 0.5 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(satanic.Name))
                                 satanic.UseAbility();
                             if (crimson != null && crimson.Cooldown <= 0 && Menu.Item("Consume Items").GetValue<AbilityToggler>().IsEnabled(crimson.Name))
                                 crimson.UseAbility();
                             if (buckler != null && buckler.Cooldown <= 0 && Menu.Item("Consume Items").GetValue<AbilityToggler>().IsEnabled(buckler.Name) && me.Mana - buckler.ManaCost >= 75)
                                 buckler.UseAbility();
                             if (lotusorb != null && lotusorb.Cooldown <= 0 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(lotusorb.Name) && me.Mana - lotusorb.ManaCost >= 75)
                                 lotusorb.UseAbility(me);
                             if (mjollnir != null && mjollnir.Cooldown <= 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(mjollnir.Name) && me.Mana - mjollnir.ManaCost >= 75)
                                 mjollnir.UseAbility(me);
                             if (armlet != null && !armlet.IsToggled && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(armlet.Name) && Utils.SleepCheck("armlet"))
                             {
                                 armlet.ToggleAbility();
                                 Utils.Sleep(300, "armlet");
                             }
                             if (madness != null && madness.Cooldown <= 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(madness.Name) && me.Mana - madness.ManaCost >= 75)
                                 madness.UseAbility();
                             if (Heal != null && Heal.Level > 0 && Heal.Cooldown <= 0 && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(Heal.Name) && !me.IsMagicImmune() && me.Mana - Heal.ManaCost >= 75)
                                 Heal.UseAbility(me);
                             if (bkb != null && bkb.Cooldown <= 0 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(bkb.Name) && (!Heal.CanBeCasted() || Heal == null))
                                 bkb.UseAbility();
                             if (blink != null && blink.Cooldown <= 0 && me.Distance2D(target) <= 1300 && me.Distance2D(target) >= 200 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(blink.Name))
                                 blink.UseAbility(target.Position);
                             if (urn != null && urn.CurrentCharges > 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(urn.Name))
                                 urn.UseAbility(target);
                             if (solar != null && solar.CanBeCasted() && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(solar.Name))
                                 solar.UseAbility(target);
                             if (medallion != null && medallion.CanBeCasted() && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(medallion.Name))
                                 medallion.UseAbility(target);
                             if (cyclone != null && cyclone.CanBeCasted() && Utils.SleepCheck("CycloneRemoveLinkens") && Menu.Item("Remove Linkens Items").GetValue<AbilityToggler>().IsEnabled(cyclone.Name) && me.Mana - cyclone.ManaCost >= 75)
                             {
                                 cyclone.UseAbility(target);
                                 Utils.Sleep(100, "CycloneRemoveLinkens");
                             }
                             else if (force != null && force.CanBeCasted() && Utils.SleepCheck("ForceRemoveLinkens") && Menu.Item("Remove Linkens Items").GetValue<AbilityToggler>().IsEnabled(force.Name) && me.Mana - force.ManaCost >= 75)
                             {
                                 force.UseAbility(target);
                                 Utils.Sleep(100, "ForceRemoveLinkens");
                             }
                             else if (halberd != null && halberd.CanBeCasted() && Utils.SleepCheck("halberdLinkens") && Menu.Item("Remove Linkens Items").GetValue<AbilityToggler>().IsEnabled(halberd.Name) && me.Mana - halberd.ManaCost >= 75)
                             {
                                 halberd.UseAbility(target);
                                 Utils.Sleep(100, "halberdLinkens");
                             }
                             else if (vyse != null && vyse.CanBeCasted() && Utils.SleepCheck("vyseLinkens") && Menu.Item("Remove Linkens Items").GetValue<AbilityToggler>().IsEnabled(vyse.Name) && me.Mana - vyse.ManaCost >= 75)
                             {
                                 vyse.UseAbility(target);
                                 Utils.Sleep(100, "vyseLinkens");
                             }
                             else if (abyssal != null && abyssal.CanBeCasted() && Utils.SleepCheck("abyssal") && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(abyssal.Name) && me.Mana - abyssal.ManaCost >= 75)
                             {
                                 abyssal.UseAbility(target);
                                 Utils.Sleep(100, "abyssal");
                             }
                             Utils.Sleep(200, "Combo2");
                         }
                     }
                     else
                     {
                         if (UsedInvis(target))
                         {
                             if (me.Distance2D(target) <= 500)
                             {
                                 if (dust != null && dust.CanBeCasted() && Utils.SleepCheck("dust") && dust != null && Menu.Item("Consume Items").GetValue<AbilityToggler>().IsEnabled(dust.Name))
                                 {
                                     dust.UseAbility();
                                     Utils.Sleep(100, "dust");
                                 }
                                 else if (sentry != null && sentry.CanBeCasted() && Utils.SleepCheck("sentry") && sentry != null && Menu.Item("Consume Items").GetValue<AbilityToggler>().IsEnabled(sentry.Name))
//.........这里部分代码省略.........
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:101,代码来源:ChallengeAccepted.cs

示例13: Game_OnUpdate

		public static void Game_OnUpdate(EventArgs args)
		{
			me = ObjectMgr.LocalHero;
			if (me == null || !Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
			{
				return;
			}
			// Ability init
			Laser = me.Spellbook.Spell1;
			Rocket = me.Spellbook.Spell2;
			ReArm = me.Spellbook.Spell4;
			// Item init
			Blink = me.FindItem("item_blink");
			Dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
			Hex = me.FindItem("item_sheepstick");
			Soulring = me.FindItem("item_soul_ring");
			Ethereal = me.FindItem("item_ethereal_blade");
			Veil = me.FindItem("item_veil_of_discord");
			Orchid = me.FindItem("item_orchid");
			Shiva = me.FindItem("item_shivas_guard");
			Glimmer = me.FindItem("item_glimmer_cape");
			// Manacost calculations
			var manaForCombo = Laser.ManaCost + Rocket.ManaCost;
			if (Dagon != null && Dagon.CanBeCasted())
				manaForCombo += 180;
			if (Hex != null && Hex.CanBeCasted())
				manaForCombo += 100;
			if (Ethereal != null && Ethereal.CanBeCasted())
				manaForCombo += 150;
			if (Veil != null && Veil.CanBeCasted())
				manaForCombo += 50;
			if (Shiva != null && Shiva.CanBeCasted())
				manaForCombo += 100;
			if (Glimmer != null && Glimmer.CanBeCasted())
				manaForCombo += 110;
			// Glimmer Use on Boots of Travel
			if (Glimmer !=null && me.IsChanneling() && Glimmer.CanBeCasted() && Utils.SleepCheck("Glimmer") && !ReArm.IsChanneling && (SubMenu.Item("safeglimmer").GetValue<bool>()))
				{
					Glimmer.UseAbility(me);
					Utils.Sleep(100 + Game.Ping, "Glimmer");
				}
			// Blink Use to Hide After Travel
			if (Blink !=null && !me.IsChanneling() && Blink.CanBeCasted() && Utils.SleepCheck("Blink") && (Menu.Item("safeblink").GetValue<KeyBind>().Active))
			{
				Blink.UseAbility(Game.MousePosition);
				Utils.Sleep(1000 + Game.Ping, "Blink");
			}
			// Main combo
			if (active && toggle)
			{
				target = me.ClosestToMouseTarget(1000);
				if ((target == null || !target.IsVisible) && !me.IsChanneling())
				{
					me.Move(Game.MousePosition);
				}
				if (target != null && target.IsAlive && !target.IsIllusion && !target.IsMagicImmune() && Utils.SleepCheck("ReArm") && !me.IsChanneling() && (me.Distance2D(target) < 3000))
				{
					if (Soulring != null && Soulring.CanBeCasted() && me.Health > 300 && Utils.SleepCheck("soulring"))
					{
						Soulring.UseAbility();
						Utils.Sleep(150 + Game.Ping, "soulring");
					}
					// Blink
					if (Blink != null && Blink.CanBeCasted() && (me.Distance2D(target) > 500) && Utils.SleepCheck("Blink") && blinkToggle)
					{
						Blink.UseAbility(target.Position);
						Utils.Sleep(1000 + Game.Ping, "Blink");
					}
					// Items
					else if (Shiva != null && Shiva.CanBeCasted() && Utils.SleepCheck("shiva"))
					{
						Shiva.UseAbility();
						Utils.Sleep(100 + Game.Ping, "shiva");
						Utils.ChainStun(me, 200 + Game.Ping, null, false);
					}
					else if (Veil != null && Veil.CanBeCasted() && Utils.SleepCheck("veil"))
					{
						Veil.UseAbility(target.Position);
						Utils.Sleep(150 + Game.Ping, "veil");
						Utils.Sleep(300 + Game.Ping, "ve");
						Utils.ChainStun(me, 170 + Game.Ping, null, false);
					}
					else if (Hex != null && Hex.CanBeCasted() && Utils.SleepCheck("hex"))
					{
						Hex.UseAbility(target);
						Utils.Sleep(150 + Game.Ping, "hex");
						Utils.Sleep(300 + Game.Ping, "h");
						Utils.ChainStun(me, 170 + Game.Ping, null, false);
					}
					else if (Ethereal != null && Ethereal.CanBeCasted() && Utils.SleepCheck("ethereal"))
					{
						Ethereal.UseAbility(target);
						Utils.Sleep(270 + Game.Ping, "ethereal");
						Utils.ChainStun(me, 200 + Game.Ping, null, false);
					}
					else if (Dagon != null && Dagon.CanBeCasted() && Utils.SleepCheck("ethereal") && Utils.SleepCheck("h") && Utils.SleepCheck("dagon") && Utils.SleepCheck("veil"))
					{
						Dagon.UseAbility(target);
						Utils.Sleep(270 + Game.Ping, "dagon");
						Utils.ChainStun(me, 200 + Game.Ping, null, false);
//.........这里部分代码省略.........
开发者ID:oleg9522,项目名称:Ensage,代码行数:101,代码来源:Program.cs

示例14: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;
            if (!Menu.Item("controll").GetValue<KeyBind>().Active || !Game.IsInGame || me == null || Game.IsPaused ||
                Game.IsChatOpen) return;

            target = me.ClosestToMouseTarget(10000);

            if (Utils.SleepCheck("delay"))
            {

                if (me.IsAlive)
                {

                    var Additive = ObjectManager.GetEntities<Unit>().Where(x => (x.ClassID == ClassID.CDOTA_BaseNPC_Additive)
                    && x.IsAlive && x.IsControllable && x.Team == me.Team).ToList();
                    if (me.ClassID == ClassID.CDOTA_Unit_Hero_Juggernaut)
                    {
                        for (int i = 0; i < Additive.Count(); i++)
                        {
                            if (Additive[i].Name == "npc_dota_juggernaut_healing_ward")

                            {

                                if (me.Position.Distance2D(Additive[i].Position) > 5 && Utils.SleepCheck(Additive[i].Handle.ToString()))
                                {
                                    Additive[i].Move(me.Position);
                                    Utils.Sleep(50, Additive[i].Handle.ToString());
                                }
                            }
                        }
                    }

                }
                var Neutral = ObjectManager.GetEntities<Creep>().Where(creep => creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral &&
                                     creep.IsAlive && creep.Team == me.Team && creep.IsControllable).ToList();

                for (int i = 0; i < Neutral.Count(); i++)
                {
                    var v =
                               ObjectManager.GetEntities<Hero>()
                                   .Where(x => x.Team == me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion).ToList();

                    if (Neutral[i].Name == "npc_dota_neutral_ogre_magi")
                    {

                        for (int z = 0; z < v.Count(); z++)
                        {
                            var armor = Neutral[i].Spellbook.SpellQ;

                            if (!v[z].Modifiers.Any(y => y.Name == "modifier_ogre_magi_frost_armor") && armor.CanBeCasted() && Neutral[i].Position.Distance2D(v[z]) <= 900
                                && Utils.SleepCheck(Neutral[i].Handle.ToString()))
                            {
                                armor.UseAbility(v[z]);
                                Utils.Sleep(400, Neutral[i].Handle.ToString());
                            }
                        }
                    }
                    if (Neutral[i].Name == "npc_dota_neutral_forest_troll_high_priest")
                    {

                        for (int z = 0; z < v.Count(); z++)
                        {
                            if (Neutral[i].Spellbook.SpellQ.CanBeCasted() && Neutral[i].Position.Distance2D(v[z]) <= 900)
                            {
                                if (v[z].Health <= (v[z].MaximumHealth * 0.9)
                                    && Utils.SleepCheck(Neutral[i].Handle.ToString() + "high_priest"))
                                {
                                    Neutral[i].Spellbook.SpellQ.UseAbility(v[z]);
                                    Utils.Sleep(350, Neutral[i].Handle.ToString() + "high_priest");
                                }
                            }
                        }
                    }
                }

                if (target == null)
                    return;

                if (target.IsAlive && !target.IsInvul() && (Game.MousePosition.Distance2D(target) <= 1000 || target.Distance2D(me) <= 600))
                {

                    //spell
                    var CheckStun = target.HasModifier("modifier_centaur_hoof_stomp");
                    var CheckSetka = target.HasModifier("modifier_dark_troll_warlord_ensnare");

                    for (int i = 0; i < Neutral.Count(); i++)
                    {

                        if (Neutral[i].Name == "npc_dota_neutral_dark_troll_warlord")
                        {
                            if (target.Position.Distance2D(Neutral[i].Position) < 550 && (!CheckSetka || !CheckStun || !target.IsHexed() || !target.IsStunned()) && Neutral[i].Spellbook.SpellQ.CanBeCasted() &&
                                     Utils.SleepCheck(Neutral[i].Handle.ToString() + "warlord"))
                            {
                                Neutral[i].Spellbook.SpellQ.UseAbility(target);
                                Utils.Sleep(450, Neutral[i].Handle.ToString() + "warlord");
                            }
                        }
                        else
                        if (Neutral[i].Name == "npc_dota_neutral_big_thunder_lizard")
//.........这里部分代码省略.........
开发者ID:Rulfy,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例15: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            if (!Game.IsInGame) return;
            _me = ObjectMgr.LocalHero;
            if (_me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_TemplarAssassin)
            {
                return;
            }
            if (!_activated) return;

            if(_target == null || _me.Distance2D(_target) > 500)
                _target = _me.ClosestToMouseTarget();

            var refraction = _me.Spellbook.SpellQ;
            var meld = _me.Spellbook.SpellW;
            var psionicTrap = _me.Spellbook.SpellR;

            var stick = _me.FindItem("item_magic_stick");
            var wand = _me.FindItem("item_magic_wand");
            var cheese = _me.FindItem("item_cheese");

            //var phase = _me.FindItem("item_phase_boots");
            //var manta = _me.FindItem("item_manta");
            var orchid = _me.FindItem("item_orchid");
            var satanic = _me.FindItem("item_satanic");
            var mjollnir = _me.FindItem("item_mjollnir");
            var blinkDagger = _me.FindItem("item_blink");
            var bkb = _me.FindItem("item_black_king_bar");
            var abyssal = _me.FindItem("item_abyssal_blade");
            var halberd = _me.FindItem("item_heavens_halberd");
            var diffusal = _me.FindItem("item_diffusal_blade");
            var maskofmadness = _me.FindItem("item_mask_of_madness");

            if (_target != null && _target.IsAlive && !_target.IsInvul())
            {
                if(!Utils.SleepCheck("TA_Combo_Wait")) return;
                var targetDistance = _me.Distance2D(_target);
                var attackRange = 190 + (60 * _me.Spellbook.Spell3.Level);
                if (targetDistance <= 1200 && targetDistance > attackRange && CanCast(_me, blinkDagger) && Utils.SleepCheck("BlinkDagger"))
                {
                    blinkDagger.UseAbility(_target.Position);
                    Utils.Sleep(150 + Game.Ping, "BlinkDagger");
                }
                if (!(targetDistance <= attackRange)) return;
                if (CanCast(_me, bkb) && _bkbToggle && Utils.SleepCheck("BKB")) {
                    bkb.UseAbility();
                    Utils.Sleep(150 + Game.Ping, "BKB");
                }
                if (CanCast(_me, mjollnir) && Utils.SleepCheck("mjollnir")) {
                    mjollnir.UseAbility(_me);
                    Utils.Sleep(150 + Game.Ping, "mjollnir");
                }
                if (CanCast(_me, abyssal) && Utils.SleepCheck("abyssal")) {
                    abyssal.UseAbility(_target);
                    Utils.Sleep(150 + Game.Ping, "abyssal");
                }
                if (CanCast(_me, diffusal) && !_target.IsMagicImmune() && _target.Modifiers.FirstOrDefault(modifier => modifier.Name == "modifier_item_diffusal_blade_slow") == null && Utils.SleepCheck("diffusal")) {
                    diffusal.UseAbility(_target);
                    Utils.Sleep(150 + Game.Ping, "diffusal");
                }
                if (CanCast(_me, orchid) && !_target.IsMagicImmune() && Utils.SleepCheck("orchid")) {
                    orchid.UseAbility(_target);
                    Utils.Sleep(150 + Game.Ping, "orchid");
                }
                if (CanCast(_me, halberd) && !_target.IsMagicImmune() && Utils.SleepCheck("halberd")) {
                    halberd.UseAbility(_target);
                    Utils.Sleep(150 + Game.Ping, "halberd");
                }
                if (CanCast(_me, maskofmadness) && Utils.SleepCheck("maskofmadness")) {
                    maskofmadness.UseAbility();
                    Utils.Sleep(150 + Game.Ping, "maskofmadness");
                }
                if (((decimal)_me.Health / _me.MaximumHealth <= (decimal)0.3) && Utils.SleepCheck("Stick/Wand/Cheese"))
                    if ((CanCast(_me, stick) || CanCast(_me, wand)) || CanCast(_me, cheese))
                    {
                        if (wand != null && wand.CurrentCharges > 0)
                            wand.UseAbility();
                        else if (stick != null && stick.CurrentCharges > 0)
                            stick.UseAbility();
                        if (cheese != null)
                            cheese.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "Stick/Wand/Cheese");
                    }

                if (CanCast(_me, satanic) && ((double)_me.Health / _me.MaximumHealth <= 0.3))
                    satanic.UseAbility();

                if (CanCast(_me, refraction) && Utils.SleepCheck("Refraction")) {
                    refraction.UseAbility();
                    Utils.Sleep(150 + Game.Ping, "Refraction");
                }
                if (CanCast(_me, psionicTrap) && Utils.SleepCheck("PsionicTrap")) {
                    psionicTrap.UseAbility(_target.Position);
                    Utils.Sleep(150 + Game.Ping, "PsionicTrap");
                }
                var traps = ObjectMgr.GetEntities<Unit>().Where(unit => unit.Name == "npc_dota_templar_assassin_psionic_trap" && _target.Distance2D(unit) <= 370).ToList();
                if (!traps.Any()) return;
                var closestTrap = traps.First();
                if (closestTrap.CanCast() && Utils.SleepCheck("trap")) {
                    closestTrap.Spellbook.Spell1.UseAbility();
//.........这里部分代码省略.........
开发者ID:rizkutuz,项目名称:TemplarCombo,代码行数:101,代码来源:Program.cs


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