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


C# Hero.IsChanneling方法代码示例

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


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

示例1: Tick

 public static void Tick(EventArgs args)
 {
     if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame || Game.IsChatOpen)
         return;
     me = ObjectMgr.LocalHero;
     if (me == null)
         return;
     if (me.IsAlive)
     {
         FindItems();
         PercentStickUse = ((double)Menu.Item("Percent Configuration").GetValue<Slider>().Value / 100);
         if ( item_bottle != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && me.Modifiers.Any(x => x.Name == "modifier_fountain_aura_buff") && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_bottle.Name) && Utils.SleepCheck("bottle"))
         {
             if(!me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && (me.Health < me.MaximumHealth || me.Mana < me.MaximumMana))
                 item_bottle.UseAbility(false);
             Alies = ObjectMgr.GetEntities<Hero>().Where(x => x.Team == me.Team && x != me && (x.Health < x.MaximumHealth || x.Mana < x.MaximumMana) && !x.Modifiers.Any(y => y.Name == "modifier_bottle_regeneration") && x.IsAlive && !x.IsIllusion && x.Distance2D(me) <= item_bottle.CastRange).ToList();
             foreach (Hero v in Alies)
                 if (v != null)
                     item_bottle.UseAbility(v,false);
             Utils.Sleep(300, "bottle");
         }
         if (item_phase_boots != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && item_phase_boots.CanBeCasted() && me.NetworkActivity == NetworkActivity.Move && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_phase_boots.Name) && Utils.SleepCheck("phaseboots"))
         {
             item_phase_boots.UseAbility(false);
             Utils.Sleep(300, "phaseboots");
         }
         if (item_magic_stick != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && item_magic_stick.CanBeCasted() && item_magic_stick.CurrentCharges > 0 && (double)me.Health / me.MaximumHealth < PercentStickUse && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_magic_stick.Name))
             item_magic_stick.UseAbility(false);
         if (item_magic_wand != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() &&  item_magic_wand.CanBeCasted() && item_magic_wand.CurrentCharges > 0 && (double)me.Health / me.MaximumHealth < PercentStickUse && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_magic_wand.Name))
             item_magic_wand.UseAbility(false);
     }
 }
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:32,代码来源:AutoItems_NINJA.cs

示例2: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args)
        {
            if (Game.IsPaused || Game.IsWatchingGame || !Game.IsInGame)
                return;
            me = ObjectMgr.LocalHero;
            if (me == null)
                return;

            if (!me.IsAlive)
                return;
            Unit Things = ObjectMgr.GetEntities<Unit>()
                .FirstOrDefault(
                    x =>
                        (x.ClassID == ClassID.CDOTA_NPC_Observer_Ward ||
                         x.ClassID == ClassID.CDOTA_NPC_Observer_Ward_TrueSight || x.ClassID == ClassID.CDOTA_NPC_TechiesMines /*|| x.ClassID == ClassID.CDOTA_NPC_Treant_EyesInTheForest*/)
                        && x.Team != me.Team && me.NetworkPosition.Distance2D(x.NetworkPosition) < 450 &&
                        x.IsVisible && x.IsAlive);
            if (!me.IsChanneling() && Utils.SleepCheck("Use"))
            {
                if (Things != null)
                {
                    var useItem = items.Select(item => me.FindItem(item)).FirstOrDefault(x => x != null && x.CanBeCasted());
                    if (useItem != null && !((useItem.Name == "item_tango_single" || useItem.Name == "item_tango") && Things.ClassID == ClassID.CDOTA_NPC_TechiesMines))
                    {
                        useItem.UseAbility(Things);
                        Utils.Sleep(250, "Use");
                    }
                    Utils.Sleep(250, "Use");
                }
            }
        }
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:31,代码来源:AutoDeward2.cs

