本文整理汇总了C#中System.Item.UseAbility方法的典型用法代码示例。如果您正苦于以下问题:C# Item.UseAbility方法的具体用法?C# Item.UseAbility怎么用?C# Item.UseAbility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Item
的用法示例。
在下文中一共展示了Item.UseAbility方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tick
public static void Tick(EventArgs args)
{
if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame || Game.IsChatOpen)
return;
me = ObjectMgr.LocalHero;
if (me == null)
return;
if (me.IsAlive && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && Utils.SleepCheck("AutoItems"))
{
item_bottle = me.FindItem("item_bottle");
item_phase_boots = me.FindItem("item_phase_boots");
item_magic_stick = me.FindItem("item_magic_stick");
item_magic_wand = me.FindItem("item_magic_wand");
PercentStickUse = ((double)Menu.Item("Percent Configuration").GetValue<Slider>().Value / 100);
if (item_bottle != null && me.Modifiers.Any(x => x.Name == "modifier_fountain_aura_buff") && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_bottle.Name))
{
if(!me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && (me.Health < me.MaximumHealth || me.Mana < me.MaximumMana))
item_bottle.UseAbility();
Alies = ObjectMgr.GetEntities<Hero>().Where(x => x.Team == me.Team && x != me && (x.Health < x.MaximumHealth || x.Mana < x.MaximumMana) && !x.Modifiers.Any(y => y.Name == "modifier_bottle_regeneration") && x.IsAlive && !x.IsIllusion && x.Distance2D(me) <= item_bottle.CastRange).ToList();
foreach (Hero v in Alies)
if (v != null)
item_bottle.UseAbility(v);
}
if (item_phase_boots != null && item_phase_boots.CanBeCasted() && me.NetworkActivity == NetworkActivity.Move && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_phase_boots.Name))
item_phase_boots.UseAbility();
if (item_magic_stick != null && item_magic_stick.CanBeCasted() && item_magic_stick.CurrentCharges > 0 && (double)me.Health / me.MaximumHealth < PercentStickUse && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_magic_stick.Name))
item_magic_stick.UseAbility();
if (item_magic_wand != null && item_magic_wand.CanBeCasted() && item_magic_wand.CurrentCharges > 0 && (double)me.Health / me.MaximumHealth < PercentStickUse && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_magic_wand.Name))
item_magic_wand.UseAbility();
Utils.Sleep(250, "AutoItems");
}
}
示例2: GameOnUpdate
private static void GameOnUpdate(EventArgs eventArgs)
{
var me = ObjectMgr.LocalHero;
if (!Game.IsInGame || me == null) return;
if (sleepTime > 0) {
sleepTime--;
return;
}
if (me.IsInvisible())
{
sleepTime = 10;
return;
}
quellingBlade =
me.Inventory.Items.FirstOrDefault(
i => i.ClassID == ClassID.CDOTA_Item_QuellingBlade || i.ClassID == ClassID.CDOTA_Item_Battlefury);
tango =
me.Inventory.Items.FirstOrDefault(
i => i.ClassID == ClassID.CDOTA_Item_Tango || i.ClassID == ClassID.CDOTA_Item_Tango_Single);
var units = ObjectMgr.GetEntities<Unit>();
var wards = units
.Where(
u => (u.ClassID == ClassID.CDOTA_NPC_Observer_Ward || u.ClassID == ClassID.CDOTA_NPC_Observer_Ward_TrueSight) && u.Team != me.Team && u.IsAlive && Vector3.Distance(me.Position, u.Position) < 475).ToList();
var mines = units.Where(u => u.ClassID == ClassID.CDOTA_NPC_TechiesMines && u.Team != me.Team && u.IsAlive && Vector3.Distance(me.NetworkPosition, u.NetworkPosition) < 475).ToList();
var canDewardWard = ((quellingBlade != null || tango != null) && wards.Count > 0);
var canDewardMine = ((quellingBlade != null) && mines.Count > 0);
if (canDewardWard && me.IsAlive) {
Item dewardItem = quellingBlade;
// is using a tango worth it?
// tango heals 230 if used on ward, 115 if used on tree
if (tango != null && quellingBlade != null && me.Modifiers.All(m => m.Name != "modifier_tango_heal")) {
var hpMissing = me.MaximumHealth - me.Health;
if (hpMissing > 115) dewardItem = tango;
}
else if (quellingBlade == null) dewardItem = tango;
if (dewardItem.Cooldown == 0) {
dewardItem.UseAbility(wards[0]);
sleepTime = 10;
}
}
if (canDewardMine) {
if (quellingBlade.Cooldown == 0) {
quellingBlade.UseAbility(mines[0]);
sleepTime = 10;
}
}
}
示例3: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
if (!Game.IsInGame || Game.IsPaused || Game.IsChatOpen || Game.IsWatchingGame || !Utils.SleepCheck("updaterate"))
return;
if (me.IsChanneling() || me.IsInvisible() || !Menu.Item("toggle").GetValue<KeyBind>().Active) return;
dagon = me.GetDagon();
target = ObjectManager.GetEntitiesParallel<Hero>().FirstOrDefault(CheckTarget);
if (dagon == null || target == null || !me.CanUseItems() || !dagon.CanBeCasted()) return;
dagon.UseAbility(target);
Utils.Sleep(100, "updaterate");
}
示例4: Game_OnUpdate
public static void Game_OnUpdate(EventArgs args)
{
if (!Game.IsInGame) return;
_me = ObjectMgr.LocalHero;
if (_me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Morphling)
{
return;
}
if (!_activated) return;
if ((_target == null || !_target.IsVisible) && !_me.IsChanneling())
_me.Move(Game.MousePosition);
if (_target == null || _me.Distance2D(_target) > 500)
_target = _me.ClosestToMouseTarget(1000);
//Skills & Items
waveform = _me.Spellbook.Spell1;
adapt = _me.Spellbook.Spell2;
eblade = _me.FindItem("item_ethereal_blade");
bkb = _me.FindItem("item_black_king_bar");
if (_target != null && _target.IsAlive && !_target.IsInvul())
{
if (!Utils.SleepCheck("Morph_Wait")) return;
var targetDistance = _me.Distance2D(_target);
var attackRange = 1000;
if (targetDistance <= attackRange && waveform != null && waveform.CanBeCasted() && Utils.SleepCheck("waveform"))
{
waveform.UseAbility(_target.Position);
Utils.Sleep(150 + Game.Ping, "waveform");
}
else if (bkb !=null && _bkbToggle && Utils.SleepCheck("BKB"))
{
bkb.UseAbility();
Utils.Sleep(150 + Game.Ping, "BKB");
}
else if (eblade != null && eblade.CanBeCasted() && Utils.SleepCheck("eblade"))
{
eblade.UseAbility(_target);
Utils.Sleep(150 + Game.Ping, "eblade");
}
else if (adapt != null && adapt.CanBeCasted() && Utils.SleepCheck("adapt"))
{
adapt.UseAbility(_target);
Utils.Sleep(150 + Game.Ping, "adapt");
}
}
}
示例5: Tick
public static void Tick(EventArgs args)
{
if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
return;
me = ObjectMgr.LocalHero;
target = ObjectMgr.GetEntities<Hero>().Where(x => x.Health <= 100 && x.Distance2D(me) <= 950 && !x.IsIllusion && x.IsAlive && x.Team != me.Team).ToList();
if (me == null || target.FirstOrDefault() == null)
return;
urn_of_shadows = me.FindItem("item_urn_of_shadows");
if (!me.IsChanneling() && target.FirstOrDefault() != null && urn_of_shadows != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki))
{
if (me.CanCast() && urn_of_shadows.CanBeCasted() && Utils.SleepCheck("urn"))
{
urn_of_shadows.UseAbility(target.FirstOrDefault());
Utils.Sleep(200, "urn");
}
}
}
示例6: A
public static void A(EventArgs args)
{
var me = ObjectMgr.LocalHero;
if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_Skywrath_Mage || me == null)
{
return;
}
var enemies =ObjectMgr.GetEntities<Hero>().Where(x => x.IsVisible && x.IsAlive && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
if (Menu.Item("autoUlt").GetValue<bool>())
{
core = me.FindItem("item_octarine_core");
force = me.FindItem("item_force_staff");
cyclone = me.FindItem("item_cyclone");
orchid = me.FindItem("item_orchid");
atos = me.FindItem("item_rod_of_atos");
foreach (var e in enemies)
{
if (e == null)
return;
bool reflect = e.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");
{
if (cyclone != null && reflect && cyclone.CanBeCasted() && me.Distance2D(e) < cyclone.CastRange && Utils.SleepCheck(e.Handle.ToString()))
{
cyclone.UseAbility(me);
Utils.Sleep(500, e.Handle.ToString());
}
if ((Game.IsKeyDown(Menu.Item("Combo Key").GetValue<KeyBind>().Key) && e.MovementSpeed <= 200 && e.Modifiers.Any(y => y.Name == "modifier_skywrath_mage_ancient_seal") || ((E.Cooldown <= 14 && core == null) || E.Cooldown <= 10 && core != null || e.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow"))))
{
if (R != null && e != null && R.CanBeCasted() && me.Distance2D(e) <= 1200
&& e.MovementSpeed <= 200
&& !e.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect")
&& !e.Modifiers.Any(y => y.Name == "modifier_sniper_headshot")
&& !e.Modifiers.Any(y => y.Name == "modifier_leshrac_lightning_storm_slow")
&& !e.Modifiers.Any(y => y.Name == "modifier_razor_unstablecurrent_slow")
&& !e.Modifiers.Any(y => y.Name == "modifier_pudge_meat_hook")
&& !e.Modifiers.Any(y => y.Name == "modifier_tusk_snowball_movement")
&& !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_spirit_breaker_charge_of_darkness")
&& !e.Modifiers.Any(y => y.Name == "modifier_shadow_demon_disruption")
&& (!e.FindSpell("abaddon_borrowed_time").CanBeCasted() && !e.Modifiers.Any(y => y.Name == "modifier_abaddon_borrowed_time_damage_redirect"))
&& e.Health >= (e.MaximumHealth / 100 * (Menu.Item("Healh").GetValue<Slider>().Value))
&& !e.IsMagicImmune()
&& Menu.Item("AutoUlt: ").GetValue<AbilityToggler>().IsEnabled(R.Name)
&& Utils.SleepCheck(e.Handle.ToString()))
{
R.UseAbility(e.Predict(500));
Utils.Sleep(300, e.Handle.ToString());
}
if (R != null && e != null && R.CanBeCasted() && me.Distance2D(e) <= 1200
&&
(
e.Modifiers.Any(y => y.Name == "modifier_meepo_earthbind")
|| e.Modifiers.Any(y => y.Name == "modifier_pudge_dismember")
|| e.Modifiers.Any(y => y.Name == "modifier_naga_siren_ensnare")
|| e.Modifiers.Any(y => y.Name == "modifier_lone_druid_spirit_bear_entangle_effect")
|| (e.Modifiers.Any(y => y.Name == "modifier_legion_commander_duel") && !e.AghanimState())
|| e.Modifiers.Any(y => y.Name == "modifier_kunkka_torrent")
|| e.Modifiers.Any(y => y.Name == "modifier_ice_blast")
|| e.Modifiers.Any(y => y.Name == "modifier_enigma_black_hole_pull")
|| e.Modifiers.Any(y => y.Name == "modifier_ember_spirit_searing_chains")
|| e.Modifiers.Any(y => y.Name == "modifier_dark_troll_warlord_ensnare")
|| e.Modifiers.Any(y => y.Name == "modifier_crystal_maiden_frostbite")
|| e.ClassID == ClassID.CDOTA_Unit_Hero_Rattletrap && e.FindSpell("rattletrap_power_cogs").IsInAbilityPhase
|| e.Modifiers.Any(y => y.Name == "modifier_axe_berserkers_call")
|| e.Modifiers.Any(y => y.Name == "modifier_bane_fiends_grip")
|| e.Modifiers.Any(y => y.Name == "modifier_faceless_void_chronosphere_freeze") && e.ClassID != ClassID.CDOTA_Unit_Hero_FacelessVoid
|| e.Modifiers.Any(y => y.Name == "modifier_storm_spirit_electric_vortex_pull")
|| (e.ClassID == ClassID.CDOTA_Unit_Hero_WitchDoctor && e.FindSpell("witch_doctor_death_ward").IsInAbilityPhase)
|| (e.ClassID == ClassID.CDOTA_Unit_Hero_CrystalMaiden && e.FindSpell("crystal_maiden_crystal_nova").IsInAbilityPhase)
|| e.IsStunned()
)
&& (!e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone")
&& !e.Modifiers.Any(y => y.Name == "modifier_item_monkey_king_bar")
&& !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_rattletrap_battery_assault")
&& !e.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect")
&& !e.Modifiers.Any(y => y.Name == "modifier_skywrath_mystic_flare_aura_effect")
&& !e.Modifiers.Any(y => y.Name == "modifier_pudge_meat_hook")
&& !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_spirit_breaker_charge_of_darkness")
&& !e.Modifiers.Any(y => y.Name == "modifier_shadow_demon_disruption")
&& !e.Modifiers.Any(y => y.Name == "modifier_tusk_snowball_movement")
&& (!e.FindSpell("abaddon_borrowed_time").CanBeCasted() && !e.Modifiers.Any(y => y.Name == "modifier_abaddon_borrowed_time_damage_redirect"))
&& e.Health >= (e.MaximumHealth / 100 * (Menu.Item("Healh").GetValue<Slider>().Value))
&& !e.IsMagicImmune())
&& Menu.Item("AutoUlt: ").GetValue<AbilityToggler>().IsEnabled(R.Name)
&& Utils.SleepCheck(e.Handle.ToString()))
//.........这里部分代码省略.........
示例7: Game_OnUpdate
public static void Game_OnUpdate(EventArgs args)
{
var me = ObjectMgr.LocalHero;
if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_Skywrath_Mage || me == null || Game.IsWatchingGame)
{
return;
}
var target = me.ClosestToMouseTarget(2000);
if (target == null)
{
return;
}
//spell
Q = me.Spellbook.SpellQ;
W = me.Spellbook.SpellW;
E = me.Spellbook.SpellE;
R = me.Spellbook.SpellR;
// Item
ethereal = me.FindItem("item_ethereal_blade");
sheep = target.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
vail = me.FindItem("item_veil_of_discord");
cheese = me.FindItem("item_cheese");
ghost = me.FindItem("item_ghost");
orchid = me.FindItem("item_orchid");
atos = me.FindItem("item_rod_of_atos");
soulring = me.FindItem("item_soul_ring");
arcane = me.FindItem("item_arcane_boots");
blink = me.FindItem("item_blink");
shiva = me.FindItem("item_shivas_guard");
dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
var ModifW = target.Modifiers.Any(y => y.Name == "modifier_skywrath_mage_concussive_shot_slow");
var ModifR = target.Modifiers.Any(y => y.Name == "modifier_skywrath_mystic_flare_aura_effect");
var ModifE = target.Modifiers.Any(y => y.Name == "modifier_skywrath_mage_ancient_seal");
var ModifRod = target.Modifiers.Any(y => y.Name == "modifier_rod_of_atos_debuff");
var ModifEther = target.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow");
var ModifVail = target.Modifiers.Any(y => y.Name == "modifier_item_veil_of_discord_debuff");
var stoneModif = target.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
if (Game.IsKeyDown(keyCode: 70) && Q.CanBeCasted() && target != null)
{
if (
Q != null
&& Q.CanBeCasted()
&& (target.IsLinkensProtected()
|| !target.IsLinkensProtected())
&& me.CanCast()
&& me.Distance2D(target) < 900
&& !stoneModif
&& Utils.SleepCheck("Q")
)
{
Q.UseAbility(target);
Utils.Sleep(200, "Q");
}
}
if (Game.IsKeyDown(Menu.Item("Combo Key").GetValue<KeyBind>().Key) && me.IsAlive && target.IsAlive && Utils.SleepCheck("activated"))
{
var noBlade = target.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");
if (target.IsVisible && me.Distance2D(target) <= 2300 && !noBlade)
{
if (
Q != null
&& Q.CanBeCasted()
&& (target.IsLinkensProtected()
|| !target.IsLinkensProtected())
&& me.CanCast()
&& me.Distance2D(target) < 1400
&& !stoneModif
&& Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(Q.Name)
&& Utils.SleepCheck("Q")
)
{
Q.UseAbility(target);
Utils.Sleep(200, "Q");
}
if ( // atos Blade
atos != null
//.........这里部分代码省略.........
示例8: Combo
public void Combo()
{
if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
return;
//manta (when silenced)
target = me.ClosestToMouseTarget(2000);
if (target == null) return;
Active = Game.IsKeyDown(menu.Item("Combo Key").GetValue<KeyBind>().Key) && !Game.IsChatOpen;
Q = me.Spellbook.SpellQ;
W = me.Spellbook.SpellW;
R = me.Spellbook.SpellR;
// item
sheep = target.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
satanic = me.FindItem("item_satanic");
shiva = me.FindItem("item_shivas_guard");
dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
arcane = me.FindItem("item_arcane_boots");
mom = me.FindItem("item_mask_of_madness");
vail = me.FindItem("item_veil_of_discord");
medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
ethereal = me.FindItem("item_ethereal_blade");
blink = me.FindItem("item_blink");
soulring = me.FindItem("item_soul_ring");
cheese = me.FindItem("item_cheese");
halberd = me.FindItem("item_heavens_halberd");
abyssal = me.FindItem("item_abyssal_blade");
mjollnir = me.FindItem("item_mjollnir");
var stoneModif = target.HasModifier("modifier_medusa_stone_gaze_stone");
var linkens = target.IsLinkensProtected();
var noBlade = target.HasModifier("modifier_item_blade_mail_reflect");
if (Active && me.IsAlive && target.IsAlive)
{
if (target.IsVisible && me.Distance2D(target) <= 2300 && !noBlade)
{
if (
me.Distance2D(target) <= 300 && (!me.IsAttackImmune() || !target.IsAttackImmune())
&& me.NetworkActivity != NetworkActivity.Attack && me.CanAttack() && Utils.SleepCheck("attack")
)
{
me.Attack(target);
Utils.Sleep(190, "attack");
}
else if (
((!me.CanAttack() && me.Distance2D(target) >= 0) || me.Distance2D(target) >= 300) && me.NetworkActivity != NetworkActivity.Attack &&
me.Distance2D(target) <= 1500 && Utils.SleepCheck("Move")
)
{
me.Move(target.Predict(350));
Utils.Sleep(350, "Move");
}
if (
R != null
&& R.CanBeCasted()
&& !me.HasModifier("modifier_nyx_assassin_vendetta")
&& me.Distance2D(target) <= 1400
&& menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(R.Name)
&& Utils.SleepCheck("R")
)
{
R.UseAbility();
Utils.Sleep(200, "R");
}
if (me.HasModifier("modifier_nyx_assassin_vendetta"))
return;
if (!R.CanBeCasted() ||
R == null || !me.HasModifier("modifier_nyx_assassin_vendetta") || !menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(R.Name))
{
if (stoneModif) return;
float angle = me.FindAngleBetween(target.Position, true);
Vector3 pos = new Vector3((float)(target.Position.X - 100 * Math.Cos(angle)), (float)(target.Position.Y - 100 * Math.Sin(angle)), 0);
if (
blink != null
&& Q.CanBeCasted()
&& me.CanCast()
&& blink.CanBeCasted()
&& me.Distance2D(target) >= 300
&& me.Distance2D(pos) <= 1180
&& menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(blink.Name)
&& Utils.SleepCheck("blink")
)
{
//.........这里部分代码省略.........
示例9: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
if (sleeper.Sleeping)
{
return;
}
dagon = hero.GetDagon();
if (dagon == null || Game.IsPaused || !Menu.Item("key").GetValue<KeyBind>().Active || hero.IsChanneling()
|| (hero.IsInvisible() && !hero.IsVisibleToEnemies))
{
sleeper.Sleep(200);
return;
}
if (hero.ClassID == ClassID.CDOTA_Unit_Hero_ArcWarden)
{
heroClone =
ObjectManager.GetEntities<Hero>()
.FirstOrDefault(
x =>
x.IsAlive && x.Team == hero.Team
&& x.HasModifier("modifier_arc_warden_tempest_double"));
if (heroClone != null)
{
dagonClone = heroClone.GetDagon();
}
}
var target = ObjectManager.GetEntities<Hero>().FirstOrDefault(x => CheckTarget(x));
if (target != null)
{
if (hero.CanUseItems() && dagon.CanBeCasted())
{
dagon.UseAbility(target);
}
else if (heroClone != null && dagonClone.CanBeCasted() && heroClone.CanUseItems())
{
dagonClone.UseAbility(target);
}
}
else if (heroClone != null)
{
if (dagonClone.CanBeCasted() && heroClone.CanUseItems() && dagon.CanBeCasted() && hero.CanUseItems())
{
target = ObjectManager.GetEntities<Hero>().FirstOrDefault(x => CheckTarget(x, true));
if (target != null)
{
dagon.UseAbility(target);
dagonClone.UseAbility(target);
}
}
}
sleeper.Sleep(200);
}
示例10: Combo
public void Combo()
{
if (!Menu.Item("enabled").IsActive())
return;
e = Toolset.ClosestToMouse(me);
if (e == null)
return;
Q = me.Spellbook.SpellQ;
W = me.Spellbook.SpellW;
R = me.Spellbook.SpellR;
Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);
Shiva = me.FindItem("item_shivas_guard");
ethereal = me.FindItem("item_ethereal_blade");
mom = me.FindItem("item_mask_of_madness");
urn = me.FindItem("item_urn_of_shadows");
dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
halberd = me.FindItem("item_heavens_halberd");
mjollnir = me.FindItem("item_mjollnir");
orchid = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
abyssal = me.FindItem("item_abyssal_blade");
mail = me.FindItem("item_blade_mail");
bkb = me.FindItem("item_black_king_bar");
satanic = me.FindItem("item_satanic");
blink = me.FindItem("item_blink");
medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
cyclone = me.FindItem("item_cyclone");
force = me.FindItem("item_force_staff");
sheep = e.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
cheese = me.FindItem("item_cheese");
soul = me.FindItem("item_soul_ring");
arcane = me.FindItem("item_arcane_boots");
stick = me.FindItem("item_magic_stick") ?? me.FindItem("item_magic_wand");
phase = me.FindItem("item_phase_boots");
var v =
ObjectManager.GetEntities<Hero>()
.Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
.ToList();
var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
var modifR = e.Modifiers.Any(y => y.Name == "modifier_bloodseeker_rupture");
var modifQ = e.HasModifier("modifier_bloodseeker_bloodrage");
if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive)
{
if (Menu.Item("orbwalk").GetValue<bool>() && me.Distance2D(e) <= 1900)
{
Orbwalking.Orbwalk(e, 0, 1600, true, true);
}
}
if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !me.IsInvisible())
{
if (cyclone != null && cyclone.CanBeCasted() && W.CanBeCasted()
&& me.Distance2D(e) <= cyclone.GetCastRange() + 300
&& Menu.Item("Item").GetValue<AbilityToggler>().IsEnabled(cyclone.Name)
&& W.CanBeCasted()
&& Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(W.Name)
&& Utils.SleepCheck(me.Handle.ToString()))
{
cyclone.UseAbility(e);
Utils.Sleep(500, me.Handle.ToString());
}
if (
Q != null && Q.CanBeCasted() && me.Distance2D(e) <= 700
&& Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(Q.Name)
&& !modifQ
&& Utils.SleepCheck("Q")
)
{
Q.UseAbility(me);
Utils.Sleep(200, "Q");
}
if (
W != null && W.CanBeCasted() && me.Distance2D(e) <= 700
&&
(!cyclone.CanBeCasted() || cyclone == null ||
!Menu.Item("Item").GetValue<AbilityToggler>().IsEnabled(cyclone.Name))
&& Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(W.Name)
&& Utils.SleepCheck("W")
)
{
W.UseAbility(e.Predict(300));
Utils.Sleep(200, "W");
}
if (
force != null
&& force.CanBeCasted()
&& me.Distance2D(e) < 800
&& modifR
&& e.IsSilenced()
&& Menu.Item("Item").GetValue<AbilityToggler>().IsEnabled(force.Name)
&& Utils.SleepCheck("force"))
{
force.UseAbility(e);
Utils.Sleep(240, "force");
}
if (cyclone == null || !cyclone.CanBeCasted() || !Menu.Item("Item").GetValue<AbilityToggler>().IsEnabled(cyclone.Name))
{
//.........这里部分代码省略.........
示例11: Game_OnUpdate
public static void Game_OnUpdate(EventArgs args)
{
var me = ObjectMgr.LocalHero;
if (!Game.IsInGame || me.ClassID != ClassID.CDOTA_Unit_Hero_Pugna || me == null)
{
return;
}
var target = me.ClosestToMouseTarget(2000);
if (target == null)
{
return;
}
//spell
Q = me.Spellbook.SpellQ;
W = me.Spellbook.SpellW;
E = me.Spellbook.SpellE;
R = me.Spellbook.SpellR;
// Item
ethereal = me.FindItem("item_ethereal_blade");
sheep = target.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");
vail = me.FindItem("item_veil_of_discord");
cheese = me.FindItem("item_cheese");
ghost = me.FindItem("item_ghost");
orchid = me.FindItem("item_orchid");
atos = me.FindItem("item_rod_of_atos");
soulring = me.FindItem("item_soul_ring");
arcane = me.FindItem("item_arcane_boots");
blink = me.FindItem("item_blink");
shiva = me.FindItem("item_shivas_guard");
dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
var ModifRod = target.Modifiers.Any(y => y.Name == "modifier_rod_of_atos_debuff");
var ModifEther = target.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow");
var ModifVail = target.Modifiers.Any(y => y.Name == "modifier_item_veil_of_discord_debuff");
var stoneModif = target.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
if (activated && me.IsAlive && target.IsAlive && Utils.SleepCheck("activated"))
{
var noBlade = target.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");
if (R.IsInAbilityPhase || me.Modifiers.Any(y => y.Name == "modifier_pugna_life_drain") )
return;
if (target.IsVisible && me.Distance2D(target) <= 2300 && !noBlade)
{
if ((!me.IsChanneling() && !me.AghanimState()) || me.AghanimState())
{
if (
blink != null
&& W.CanBeCasted()
&& me.CanCast()
&& blinkToggle
&& blink.CanBeCasted()
&& me.Distance2D(target) > 600
&& me.Distance2D(target) < 1150
&& !stoneModif
&& Utils.SleepCheck("blink")
)
{
blink.UseAbility(target.Position);
Utils.Sleep(250, "blink");
}
if (
W != null
&& W.CanBeCasted()
&& (target.IsLinkensProtected()
|| !target.IsLinkensProtected())
&& me.CanCast()
&& me.Distance2D(target) < 1400
&& !stoneModif
&& Utils.SleepCheck("W")
)
{
W.UseAbility(target);
Utils.Sleep(200, "W");
}
if ( // atos Blade
atos != null
&& atos.CanBeCasted()
&& me.CanCast()
&& !target.IsLinkensProtected()
&& !target.IsMagicImmune()
&& Utils.SleepCheck("atos")
&& me.Distance2D(target) <= 2000
//.........这里部分代码省略.........
示例12: Combo
public void Combo()
{
Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);
Q = me.Spellbook.SpellQ;
W = me.Spellbook.SpellW;
R = me.Spellbook.SpellR;
mom = me.FindItem("item_mask_of_madness");
urn = me.FindItem("item_urn_of_shadows");
dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
halberd = me.FindItem("item_heavens_halberd");
mjollnir = me.FindItem("item_mjollnir");
armlet = me.FindItem("item_armlet");
abyssal = me.FindItem("item_abyssal_blade");
mail = me.FindItem("item_blade_mail");
bkb = me.FindItem("item_black_king_bar");
blink = me.FindItem("item_blink");
satanic = me.FindItem("item_satanic");
medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
Shiva = me.FindItem("item_shivas_guard");
manta = me.FindItem("item_manta");
var v =
ObjectManager.GetEntities<Hero>()
.Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
.ToList();
e = Toolset.ClosestToMouse(me);
if (e == null)
return;
var a = ObjectManager.GetEntities<Hero>()
.Where(x => x.Team == me.Team && x.IsAlive && x.IsVisible && x.IsIllusion && x.IsControllable).ToList();
var illy = a.Count;
if (illy >= 1)
{
for (int i = 0; i < illy; ++i)
{
if (a[i].Distance2D(e) <= a[i].GetAttackRange() + a[i].HullRadius && !e.IsAttackImmune()
&& !a[i].IsAttacking() && a[i].CanAttack() && Utils.SleepCheck(a[i].Handle + "Attack")
)
{
a[i].Attack(e);
Utils.Sleep(330, a[i].Handle + "Attack");
}
else if (a[i].Distance2D(e) <= 1000)
{
if ((!a[i].CanAttack() || a[i].Distance2D(e) >= 0)
&& !a[i].IsAttacking()
&& a[i].CanMove() && Utils.SleepCheck(a[i].Handle + "Move")
)
{
a[i].Move(Prediction.InFront(e, 100));
Utils.Sleep(400, a[i].Handle + "Move");
}
}
}
}
if (Active)
{
if (Menu.Item("orbwalk").GetValue<bool>() && me.Distance2D(e) <= 1900)
{
Orbwalking.Orbwalk(e, 0, 1600, true, true);
}
}
if (Active && me.Distance2D(e) <= 1400 && e != null && e.IsAlive && !Toolset.invUnit(me))
{
float angle = me.FindAngleBetween(e.Position, true);
Vector3 pos = new Vector3((float) (e.Position.X - 70*Math.Cos(angle)), (float) (e.Position.Y - 70*Math.Sin(angle)),
0);
if (
blink != null
&& Q.CanBeCasted()
&& me.CanCast()
&& blink.CanBeCasted()
&& me.Distance2D(e) >= 490
&& me.Distance2D(pos) <= 1180
&& Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(blink.Name)
&& Utils.SleepCheck("blink")
)
{
blink.UseAbility(pos);
Utils.Sleep(250, "blink");
}
if (
Q != null
&& Q.CanBeCasted()
&& me.Distance2D(e) <= 900
&& Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(Q.Name)
&& Utils.SleepCheck("Q")
)
{
Q.UseAbility(e);
Utils.Sleep(200, "Q");
}
if (armlet != null
&& !armlet.IsToggled
&& Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(armlet.Name) &&
Utils.SleepCheck("armlet"))
{
armlet.ToggleAbility();
Utils.Sleep(300, "armlet");
//.........这里部分代码省略.........
示例13: Game_OnUpdate
//.........这里部分代码省略.........
Utils.SleepCheck("Armlet"))
{
// Console.WriteLine("Activating Armlet!");
Armlet.ToggleAbility();
Utils.Sleep(100 + Game.Ping, "Armlet");
}
}
else if (me.Health > 250 && enemiesInRange.Count < 1 && !me.IsStunned() && Armlet.IsToggled &&
Utils.SleepCheck("Armlet") &&
me.Modifiers.Any(x => x.Name == "modifier_item_armlet_unholy_strength"))
{
// Console.WriteLine("Deactivating Armlet!");
Armlet.ToggleAbility();
Utils.Sleep(100 + Game.Ping, "Armlet");
}
else if (me.Health < 250 && projectiles.Any() && Armlet.IsToggled && !me.IsStunned() &&
Utils.SleepCheck("Armlet"))
{
// Console.WriteLine("Toggling armlet!");
Armlet.ToggleAbility();
Armlet.ToggleAbility();
Utils.Sleep(100 + Game.Ping, "Armlet");
}
}
if (target != null)
{
turnTime = me.GetTurnTime(target);
if (Blink != null && Blink.CanBeCasted() && me.Distance2D(target) <= Blink.CastRange &&
Utils.SleepCheck("Blink") &&
target != null)
{
Blink.UseAbility(target.Position);
Utils.Sleep(turnTime*1000 + 100 + Game.Ping, "Blink");
}
/*if (spellR.CanBeCasted(target) && me.Distance2D(target) <= spellR.CastRange && Utils.SleepCheck("R") &&
target != null && target.Health > (target.MaximumHealth*0.8) && !target.IsMagicImmune())
{
spellR.UseAbility(target);
Utils.Sleep(LifebreakCastTime + Game.Ping, "R");
}*/
if (Abyssal != null && Abyssal.CanBeCasted(target) && me.Distance2D(target) <= Abyssal.CastRange &&
Utils.SleepCheck("abyssal") && target != null)
{
var canUse = Utils.ChainStun(target, turnTime + 0.1 + Game.Ping/1000, null, false);
if (canUse)
{
Abyssal.UseAbility(target);
Utils.Sleep(turnTime*1000 + 100 + Game.Ping, "abyssal");
}
}
if (Hex != null && Hex.CanBeCasted(target) && me.Distance2D(target) <= (Hex.CastRange) &&
Utils.SleepCheck("hex") &&
target != null)
{
var canUse = Utils.ChainStun(target, turnTime + 0.1 + Game.Ping/1000, null, false);
if (canUse)
{
Hex.UseAbility(target);
Utils.Sleep(turnTime*1000 + 100 + Game.Ping, "hex");
}
}
示例14: Game_OnUpdate
public static void Game_OnUpdate(EventArgs args)
{
me = ObjectMgr.LocalHero;
if (me == null || !Game.IsInGame || Game.IsWatchingGame)
return;
if (me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
return;
// Ability init
Laser = me.Spellbook.Spell1;
Rocket = me.Spellbook.Spell2;
Refresh = me.Spellbook.Spell4;
// Item init
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);
//.........这里部分代码省略.........
示例15: RunScript
//.........这里部分代码省略.........
var EnemyHero = ObjectManager.GetEntities<Hero>().Where(enemy => enemy.Team == me.GetEnemyTeam() && enemy.IsAlive && !enemy.IsIllusion && enemy.Distance2D(Game.MousePosition) <= TargetFindRange).ToList();
e = EnemyHero.MinOrDefault(x => x.Health);
break;
}
}
if (Utils.SleepCheck("delay"))
{
if (me.IsAlive)
{
var count = units.Count();
if (count <= 0) return;
for (int i = 0; i < count; ++i)
{
var v = ObjectManager.GetEntities<Hero>()
.Where(x => x.Team == me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion).ToList();
if (units[i].Name == "npc_dota_juggernaut_healing_ward")
{
if (me.Position.Distance2D(units[i].Position) > 5 && Utils.SleepCheck(units[i].Handle.ToString()))
{
units[i].Move(me.Position);
Utils.Sleep(50, units[i].Handle.ToString());
}
}
else if (units[i].Name == "npc_dota_neutral_ogre_magi")
{
for (int z = 0; z < v.Count(); ++z)
{
var armor = units[i].Spellbook.SpellQ;
if ((!v[z].HasModifier("modifier_ogre_magi_frost_armor") || !me.HasModifier("modifier_ogre_magi_frost_armor")) && armor.CanBeCasted() && units[i].Position.Distance2D(v[z]) <= 900
&& Utils.SleepCheck(units[i].Handle.ToString()))
{
armor.UseAbility(v[z]);
Utils.Sleep(400, units[i].Handle.ToString());
}
}
}
else if (units[i].Name == "npc_dota_neutral_forest_troll_high_priest")
{
if (units[i].Spellbook.SpellQ.CanBeCasted())
{
for (int z = 0; z < v.Count(); ++z)
{
if (units[i].Position.Distance2D(v[z]) <= 900
&& Utils.SleepCheck(units[i].Handle + "high_priest"))
{
units[i].Spellbook.SpellQ.UseAbility(v[z]);
Utils.Sleep(350, units[i].Handle + "high_priest");
}
}
}
}
if (e == null) return;
if (e.IsAlive && !e.IsInvul() && (holdKey || toggleKey))
{
//spell
var CheckStun = e.HasModifier("modifier_centaur_hoof_stomp");
var CheckSetka = e.HasModifier("modifier_dark_troll_warlord_ensnare");
if (units[i].Name == "npc_dota_neutral_dark_troll_warlord")
{
if (e.Position.Distance2D(units[i].Position) < 550 && (!CheckSetka || !CheckStun || !e.IsHexed() || !e.IsStunned()) && units[i].Spellbook.SpellQ.CanBeCasted() &&
Utils.SleepCheck(units[i].Handle + "warlord"))