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


C# Hero.CanAttack方法代码示例

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


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

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

示例2: Player_OnExecuteAction


//.........这里部分代码省略.........
							
							if (me.NetworkPosition.Distance2D(target.NetworkPosition) > safeRange + closeRange)
							{
								var tpos = me.NetworkPosition;
								var a = tpos.ToVector2().FindAngleBetween(target.NetworkPosition.ToVector2(), true);
								
								safeRange -= (int)me.HullRadius;
								p13 = new Vector3(
									tpos.X + (safeRange + closeRange)  * (float)Math.Cos(a),
									tpos.Y + (safeRange + closeRange) * (float)Math.Sin(a),
									100);
							}
							else 
							{
								var tpos = me.NetworkPosition;
								var a = tpos.ToVector2().FindAngleBetween(target.NetworkPosition.ToVector2(), true);
								var uncloseRange = me.NetworkPosition.Distance2D(target.NetworkPosition) - closeRange;
								
								safeRange -= (int)me.HullRadius;
								p13 = new Vector3(
									tpos.X + uncloseRange * (float)Math.Cos(a),
									tpos.Y + uncloseRange * (float)Math.Sin(a),
									100);							
							}
							blink.UseAbility(p13);
							//Utils.Sleep(250, "Blinks");

						}*/						
						else
							elsecount += 1;
							
							
						if (!me.IsChanneling() 
							&& me.CanAttack() 
							&& !target.IsAttackImmune() 
							&& !me.Spellbook.Spells.Any(x => x.IsInAbilityPhase)
							&& OneHitLeft(target)
							&& target.NetworkPosition.Distance2D(me) <= me.GetAttackRange()+50
							//&& Utils.SleepCheck("attack")	
							//&& Utils.SleepCheck("Blinks")
							)
						{
							me.Attack(target);
							//Orbwalking.Orbwalk(target);
							//Utils.Sleep(250, "attack");
						}
						else
							elsecount += 1;

							
							
						if (target.IsLinkensProtected() && Utils.SleepCheck("combo2"))
						{
							if (forcestaff != null && forcestaff.CanBeCasted() )
								forcestaff.UseAbility(target);	
							else if (cyclone != null && cyclone.CanBeCasted() )
								cyclone.UseAbility(target);
							else if (Laser.Level >= 1 && Laser.CanBeCasted() )
								Laser.UseAbility(target);
								
							Utils.Sleep(200, "combo2");

						}
						else
						{
							
开发者ID:Air13,项目名称:ESharp,代码行数:66,代码来源:Tinker_Air13.cs

示例3: AD


//.........这里部分代码省略.........
					 
					)
				{
				
					if (e.Health < factdamage(e)
						&& me.Mana >= manafactdamage(e)
						&& (!CanReflectDamage(e) || me.IsMagicImmune())
						//&& (!e.FindSpell("abaddon_borrowed_time").CanBeCasted() && !e.Modifiers.Any(y => y.Name == "modifier_abaddon_borrowed_time_damage_redirect"))
						&& !e.Modifiers.Any(y => y.Name == "modifier_abaddon_borrowed_time_damage_redirect")
						&& !e.Modifiers.Any(y => y.Name == "modifier_obsidian_destroyer_astral_imprisonment_prison")
						&& !e.Modifiers.Any(y => y.Name == "modifier_puck_phase_shift")
						&& !e.Modifiers.Any(y => y.Name == "modifier_eul_cyclone")
						&& !e.Modifiers.Any(y => y.Name == "modifier_dazzle_shallow_grave")
						&& !e.Modifiers.Any(y => y.Name == "modifier_brewmaster_storm_cyclone")
						&& !e.Modifiers.Any(y => y.Name == "modifier_shadow_demon_disruption")
						&& !e.Modifiers.Any(y => y.Name == "modifier_tusk_snowball_movement")
						&& !me.Modifiers.Any(y => y.Name == "modifier_pugna_nether_ward_aura")
						&& !me.IsSilenced() 
						&& !me.IsHexed() 
						&& !me.Modifiers.Any(y => y.Name == "modifier_doom_bringer_doom") 
						&& !me.Modifiers.Any(y => y.Name == "modifier_riki_smoke_screen")
						&& !me.Modifiers.Any(y => y.Name == "modifier_disruptor_static_storm")


						)
						{
							if (Utils.SleepCheck("AUTOCOMBO") && !me.IsChanneling())
							{

								bool EzkillCheck = EZkill(e);
								bool magicimune = (!e.IsMagicImmune() && !e.Modifiers.Any(x => x.Name == "modifier_eul_cyclone"));
								
								if (!me.IsChanneling() 
									&& me.CanAttack() 
									&& !e.IsAttackImmune() 
									&& !me.Spellbook.Spells.Any(x => x.IsInAbilityPhase)
									&& OneHitLeft(e)
									&& e.NetworkPosition.Distance2D(me) <= me.GetAttackRange()+50
									//&& Utils.SleepCheck("attack")			
									)
								{
									me.Attack(e);
									//Orbwalking.Orbwalk(e);
									//Utils.Sleep(250, "attack");
								}
								
								if (soulring != null && soulring.CanBeCasted()
									//&& Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(soulring.Name)  
									&& e.NetworkPosition.Distance2D(me) < 2500
									&& magicimune  
									&& !OneHitLeft(e)
									&& (((veil == null || !veil.CanBeCasted() || e.Modifiers.Any(y => y.Name == "modifier_item_veil_of_discord_debuff")  /*| !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(veil.Name)*/) && e.NetworkPosition.Distance2D(me) <= 1500+aetherrange) || ((e.NetworkPosition.Distance2D(me) > 1500+aetherrange) && (e.Health < (int)(e.DamageTaken(rocket_damage[Rocket.Level - 1], DamageType.Magical, me, false, 0, 0, 0)*spellamplymult*lensmult)))   )
									&& (((ethereal == null || (ethereal!=null && !ethereal.CanBeCasted()) || IsCasted(ethereal) /*|| e.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_ethereal")*/ /*| !Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name)*/)&& e.NetworkPosition.Distance2D(me) <= 800+aetherrange)|| ((e.NetworkPosition.Distance2D(me) > 800+aetherrange) && (e.Health < (int)(e.DamageTaken(rocket_damage[Rocket.Level - 1], DamageType.Magical, me, false, 0, 0, 0)*spellamplymult*lensmult)))   )
																		
									)
									soulring.UseAbility();
									
								
								if (veil != null && veil.CanBeCasted() 
									&& magicimune
									//&& Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(veil.Name)
									&& e.NetworkPosition.Distance2D(me) <= 1500+aetherrange + ensage_error
									&& !OneHitLeft(e)
									&& !(e.Modifiers.Any(y => y.Name == "modifier_teleporting") && IsEulhexFind())
									&& !e.Modifiers.Any(y => y.Name == "modifier_item_veil_of_discord_debuff")
									)
开发者ID:Air13,项目名称:ESharp,代码行数:67,代码来源:Tinker_Air13.cs

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

示例5: Orbwalk

 private static void Orbwalk(Hero me,Unit target,float bonusWindupMs = 100,float bonusRange = 0)
 {
     if (me == null)
     {
         return;
     }
     var targetHull = 0f;
     if (target != null)
     {
         targetHull = target.HullRadius;
     }
     float distance = 0;
     if (target != null)
     {
         var pos = Prediction.InFront(
             me,
             (float)((Game.Ping / 1000 + me.GetTurnTime(target.Position)) * me.MovementSpeed));
         distance = pos.Distance2D(target) - me.Distance2D(target);
     }
     var isValid = target != null && target.IsValid && target.IsAlive && target.IsVisible && !target.IsInvul()
                   && !target.Modifiers.Any(
                       x => x.Name == "modifier_ghost_state" || x.Name == "modifier_item_ethereal_blade_slow")
                   && target.Distance2D(me)
                   <= (me.GetAttackRange() + me.HullRadius + 50 + targetHull + bonusRange + Math.Max(distance, 0));
     if (isValid || (target != null && me.IsAttacking() && me.GetTurnTime(target.Position) < 0.1))
     {
         var canAttack = !AttackOnCooldown(me,target, bonusWindupMs)
                         && !target.IsAttackImmune() && !target.IsInvul() && me.CanAttack();
         if (canAttack && Utils.SleepCheck("!Orbwalk.Attack"))
         {
             me.Attack(target);
             Utils.Sleep(
                 UnitDatabase.GetAttackPoint(me) * 1000 + me.GetTurnTime(target) * 1000,
                 "!Orbwalk.Attack");
             return;
         }
     }
     var canCancel = (CanCancelAnimation(me) && AttackOnCooldown(me,target, bonusWindupMs))
                     || (!isValid && !me.IsAttacking() && CanCancelAnimation(me));
     if (!canCancel || !Utils.SleepCheck("!Orbwalk.Move") || !Utils.SleepCheck("!Orbwalk.Attack"))
     {
         return;
     }
     if (target != null) me.Move(target.Position);
     Utils.Sleep(100, "!Orbwalk.Move");
 }
开发者ID:DevGdos,项目名称:EnsageSharp,代码行数:46,代码来源:Program.cs

示例6: 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_Sven)
                return;

            if (me == null)
                return;

            if (stun == null)
                stun = me.Spellbook.Spell1;
            if (armor == null)
                armor = me.Spellbook.Spell3;
            if (ulti == null)
                ulti = me.Spellbook.Spell4;

            if (Lompat == null)
                Lompat = me.FindItem("item_blink");
            if (bloodthorn == null)
                bloodthorn = me.FindItem("item_bloodthorn");
            if (armlet == null)
                armlet = me.FindItem("item_armlet");
            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 (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 (combo && Menu.Item("enable").GetValue<bool>())
            {
                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");

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

                        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 (ulti.CanBeCasted() && Utils.SleepCheck("ulti"))
                        {
                            ulti.UseAbility();
                            Utils.Sleep(150 + Game.Ping, "ulti");
                        }
                        if (armor.CanBeCasted() && Utils.SleepCheck("armor"))
                        {
                            armor.UseAbility();
                            Utils.Sleep(150 + Game.Ping, "armor");
                        }
                        Utils.ChainStun(me, 100, null, false);

                        if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck("bkb") && Menu.Item("useBKB").GetValue<bool>())
                        {
                            bkb.UseAbility();
                            Utils.Sleep(150 + Game.Ping, "bkb");
                        }
//.........这里部分代码省略.........
开发者ID:spyware293,项目名称:Ensage,代码行数:101,代码来源:Program.cs

示例7: Tinker_In_Madness


//.........这里部分代码省略.........
                     glimmer.UseAbility(me);
                     Utils.Sleep(200 - Game.Ping, "glimmer");
                 }
                 else
                     elsecount += 1;
                 if (ghost != null && Ethereal == null && ghost.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(ghost.Name) && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("ghost"))
                 {
                     ghost.UseAbility();
                     Utils.Sleep(200 - Game.Ping, "ghost");
                 }
                 else
                     elsecount += 1;
                 if (Soulring != null && Soulring.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Soulring.Name) && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("soulring"))
                 {
                     Soulring.UseAbility();
                     Utils.Sleep(200 - Game.Ping, "soulring");
                 }
                 else
                     elsecount += 1;
                 if (Hex != null && Hex.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Hex.Name) && magicimune && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("Hex"))
                 {
                     Hex.UseAbility(target);
                     Utils.Sleep(200 - Game.Ping, "Hex");
                 }
                 else
                     elsecount += 1;
                 if (Laser != null && Laser.CanBeCasted() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Laser.Name) && magicimune && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("laser"))
                 {
                     Utils.Sleep(400 - Game.Ping, "laser");
                     Laser.UseAbility(target);
                 }
                 else
                     elsecount += 1;
                 if (Ethereal != null && Ethereal.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Ethereal.Name) && magicimune && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("ethereal"))
                 {
                     Ethereal.UseAbility(target);
                     Utils.Sleep(400 - Game.Ping, "Ethereal");
                     if (Utils.SleepCheck("EtherealTime") && me.Distance2D(target) <= Ethereal.CastRange)
                     {
                         Utils.Sleep(((me.NetworkPosition.Distance2D(target.NetworkPosition) / 1200) * 1000) + 25, "EtherealTime");
                         Utils.Sleep(((me.NetworkPosition.Distance2D(target.NetworkPosition) / 1200) * 1000) + 200, "EtherealTime2");
                     }
                 }
                 else
                     elsecount += 1;
                 if (Dagon != null && Dagon.CanBeCasted() && !Ethereal.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_dagon") && magicimune && Utils.SleepCheck("Rearm") && Utils.SleepCheck("EtherealTime") && !Refresh.IsChanneling && Utils.SleepCheck("dagon"))
                 {
                     Dagon.UseAbility(target);
                     Utils.Sleep(350 - Game.Ping, "dagon");
                 }
                 else
                     elsecount += 1;
                 if (Rocket != null && Rocket.CanBeCasted() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Rocket.Name) && magicimune && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("rocket"))
                 {
                     Rocket.UseAbility();
                     Utils.Sleep(500 - Game.Ping, "rocket");
                     if (Utils.SleepCheck("RocketTime") && me.Distance2D(target) <= Rocket.CastRange)
                     {
                         Utils.Sleep(((me.NetworkPosition.Distance2D(target.NetworkPosition) / 900) * 1000), "RocketTime");
                         Utils.Sleep(((me.NetworkPosition.Distance2D(target.NetworkPosition) / 900) * 1000) + 200, "RocketTime2");
                     }
                 }
                 else
                     elsecount += 1;
                 if (Shiva != null && Shiva.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Shiva.Name) && magicimune && Utils.SleepCheck("Rearm") && !Refresh.IsChanneling && Utils.SleepCheck("shiva"))
                 {
                     Shiva.UseAbility();
                     Utils.Sleep(200 - Game.Ping, "shiva");
                 }
                 else
                     elsecount += 1;
                 if (elsecount == 9 && euls != null && euls.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(euls.Name) && magicimune && Utils.SleepCheck("Rearm") && Utils.SleepCheck("EtherealTime2") && Utils.SleepCheck("RocketTime2") && Utils.SleepCheck("euls"))
                 {
                     euls.UseAbility(target);
                     Utils.Sleep(200 - Game.Ping, "euls");
                 }
                 else
                     elsecount += 1;
                 if (elsecount == 10 && Refresh != null && Refresh.CanBeCasted() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Refresh.Name) && !Refresh.IsChanneling && Utils.SleepCheck("Rearm") && Ready_for_refresh())
                 {
                     Refresh.UseAbility();
                     Utils.Sleep(1000, "Rearm");
                 }
                 else
                 {
                     if (!me.IsChanneling() && me.CanAttack() && Utils.SleepCheck("Rearm") && me.Distance2D(target) <= me.AttackRange)
                         Orbwalking.Orbwalk(target);
                 }
             }
         }
         else
         {
             autoattack(false);
             if (!me.IsChanneling() && Utils.SleepCheck("Rearm"))
                 me.Move(Game.MousePosition);
         }
     }
     else
         autoattack(false);
 }