示例3: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args)
        {
            if (Game.IsPaused || Game.IsWatchingGame || !Game.IsInGame)
                return;
            me = ObjectMgr.LocalHero;
            if (me == null)
                return;

            if (!me.IsAlive)
                return;
            Unit wards = ObjectMgr.GetEntities<Unit>()
                .Where(
                    x =>
                        (x.ClassID == ClassID.CDOTA_NPC_Observer_Ward ||
                         x.ClassID == ClassID.CDOTA_NPC_Observer_Ward_TrueSight || x.ClassID == ClassID.CDOTA_NPC_TechiesMines || x.ClassID == ClassID.CDOTA_NPC_Treant_EyesInTheForest)
                        && x.Team != me.Team && GetDistance2D(x.NetworkPosition, me.NetworkPosition) < 450 &&
                        x.IsVisible && x.IsAlive).FirstOrDefault();
            if (!me.IsChanneling() && Utils.SleepCheck("Use"))
            {
                if (wards != null)
                {
                    uint i = 0;
                    uint last_i = 100;
                    string item_name = null;
                    List<Item> me_inventory = me.Inventory.Items.ToList();
                    items = new string[5] { "item_quelling_blade", "item_iron_talon", "item_bfury", "item_tango_single", "item_tango" };
                    foreach (Item x in me_inventory)
                    {
                        for (i = 0; i < 5; i++)
                        {
                            if (items[i] == x.Name && x.Cooldown <= 0)
                            {
                                if (i <= last_i)
                                {
                                    item_name = x.Name;
                                    last_i = i;
                                }
                            }
                        }
                    }
                    if (item_name != null && me.FindItem(item_name).CanBeCasted())
                        me.FindItem(item_name).UseAbility(wards);
                    Utils.Sleep(250, "Use");
                }
            }
        }
开发者ID:VickTheRock,项目名称:EnsageSharp-4,代码行数:46,代码来源:AutoDeward2.cs

示例4: 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

示例5: Tick

        public static void Tick(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;
            me = ObjectMgr.LocalHero;
            target = ObjectMgr.GetEntities<Hero>().Where(x => x.Health <= 100 && x.Distance2D(me) <= 950 && !x.IsIllusion && x.IsAlive && x.Team != me.Team).ToList();
            if (me == null || target.FirstOrDefault() == null)
                return;
            urn_of_shadows = me.FindItem("item_urn_of_shadows");

            if (!me.IsChanneling() && target.FirstOrDefault() != null && urn_of_shadows != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki))
            {
                if (me.CanCast() && urn_of_shadows.CanBeCasted() && Utils.SleepCheck("urn"))
                {
                    urn_of_shadows.UseAbility(target.FirstOrDefault());
                    Utils.Sleep(200, "urn");
                }
            }
        }
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:19,代码来源:AutoUrn.cs

示例6: 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

