本文整理汇总了C#中Hero.Attack方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.Attack方法的具体用法?C# Hero.Attack怎么用?C# Hero.Attack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.Attack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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))
//.........这里部分代码省略.........
示例2: Universe
//.........这里部分代码省略.........
//black king bar
if ((bkb != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(bkb.Name)) && bkb.CanBeCasted() && Utils.SleepCheck("bkb"))
{
bkb.UseAbility();
Utils.Sleep(150 + Game.Ping, "bkb");
}
//blink
if ((blink != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(blink.Name)) && blink.CanBeCasted() && target.Position.Distance2D(me.Position) > 300 && Utils.SleepCheck("blink"))
{
blink.UseAbility(me.Distance2D(mousepos) < 1200 ? mousepos : new Vector3(me.NetworkPosition.X + 1150 * (float)Math.Cos(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), me.NetworkPosition.Y + 1150 * (float)Math.Sin(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), 100), false);
Utils.Sleep(150 + Game.Ping, "blink");
}
//orchid
if ((orchid != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(orchid.Name)) && orchid.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("orchid"))
{
orchid.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "orchid");
}
//dust
if ((dust != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(dust.Name)) && dust.CanBeCasted() && Utils.SleepCheck("dust"))
{
dust.UseAbility();
Utils.Sleep(150 + Game.Ping, "dust");
}
//necronomicon
if ((necronomicon != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon.Name)) && necronomicon.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon"))
{
necronomicon.UseAbility();
Utils.Sleep(150 + Game.Ping, "necronomicon");
}
if ((necronomicon2 != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon2.Name)) && necronomicon2.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon2"))
{
necronomicon2.UseAbility();
Utils.Sleep(150 + Game.Ping, "necronomicon2");
}
if ((necronomicon3 != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon3.Name)) && necronomicon3.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon3"))
{
necronomicon3.UseAbility();
Utils.Sleep(150 + Game.Ping, "necronomicon3");
}
//thunder clap
if ((thunderclap != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(thunderclap.Name)) && thunderclap.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("thunderclap"))
{
thunderclap.UseAbility();
Utils.Sleep(150 + Game.Ping, "thunderclap");
}
//urn of shadow
if ((urn != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(urn.Name)) && urn.CanBeCasted() && Utils.SleepCheck("urn"))
{
urn.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "urn");
}
//medal
if ((medal != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(medal.Name)) && medal.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("medal"))
{
medal.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "medal");
}
//shiva
if ((shiva != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(shiva.Name)) && shiva.CanBeCasted() && (target.Position.Distance2D(me.Position) <= 800) && Utils.SleepCheck("shiva"))
{
shiva.UseAbility();
Utils.Sleep(150 + Game.Ping, "shiva");
}
//manta
if ((manta != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(manta.Name)) && manta.CanBeCasted() && (target.Position.Distance2D(me.Position) <= 450) && Utils.SleepCheck("manta"))
{
manta.UseAbility();
Utils.Sleep(150 + Game.Ping, "manta");
}
//ULTIMATE: PrimalSplit
if ((primalsplit != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(primalsplit.Name)) && primalsplit.CanBeCasted() && (target.Position.Distance2D(me.Position) < 500) && (target.Health > (target.MaximumHealth*0.35)) && !thunderclap.CanBeCasted() && !orchid.CanBeCasted() && !dust.CanBeCasted() && !necronomicon.CanBeCasted() && !necronomicon2.CanBeCasted() && !necronomicon3.CanBeCasted() && !urn.CanBeCasted() && !medal.CanBeCasted() && !shiva.CanBeCasted() && !manta.CanBeCasted() && activated && Utils.SleepCheck("primalsplit"))
{
primalsplit.UseAbility();
Utils.Sleep(1000 + Game.Ping, "primalsplit");
var primalstorm = ObjectMgr.GetEntities<Unit>().FirstOrDefault(unit => unit.ClassID == ClassID.CDOTA_Unit_Brewmaster_PrimalStorm && unit.IsAlive);
}
//Moving+Attaking
if (me.CanMove() && (target.Position.Distance2D(me.Position) > 200))
{
me.Move(mousepos, false);
}
if (me.CanMove() && (target.Position.Distance2D(me.Position) < 200))
{
me.Attack(target);
}
}
else
{
if (me.CanMove())
{
me.Move(mousepos, false);
}
}
}
}
}
示例3: 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
{
示例4: Game_OnUpdate
public static void Game_OnUpdate(EventArgs args)
{
_source = ObjectMgr.LocalHero;
if (!Game.IsInGame||Game.IsPaused||Game.IsWatchingGame)
{
return;
}
if (_source.ClassID != ClassID.CDOTA_Unit_Hero_Bristleback)
{
return;
}
var _enemy = ObjectMgr.GetEntities<Hero>().Where(hero => hero.IsAlive && !hero.IsIllusion && hero.IsVisible && hero.Team != _source.Team);
var _creep = ObjectMgr.GetEntities<Creep>().Where(x => (x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege) && x.IsAlive && x.IsSpawned && x.IsVisible).ToList();
if (_source == null)
{
return;
}
if (Quill == null)
{
Quill = _source.Spellbook.Spell2;
}
if (Goo == null)
{
Goo = _source.Spellbook.Spell1;
}
if (abyssal == null)
{
abyssal = _source.FindItem("item_abyssal_blade");
}
if (dust == null)
{
dust = _source.FindItem("item_dust");
}
if (atos == null)
{
atos = _source.FindItem("item_rod_of_atos");
}
if (solar == null)
{
solar = _source.FindItem("item_solar_crest");
}
if (medallion == null)
{
medallion = _source.FindItem("item_medallion_of_courage");
}
if (halberd == null)
{
halberd = _source.FindItem("item_heavens_halberd");
}
if (Menu.Item("Quill").GetValue<StringList>().SelectedIndex == 3 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
{
foreach (var x in _creep)
{
if (x.Team == _source.GetEnemyTeam() && x.Health > 0 && x.Health < (Quilldmg[Quill.Level-1] * (1-x.DamageResist)+20) && GetDistance2D(x.Position, _source.Position) < Quill.CastRange && Utils.SleepCheck("quill"))
{
Quill.UseAbility();
Utils.Sleep(150 + Game.Ping, "quill");
}
}
}
if (Menu.Item("Quill").GetValue<StringList>().SelectedIndex == 0 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
{
Quill.UseAbility();
Utils.Sleep(150 + Game.Ping, "quill");
}
if (Menu.Item("Quill").GetValue<StringList>().SelectedIndex == 1 && Quill.CanBeCasted() && _source.CanCast() && Utils.SleepCheck("quill") && !_source.IsChanneling() && !_source.IsInvisible())
{
foreach (var enemy in _enemy)
{
if (GetDistance2D(enemy.Position, _source.Position) < Quill.CastRange)
{
Quill.UseAbility();
Utils.Sleep(150 + Game.Ping, "quill");
}
}
}
if (chase && Menu.Item("enable").GetValue<bool>())
{
_target = _source.ClosestToMouseTarget(1000);
if (_source.CanAttack() && _source.CanCast())
{
var linken = _target.Modifiers.Any(x => x.Name == "modifier_item_spheretarget") || _target.Inventory.Items.Any(x => x.Name == "item_sphere");
if (abyssal != null && abyssal.CanBeCasted() && Utils.SleepCheck("item_abyssal") && !linken)
{
abyssal.UseAbility(_target);
Utils.Sleep(400 + Game.Ping, "item_abyssal");
}
if (abyssal != null)
{
Utils.ChainStun(_source, 310, null, false);
}
if (medallion != null && medallion.CanBeCasted() && Utils.SleepCheck("item_medal") && !linken)
{
medallion.UseAbility(_target);
Utils.Sleep(150 + Game.Ping, "item_medal");
}
if (atos != null && atos.CanBeCasted() && Utils.SleepCheck("item_atos") && !linken)
//.........这里部分代码省略.........
示例5: JungleFarm
private static void JungleFarm(Hero me)
{
var s = JungleCamps.FindClosestCamp(me, Menu.Item("JungleFarm.TeamCheck").GetValue<bool>(),
Menu.Item("JungleFarm.Ancient").GetValue<bool>());
string name;
var enemyHeroes = Heroes.GetByTeam(me.GetEnemyTeam()).Where(x => x.IsAlive).ToList();
var dist = Menu.Item("JungleFarm.EscapeRange").GetValue<Slider>().Value;
if (Menu.Item("JungleFarm.EscapeFromAnyEnemyHero").GetValue<bool>() &&
enemyHeroes.Any(x => x.Distance2D(me) <= dist)) //escape from hero
{
var handle = me.Handle;
OrderStates[handle] = OrderState.Escape;
NeedHeal[handle] = true;
}
if (s == null)
{
s = JungleCamps.GetCamps.OrderBy(x => x.CampPosition.Distance2D(me)).FirstOrDefault();
if (s != null)
{
name = MeepoSet.Find(x => Equals(x.Hero, me)).Handle.ToString();
if (Utils.SleepCheck("MOVIER_jungle" + name))
{
me.Move(s.StackPosition);
Utils.Sleep(500, "MOVIER_jungle" + name);
}
}
return;
}
name = MeepoSet.Find(x => Equals(x.Hero, me)).Handle.ToString();
var anyMeepo =
MeepoSet.Where(
x =>
x.CurrentOrderState == OrderState.Jungle && x.IsAlive && x.Handle != me.Handle &&
x.Hero.Health >= Menu.Item("Escape.MinRange").GetValue<Slider>().Value)
.OrderBy(y => y.Hero.Distance2D(me))
.FirstOrDefault();
if (anyMeepo != null && me.Health <= 500 && anyMeepo.Hero.Distance2D(MyHero) <= 400 &&
CheckForChangedHealth(me))
{
if (!Utils.SleepCheck(name + "attack_test")) return;
Utils.Sleep(200, name + "attack_test");
var enemy =
ObjectManager.GetEntities<Unit>()
.FirstOrDefault(
x =>
x.IsAlive && x.IsVisible && x.Team != MyHero.Team && x.Distance2D(MyHero) <= 500 &&
!x.IsWaitingToSpawn);
if (enemy != null)
{
var creep = enemy.Position;
var ang = me.FindAngleBetween(creep, true);
var p = new Vector3((float) (me.Position.X - 250*Math.Cos(ang)),
(float) (me.Position.Y - 250*Math.Sin(ang)), 0);
me.Move(p);
}
me.Attack(anyMeepo.Hero, true);
return;
}
var mySet = MeepoSet.Find(x => Equals(x.Hero, me));
var w = mySet.SpellW;
if (w != null && Menu.Item("JungleFarm.AutoW").GetValue<bool>() && w.CanBeCasted())
{
var enemy =
ObjectManager
.GetEntities<Unit>(
)
.FirstOrDefault(
x =>
x.IsAlive && x.Health > 80 && x.IsVisible && x.Team != MyHero.Team &&
x.Distance2D(me) <= 375 &&
!x.IsWaitingToSpawn);
if (enemy != null && Utils.SleepCheck("jungle_farm_w" + name))
{
w.UseAbility(enemy.Position);
Utils.Sleep(1500, "jungle_farm_w_inCasting" + name);
Utils.Sleep(250, "jungle_farm_w" + name);
}
else if (enemy == null && !Utils.SleepCheck("jungle_farm_w_inCasting" + name) &&
Utils.SleepCheck("jungle_farm_w_stop" + name))
{
me.Stop();
Utils.Sleeps.Remove("jungle_farm_w_inCasting" + name);
Utils.Sleep(500, "jungle_farm_w_stop" + name);
}
}
if (!Utils.SleepCheck(name + "attack") || me.IsAttacking()) return;
Utils.Sleep(500, name + "attack");
me.Attack(s.CampPosition);
}
示例6: Game_OnUpdate
//.........这里部分代码省略.........
Blink = me.FindItem("item_blink");
Dagon = me.GetDagon();
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_shiva");
// 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;
// Main combo
if (active && toggle)
{
target = me.ClosestToMouseTarget(1000);
if (target != null && target.IsAlive && !target.IsIllusion && !target.IsMagicImmune() && Utils.SleepCheck("refresh") && !Refresh.IsChanneling)
{
if (Soulring != null && me.Mana < manaForCombo && Soulring.CanBeCasted() && me.Health > 400 && Utils.SleepCheck("soulring"))
{
Soulring.UseAbility();
Utils.Sleep(150 + Game.Ping, "soulring");
}
// Blink
else if (Blink != null && Blink.CanBeCasted() && Utils.SleepCheck("blink"))
{
Utils.Sleep(300 + Game.Ping, "blink");
Utils.ChainStun(me, me.GetTurnTime(target) * 1000 + Game.Ping, null, false);
Blink.UseAbility(target.Position);
}
// Items
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);
}
// Skills
else if (Rocket != null && Rocket.CanBeCasted() && Utils.SleepCheck("rocket") && Utils.SleepCheck("ethereal") && Utils.SleepCheck("veil"))
{
Rocket.UseAbility();
Utils.Sleep(150 + Game.Ping, "rocket");
Utils.ChainStun(me, 150 + Game.Ping, null, false);
}
else if (Laser != null && Laser.CanBeCasted() && Utils.SleepCheck("laser") && Utils.SleepCheck("ethereal") && Utils.SleepCheck("rocket"))
{
Laser.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "laser");
Utils.ChainStun(me, 150 + Game.Ping, null, false);
}
else if (Refresh != null && Refresh.CanBeCasted() && me.Mana > 200 && Utils.SleepCheck("refresh") && !Refresh.IsChanneling && nothingCanCast())
{
Refresh.UseAbility();
Utils.ChainStun(me, (Refresh.ChannelTime * 1000) + Game.Ping + 400, null, false);
Utils.Sleep(700 + Game.Ping, "refresh");
}
else if (!me.IsChanneling() && !Refresh.IsChanneling && nothingCanCast())
{
me.Attack(target);
}
}
}
}
示例7: DoCombo
private static void DoCombo(Hero me, Hero target)
{
var distance = me.Distance2D(target);
IEnumerable<Item> inv;
Item[] enumerable;
bool dagger;
double targetHull = target.HullRadius;
if (Menu.Item("order").GetValue<StringList>().SelectedIndex == (int) Orders.Caster &&
!Menu.Item("hotkeyClone").GetValue<KeyBind>().Active)
{
foreach (var hero in Objects.Tempest.GetCloneList(me))
{
var d = hero.Distance2D(target) - _myHull - targetHull;
inv = hero.Inventory.Items;
enumerable = inv as Item[] ?? inv.ToArray();
dagger =
enumerable.Any(
x =>
x.Name == "item_blink" && x.Cooldown == 0 &&
SpellBaseList.Find(z => z.Name == x.StoredName()) == null);
// uses all items available
if (!hero.IsInvisible())
if (ItemUsage(hero, enumerable, target, d,
Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int)BkbUsage.Clones ||
Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int)BkbUsage.All, true))
SpellsUsage(hero, target, d, dagger, true);
/*SpellsUsage(hero, target, d, dagger, true);
ItemUsage(hero, enumerable, target, d,
Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int) BkbUsage.Clones ||
Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int) BkbUsage.All, true);*/
if (Menu.Item("OrbWalking.Enable").GetValue<bool>() && OrbMinDist < hero.Distance2D(target))
{
Orbwalk(hero, target);
}
else
{
if (!Utils.SleepCheck("clone_attacking" + hero.Handle)) continue;
hero.Attack(target);
Utils.Sleep(350, "clone_attacking" + hero.Handle);
}
/*
if (Menu.Item("OrbWalking.Enable").GetValue<bool>())
{
Orbwalk(hero, target);
}
else
{
if (!Utils.SleepCheck("clone_attacking" + hero.Handle)) continue;
hero.Attack(target);
Utils.Sleep(350, "clone_attacking" + hero.Handle);
}*/
}
}
var illusions =
ObjectManager.GetEntities<Hero>()
.Where(
x =>
x.IsAlive && x.IsControllable && x.Team == me.Team && x.IsIllusion &&
!x.HasModifier("modifier_kill"))
.ToList();
foreach (var illusion in illusions.TakeWhile(illusion => Utils.SleepCheck("clone_attacking" + illusion.Handle)))
{
illusion.Attack(target);
Utils.Sleep(350, "clone_attacking" + illusion.Handle);
}
var necr = Objects.Necronomicon.GetNecronomicons(me);
foreach (
var necronomicon in
necr.TakeWhile(
illusion =>
Utils.SleepCheck("clone_attacking" + illusion.Handle) && illusion.Distance2D(target) <= 1500 &&
!Equals(illusion, me)))
{
necronomicon.Attack(target);
var spell = necronomicon.Spellbook.Spell1;
if (spell != null && spell.CanBeCasted(target) &&
necronomicon.Distance2D(target) <= spell.CastRange + necronomicon.HullRadius + targetHull &&
Utils.SleepCheck(spell.Name + "clone_attacking" + necronomicon.Handle))
{
spell.UseAbility(target);
Utils.Sleep(300, spell.Name + "clone_attacking" + necronomicon.Handle);
}
Utils.Sleep(600, "clone_attacking" + necronomicon.Handle);
}
if (!me.IsAlive) return;
inv = me.Inventory.Items;
enumerable = inv as Item[] ?? inv.ToArray();
dagger = enumerable.Any(x=>x.Name=="item_blink" && x.Cooldown==0);
SpellsUsage(me, target, distance, dagger,false);
ItemUsage(me,enumerable, target, distance,
Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int) BkbUsage.Me ||
Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int) BkbUsage.All);
//Orbwalk(me,target);
if (Menu.Item("OrbWalking.Enable").GetValue<bool>() && OrbMinDist < me.Distance2D(target))
{
Orbwalk(me, target);
}
else
//.........这里部分代码省略.........
示例8: Tick
public static void Tick(EventArgs args)
{
// initial things
me = ObjectMgr.LocalHero;
if ((Game.IsKeyDown(Menu.Item("2001").GetValue<KeyBind>().Key)) || (Game.IsKeyDown(Menu.Item("2002").GetValue<KeyBind>().Key)) || target == null || Utils.SleepCheck("selected"))
{
target = me.ClosestToMouseTarget(1000);
Utils.Sleep(1200,"selected");
}
if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame || Game.IsChatOpen)
return;
if (me.ClassID != ClassID.CDOTA_Unit_Hero_Necrolyte)
return;
if (me == null || target == null)
return;
// skills
if (Qskill == null)
Qskill = me.Spellbook.Spell1;
if (Rskill == null)
Rskill = me.Spellbook.Spell4;
// itens
Blink = me.FindItem("item_blink");
shadow = me.FindItem("item_invis_sword");
silveredge = me.FindItem("item_silver_edge");
dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
ethereal = me.FindItem("item_ethereal_blade");
veil = me.FindItem("item_veil_of_discord");
euls = me.FindItem("item_cyclone");
shivas = me.FindItem("item_shivas_guard");
malevo = me.FindItem("item_orchid");
forcestaff = me.FindItem("item_force_staff");
int ComboDamage = 0;
if (target != null && !target.IsIllusion)
ComboDamage = Damagetokill();
else
ComboDamage = 0;
//Starting Combo
var blinkposition = ((me.Position - target.Position) * 300 / me.Distance2D(target) + target.Position);
var IsLinkensProtected = (target.Modifiers.Any(x => x.Name == "modifier_item_sphere_target") || (target.FindItem("item_sphere") != null && (target.FindItem("item_sphere").Cooldown <= 0)));
var _Is_in_Advantage = (target.Modifiers.Any(x => x.Name == "modifier_item_blade_mail_reflect") || target.Modifiers.Any(x => x.Name == "modifier_item_lotus_orb_active") || target.Modifiers.Any(x => x.Name == "modifier_nyx_assassin_spiked_carapace") || target.Modifiers.Any(x => x.Name == "modifier_templar_assassin_refraction_damage") || target.Modifiers.Any(x => x.Name == "modifier_ursa_enrage") || target.Modifiers.Any(x => x.Name == "modifier_abaddon_borrowed_time") || (target.Modifiers.Any(x => x.Name == "modifier_dazzle_shallow_grave")));
var WindWalkMod = me.Modifiers.Any(x => x.Name == "modifier_item_silver_edge_windwalk" || x.Name == "modifier_item_invisibility_edge_windwalk");
if (((Game.IsKeyDown(Menu.Item("2001").GetValue<KeyBind>().Key) && (ComboDamage <= 0 || stage == 1) && me.Distance2D(target) <= 1000 && target.IsVisible && target.IsAlive && !target.IsMagicImmune() && !target.IsIllusion && target != null && !_Is_in_Advantage) || ( me.Distance2D(target) <= 1000 && target.IsVisible && target.IsAlive && !target.IsMagicImmune() && !target.IsIllusion && target != null && Game.IsKeyDown(Menu.Item("2002").GetValue<KeyBind>().Key))) && Utils.SleepCheck("combo"))
{
stage = 1;
if (me.CanCast() && !me.IsChanneling())
{
if (WindWalkMod)
{
me.Attack(target);
Utils.ChainStun(me, Game.Ping + shadow.GetCastDelay(me, target, true, true), null, false);
}
else
{
if (IsLinkensProtected && (!WindWalkMod))
{
if (euls != null && euls.Cooldown <= 0 && IsLinkensProtected && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(euls.Name))
{
euls.UseAbility(target);
Utils.ChainStun(me,Game.Ping+euls.GetCastDelay(me,target,true,true),null,false);
}
else if (forcestaff != null && forcestaff.Cooldown <= 0 && IsLinkensProtected && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(forcestaff.Name))
{
forcestaff.UseAbility(target);
Utils.ChainStun(me, Game.Ping + forcestaff.GetCastDelay(me, target, true, true), null, false);
}
else if (dagon != null && dagon.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_dagon"))
{
dagon.UseAbility(target);
Utils.ChainStun(me, Game.Ping + dagon.GetCastDelay(me, target, true, true), null, false);
}
else if (ethereal != null && ethereal.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name))
{
ethereal.UseAbility(target);
Utils.ChainStun(me, Game.Ping + ethereal.GetCastDelay(me, target, true, true), null, false);
}
}
else if (!IsLinkensProtected && (!WindWalkMod))
{
if (Blink != null && Blink.Cooldown <= 0 && me.Distance2D(blinkposition) > 300 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Blink.Name))
{
Blink.UseAbility(blinkposition);
Utils.ChainStun(me, Game.Ping + Blink.GetCastDelay(me, target, true, true), null, false);
}
if (malevo != null && malevo.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(malevo.Name))
{
malevo.UseAbility(target);
Utils.ChainStun(me, Game.Ping + malevo.GetCastDelay(me, target, true, true), null, false);
}
if (Rskill.Cooldown <= 0 && Menu.Item("Abilities: ").GetValue<AbilityToggler>().IsEnabled(Rskill.Name))
{
Rskill.UseAbility(target);
Utils.ChainStun(me, Game.Ping + Rskill.GetCastDelay(me, target, true, true), null, false);
}
if (ethereal != null && ethereal.Cooldown <= 0 && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(ethereal.Name))
{
ethereal.UseAbility(target);
Utils.ChainStun(me, Game.Ping + ethereal.GetCastDelay(me, target, true, true), null, false);
ethereal_used = true;
ethereal_used2 = true;
}
//.........这里部分代码省略.........
示例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();
}
示例10: ComboInAction
private static void ComboInAction(Hero me, Hero target)
{
#region Init
/*
var q = me.Spellbook.SpellQ;
var w = me.Spellbook.SpellW;
var e = me.Spellbook.SpellE;
var active1 = me.Spellbook.Spell4;
var active2 = me.Spellbook.Spell5;
*/
var invoke = me.FindSpell("invoker_invoke");
var eul = me.FindItem("item_cyclone");
var dagger = me.FindItem("item_blink");
var refresher = me.FindItem("item_refresher");
var icewall = me.FindSpell("invoker_ice_wall");
var hex = me.FindItem("item_sheepstick");
/*
var ss = me.FindSpell("invoker_sun_strike");
var coldsnap = me.FindSpell("invoker_cold_snap");
var ghostwalk = me.FindSpell("invoker_ghost_walk");
var tornado = me.FindSpell("invoker_tornado");
var deafblast = me.FindSpell("invoker_deafening_blast");
var forge = me.FindSpell("invoker_forge_spirit");
var emp = me.FindSpell("invoker_emp");
var alacrity = me.FindSpell("invoker_alacrity");
var chaosmeteor = me.FindSpell("invoker_chaos_meteor");
*/
if (!_initNewCombo)
{
_initNewCombo = true;
_stage = 1;
PrintInfo("Starting new combo! " + string.Format("[{0}] target: {1}", _combo + 1, target.Name));
}
if (!Utils.SleepCheck("StageCheck")) return;
#endregion
/*var modif = target.Modifiers.Where(x=>x.IsDebuff);
PrintInfo("===========================");
foreach (var s in modif)
{
PrintInfo(s.Name);
}*/
switch (_stage)
{
case 1:
if (Combos[_combo].CheckEul())
{
if (eul == null || eul.AbilityState != AbilityState.Ready) return;
if (me.Distance2D(target) <= eul.CastRange)
{
eul.UseAbility(target);
_stage++;
Utils.Sleep(250, "StageCheck");
}
else if (_autoUseDagger && dagger != null && dagger.CanBeCasted() && Utils.SleepCheck("blinker"))
{
var dist = eul.CastRange - 100;
var point =
new Vector3(
(float) (target.Position.X -
dist *
Math.Cos(me.FindAngleBetween(target.Position, true))),
(float) (target.Position.Y -
dist *
Math.Sin(me.FindAngleBetween(target.Position, true))), 0);
if (me.Distance2D(point) <= 1100)
{
dagger.UseAbility(point);
Utils.Sleep(250, "blinker");
}
}
}
else
{
_stage++;
}
break;
default:
if (Combos[_combo].GetComboAbilities().Length < _stage - 1)
{
me.Attack(target);
Utils.Sleep(1000, "StageCheck");
return;
}
_spellForCast = Combos[_combo].GetComboAbilities()[_stage - 2];
Ability nextSpell = null;
try
{
nextSpell = Combos[_combo].GetComboAbilities()[_stage - 1];
}
catch
{
// ignored
}
if (nextSpell != null && nextSpell.AbilityState == AbilityState.Ready)
{
if (Equals(nextSpell, icewall) || _autoMoveToTarget)
//.........这里部分代码省略.........
示例11: 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))
//.........这里部分代码省略.........
示例12: ComboInAction
//.........这里部分代码省略.........
{
if (dist >= Pull.CastRange + 1100)
{
me.Move(target.Position);
Utils.Sleep(200, "nextAction");
break;
}
if (Menu.Item("dagger").GetValue<StringList>().SelectedIndex ==
(int) DaggerStage.AfterSmash)
{
var ang = me.FindAngleBetween(target.Position, true);
var p = new Vector2((float) (me.Position.X + 1100*Math.Cos(ang)),
(float) (me.Position.Y + 1100*Math.Sin(ang)));
blink.UseAbility(p.ToVector3(true));
Utils.Sleep(100, "nextAction");
if (Menu.Item("debug").GetValue<bool>()) PrintInfo("dagger is used");
}
}
}
}
}
else
{
if (Remnant.CanBeCasted())
{
if (me.NetworkActivity == NetworkActivity.Move)
me.Stop();
Remnant.UseAbility(target.Position);
if (Menu.Item("debug").GetValue<bool>()) PrintInfo("remnant create");
}
}
}
else
_stage++;
break;
case 3:
if (Roll.CanBeCasted() && !Pull.CanBeCasted())
{
Roll.UseAbility(target.Position);
Utils.Sleep(100 + Roll.FindCastPoint(), "nextAction");
if (Menu.Item("debug").GetValue<bool>()) PrintInfo("roll casted");
}
else
_stage++;
break;
case 4:
if (Magnetize.CanBeCasted())
{
if (me.Distance2D(target) < 300)
{
Magnetize.UseAbility();
Utils.Sleep(100 + Magnetize.FindCastPoint(), "nextAction");
_stage++;
if (Menu.Item("debug").GetValue<bool>()) PrintInfo("Magnetize casted");
}
}
break;
case 5:
if (Remnant.CanBeCasted() && Menu.Item("supult").GetValue<bool>())
{
var mod = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_earth_spirit_magnetize");
if (mod != null && mod.RemainingTime <= 0.5+Game.Ping && me.Distance2D(target)<=Remnant.CastRange)
{
Remnant.UseAbility(target.Position);
Utils.Sleep(1000, "nextAction");
me.Attack(target,true);
break;
}
if (Utils.SleepCheck("attackcd"))
{
me.Attack(target);
Utils.Sleep(150, "attackcd");
}
}
else if (Utils.SleepCheck("attackcd"))
{
me.Attack(target);
Utils.Sleep(200, "attackcd");
}
if (Menu.Item("killsteal").GetValue<bool>() && Push.CanBeCasted() && target.DamageTaken(50 * Push.Level, DamageType.Magical, me) > target.Health)
{
Push.UseAbility(target);
Utils.Sleep(500, "nextAction");
me.Attack(target, true);
break;
}
if (Menu.Item("rolling").GetValue<bool>() && Roll.CanBeCasted())
{
Roll.UseAbility(target.Position);
Utils.Sleep(500, "nextAction");
}
break;
}
if (Menu.Item("items").GetValue<bool>())
{
LetsUseItems(me, target);
}
}
示例13: DoCombo
private static void DoCombo(Hero me, Hero target)
{
var darkPact = me.Spellbook.SpellQ;
var pounce = me.Spellbook.SpellW;
var shadowDance = me.Spellbook.SpellR;
var distance = me.Distance2D(target);
var inSb = me.Modifiers.Any(x => x.Name == "modifier_item_silver_edge_windwalk" || x.Name == "modifier_item_invisibility_edge_windwalk");
if (inSb)
{
if (!Utils.SleepCheck("attacking")) return;
me.Attack(target);
Utils.Sleep(200, "attacking");
return;
}
if (Utils.SleepCheck("items"))
{
/*foreach (var item in me.Inventory.Items)
{
Game.PrintMessage(item.Name+": "+item.AbilityBehavior,MessageType.ChatMessage);
}*/
var items =
me.Inventory.Items.Where(
x =>
Items.Contains(x.Name) && x.CanBeCasted() && Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(x.Name) &&
(x.CastRange==0 || x.CastRange >= distance) && Utils.SleepCheck(x.Name)).ToList();
foreach (var item in items)
{
switch (item.ClassID)
{
case ClassID.CDOTA_Item_BlinkDagger:
var p = Prediction.InFront(target, 100);
var dist = me.Distance2D(p);
if (dist <= 1150 && dist >= 400 && pounce != null && pounce.CanBeCasted())
{
item.UseAbility(p);
Utils.Sleep(200, item.Name);
}
break;
default:
if (item.IsAbilityBehavior(AbilityBehavior.UnitTarget))
{
if (!target.IsStunned() && !target.IsHexed())
{
item.UseAbility(target);
}
item.UseAbility(me);
}
else
{
item.UseAbility();
}
Utils.Sleep(200, item.Name);
break;
}
}
}
if (Utils.SleepCheck("dp") && darkPact != null && darkPact.CanBeCasted() && darkPact.CanHit(target))
{
darkPact.UseAbility();
Utils.Sleep(100, "dp");
}
var angle = (float) Math.Max(
Math.Abs(me.RotationRad - Utils.DegreeToRadian(me.FindAngleBetween(target.Position))) - 0.20, 0);
if (Utils.SleepCheck("pounce") && pounce != null && pounce.CanBeCasted() && distance <= 300 && angle == 0)
{
pounce.UseAbility();
Utils.Sleep(100, "pounce");
}
if (me.Health <= me.MaximumHealth / 100 * Menu.Item("minHp").GetValue<Slider>().Value && Utils.SleepCheck("dance") && shadowDance != null && shadowDance.CanBeCasted())
{
shadowDance.UseAbility();
Utils.Sleep(100, "dance");
}
if (!Utils.SleepCheck("attacking")) return;
me.Attack(target);
Utils.Sleep(200, "attacking");
}
示例14: Tinker_In_Madness
//.........这里部分代码省略.........
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");
}
else
elsecount += 1;
if (Dagon != null && Dagon.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled("item_dagon") && magicimune && Utils.SleepCheck("Rearm") && Utils.SleepCheck("EtherealTime"))
Dagon.UseAbility(target);
else
elsecount += 1;
if (Rocket != null && Rocket.CanBeCasted() && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Rocket.Name) && magicimune && Utils.SleepCheck("Rearm"))
{
Rocket.UseAbility();
if (Utils.SleepCheck("RocketTime") && me.Distance2D(target) <= Rocket.CastRange)
Utils.Sleep((me.NetworkPosition.Distance2D(target.NetworkPosition) / 600) * 1000, "RocketTime");
}
else
elsecount += 1;
if (Shiva != null && Shiva.CanBeCasted() && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(Shiva.Name) && magicimune && Utils.SleepCheck("Rearm"))
Shiva.UseAbility();
else
elsecount += 1;
if (elsecount == 9 && euls != null && euls.CanBeCasted() && Menu.Item("Items2: ").GetValue<AbilityToggler>().IsEnabled(euls.Name) && magicimune && Utils.SleepCheck("Rearm") && Utils.SleepCheck("EtherealTime") && Utils.SleepCheck("RocketTime"))
euls.UseAbility(target);
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(800, "Rearm");
}
else
{
if (!me.IsChanneling() && Utils.SleepCheck("Rearm") && me.Distance2D(target) <= me.AttackRange)
me.Attack(target);
}
Utils.Sleep(150, "combo");
}
}
}
else
{
autoattack(false);
if (!me.IsChanneling() && Utils.SleepCheck("Rearm"))
me.Move(Game.MousePosition);
}
}
else
autoattack(false);
}
示例15: Game_OnUpdate
//.........这里部分代码省略.........
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);
}
// Skills
else if (Rocket != null && Rocket.CanBeCasted() && Utils.SleepCheck("rocket") && Utils.SleepCheck("ethereal") && Utils.SleepCheck("veil"))
{
Rocket.UseAbility();
Utils.Sleep(150 + Game.Ping, "rocket");
Utils.ChainStun(me, 150 + Game.Ping, null, false);
}
else if (Laser != null && Laser.CanBeCasted() && Utils.SleepCheck("laser") && Utils.SleepCheck("ethereal") && Utils.SleepCheck("rocket"))
{
Laser.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "laser");
Utils.ChainStun(me, 150 + Game.Ping, null, false);
}
else if (ReArm != null && ReArm.CanBeCasted() && me.Mana > 200 && Utils.SleepCheck("ReArm") && !ReArm.IsChanneling && nothingCanCast())
{
ReArm.UseAbility();
Utils.ChainStun(me, (ReArm.ChannelTime * 1000) + Game.Ping + 400, null, false);
Utils.Sleep(700 + Game.Ping, "ReArm");
}
else if (!me.IsChanneling() && !ReArm.IsChanneling && nothingCanCast())
{
me.Attack(target);
}
}
}
}