开发者ID:jaddyknight,项目名称:EnsageSharp,代码行数:101,代码来源:Tinker_Perfect_type.cs

示例8: Game_OnUpdate


//.........这里部分代码省略.........

            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);

                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");

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

                        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");
                        }

                        Utils.ChainStun(me, 100, null, false);
                        if (blink != null && blink.CanBeCasted() && me.Distance2D(target) > 300 && me.Distance2D(target) <= 1300 && Utils.SleepCheck("blink"))
                        {
                            blink.UseAbility(target.Position);
                            Utils.Sleep(150 + Game.Ping, "blink");
开发者ID:spyware293,项目名称:Ensage,代码行数:67,代码来源:Program.cs

示例9: Game_OnUpdate


//.........这里部分代码省略.........
                                    {
                                        ghost.UseAbility();
                                        Utils.Sleep(250, "Ghost");
                                    }

                                    if (// Shiva Item
                                        shiva != null
                                        && shiva.CanBeCasted()
                                        && me.CanCast()
                                        && !target.IsMagicImmune()
                                        && Utils.SleepCheck("shiva")
                                        && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(shiva.Name)
                                        && me.Distance2D(target) <= 600
                                        )

                                    {
                                        shiva.UseAbility();
                                        Utils.Sleep(250, "shiva");
                                    } // Shiva Item end
                                    if ( // sheep
                                        sheep != null
                                        && sheep.CanBeCasted()
                                        && me.CanCast()
                                        && !target.IsLinkensProtected()
                                        && !target.IsMagicImmune()
                                        && me.Distance2D(target) <= 1400
                                        && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(sheep.Name)
                                        && Utils.SleepCheck("sheep")
                                        )
                                    {
                                        sheep.UseAbility(target);
                                        Utils.Sleep(250, "sheep");
                                    } // sheep Item end

                                    if (// Dagon
                                        me.CanCast()
                                        && dagon != null
                                        && (ethereal == null
                                        || (target.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow")
                                        || ethereal.Cooldown < 17))
                                        && !target.IsLinkensProtected()
                                        && dagon.CanBeCasted()
                                        && !target.IsMagicImmune()
                                        && Utils.SleepCheck("dagon")
                                       )
                                    {
                                        dagon.UseAbility(target);
                                        Utils.Sleep(200, "dagon");
                                    } // Dagon Item end

                                    if (
                                         // cheese
                                         cheese != null
                                         && cheese.CanBeCasted()
                                         && me.Health <= (me.MaximumHealth * 0.3)
                                         && me.Distance2D(target) <= 700
                                         && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(cheese.Name)
                                         && Utils.SleepCheck("cheese")
                                     )
                                    {
                                        cheese.UseAbility();
                                        Utils.Sleep(200, "cheese");
                                    } // cheese Item end
                                }
                            }
                        }
                        if (Menu.Item("orbwalk").GetValue<bool>())
                        {
                            if (me.Distance2D(target) <= me.AttackRange + 5 &&
                            (!me.IsAttackImmune()
                            || !target.IsAttackImmune()
                            )
                            && me.NetworkActivity != NetworkActivity.Attack
                            && me.CanAttack()
                            && !me.IsAttacking()
                            && Utils.SleepCheck("attack")
                            )
                            {
                                me.Attack(target);
                                Utils.Sleep(180, "attack");
                            }
                            else if (
                                (!me.CanAttack()
                                || me.Distance2D(target) >= 450)
                                && me.NetworkActivity != NetworkActivity.Attack
                                && me.Distance2D(target) <= 2500
                                && !me.IsAttacking()
                                && Utils.SleepCheck("Move")
                                )
                            {
                                me.Move(Prediction.InFront(target, 100));
                                Utils.Sleep(400, "Move");
                            }
                        }
                    }
                }
                Utils.Sleep(100, "activated");
            }
            A();
        }
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

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