示例7: ItemUsage

        /**
        * ItemUsage takes in a Hero me, its inventory inv, a Hero target, the distance between me and target, a boolean usebkb and byillusion
        * and uses all items as necessary
        * 1) Uses blink dagger to a point given by Dagger.CloseRange menu option
        * 2) Uses all other items specified in the Items list (line 53)
        * 3) Uses diffusal blade (to purge or dispel) if enabled
        * 4) Uses bkb if enabled
        * 5) Uses ultimate if all items expect of refresher was casted
        **/
        private static bool ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, double distance, bool useBkb, bool byIllusion = false)
        {
            if (me.IsChanneling() || !Utils.SleepCheck("DaggerTime") || me.IsStunned()) return false;
            // use all items given in Items list (line 53)
            var enumerable = inv as Item[] ?? inv.ToArray();
            var phase =
                enumerable.Find(
                    x =>
                        x.StoredName() == HideItemList[0] && byIllusion &&
                        SpellBaseList.Find(z => z.Name == x.Name) == null && Utils.SleepCheck(x.Name + me.Handle));
            if (phase != null)
            {
                phase.UseAbility();
                Utils.Sleep(250, $"{phase.StoredName() + me.Handle}");
            }
            var inventory =
                enumerable.Where(
                    x =>
                        (IsItemEnable(x.StoredName(), byIllusion) || CloneOnlyComboItems.Contains(x.StoredName()) ||
                         x.StoredName() == "item_dust" || x.StoredName() == "item_black_king_bar") && x.CanBeCasted() &&
                        (!byIllusion || SpellBaseList.Find(z => z.Name == x.Name) == null)
                            /* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/ && CheckForPike(me,target,distance,x) ).ToList();
            var items =
                inventory.Where(
                    x =>
                        Utils.SleepCheck(x.Name + me.Handle) && Items.Keys.Contains(x.Name) &&
                        ((x.CastRange == 0 &&
                          distance <=
                          (x.Name == "item_blink" ? 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value : 1000)) ||
                         /*x.CastRange+50 >= distance*/x.CanHit(target))).OrderByDescending(y => GetComboOrder(y, byIllusion));
            var slarkMod = target.HasModifiers(new[] { "modifier_slark_dark_pact", "modifier_slark_dark_pact_pulses" }, false);
            foreach (var item in items)
            {
                var name = item.StoredName();
                if (name == "item_ethereal_blade")
                    _ethereal.Sleep(1000);
                if (name == "item_dagon" || name == "item_dagon_2" || name == "item_dagon_3" || name == "item_dagon_4" || name == "item_dagon_5")
                    if (_ethereal.Sleeping && !target.HasModifier("modifier_item_ethereal_blade_ethereal"))
                        continue;
                if (name == "item_hurricane_pike")
                {
                    item.UseAbility(me);
                    Utils.Sleep(250, $"{name + me.Handle}");
                    continue;
                }
                if (item.IsAbilityBehavior(AbilityBehavior.NoTarget))
                {
                    item.UseAbility();
                    Print($"[Using]: {item.Name} (10)", print: false);
                }
                else if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
                    if (item.TargetTeamType == TargetTeamType.Enemy || item.TargetTeamType == TargetTeamType.All ||
                        item.TargetTeamType == TargetTeamType.Custom)
                    {
                        if (item.IsDisable())
                        {
                            if (!slarkMod && !target.IsLinkensProtected())
                                if (item.CastStun(target))
                                {
                                    Print($"[Using]: {item.Name} (9)", print: false);
                                    Utils.Sleep(350, $"{item.Name + me.Handle}");
                                    continue;
                                }
                        }
                        else if (item.IsSilence())
                        {
                            if (!slarkMod)
                                if (!target.IsSilenced())
                                {
                                    item.UseAbility(target);
                                    Print($"[Using]: {item.Name} (8)", print: false);
                                }
                        }
                        else if ((item.StoredName().Contains("dagon") || item.StoredName() == "item_ethereal_blade") &&
                                 target.HasModifiers(
                                     new[]
                                     {
                                         "modifier_templar_assassin_refraction_absorb",
                                         "modifier_templar_assassin_refraction_absorb_stacks",
                                         "modifier_oracle_fates_edict",
                                         "modifier_abaddon_borrowed_time"
                                     }, false))
                        {
                            Print("can damage this shit", print: false);
                            continue;
                        }
                        else
                        {
                            item.UseAbility(target);
                            Print($"[Using]: {item.Name} (1)", print: false);
                            Utils.Sleep(350, $"{item.Name + me.Handle}");
//.........这里部分代码省略.........
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:101,代码来源:Core.cs

示例8: Working


//.........这里部分代码省略.........
                             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))
                                 {
                                     sentry.UseAbility(me.Position);
                                     Utils.Sleep(100, "sentry");
                                 }
                             }
                         }
                         uint elsecount = 1;
                         if (Utils.SleepCheck("combo"))
                         {
                             if (blademail != null && blademail.Cooldown <= 0 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(blademail.Name) && me.Mana - blademail.ManaCost >= 75)
                                 blademail.UseAbility();
                             else
                                 elsecount += 1;
                             if (satanic != null && satanic.Cooldown <= 0 && me.Health <= me.MaximumHealth * 0.5 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(satanic.Name))
                                 satanic.UseAbility();
                             else
                                 elsecount += 1;
                             if (crimson != null && crimson.Cooldown <= 0 && Menu.Item("Consume Items").GetValue<AbilityToggler>().IsEnabled(crimson.Name))
                                 crimson.UseAbility();
                             else
                                 elsecount += 1;
                             if (buckler != null && buckler.Cooldown <= 0 && Menu.Item("Consume Items").GetValue<AbilityToggler>().IsEnabled(buckler.Name) && me.Mana - buckler.ManaCost >= 75)
                                 buckler.UseAbility();
                             else
                                 elsecount += 1;
                             if (lotusorb != null && lotusorb.Cooldown <= 0 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(lotusorb.Name) && me.Mana - lotusorb.ManaCost >= 75)
                                 lotusorb.UseAbility(me);
                             else
                                 elsecount += 1;
                             if (mjollnir != null && mjollnir.Cooldown <= 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(mjollnir.Name) && me.Mana - mjollnir.ManaCost >= 75)
                                 mjollnir.UseAbility(me);
                             else
                                 elsecount += 1;
                             if (armlet != null && !armlet.IsToggled && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(armlet.Name) && Utils.SleepCheck("armlet"))
                             {
                                 armlet.ToggleAbility();
                                 Utils.Sleep(300, "armlet");
                             }
                             else
                                 elsecount += 1;
                             if (madness != null && madness.Cooldown <= 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(madness.Name) && me.Mana - madness.ManaCost >= 75)
                                 madness.UseAbility();
                             else
                                 elsecount += 1;
                             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);
                             else
                                 elsecount += 1;
                             if (bkb != null && bkb.Cooldown <= 0 && Menu.Item("Defensive Items").GetValue<AbilityToggler>().IsEnabled(bkb.Name) && (!Heal.CanBeCasted() || Heal == null))
                                 bkb.UseAbility();
                             else
                                 elsecount += 1;
                             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);
                             else
                                 elsecount += 1;
                             if (abyssal != null && abyssal.Cooldown <= 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(abyssal.Name) && me.Mana - abyssal.ManaCost >= 75)
                                 abyssal.UseAbility(target);
                             else
                                 elsecount += 1;
                             if (urn != null && urn.CurrentCharges > 0 && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(urn.Name))
                                 urn.UseAbility(target);
                             else
                                 elsecount += 1;
                             if (solar != null && solar.CanBeCasted() && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(solar.Name))
                                 solar.UseAbility(target);
                             else
                                 elsecount += 1;
                             if (medallion != null && medallion.CanBeCasted() && Menu.Item("Ofensive Items").GetValue<AbilityToggler>().IsEnabled(medallion.Name))
                                 medallion.UseAbility(target);
                             else
                                 elsecount += 1;
                             if (Duel != null && Duel.Cooldown <= 0 && !target.IsLinkensProtected() && !target.Modifiers.Any(x => x.Name == "modifier_abaddon_borrowed_time") && Utils.SleepCheck("Duel") && elsecount == 16)
                             {
                                 Duel.UseAbility(target);
                                 Utils.Sleep(100, "Duel");
                             }
                             else
                                 me.Attack(target,false);
                             Utils.Sleep(150, "combo");
                         }
                     }
                 }
             }
         }
         else
         {
             if(me.IsAlive && !me.IsChanneling())
             me.Move(Game.MousePosition,false);
         }
     }
 }
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:101,代码来源:ChallengeAccepted.cs

