本文整理汇总了C#中LeagueSharp.Common.Spell.CastOnUnit方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.CastOnUnit方法的具体用法?C# Spell.CastOnUnit怎么用?C# Spell.CastOnUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeagueSharp.Common.Spell
的用法示例。
在下文中一共展示了Spell.CastOnUnit方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CastSpellSelfAuto
public static void CastSpellSelfAuto(Spell spell, Obj_AI_Hero target)
{
if (Player.Distance(target) <= Player.AttackRange)
{
Orbwalking.ResetAutoAttackTimer();
spell.CastOnUnit(ObjectManager.Player);
Program.Player.IssueOrder(GameObjectOrder.AttackUnit, target);
}
}
示例2: Karma
static void Karma()
{
Game.PrintChat("Karma supported");
var shield = new Spell(SpellSlot.E, 400);
Game.OnUpdate += eventArgs =>
{
if (shield.IsReady() && ObjectManager.Player.CountEnemiesInRange(1500) > 0)
{
shield.CastOnUnit(ObjectManager.Player);
}
};
}
示例3: HikiJump
/// <summary>
/// Basic Wardjump
/// </summary>
/// <param name="W">W Skill</param>
/// <param name="position">Jump Position</param>
public static void HikiJump(Spell W,Vector3 position)
{
ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
if (WardCastable && W.Instance.Name == "BlindMonkWOne" && W.IsReady())
{
ObjectManager.Player.Spellbook.CastSpell(Items.GetWardSlot().SpellSlot, position);
LastWardCreated = Game.Time;
LastWardJumpTime = Game.Time;
WardCastPosition = position;
}
var ward = ObjectManager.Get<Obj_AI_Base>()
.OrderBy(obj => obj.Distance(ObjectManager.Player.ServerPosition))
.FirstOrDefault(
obj =>
obj.IsAlly && !obj.IsMe && obj.Name.IndexOf("ward", StringComparison.InvariantCultureIgnoreCase) >= 0 &&
(!(obj.Name.IndexOf("turret", StringComparison.InvariantCultureIgnoreCase) >= 0) &&
Vector3.DistanceSquared(Game.CursorPos, obj.ServerPosition) <= 150 * 150));
if (ward != null)
{
W.CastOnUnit(ward);
}
}
示例4: TargetSkill
public static void TargetSkill(Obj_AI_Base target, Spell spell, bool packet = false, bool towerCheck = false)
{
if (!spell.IsReady() || target == null || towerCheck && target.UnderTurret(true))
{
return;
}
spell.CastOnUnit(target, packet);
}
示例5: Cast_onMinion_nearEnemy
public void Cast_onMinion_nearEnemy(Spell spell, float range, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, MinionTypes minionTypes = MinionTypes.All, MinionTeam minionTeam = MinionTeam.All)
{
if(!spell.IsReady() || !ManaManagerAllowCast(spell))
return;
var target = SimpleTs.GetTarget(spell.Range + range, damageType);
Obj_AI_Base[] nearstMinion = { null };
var allminions = MinionManager.GetMinions(target.Position, range, minionTypes, minionTeam);
foreach(var minion in allminions.Where(minion => minion.Distance(ObjectManager.Player) <= spell.Range && minion.Distance(target) <= range).Where(minion => nearstMinion[0] == null || nearstMinion[0].Distance(target) >= minion.Distance(target)))
nearstMinion[0] = minion;
if(nearstMinion[0] != null)
spell.CastOnUnit(nearstMinion[0], Packets());
}
示例6: Cast_onEnemy
public void Cast_onEnemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
{
if(!spell.IsReady() || !ManaManagerAllowCast(spell))
return;
var target = SimpleTs.GetTarget(spell.Range, damageType);
if(target.IsValidTarget(spell.Range))
spell.CastOnUnit(target, Packets());
}
示例7: Cast_Shield_onFriend
public void Cast_Shield_onFriend(Spell spell, int percent,bool skillshot = false)
{
if(!spell.IsReady() || !ManaManagerAllowCast(spell))
return;
foreach(var friend in Program.Helper.OwnTeam.Where(hero => hero.Distance(ObjectManager.Player) <= spell.Range).Where(friend => friend.Health / friend.MaxHealth * 100 <= percent && Utility.CountEnemysInRange(1000) >= 1))
{
if (skillshot)
spell.Cast(friend.Position, Packets());
else
spell.CastOnUnit(friend, Packets());
return;
}
}
示例8: Cast_Speedboost_onFriend
public void Cast_Speedboost_onFriend(Spell spell)
{
if(!spell.IsReady() || !ManaManagerAllowCast(spell))
return;
var friend = Program.Helper.OwnTeam.FirstOrDefault(x => x.Distance(ObjectManager.Player) <= spell.Range &&
Program.Helper.EnemyTeam.Any(enemy => x.Distance(enemy) <= Orbwalking.GetRealAutoAttackRange(x) + 200 && x.BaseAttackDamage * x.AttackSpeedMod * 3 >= enemy.Health));
if(friend == null)
return;
spell.CastOnUnit(friend, Packets());
}
示例9: Cast_Shield_onFriend
public void Cast_Shield_onFriend(Spell spell, int percent, bool skillshot = false)
{
if(!spell.IsReady())
return;
foreach(var friend in PUC.AllHerosFriend.Where(hero => hero.Distance(PUC.Player) <= spell.Range).Where(friend => friend.Health / friend.MaxHealth * 100 <= percent && EnemysinRange(600, 1, friend)))
{
if(skillshot)
spell.Cast(spell.GetPrediction(friend).CastPosition , UsePackets());
else
spell.CastOnUnit(friend, UsePackets());
return;
}
}
示例10: CastSpell
public void CastSpell(Spell spell, SpellDataInst sDataInst)
{
target = GetTarget(spell);
if (target != null && spell.IsReady())
{
if (target.UnderTurret(true))
return;
var pred = spell.GetPrediction(target);
if (sDataInst.SData.IsToggleSpell)
{
if (spell.Instance.ToggleState == 1)
{
if (sDataInst.SData.TargettingType == SpellDataTargetType.Location)
spell.Cast(pred.CastPosition);
else if (sDataInst.SData.TargettingType == SpellDataTargetType.Unit)
spell.CastOnUnit(target);
else
spell.Cast();
}
}
else
{
if (spell.IsReady())
{
if (sDataInst.SData.TargettingType == SpellDataTargetType.Self)
spell.Cast();
else if (sDataInst.SData.TargettingType == SpellDataTargetType.Unit)
spell.CastOnUnit(target);
else if (pred.Hitchance >= HitChance.Medium)
{
spell.Cast(pred.CastPosition);
}
}
}
}
}
示例11: Obj_AI_Base_OnCreate
static void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args)
{
if (!config.Item("Use").GetValue<KeyBind>().Active && !config.Item("Always").GetValue<bool>())
return;
#region Rengar
var Rengar = HeroManager.Enemies.Find(x => x.ChampionName.ToLower() == "rengar");
if (Rengar != null)
{
if (config.Item("RengarR").GetValue<bool>())
{
if (sender.IsEnemy && sender.Name.Contains("Rengar_Base_R_Alert"))
{
if (ObjectManager.Player.HasBuff("rengarralertsound") &&
!CheckWard() &&
!Rengar.IsVisible &&
!Rengar.IsDead &&
CheckSlot() != SpellSlot.Unknown)
{
ObjectManager.Player.Spellbook.CastSpell(CheckSlot(), ObjectManager.Player.Position);
}
}
}
var spell = new Spell(SkillData.slot, SkillData.range);
if (config.Item("FRUse").GetValue<bool>() && SkillData.slot != SpellSlot.Unknown)
{
if (sender.IsEnemy && sender.Name.Contains("Rengar_LeapSound.troy") &&
ObjectManager.Player.Distance(sender.Position) < 1700 &&
spell.IsReady())
{
if (spell.Range == 1 && ObjectManager.Player.Distance(Rengar.Position) < 750)
{
spell.Cast(ObjectManager.Player.Position);
}
else if (ObjectManager.Player.Distance(Rengar.Position) < spell.Range &&
Rengar.IsValidTarget())
{
spell.CastOnUnit(Rengar);
}
}
}
}
#endregion
#region Leblanc
var Leblanc = HeroManager.Enemies.Find(x => x.ChampionName.ToLower() == "leblanc");
if (Leblanc != null)
{
if (!config.Item("LeBlancR").GetValue<bool>())
return;
if (ObjectManager.Player.Distance(sender.Position) > 600)
return;
if (sender.IsEnemy && sender.Name == "LeBlanc_Base_P_poof.troy")
{
if (!CheckWard() &&
!Leblanc.IsVisible &&
!Leblanc.IsDead &&
CheckSlot() != SpellSlot.Unknown)
{
ObjectManager.Player.Spellbook.CastSpell(CheckSlot(), ObjectManager.Player.Position);
}
}
}
#endregion
}