本文整理汇总了C#中Hero.IsInvisible方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.IsInvisible方法的具体用法?C# Hero.IsInvisible怎么用?C# Hero.IsInvisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.IsInvisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tick
public static void Tick(EventArgs args)
{
if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame || Game.IsChatOpen)
return;
me = ObjectMgr.LocalHero;
if (me == null)
return;
if (me.IsAlive)
{
FindItems();
PercentStickUse = ((double)Menu.Item("Percent Configuration").GetValue<Slider>().Value / 100);
if ( item_bottle != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && me.Modifiers.Any(x => x.Name == "modifier_fountain_aura_buff") && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_bottle.Name) && Utils.SleepCheck("bottle"))
{
if(!me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && (me.Health < me.MaximumHealth || me.Mana < me.MaximumMana))
item_bottle.UseAbility(false);
Alies = ObjectMgr.GetEntities<Hero>().Where(x => x.Team == me.Team && x != me && (x.Health < x.MaximumHealth || x.Mana < x.MaximumMana) && !x.Modifiers.Any(y => y.Name == "modifier_bottle_regeneration") && x.IsAlive && !x.IsIllusion && x.Distance2D(me) <= item_bottle.CastRange).ToList();
foreach (Hero v in Alies)
if (v != null)
item_bottle.UseAbility(v,false);
Utils.Sleep(300, "bottle");
}
if (item_phase_boots != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && item_phase_boots.CanBeCasted() && me.NetworkActivity == NetworkActivity.Move && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_phase_boots.Name) && Utils.SleepCheck("phaseboots"))
{
item_phase_boots.UseAbility(false);
Utils.Sleep(300, "phaseboots");
}
if (item_magic_stick != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && item_magic_stick.CanBeCasted() && item_magic_stick.CurrentCharges > 0 && (double)me.Health / me.MaximumHealth < PercentStickUse && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_magic_stick.Name))
item_magic_stick.UseAbility(false);
if (item_magic_wand != null && (!me.IsInvisible() || me.ClassID == ClassID.CDOTA_Unit_Hero_Riki) && !me.IsChanneling() && item_magic_wand.CanBeCasted() && item_magic_wand.CurrentCharges > 0 && (double)me.Health / me.MaximumHealth < PercentStickUse && _item_config.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(item_magic_wand.Name))
item_magic_wand.UseAbility(false);
}
}
示例2: cekinvis
//Cek yang invi keliatan apa g
static void cekinvis(Hero kita)
{
if (kita.IsInvisible() && kita.IsVisibleToEnemies)
{
Game.ExecuteCommand("say_team " + kita.Name.Replace("npc_dota_hero_","") + " keliatan");
count += 1;
}
}
示例3: 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");
}
}
}
示例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: Game_OnUpdate
//.........这里部分代码省略.........
catch (Exception)
{
}
}
/*if (t.DayVision == 0 && !find)
{
Bara = t;
find = true;
BaraStartPos=Bara.Position;
}
else if (!find)
{
Bara = null;
BaraStartPos=new Vector3(0,0,0);
}*/
}
}
#endregion
#region ShowRoshanTimer
if (ShowRoshanTimer)
{
var tickDelta = Game.GameTime - _deathTime;
_roshanMinutes = Math.Floor(tickDelta / 60);
_roshanSeconds = tickDelta % 60;
var roshan =
ObjectMgr.GetEntities<Unit>()
.FirstOrDefault(unit => unit.ClassID == ClassID.CDOTA_Unit_Roshan && unit.IsAlive);
if (roshan != null)
{
_roshIsAlive = true;
//RoshanMinutes = 0;
//RoshanSeconds = 0;
//DeathTime = 0;
}
}
#endregion
#region ShowIllusions
if (ShowIllusions)
{
var illusions = ObjectMgr.GetEntities<Hero>()
.Where(
x =>
x.IsIllusion && x.Team != _me.Team);
foreach (var s in illusions)
{
HandleEffect(s);
}
}
#endregion
return;
#region AutoItems
if (!AutoItemsActive || !Utils.SleepCheck("AutoItems")) return;
if (AutoItemsMidas)
{
var midas = _me.FindItem("item_hand_of_midas");
if (midas != null && midas.CanBeCasted() && !_me.IsInvisible())
{
var creep =
ObjectMgr
.GetEntities<Unit>(
).FirstOrDefault(x => ((x is Hero && !x.IsIllusion) || (x is Creep && x.IsSpawned)) && x.IsAlive &&
x.IsVisible && _me.Distance2D(x) <= midas.CastRange && x.Team != _me.Team);
midas.UseAbility(creep);
Utils.Sleep(250, "AutoItems");
//PrintError("midas.CastRange: " + midas.CastRange);
}
}
if (AutoItemsPhase)
{
var phase = _me.FindItem("item_phase_boots");
if (phase != null && phase.CanBeCasted() && !_me.IsAttacking() && !_me.IsInvisible())
{
phase.UseAbility();
Utils.Sleep(250, "AutoItems");
}
}
if (!AutoItemsStick) return;
var stick = _me.FindItem("item_magic_stick");
var wand = _me.FindItem("item_magic_wand");
if (_me.Health * 100 / _me.MaximumHealth > 30 || !_me.IsAlive) return;
if (stick != null && stick.CanBeCasted() && !_me.IsInvisible())
{
stick.UseAbility();
Utils.Sleep(250, "AutoItems");
}
if (wand == null || !wand.CanBeCasted()) return;
wand.UseAbility();
Utils.Sleep(250, "AutoItems");
#endregion
}
示例6: AD
public static void AD(EventArgs args)
{
if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
return;
me = ObjectMgr.LocalHero;
if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker)
return;
aether = me.FindItem("item_aether_lens");
//cyclone = me.FindItem("item_cyclone");
//ghost = me.FindItem("item_ghost");
//sheep = me.FindItem("item_sheepstick");
//atos = me.FindItem("item_rod_of_atos");
FindItems();
if (aether == null)
aetherrange = 0;
else
aetherrange = 200;
if (bottle != null && !me.IsInvisible() && !me.IsChanneling() && !me.Spellbook.Spells.Any(x => x.IsInAbilityPhase) && !March.IsInAbilityPhase && me.Modifiers.Any(x => x.Name == "modifier_fountain_aura_buff") && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(bottle.Name) && Utils.SleepCheck("bottle1"))
{
if(!me.Modifiers.Any(x => x.Name == "modifier_bottle_regeneration") && (me.Health < me.MaximumHealth || me.Mana < me.MaximumMana))
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) <= bottle.CastRange).ToList();
foreach (Hero v in Alies)
if (v != null)
bottle.UseAbility(v);
Utils.Sleep(255, "bottle1");
}
var enemies = ObjectMgr.GetEntities<Hero>().Where(x => x.IsVisible && x.IsAlive && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
foreach (var e in enemies)
{
if (e == null)
return;
//distance = me.Distance2D(e);
angle = Math.Abs(e.FindAngleR() - Utils.DegreeToRadian(e.FindAngleForTurnTime(me.NetworkPosition)));
if (Menu.Item("autoDisable").GetValue<bool>() && me.IsAlive && me.IsVisibleToEnemies)
{
//break linken if tp
if (!me.IsChanneling()
&& me.Distance2D(e) <= 800 + aetherrange + ensage_error
&& me.Distance2D(e) >= 300 + ensage_error
&& e.Modifiers.Any(y => y.Name == "modifier_teleporting")
&& e.IsLinkensProtected()
&& Utils.SleepCheck("tplink")
)
{
if ((cyclone != null && cyclone.CanBeCasted()) || (sheep != null && sheep.CanBeCasted()))
{
if (atos != null && atos.CanBeCasted())
atos.UseAbility(e);
else if (me.Spellbook.SpellQ != null && me.Spellbook.SpellQ.CanBeCasted())
me.Spellbook.SpellQ.UseAbility(e);
else if (ethereal != null && ethereal.CanBeCasted())
ethereal.UseAbility(e);
else if (dagon != null && dagon.CanBeCasted())
dagon.UseAbility(e);
else if ((sheep != null && sheep.CanBeCasted()) && (cyclone != null && cyclone.CanBeCasted()))
sheep.UseAbility(e);
//else if (cyclone != null && cyclone.CanBeCasted())
// cyclone.UseAbility(e);
}
Utils.Sleep(150, "tplink");
}
//break TP
if (!me.IsChanneling()
&& me.Distance2D(e) <= 800 + aetherrange + ensage_error
&& e.Modifiers.Any(y => y.Name == "modifier_teleporting")
//&& e.IsChanneling()
&& !e.IsHexed()
&& !e.Modifiers.Any(y => y.Name == "modifier_eul_cyclone")
&& !e.IsLinkensProtected()
&& Utils.SleepCheck("tplink1")
)
{
if (sheep != null && sheep.CanBeCasted())
sheep.UseAbility(e);
else if (cyclone != null && cyclone.CanBeCasted())
cyclone.UseAbility(e);
Utils.Sleep(150, "tplink1");
//.........这里部分代码省略.........
示例7: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
_mainHero = ObjectMgr.LocalHero;
//Print($"_mainHero: {_mainHero.Position.X}/{_mainHero.Position.Y}/{_mainHero.Position.Z}");
if (!_loaded)
{
if (!Game.IsInGame || _mainHero == null || _mainHero.ClassID != ClassID.CDOTA_Unit_Hero_ArcWarden)
{
return;
}
_loaded = true;
Game.PrintMessage(
"<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName + " By Jumpering" +
" loaded!</font> <font color='#aa0000'>v" + Assembly.GetExecutingAssembly().GetName().Version,
MessageType.LogMessage);
LastAttackStart.Clear();
LastActivity.Clear();
}
if (!Game.IsInGame || _mainHero == null)
{
_loaded = false;
return;
}
if (Game.IsPaused) return;
_tick = Environment.TickCount;
NetworkActivity act;
var handle = _mainHero.Handle;
if (!LastActivity.TryGetValue(handle, out act) || _mainHero.NetworkActivity != act)
{
LastActivity.Remove(handle);
LastActivity.Add(handle, _mainHero.NetworkActivity);
if (_mainHero.IsAttacking())
{
LastAttackStart.Remove(handle);
LastAttackStart.Add(handle,_tick);
}
}
foreach (var clone in Objects.Tempest.GetCloneList(_mainHero))
{
if (Menu.Item("AutoHeal.Enable").GetValue<KeyBind>().Active)
{
var enemy =
ObjectMgr.GetEntities<Unit>()
.Any(
x =>
x.Team == _mainHero.GetEnemyTeam() && x.IsAlive && x.IsVisible &&
x.Distance2D(_mainHero) < Menu.Item("AutoHeal.Range").GetValue<Slider>().Value);
if (!enemy)
{
CloneUseHealItems(clone, _mainHero, clone.Distance2D(_mainHero));
}
}
handle = clone.Handle;
if (LastActivity.TryGetValue(handle, out act) && clone.NetworkActivity == act) continue;
LastActivity.Remove(handle);
LastActivity.Add(handle, clone.NetworkActivity);
if (!clone.IsAttacking()) continue;
LastAttackStart.Remove(handle);
LastAttackStart.Add(handle, _tick);
}
if (Menu.Item("spamHotkey").GetValue<KeyBind>().Active)
{
SparkSpam(_mainHero);
return;
}
if (Menu.Item("hotkeyClone").GetValue<KeyBind>().Active)
{
if (_globalTarget2 == null || !_globalTarget2.IsValid)
{
_globalTarget2 = ClosestToMouse(_mainHero, 500);
}
if (_globalTarget2 != null && _globalTarget2.IsValid && _globalTarget2.IsAlive)
{
DoCombo2(_mainHero, _globalTarget2);
}
}
else
{
_globalTarget2 = null;
if (Menu.Item("AutoPush.Enable").GetValue<KeyBind>().Active)
AutoPush(_mainHero);
}
//if (!me.IsAlive) return;
var midas = _mainHero.FindItem("item_hand_of_midas");
if (midas != null && Menu.Item("AutoMidas").GetValue<bool>())
{
if (midas.CanBeCasted() && Utils.SleepCheck(_mainHero.Handle + "midas") && _mainHero.IsAlive && !_mainHero.IsInvisible())
{
var enemy =
ObjectMgr.GetEntities<Unit>()
.Where(
x =>
!x.IsMagicImmune() && x.Team != _mainHero.Team &&
(x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral) && x.IsSpawned && x.IsAlive &&
//.........这里部分代码省略.........
示例8: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
me = ObjectManager.LocalHero;
if (!Game.IsInGame || Game.IsWatchingGame || me==null || me.ClassID != ClassID.CDOTA_Unit_Hero_Tiny) return;
if (!Menu.Item("enabled").IsActive())
return;
e = me.ClosestToMouseTarget(1800);
if (e == null)
return;
Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);
Q = me.Spellbook.SpellQ;
W = me.Spellbook.SpellW;
blink = me.FindItem("item_blink");
mom = me.FindItem("item_mask_of_madness");
urn = me.FindItem("item_urn_of_shadows");
dagon = me.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_dagon"));
ethereal = me.FindItem("item_ethereal_blade");
halberd = me.FindItem("item_heavens_halberd");
mjollnir = me.FindItem("item_mjollnir");
orchid = me.FindItem("item_orchid") ?? me.FindItem("item_bloodthorn");
abyssal = me.FindItem("item_abyssal_blade");
mail = me.FindItem("item_blade_mail");
bkb = me.FindItem("item_black_king_bar");
satanic = me.FindItem("item_satanic");
medall = me.FindItem("item_medallion_of_courage") ?? me.FindItem("item_solar_crest");
Shiva = me.FindItem("item_shivas_guard");
vail = me.FindItem("item_veil_of_discord");
var modifEther = e.Modifiers.Any(y => y.Name == "modifier_item_ethereal_blade_slow");
var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
var v =
ObjectManager.GetEntities<Hero>()
.Where(x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsIllusion && !x.IsMagicImmune())
.ToList();
var isInvisible =
me.IsInvisible();
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.IsAlive && !isInvisible)
{
float angle = me.FindAngleBetween(e.Position, true);
Vector3 pos = new Vector3((float)(e.Position.X - 100 * Math.Cos(angle)), (float)(e.Position.Y - 100 * Math.Sin(angle)), 0);
if (
blink != null
&& Q.CanBeCasted()
&& me.CanCast()
&& blink.CanBeCasted()
&& me.Distance2D(e) >= me.GetAttackRange()+ me.HullRadius+150
&& me.Distance2D(pos) <= 1180
&& Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(blink.Name)
&& Utils.SleepCheck("blink")
)
{
blink.UseAbility(pos);
Utils.Sleep(250, "blink");
}
if (orchid != null && orchid.CanBeCasted() && me.Distance2D(e) <= 900 &&
Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(orchid.Name) && Utils.SleepCheck("orchid"))
{
orchid.UseAbility(e);
Utils.Sleep(100, "orchid");
}
if ( // vail
vail != null
&& vail.CanBeCasted()
&& me.CanCast()
&& !e.IsMagicImmune()
&& Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(vail.Name)
&& me.Distance2D(e) <= 1500
&& Utils.SleepCheck("vail")
)
{
vail.UseAbility(e.Position);
Utils.Sleep(250, "vail");
} // orchid Item end
if (ethereal != null && ethereal.CanBeCasted()
&& me.Distance2D(e) <= 700 && me.Distance2D(e) <= 400
&& Menu.Item("Items").GetValue<AbilityToggler>().IsEnabled(ethereal.Name) &&
Utils.SleepCheck("ethereal"))
{
ethereal.UseAbility(e);
Utils.Sleep(100, "ethereal");
}
if ( // Dagon
me.CanCast()
&& dagon != null
&& (ethereal == null
|| (modifEther
|| ethereal.Cooldown < 17))
&& !e.IsLinkensProtected()
//.........这里部分代码省略.........
示例9: Heal
private static void Heal(Hero self, Ability healSpell, float[] amount, uint range, int targettingType,
bool targetSelf = true)
{
if (healSpell != null && healSpell.CanBeCasted() && !self.IsChanneling())
{
if (self.IsAlive && !self.IsChanneling() &&
(!self.IsInvisible() || !me.Modifiers.Any(x => x.Name == "modifier_treant_natures_guise")) &&
self.Distance2D(fountain) > 2000)
{
var heroes = targetSelf
? ObjectMgr.GetEntities<Hero>()
.Where(
entity =>
entity.Team == self.Team && self.Distance2D(entity) <= range && !entity.IsIllusion &&
entity.IsAlive)
.ToList()
: ObjectMgr.GetEntities<Hero>()
.Where(
entity =>
entity.Team == self.Team && self.Distance2D(entity) <= range && !entity.IsIllusion &&
entity.IsAlive && !Equals(entity, me)).ToList();
if (heroes.Any())
{
foreach (var ally in heroes)
{
if (ally.Health <= (ally.MaximumHealth*0.7) && healSpell.CanBeCasted() &&
self.Distance2D(fountain) > 2000 && IsInDanger(ally) &&
ally.Health + amount[healSpell.Level - 1] <= ally.MaximumHealth && (me.ClassID != ClassID.CDOTA_Unit_Hero_WitchDoctor || !me.Spellbook.SpellW.IsToggled))
{
if (targettingType == 1)
CastHeal(healSpell, ally);
else if (targettingType == 2)
CastHeal(healSpell);
else if (targettingType == 3 && Utils.SleepCheck("ToggleHeal"))
{
/*if (healSpell.CanBeCasted() && Utils.SleepCheck("ToggleHeal"))
{
if (!healSpell.IsToggled)
{
CastHeal(healSpell);
Utils.Sleep(1000 + Game.Ping, "ToggleHeal");
}
}*/
CastHeal(healSpell, null, true);
Utils.Sleep(1000 + Game.Ping, "ToggleHeal");
}
}
else if (targettingType == 3 && ally.Health > (ally.MaximumHealth*0.7) && healSpell.IsToggled &&
Utils.SleepCheck("ToggleHeal"))
{
healSpell.ToggleAbility();
Utils.Sleep(1000 + Game.Ping, "ToggleHeal");
}
}
}
}
}
}
示例10: Invisible
public static bool Invisible(Hero target)
{
return target.CanGoInvis() || target.IsInvisible();
}
示例11: ItemUsage
//.........这里部分代码省略.........
if (pike!=null && pike.IsValid)
{
if (target.IsMelee)
{
if (target.Distance2D(me) <= pike.GetCastRange())
{
var angle = (float)Math.Max(
Math.Abs(target.RotationRad -
Utils.DegreeToRadian(target.FindAngleBetween(me.Position))) - 0.20, 0);
if (!Prediction.IsTurning(target) && angle == 0)
{
pike.UseAbility(target);
Utils.Sleep(500, pike.Name + me.Handle);
}
}
else
{
}
}
}
// purge enemies if menu setting enabled
var purgeAll = Menu.Item("Diffusal.PurgEnemy").GetValue<StringList>().SelectedIndex == (int)PurgeSelection.AllEnemies;
// if ItemUsage is called by combo1
if (byIllusion)
{
var targets = ObjectManager.GetEntities<Hero>()
.Where(
x =>
x.IsValid && x.IsAlive && x.IsVisible && x.Team!=me.Team && x.Distance2D(me) <= 750 &&
(purgeAll || Equals(target, x)) &&
!x.IsStunned() && !x.IsHexed())
.ToList();
foreach (var hero in targets)
{
var mod =
hero.HasModifier("modifier_item_diffusal_blade_slow");
var repel = hero.FindModifier("modifier_omniknight_repel")!=null;
var guard = hero.FindModifier("modifier_omninight_guardian_angel")!=null;
var dust = inventory.Find(x => Utils.SleepCheck(x.Name + me.Handle) && x.Name == "item_dust");
if (dust != null && (!Menu.Item("Dust.Check").GetValue<bool>() || target.CanGoInvis() || target.IsInvisible()))
{
dust.UseAbility();
Utils.Sleep(250, dust.StoredName() + me.Handle);
}
if (mod && !repel && !guard)
{
continue;
}
var items2 =
inventory.Where(
x =>
Utils.SleepCheck(x.Name + me.Handle) && CloneOnlyComboItems.Contains(x.Name) &&
(me.Distance2D(hero) <= 650)).ToList();
foreach (var item in items2)
{
item.UseAbility(hero);
Utils.Sleep(500, item.Name + me.Handle);
}
}
}
// code for diffusal blade dispelling
var both = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Both;
var main = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Me;
var tempest = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Tempest;
if (byIllusion && (both || main || tempest))
{
var dif = inventory.Where(
x =>
Utils.SleepCheck(x.Name + me.Handle) && CloneOnlyComboItems.Contains(x.Name)).ToList();
if (dif.Any())
TryToDispell(me, dif, both, main, tempest);
}
// code for using bkb
if (useBkb && distance<900)
{
var bkb = inventory.FirstOrDefault(x => Utils.SleepCheck(x.Name + me.Handle) && x.Name == "item_black_king_bar");
if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck(bkb.Name + me.Handle))
{
bkb.UseAbility();
Utils.Sleep(500, bkb.Name + me.Handle);
}
}
// Uses ultimate if all items expect of refresher was casted
var refreshItems = inventory.Where(
x =>
Items.Keys.Contains(x.StoredName()));
if (refreshItems.Any()) return !items.Any();
var r = me.Spellbook.SpellR;
if (r == null || r.CanBeCasted()) return !items.Any();
var refresher = inventory.FirstOrDefault(x => Utils.SleepCheck(x.Name + me.Handle) && x.Name == "item_refresher");
refresher?.UseAbility();
Utils.Sleep(500, refresher?.Name + me.Handle);
return !items.Any();
}
示例12: Save
private static void Save(Hero self, Ability saveSpell, float castTime = 800, uint castRange = 0,
int targettingType = 1)
{
if (saveSpell != null && saveSpell.CanBeCasted())
{
if (self.IsAlive && !self.IsChanneling() &&
(!self.IsInvisible() || !me.Modifiers.Any(x => x.Name == "modifier_treant_natures_guise")))
{
var alliesExcludeMe =
ObjectMgr.GetEntities<Hero>()
.Where(
x =>
x.Team == self.Team && self.Distance2D(x) <= castRange && IsInDanger(x) &&
!Equals(x, self) && !x.IsIllusion && x.IsAlive)
.ToList();
var alliesIncludeMe =
ObjectMgr.GetEntities<Hero>()
.Where(
x =>
x.Team == self.Team && self.Distance2D(x) <= castRange && IsInDanger(x) && x.IsAlive &&
!x.IsIllusion && x.IsAlive)
.ToList();
if (includeSaveSelf)
{
if (alliesIncludeMe.Any())
{
foreach (var ally in alliesIncludeMe)
{
if (ally.Health <= (ally.MaximumHealth*0.3))
{
if (targettingType == 1)
{
if (Utils.SleepCheck("saveduration"))
{
saveSpell.UseAbility(ally);
Utils.Sleep(castTime + Game.Ping, "saveduration");
}
}
}
}
}
}
else
{
if (alliesExcludeMe.Any())
{
foreach (var ally in alliesExcludeMe)
{
if (ally.Health <= (ally.MaximumHealth*0.3))
{
if (targettingType == 1)
{
if (Utils.SleepCheck("saveduration"))
{
saveSpell.UseAbility(ally);
Utils.Sleep(castTime + Game.Ping, "saveduration");
}
}
}
}
}
}
}
}
}
示例13: Game_OnUpdate
//.........这里部分代码省略.........
}
else
{
_findAa = false;
}
/*if (t.DayVision == 0 && !find)
{
Bara = t;
find = true;
BaraStartPos=Bara.Position;
}
else if (!find)
{
Bara = null;
BaraStartPos=new Vector3(0,0,0);
}*/
}
}
#endregion
#region ShowRoshanTimer
if (_showRoshanTimer)
{
var tickDelta = Game.GameTime - _deathTime;
_roshanMinutes = Math.Floor(tickDelta / 60);
_roshanSeconds = tickDelta % 60;
var roshan =
ObjectMgr.GetEntities<Unit>()
.FirstOrDefault(unit => unit.ClassID == ClassID.CDOTA_Unit_Roshan && unit.IsAlive);
if (roshan != null)
{
_roshIsAlive = true;
//RoshanMinutes = 0;
//RoshanSeconds = 0;
//DeathTime = 0;
}
}
#endregion
#region ShowIllusions
if (_showIllusions)
{
var illusions = ObjectMgr.GetEntities<Hero>()
.Where(
x =>
x.IsIllusion && x.Team != _me.Team);
foreach (var s in illusions)
{
HandleEffect(s);
}
}
#endregion
#region AutoItems
if (!_autoItemsActive || !Utils.SleepCheck("AutoItems") || !_me.IsAlive) return;
if (Menu.Item("autoitemsList").GetValue<AbilityToggler>().IsEnabled("item_hand_of_midas"))
{
var midas = _me.FindItem("item_hand_of_midas");
if (midas != null && midas.CanBeCasted() && !_me.IsInvisible())
{
var creep =
ObjectMgr.GetEntities<Unit>()
.FirstOrDefault(
x =>
x.Team != _me.Team &&
(x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral) && x.IsSpawned && x.IsAlive &&
x.Distance2D(_me) <= 600);
midas.UseAbility(creep);
Utils.Sleep(250, "AutoItems");
//PrintError("midas.CastRange: " + midas.CastRange);
}
}
if (Menu.Item("autoitemsList").GetValue<AbilityToggler>().IsEnabled("item_phase_boots"))
{
var phase = _me.FindItem("item_phase_boots");
if (phase != null && phase.CanBeCasted() && !_me.IsAttacking() && !_me.IsInvisible() && !_me.IsChanneling() && _me.NetworkActivity==NetworkActivity.Move)
{
phase.UseAbility();
Utils.Sleep(250, "AutoItems");
}
}
if (!Menu.Item("autoitemsList").GetValue<AbilityToggler>().IsEnabled("item_magic_wand")) return;
var stick = _me.Inventory.Items.FirstOrDefault(x => (x.Name == "item_magic_stick" || x.Name == "item_magic_wand") && x.CanBeCasted() && x.CurrentCharges>0);
if (!_me.IsAlive) return;
if (_me.Health*100/_me.MaximumHealth >= Menu.Item("autoitemlistHealth").GetValue<Slider>().Value &&
!(_me.Mana*100/_me.MaximumMana < Menu.Item("autoitemlistMana").GetValue<Slider>().Value)) return;
if (stick == null || _me.IsInvisible()) return;
stick.UseAbility();
Utils.Sleep(250, "AutoItems");
#endregion
}
示例14: Heal
private static void Heal(Hero self, Ability healSpell, float[] amount, uint range, int targettingType)
{
if (healSpell != null && healSpell.CanBeCasted() && !self.IsChanneling())
{
if (self.IsAlive && !self.IsChanneling() &&
(!self.IsInvisible() || !me.Modifiers.Any(x => x.Name == "modifier_treant_natures_guise")) &&
self.Distance2D(fountain) > 2000)
{
var heroes =
ObjectMgr.GetEntities<Hero>()
.Where(
entity =>
entity.Team == self.Team && self.Distance2D(entity) <= range && !entity.IsIllusion &&
entity.IsAlive)
.ToList();
if (heroes.Any())
{
foreach (var ally in heroes)
{
if (ally.Health <= (ally.MaximumHealth*0.7) && healSpell.CanBeCasted() &&
self.Distance2D(fountain) > 2000 && IsInDanger(ally) &&
ally.Health + amount[healSpell.Level - 1] <= ally.MaximumHealth)
{
if (targettingType == 1)
CastHeal(healSpell, ally);
else if (targettingType == 2)
CastHeal(healSpell);
else if (targettingType == 3)
{
/*if (healSpell.CanBeCasted() && !healSpell.IsChanneling)
{
Console.Write("Casting Heal");
CastHeal(healSpell);
}
else
{
if (ally.Health > (ally.MaximumHealth*0.7) && healSpell.IsChanneling)
{
Console.Write("Casting Heal");
CastHeal(healSpell);
}
}*/
if (healSpell.CanBeCasted() && Utils.SleepCheck("ToggleHeal"))
{
if (!healSpell.IsToggled)
{
CastHeal(healSpell);
Utils.Sleep(100 + Game.Ping, "ToggleHeal");
}
}
}
}
else if (targettingType == 3 && ally.Health > (ally.MaximumHealth*0.7) && healSpell.IsToggled &&
Utils.SleepCheck("ToggleHeal"))
{
CastHeal(healSpell);
Utils.Sleep(100 + Game.Ping, "ToggleHeal");
}
}
}
}
}
}
示例15: ComboInAction
private static void ComboInAction(Hero me, Hero target)
{
if (!Utils.SleepCheck("nextAction")) return;
var duel = me.Spellbook.Spell4;
if (duel==null) return;
if (!duel.CanBeCasted()) return;
var haras = me.Spellbook.Spell1;
var heal = me.Spellbook.Spell2;
var dagger = me.FindItem("item_blink");
var neededMana = me.Mana-duel.ManaCost;
var allitems = me.Inventory.Items.Where(x => x.CanBeCasted() && x.ManaCost <= neededMana);
var dpActivated =
target.Modifiers.Any(
x => x.Name == "modifier_slark_dark_pact" || x.Name == "modifier_slark_dark_pact_pulses");
var enumerable = allitems as Item[] ?? allitems.ToArray();
var isInvise = me.IsInvisible();
var itemOnTarget =
enumerable.FirstOrDefault(
x =>
x.Name == "item_abyssal_blade" || x.Name == "item_orchid" ||
x.Name == "item_heavens_halberd" || x.Name == "item_sheepstick" ||
x.Name == "item_urn_of_shadows" || x.Name == "item_medallion_of_courage" ||
x.Name == "item_solar_crest");
var itemWithOutTarget = enumerable.FirstOrDefault(
x =>
x.Name == "item_soul_ring" || (x.Name == "item_armlet" && !x.IsToggled) ||
x.Name == "item_mask_of_madness" || x.Name == "item_satanic" ||
x.Name == "item_blade_mail" || x.Name == "item_silver_edge" || x.Name == "item_invis_sword");
var itemOnMySelf = enumerable.FirstOrDefault(
x =>
x.Name == "item_mjollnir");
Item bkb = null;
if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("item_black_king_bar"))
{
bkb = me.FindItem("item_black_king_bar");
}
var distance = me.Distance2D(target);
if (distance >= 1150)
{
me.Move(target.Position);
Utils.Sleep(200 + Game.Ping, "nextAction");
return;
}
if (Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("legion_commander_overwhelming_odds") && haras != null && haras.CanBeCasted() && distance <= haras.CastRange)
{
haras.UseAbility(target.Position);
Utils.Sleep(300 + Game.Ping, "nextAction");
return;
}
if (!me.IsMagicImmune() && heal.CanBeCasted() && heal.ManaCost <= neededMana && Menu.Item("enabledAbilities").GetValue<AbilityToggler>().IsEnabled("legion_commander_press_the_attack"))
{
heal.UseAbility(me);
Utils.Sleep(200 + Game.Ping, "nextAction");
return;
}
if (itemOnMySelf != null && Menu.Item("buff").GetValue<bool>())
{
itemOnMySelf.UseAbility(me);
Utils.Sleep(50 + Game.Ping, "nextAction");
return;
}
if (itemWithOutTarget != null && Menu.Item("buff").GetValue<bool>())
{
if (itemWithOutTarget.Name == "item_armlet")
{
itemWithOutTarget.ToggleAbility();
Utils.Sleep(50 + Game.Ping, "nextAction");
return;
}
itemWithOutTarget.UseAbility();
Utils.Sleep(100 + Game.Ping, "nextAction");
return;
}
if (dagger != null && dagger.CanBeCasted() && !isInvise && Utils.SleepCheck("dagger"))
{
var point = new Vector3(
(float)(target.Position.X - 20 * Math.Cos(me.FindAngleBetween(target.Position, true))),
(float)(target.Position.Y - 20 * Math.Sin(me.FindAngleBetween(target.Position, true))),
target.Position.Z);
dagger.UseAbility(point);
Utils.Sleep(200 + Game.Ping, "dagger");
return;
}
if (distance > duel.CastRange + 100 && Utils.SleepCheck("moving"))
{
if (isInvise)
me.Attack(target);
else
me.Move(target.Position);
Utils.Sleep(150 + Game.Ping, "moving");
return;
}
if (itemOnTarget != null && !dpActivated && Menu.Item("debuff").GetValue<bool>() && !isInvise)
{
itemOnTarget.UseAbility(target);
//.........这里部分代码省略.........