示例9: Heal

        private static void Heal(Hero self, Ability healSpell, float[] amount, uint range, int targettingType,
            bool targetSelf = true)
        {
            if (healSpell != null && healSpell.CanBeCasted() && !self.IsChanneling())
            {
                if (self.IsAlive && !self.IsChanneling() &&
                    (!self.IsInvisible() || !me.Modifiers.Any(x => x.Name == "modifier_treant_natures_guise")) &&
                    self.Distance2D(fountain) > 2000)
                {
                    var heroes = targetSelf
                        ? ObjectMgr.GetEntities<Hero>()
                            .Where(
                                entity =>
                                    entity.Team == self.Team && self.Distance2D(entity) <= range && !entity.IsIllusion &&
                                    entity.IsAlive)
                            .ToList()
                        : ObjectMgr.GetEntities<Hero>()
                            .Where(
                                entity =>
                                    entity.Team == self.Team && self.Distance2D(entity) <= range && !entity.IsIllusion &&
                                    entity.IsAlive && !Equals(entity, me)).ToList();

                    if (heroes.Any())
                    {
                        foreach (var ally in heroes)
                        {
                            if (ally.Health <= (ally.MaximumHealth*0.7) && healSpell.CanBeCasted() &&
                                self.Distance2D(fountain) > 2000 && IsInDanger(ally) &&
                                ally.Health + amount[healSpell.Level - 1] <= ally.MaximumHealth && (me.ClassID != ClassID.CDOTA_Unit_Hero_WitchDoctor || !me.Spellbook.SpellW.IsToggled))
                            {
                                if (targettingType == 1)
                                    CastHeal(healSpell, ally);
                                else if (targettingType == 2)
                                    CastHeal(healSpell);
                                else if (targettingType == 3 && Utils.SleepCheck("ToggleHeal"))
                                {
                                    /*if (healSpell.CanBeCasted() && Utils.SleepCheck("ToggleHeal"))
                                    {
                                        if (!healSpell.IsToggled)
                                        {
                                            CastHeal(healSpell);
                                            Utils.Sleep(1000 + Game.Ping, "ToggleHeal");
                                        }
                                    }*/

                                    CastHeal(healSpell, null, true);
                                    Utils.Sleep(1000 + Game.Ping, "ToggleHeal");
                                }
                            }
                            else if (targettingType == 3 && ally.Health > (ally.MaximumHealth*0.7) && healSpell.IsToggled &&
                                     Utils.SleepCheck("ToggleHeal"))
                            {
                                healSpell.ToggleAbility();
                                Utils.Sleep(1000 + Game.Ping, "ToggleHeal");
                            }
                        }
                    }
                }
            }
        }
开发者ID:evezus,项目名称:EnsageSharp,代码行数:60,代码来源:Program.cs