示例11: Game_OnUpdate


//.........这里部分代码省略.........
                    }

                    if (ethereal != null && ethereal.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion && !linkedsph &&
                        Utils.SleepCheck("ethereal") && menuValue.IsEnabled(ethereal.Name))
                    {
                        ethereal.UseAbility(target);
                        Utils.Sleep(50+Game.Ping, "ethereal");
                    }

                    if (halberd != null && halberd.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion &&
                        !linkedsph &&
                        Utils.SleepCheck("halberd") && Menu.Item("active").GetValue<KeyBind>().Active && menuValue.IsEnabled(halberd.Name))
                    {
                        halberd.UseAbility(target);
                        Utils.Sleep(50 + Game.Ping, "halberd");
                    }

                    if (dagon != null && dagon.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion && !linkedsph && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-2 || ghostform) &&
                        Utils.SleepCheck("dagon") && menuValue.IsEnabled("item_dagon_5"))
                    {
                        dagon.UseAbility(target);
                        Utils.Sleep(50+Game.Ping, "dagon");
                    }

                    if (shiva != null && shiva.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion && me.Distance2D(target) < 850 &&
                        Utils.SleepCheck("shiva") && Menu.Item("active").GetValue<KeyBind>().Active && menuValue.IsEnabled(shiva.Name))
                    {
                        shiva.UseAbility();
                        Utils.Sleep(50+Game.Ping, "shiva");
                    }
                    
                    if (me.Spellbook.SpellQ != null && me.Spellbook.SpellQ.CanBeCasted() &&
                        me.Mana > me.Spellbook.Spell1.ManaCost && !target.IsMagicImmune() && !target.IsIllusion && me.CanCast() &&
                        Utils.SleepCheck("Q") && (!me.Spellbook.Spell2.CanBeCasted() || linkedsph) && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-1.5 || ghostform))
                    {
                        me.Spellbook.SpellQ.UseAbility(target);
                        Utils.Sleep(200 + Game.Ping, "Q");
                    }

                    if (me.Spellbook.Spell2 != null && (me.Distance2D(target) < Wrange) &&
                        me.Spellbook.Spell2.CanBeCasted() && me.Mana > me.Spellbook.Spell2.ManaCost && !linkedsph && me.CanCast() &&
                        !target.IsMagicImmune() && !target.IsIllusion && Utils.SleepCheck("W") && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength - 1.5 || ghostform || target.IsChanneling()))
                    {
                        me.Spellbook.Spell2.UseAbility(target);
                        Utils.Sleep(400 + Game.Ping, "W");
                    }

                    if (me.Spellbook.Spell2 != null &&
                        (me.Distance2D(target) < realWrange) &&
                        (me.Distance2D(target) > Wrange) && me.Spellbook.Spell2.CanBeCasted() && me.CanCast() &&
                        me.Mana > me.Spellbook.Spell2.ManaCost && !target.IsMagicImmune() && !target.IsIllusion && !linkedsph &&
                        Utils.SleepCheck("W") && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-1.5 || ghostform || target.IsChanneling()))
                    {
                        me.Spellbook.Spell2.CastSkillShot(target);
                        Utils.Sleep(400 + Game.Ping, "W");
                    }

                    if (
                        (!(me.Spellbook.Spell2.CanBeCasted() && me.Spellbook.Spell1.CanBeCasted()) || target.IsMagicImmune() || !me.CanCast()) && !ghostform &&
                        me.CanAttack() && me.Distance2D(target) < 350+me.HullRadius+target.HullRadius &&
                        target != null)
                    {
                        Orbwalking.Orbwalk(target);
                    }
                    else if (me.CanMove() && !me.IsChanneling() && Utils.SleepCheck("movesleep") && (me.Distance2D(target) >= 350 + me.HullRadius + target.HullRadius || ghostform || !me.CanAttack()))
                    {
                        me.Move(Game.MousePosition);
                        Utils.Sleep(50 + Game.Ping, "movesleep");
                    }
                    if (Menu.Item("refresherToggle").GetValue<bool>() && !target.IsMagicImmune() && refresher != null &&
                        refresher.CanBeCasted() && me.Spellbook.Spell4.CanBeCasted() && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-2 || ghostform) &&
                        Utils.SleepCheck("ultiRefresher") && Menu.Item("active").GetValue<KeyBind>().Active)
                    {
                        me.Spellbook.Spell4.UseAbility();
                        Utils.Sleep(100 + Game.Ping, "ultiRefresher");
                    }

                    if (Menu.Item("refresherToggle").GetValue<bool>() && refresher != null && refresher.CanBeCasted() && me.Mana > refresherComboManacost &&
                        Utils.SleepCheck("refresher") && !target.IsMagicImmune() && target != null &&
                        !me.Spellbook.Spell4.CanBeCasted() && !me.Spellbook.Spell2.CanBeCasted() &&
                        (orchid == null || orchid.Cooldown > 0) &&
                        (sheepstick == null || sheepstick.Cooldown > 0) &&
                        (veil == null || veil.Cooldown > 0) &&
                        (shiva == null || shiva.Cooldown > 0) &&
                        (halberd == null || halberd.Cooldown > 0) &&
                        (dagon == null || dagon.Cooldown > 0) &&
                        (ethereal == null || ethereal.Cooldown > 0) && 
                        Menu.Item("active").GetValue<KeyBind>().Active)
                    {
                        refresher.UseAbility();
                        Utils.Sleep(300 + Game.Ping, "refresher");
                    }
                }
                else if (!me.IsChanneling() && Utils.SleepCheck("movesleep"))
                {
                    me.Move(Game.MousePosition);
                    Utils.Sleep(50 + Game.Ping, "movesleep");
                }
            }
        }