示例10: Riki_Kill

        private static void Riki_Kill(Hero me, Ability blinkstrike, IReadOnlyList<double> damage)
        {
            var bs = new[] { 0.5, 0.75, 1, 1.25 };
            var backstab = me.Spellbook.Spell3;

            if (blinkstrike.Level <= 0 || backstab.Level <= 0) return;

            var spellDamage = damage[(int) blinkstrike.Level];
            var backstabDamage = (float)bs[backstab.Level] * me.TotalAgility + me.MinimumDamage + me.BonusDamage;
            var spellRange = blinkstrike.CastRange + 50;
            var spellCastPoint = (float)(blinkstrike.GetCastPoint() + Game.AvgPing / 1000);
            var enemies = ObjectMgr.GetEntities<Hero>().Where(enemy => enemy.Team == me.GetEnemyTeam() && !enemy.IsIllusion() && enemy.IsVisible && enemy.IsAlive && enemy.Health > 0).ToList();
            foreach (var enemy in enemies)
            {
                var damageBlinkstrike = enemy.DamageTaken((float) spellDamage, blinkstrike.DamageType, me, true);
                var damageBackstab = enemy.DamageTaken(backstabDamage, backstab.DamageType, me, true);
                float damageNeeded;

                if (!HeroDamageDictionary.TryGetValue(enemy, out damageNeeded))
                {
                    damageNeeded = enemy.Health - damageBlinkstrike - damageBackstab + spellCastPoint * enemy.HealthRegeneration + MorphMustDie(enemy, spellCastPoint);
                    HeroDamageDictionary.Add(enemy, damageNeeded);
                    HeroSpellDictionary.Add(enemy, blinkstrike);
                }
                else
                {
                    HeroDamageDictionary.Remove(enemy);
                    HeroSpellDictionary.Remove(enemy);
                    damageNeeded = enemy.Health - damageBlinkstrike - damageBackstab + spellCastPoint * enemy.HealthRegeneration + MorphMustDie(enemy, spellCastPoint);
                    HeroDamageDictionary.Add(enemy, damageNeeded);
                    HeroSpellDictionary.Add(enemy, blinkstrike);
                }
                if (_killstealEnabled && !me.IsChanneling())
                {
                    if (damageNeeded < 0 && me.Distance2D(enemy) < spellRange && MeCanSurvive(enemy, me, blinkstrike, damageBlinkstrike + damageBackstab))
                    {
                        CastSpell(blinkstrike, enemy, me, true);
                        break;
                    }
                }
            }
        }
开发者ID:YukinoAguria,项目名称:ensagesharp,代码行数:42,代码来源:Program.cs

示例11: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;
            if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_BountyHunter) return;
            if (!Menu.Item("enabled").IsActive())
                return;

            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);

            RActive = Menu.Item("KeyR").GetValue<KeyBind>().Active;
            Q = me.Spellbook.SpellQ;
            R = me.Spellbook.SpellR;

            var enemies = ObjectManager.GetEntities<Hero>()
                    .Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
                    .ToList();
            if (Active)
            {
                e = me.ClosestToMouseTarget(1800);
                if (e == null)
                    return;
                mom = me.FindItem("item_mask_of_madness");
                urn = me.FindItem("item_urn_of_shadows");
                dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
                ethereal = me.FindItem("item_ethereal_blade");
                halberd = me.FindItem("item_heavens_halberd");
                mjollnir = me.FindItem("item_mjollnir");
                orchid = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
                abyssal = me.FindItem("item_abyssal_blade");
                mail = me.FindItem("item_blade_mail");
                bkb = me.FindItem("item_black_king_bar");
                satanic = me.FindItem("item_satanic");
                medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
                Shiva = me.FindItem("item_shivas_guard");

                if (Menu.Item("orbwalk").GetValue<bool>() && me.Distance2D(e) <= 1900)
                {
                    Orbwalking.Orbwalk(e, 0, 1600, true, true);
                }
                if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !me.IsInvisible())
                {
                    if (
                        Q != null && Q.CanBeCasted() && me.Distance2D(e) <= 1500
                        && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(Q.Name)
                        && Utils.SleepCheck("Q")
                        )
                    {
                        Q.UseAbility(e);
                        Utils.Sleep(200, "Q");
                    }
                    if (
                        R != null && R.CanBeCasted() && me.Distance2D(e) <= 1500
                        && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(R.Name)
                        && !me.HasModifier("modifier_bounty_hunter_wind_walk")
                        && !me.IsChanneling()
                        && Utils.SleepCheck("R")
                        )
                    {
                        R.UseAbility(e);
                        Utils.Sleep(200, "R");
                    }

                    if ( // MOM
                        mom != null
                        && mom.CanBeCasted()
                        && me.CanCast()
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(mom.Name)
                        && Utils.SleepCheck("mom")
                        && me.Distance2D(e) <= 700
                        )
                    {
                        mom.UseAbility();
                        Utils.Sleep(250, "mom");
                    }
                    if ( // Mjollnir
                        mjollnir != null
                        && mjollnir.CanBeCasted()
                        && me.CanCast()
                        && !e.IsMagicImmune()
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(mjollnir.Name)
                        && Utils.SleepCheck("mjollnir")
                        && me.Distance2D(e) <= 900
                        )
                    {
                        mjollnir.UseAbility(me);
                        Utils.Sleep(250, "mjollnir");
                    } // Mjollnir Item end
                    if ( // Medall
                        medall != null
                        && medall.CanBeCasted()
                        && Utils.SleepCheck("Medall")
                        && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(medall.Name)
                        && me.Distance2D(e) <= 700
                        )
                    {
                        medall.UseAbility(e);
                        Utils.Sleep(250, "Medall");
                    } // Medall Item end
                    if ( // Hellbard
                        halberd != null
//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例12: 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

示例13: Player_OnExecuteAction


//.........这里部分代码省略.........
                    spell.UseAbility();
                    break;
                }
                case Order.ToggleAbility: 
				{
                    spell.ToggleAbility();
                    break;
                }
            }
        }*/

		
		
		
        public static void ComboEngine(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("Rocket Spam Key").GetValue<KeyBind>().Key) && Utils.SleepCheck("RocketSpam") && !Game.IsChatOpen)
            {

				FindItems();

				if (blink != null && blink.CanBeCasted() 
					&& !me.IsChanneling()  
					&& Utils.SleepCheck("Rearms") 
					&& (!me.Modifiers.Any(y => y.Name == "modifier_bloodseeker_rupture") || (me.Distance2D(Game.MousePosition)>1325 && aetherrange!=0))
					&& (me.Distance2D(Game.MousePosition) > 650+aetherrange+ensage_error))
				{
					var safeRange = me.FindItem("item_aether_lens") == null ? 1200 : 1400;
					var p = Game.MousePosition;
					
					if (me.Distance2D(Game.MousePosition) > safeRange)
					{
						var tpos = me.Position;
						var a = tpos.ToVector2().FindAngleBetween(Game.MousePosition.ToVector2(), true);
						
						safeRange -= (int)me.HullRadius;
						p = new Vector3(
							tpos.X + safeRange * (float)Math.Cos(a),
							tpos.Y + safeRange * (float)Math.Sin(a),
							100);
					}
					else p = Game.MousePosition;				
				
					blink.UseAbility(p);
                    Utils.Sleep(50, "Blinks");

				}
						
				/*
				if (soulring != null && soulring.CanBeCasted() && !me.IsChanneling() && (blink!=null && me.Distance2D(Game.MousePosition) > 650+ aetherrange  + ensage_error) && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(soulring.Name) && Utils.SleepCheck("Rearms"))
				{
					soulring.UseAbility();
				}
				*/
				if (bottle != null && bottle.CanBeCasted() && !me.IsChanneling() && (blink==null || (blink!=null && me.Distance2D(Game.MousePosition) <= 650+ aetherrange  + ensage_error)) && !me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && (me.MaximumMana-me.Mana)>60 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(bottle.Name) && Utils.SleepCheck("Rearms"))
开发者ID:Air13,项目名称:ESharp,代码行数:67,代码来源:Tinker_Air13.cs

示例14: ItemUsage

        private static void ItemUsage(Hero me, IEnumerable<Item> inv, Hero target, float distance, bool useBkb, bool byIllusion = false)
        {
            if (me.IsChanneling()) return;
            var inventory = inv.Where(x => Utils.SleepCheck(x.Name + me.Handle) && x.CanBeCasted()/* && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name)*/).ToList();
            var items =
                inventory.Where(
                    x =>
                        Items.Contains(x.Name) &&
                        ((x.CastRange == 0 && distance <= 1150 + Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value) ||
                         x.CastRange >= distance)).ToList();
            foreach (var item in items)
            {
                if (item.Name == "item_blink")
                {
                    if (distance > 1150)
                    {
                        var point = new Vector3(
                            (float)
                                (target.Position.X -
                                 Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                                 Math.Cos(me.FindAngleBetween(target.Position, true))),
                            (float)
                                (target.Position.Y -
                                 Menu.Item("Dagger.CloseRange").GetValue<Slider>().Value*
                                 Math.Sin(me.FindAngleBetween(target.Position, true))),
                            target.Position.Z);
                        var dist = me.Distance2D(point);
                        if (dist >= Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value && dist <= 1150)
                        {
                            item.UseAbility(point);
                            Utils.Sleep(500, item.Name + me.Handle);
                        }
                    }
                    else if (distance>Menu.Item("Dagger.MinDistance").GetValue<Slider>().Value)
                    {
                        item.UseAbility(target.Position);
                        Utils.Sleep(500, item.Name + me.Handle);
                    }
                    continue;
                }
                item.UseAbility();
                item.UseAbility(target);
                item.UseAbility(target.Position);
                item.UseAbility(me);
                Utils.Sleep(500, item.Name + me.Handle);
            }
            //var underDiff = target.Modifiers.Any(x => x.Name == "modifier_item_diffusal_blade_slow");
            //Game.PrintMessage("Under SLow?: "+target.Modifiers.Any(x=>x.Name=="modifier_item_diffusal_blade_slow"),MessageType.ChatMessage);
            
            //var PurgeMain = Menu.Item("Diffusal.PurgEnemy").GetValue<StringList>().SelectedIndex == (int)PurgeSelection.MainTarget;
            var purgeAll = Menu.Item("Diffusal.PurgEnemy").GetValue<StringList>().SelectedIndex == (int)PurgeSelection.AllEnemies;

            
            if (byIllusion)
            {
                var targets =
                ObjectMgr.GetEntities<Hero>()
                    .Where(
                        x =>
                            x.IsValid && x.IsAlive && x.IsVisible && x.Team!=me.Team && x.Distance2D(me) <= 650 &&
                            (purgeAll || Equals(target, x)) &&
                             !x.IsStunned() && !x.IsHexed())
                    .ToList();
                foreach (var hero in targets)
                {
                    var mod =
                        hero.Modifiers.Any(modifierName => modifierName.Name == "modifier_item_diffusal_blade_slow");
                    if (mod) continue;
                    var items2 =
                    inventory.Where(
                        x =>
                            CloneOnlyComboItems.Contains(x.Name) &&
                            (me.Distance2D(hero) <= 650)).ToList();
                    foreach (var item in items2)
                    {
                        item.UseAbility(hero);
                        Utils.Sleep(500, item.Name + me.Handle);
                    }
                }
            }
            var both = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Both;
            var main = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Me;
            var tempest = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Tempest;
            if (byIllusion&& (both || main || tempest))
            {
                TryToDispell(me, inventory.Where(
                    x =>
                        CloneOnlyComboItems.Contains(x.Name)).ToList(),both,main,tempest);
            }
            if (useBkb && distance<650)
            {
                var bkb = inventory.FirstOrDefault(x => x.Name == "item_black_king_bar");
                if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck(bkb.Name + me.Handle))
                {
                    bkb.UseAbility();
                    Utils.Sleep(500, bkb.Name + me.Handle);
                }
            }
            if (!items.Any()) return;
            {
//.........这里部分代码省略.........
开发者ID:DevGdos,项目名称:EnsageSharp,代码行数:101,代码来源:Program.cs

示例15: 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("Blink On/Off").GetValue<KeyBind>().Key) && !Game.IsChatOpen && Utils.SleepCheck("BLINKTOGGLE"))
     {
         Items["item_blink"] = !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_blink");
         Utils.Sleep(500, "BLINKTOGGLE");
     }
     if ((Game.IsKeyDown(Menu.Item("Farm Key").GetValue<KeyBind>().Key)) && !Game.IsChatOpen || (!Utils.SleepCheck("InCombo") && Refresh.IsChanneling))
     {
         FindItems();
         autoattack(true);
         Vector3 POSMARCH = (Game.MousePosition - me.NetworkPosition) * 10 / Game.MousePosition.Distance2D(me.NetworkPosition) + me.NetworkPosition;
         if (stage == 0 && Utils.SleepCheck("FarmRefresh"))
         {
             if (Blink != null && Blink.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Blink.Name) && Utils.SleepCheck("REFRESHEER") && !Refresh.IsChanneling && Utils.SleepCheck("blink") && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_blink") && !me.IsChanneling())
             {
                 Blink.UseAbility(Game.MousePosition);
                 Utils.Sleep(100 - Game.Ping, "blink");
             }
             if (ghost != null && ghost.CanBeCasted() && !me.IsChanneling() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(ghost.Name) && Utils.SleepCheck("ghost_usage") && Utils.SleepCheck("REFRESHEEER"))
             {
                 ghost.UseAbility(false);
                 Utils.Sleep(600 - Game.Ping, "ghost_usage");
             }
             if (Soulring != null && Soulring.CanBeCasted() && !me.IsChanneling() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Soulring.Name) && Utils.SleepCheck("soul_ring_usage") && Utils.SleepCheck("REFRESHEEER"))
             {
                 Soulring.UseAbility(false);
                 Utils.Sleep(600 - Game.Ping, "soul_ring_usage");
             }
             if (bottle != null && bottle.CanBeCasted() && !me.IsChanneling() && !me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && bottle.CurrentCharges >= 0 && Utils.SleepCheck("bottle_CD") && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(bottle.Name) && Utils.SleepCheck("REFRESHEEER"))
             {
                 bottle.UseAbility(false);
                 Utils.Sleep(1000 - Game.Ping, "bottle_CD");
             }
             if (March != null && March.CanBeCasted() && !me.IsChanneling() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(March.Name) && me.Mana >= March.ManaCost + 75 && Utils.SleepCheck("MarchUsage"))
             {
                 March.UseAbility(POSMARCH, false);
                 Utils.Sleep(800 - Game.Ping, "MarchUsage");
             }
             if ((Soulring == null || !Soulring.CanBeCasted() || !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Soulring.Name)) && (!March.CanBeCasted() || March.Level <= 0 || me.Mana <= March.ManaCost + 75 || !Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(March.Name)) && (Refresh.Level >= 0 && Refresh.CanBeCasted()) && !me.IsChanneling() && Utils.SleepCheck("REFRESHEEER") && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Refresh.Name))
             {
                 Refresh.UseAbility(false);
                 Utils.Sleep(900 - Game.Ping, "REFRESHEEER");
             }
             if (Refresh.IsChanneling)
             {
                 stage = 1;
                 Utils.Sleep(5000 - Game.Ping, "CD_COMBO_FARM");
             }
             if (me.Mana <= Refresh.ManaCost)
                 stage = 1;
             Utils.Sleep(500 - Game.Ping, "InCombo");
         }
         if (stage == 1 && Utils.SleepCheck("FarmRefresh"))
         {
             if (Blink != null && Blink.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Blink.Name) && Utils.SleepCheck("REFRESHEER") && !Refresh.IsChanneling && Utils.SleepCheck("blink") && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_blink") && !me.IsChanneling())
             {
                 Blink.UseAbility(Game.MousePosition);
                 Utils.Sleep(300 - Game.Ping, "blink");
             }
             if (ghost != null && ghost.CanBeCasted() && !me.IsChanneling() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(ghost.Name) && Utils.SleepCheck("REFRESHEEER") && Utils.SleepCheck("ghost_usage"))
             {
                 ghost.UseAbility(false);
                 Utils.Sleep(600 - Game.Ping, "ghost_usage");
             }
             if (Soulring != null && Soulring.CanBeCasted() && !me.IsChanneling() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Soulring.Name) && Utils.SleepCheck("REFRESHEEER") && Utils.SleepCheck("soul_ring_usage"))
             {
                 Soulring.UseAbility(false);
                 Utils.Sleep(600 - Game.Ping, "soul_ring_usage");
             }
             if (bottle != null && bottle.CanBeCasted() && !me.IsChanneling() && !me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && bottle.CurrentCharges >= 0 && Utils.SleepCheck("bottle_CD") && Utils.SleepCheck("REFRESHEEER"))
             {
                 bottle.UseAbility();
                 Utils.Sleep(1000 - Game.Ping, "bottle_CD");
             }
             if (March != null && March.CanBeCasted() && !me.IsChanneling() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(March.Name) && me.Mana >= March.ManaCost + 75 && Utils.SleepCheck("REFRESHEEER") && Utils.SleepCheck("MarchUsage"))
             {
                 March.UseAbility(POSMARCH);
                 Utils.Sleep(800 - Game.Ping, "MarchUsage");
             }
             if ((Soulring == null || !Soulring.CanBeCasted() || !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Soulring.Name)) && (!March.CanBeCasted() || March.Level <= 0 || me.Mana <= March.ManaCost + 75 || !Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(March.Name)) && Utils.SleepCheck("REFRESHEEER"))
             {
                 if (travel.CanBeCasted() && !me.IsChanneling())
                 {
                     if (me.Team == Team.Dire)
                         travel.UseAbility(Dire);
                     if (me.Team == Team.Radiant)
                         travel.UseAbility(Radiant);
                     Utils.Sleep(500 - Game.Ping, "FarmRefresh");
                 }
                 if (travel.IsChanneling)
                     stage = 0;
             }
//.........这里部分代码省略.........
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:101,代码来源:Tinker_Perfect_type.cs


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