开发者ID:Evervolv1337,项目名称:Ensage,代码行数:101,代码来源:Program.cs

示例12: 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_Clinkz)
                return;

            if (me == null)
                return;

            if (arrows == null)
                arrows = me.Spellbook.SpellW;

            if (bkb == null)
                bkb = me.FindItem("item_black_king_bar");

            if (strafe == null)
                strafe = me.Spellbook.Spell1;

            if (hex == null)
                hex = me.FindItem("item_sheepstick");

            if (orchid == null)
                orchid = me.FindItem("item_orchid");

            if (medallion == null)
                medallion = me.FindItem("item_medallion_of_courage");

            if (solar == null)
                solar = me.FindItem("item_solar_crest");

            if (!menuvalueSet)
            {
                menuValue = Menu.Item("Items").GetValue<AbilityToggler>();
                menuvalueSet = true;
            }

            const int DPrange = 0x190;

            var creepR =
                ObjectMgr.GetEntities<Creep>()
                    .Where(
                        creep =>
                            (creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
                             creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral) &&
                             creep.IsAlive && creep.IsVisible && creep.IsSpawned &&
                             creep.Team != me.Team && creep.Position.Distance2D(me.Position) <= DPrange &&
                             me.Spellbook.SpellR.CanBeCasted()).ToList();

            if (autoKillz && Menu.Item("enable").GetValue<bool>())
            {

                target = me.ClosestToMouseTarget(0x3e8);

            //orbwalk
            if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0))
            {
                target = null;
            }
            var canCancel = Orbwalking.CanCancelAnimation();
            if (canCancel)
            {
                if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target))
                {
                    target = me.ClosestToMouseTarget(0x3e8);
                }

            }

            if (target != null && target.IsAlive && !target.IsInvul() && !target.IsIllusion)
            {

                int attackrange = 0x276;
                if (me.CanAttack() && me.CanCast())
                {

                    if (arrows != null && arrows.IsValid && arrows.CanBeCasted() &&me.CanCast() && Utils.SleepCheck("arrows"))
                    {
                        arrows.UseAbility(target);
                        Utils.Sleep(50, "arrows");
                    }

                    if (strafe != null && strafe.IsValid && strafe.CanBeCasted() && me.CanCast() && me.Distance2D(target) <= 720 &&
                        Utils.SleepCheck("strafe"))

                    {
                        strafe.UseAbility();
                        Utils.Sleep(50 + Game.Ping, "strafe");
                    }

                    if (creepR.Count > 0 && !me.Modifiers.ToList().Exists(x => x.Name == "modifier_clinkz_death_pact"))
                    {
                        var creepmax = creepR.MaxOrDefault(x => x.Health);
                        me.Spellbook.SpellR.UseAbility(creepmax);
                    }

                    if (medallion != null && medallion.IsValid && medallion.CanBeCasted() && Utils.SleepCheck("medallion") && menuValue.IsEnabled(medallion.Name))
//.........这里部分代码省略.........
开发者ID:dijedodol,项目名称:Ensage-,代码行数:101,代码来源:Program.cs


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