本文整理汇总了C#中LeagueSharp.Common.Spell.Cast方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.Cast方法的具体用法?C# Spell.Cast怎么用?C# Spell.Cast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeagueSharp.Common.Spell
的用法示例。
在下文中一共展示了Spell.Cast方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CastSkillshot
public void CastSkillshot(Obj_AI_Hero t, Spell s, HitChance hc = HitChance.High)
{
if (!s.IsSkillshot)
return;
PredictionOutput p = s.GetPrediction(t);
if (s.Collision)
{
for (int i = 0; i < p.CollisionObjects.Count; i++)
if (!p.CollisionObjects[i].IsDead && (p.CollisionObjects[i].IsEnemy || p.CollisionObjects[i].IsMinion))
return;
}
if ((t.HasBuffOfType(BuffType.Slow) && p.Hitchance >= HitChance.High) || p.Hitchance == HitChance.Immobile)
s.Cast(p.CastPosition);
else if (t.IsRecalling())
s.Cast(t.ServerPosition);
else
{
if (s.IsReady())
{
s.SPredictionCast(t, hc);
}
}
}
示例2: CastBasicFarm
public static void CastBasicFarm(Spell spell)
{
if (!spell.IsReady())
return;
var minion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly);
if (minion.Count == 0)
return;
if (spell.Type == SkillshotType.SkillshotCircle)
{
spell.UpdateSourcePosition();
var predPosition = spell.GetCircularFarmLocation(minion);
if (predPosition.MinionsHit >= 2)
{
spell.Cast(predPosition.Position);
}
}
else if (spell.Type == SkillshotType.SkillshotLine || spell.Type == SkillshotType.SkillshotCone)
{
spell.UpdateSourcePosition();
var predPosition = spell.GetLineFarmLocation(minion);
if (predPosition.MinionsHit >= 2)
spell.Cast(predPosition.Position);
}
}
示例3: WallJumpo
public static void WallJumpo(Spell spell, string menuname)
{
if (ObjectManager.Player.IsDead && ObjectManager.Player.IsZombie)
{
return;
}
CheckSpell(spell);
if (Program.Champion.misc.Item(menuname).GetValue<KeyBind>().Active)
{
if (DrawColor == Color.Green)
{
if (ObjectManager.Player.Distance(LastWallStartPosition) > 50)
ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, LastWallStartPosition.To3D());
else
if (Prediction.GetPrediction(ObjectManager.Player, 500).UnitPosition.Distance(ObjectManager.Player.Position) <= 10 && SpellCount == 1)
spell.Cast(LastEndPosition);
}
else if (SpellCount == 1 && DrawColor == Color.ForestGreen)
{
DrawColor = Color.White;
spell.Cast(LastWallJumpEndPosition);
}
}
Vector2 dir = new Vector2(0, 0);
float scale = 200;
Position = ObjectManager.Player.Position.To2D() + scale * ObjectManager.Player.Direction.To2D().Perpendicular();
if (LeagueSharp.Common.Utility.IsWall(Position))
{
dir = scale * ObjectManager.Player.Direction.To2D().Perpendicular();
Continue(dir);
}
if (!LeagueSharp.Common.Utility.IsWall(Position) || LastColor == Color.Red)
{
scale = 200;
Position2 = ObjectManager.Player.Position.To2D() + (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular();
Position3 = ObjectManager.Player.Position.To2D() + (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular2();
if (LeagueSharp.Common.Utility.IsWall(Position2))
{
dir = (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular();
WardJumpPosition = Position2;
Continue(dir, true);
}
else if (LeagueSharp.Common.Utility.IsWall(Position3))
{
dir = (scale * ObjectManager.Player.Direction.To2D().Perpendicular()).Perpendicular2();
WardJumpPosition = Position3;
Continue(dir, true);
}
}
}
示例4: CastSafePosition
private static void CastSafePosition(Spell spell, Obj_AI_Hero hero)
{
if (Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(), Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range, Orbwalking.GetRealAutoAttackRange(hero)).Count() > 0)
{
spell.Cast(
Geometry.CircleCircleIntersection(ObjectManager.Player.ServerPosition.To2D(),
Prediction.GetPrediction(hero, 0f, hero.AttackRange).UnitPosition.To2D(), spell.Range,
Orbwalking.GetRealAutoAttackRange(hero)).MinOrDefault(i => i.Distance(Game.CursorPos)));
}
else
{
spell.Cast(ObjectManager.Player.ServerPosition.Extend(hero.ServerPosition, -E.Range));
}
}
示例5: Obj_AI_Hero_OnProcessSpellCast
static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
Q = new Spell(SpellSlot.Q, 1150f);
W = new Spell(SpellSlot.W, 5000f);
E = new Spell(SpellSlot.E, 1000f);
R = new Spell(SpellSlot.R, 1500f);
foreach (var unit in ObjectManager.Get<Obj_AI_Hero>().Where(h => h.IsEnemy && h.IsHPBarRendered))
{
// Get buffs
for (int i = 0; i < unit.Buffs.Count(); i++)
{
// Check if the Soulbound is in a good range
var soulboundhero = HeroManager.Allies.FirstOrDefault(hero => hero.HasBuff("kalistacoopstrikeally", true) && args.Target.NetworkId == hero.NetworkId && hero.HealthPercent <= 15);
var enemy = HeroManager.Enemies.Where(x => soulboundhero.Distance(x.Position) > 800);
// Check if the Soulbound is a Blitzcrank
// Check if the enemy is hooked
// Check if target was far enough for ult
if (soulboundhero.ChampionName == "Blitzcrank" && unit.Buffs[i].Name == "rocketgrab2" && unit.Buffs[i].IsActive && enemy.Count() > 0 && Menu.Item("kaliscrank2", true).GetValue<Boolean>())
{
R.Cast();
}
}
}
}
示例6: W
public static void W(Spell spell)
{
foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range) && x.Health < spell.GetDamage(x)))
{
spell.Cast(enemy);
}
}
示例7: CastBasicSkillShot
public static void CastBasicSkillShot(Spell spell, float range, TargetSelector.DamageType type, HitChance hitChance, bool towerCheck = false)
{
var target = TargetSelector.GetTarget(range, type);
if (target == null || !spell.IsReady())
return;
if (towerCheck && target.UnderTurret(true))
return;
spell.UpdateSourcePosition();
if (spell.Type == SkillshotType.SkillshotCircle)
{
var pred = Prediction.GetPrediction(target, spell.Delay);
if (pred.Hitchance >= hitChance)
spell.Cast(pred.CastPosition);
}
else
{
spell.CastIfHitchanceEquals(target, hitChance);
}
}
示例8: DoCast
public static bool DoCast(Spell spell, Obj_AI_Hero target, HitChance minHitChance, bool colisionCheck=false)
{
// Data.Static.Objects.ProjectLogger.WriteLog("DoCast Call");
if ((PredictionMethod==0)||((PredictionMethod==1)&&colisionCheck)) //Sebby Colision is broken...lol
{
var output=spell.GetPrediction(target);
if (colisionCheck)
if (CheckColision(output))
return false;
if (minHitChance>output.Hitchance)
return false;
spell.Cast(output.CastPosition);
return true;
}
if (PredictionMethod==1)
{
var output=SebbyLib.Prediction.Prediction.GetPrediction(target, spell.Delay);
if (minHitChance>(HitChance)output.Hitchance)
return false;
spell.Cast(output.CastPosition);
return true;
}
if (PredictionMethod==2)
{
var output=spell.GetSPrediction(target);
if (colisionCheck)
if (CheckColision(output))
return false;
if (minHitChance>output.HitChance)
return false;
spell.Cast(output.CastPosition);
return true;
}
return false;
}
示例9: CastSpell
public static void CastSpell(Spell spell, Obj_AI_Base target, bool packetCast)
{
if (target.IsValidTarget(spell.Range))
{
spell.Cast(target, packetCast);
LastCastTime = Environment.TickCount;
Orbwalking.ResetAutoAttackTimer();
}
}
示例10: CastBasicSkillShot
public static void CastBasicSkillShot(Spell spell, float range, LeagueSharp.Common.TargetSelector.DamageType type, HitChance hitChance)
{
var target = LeagueSharp.Common.TargetSelector.GetTarget(range, type);
if (target == null || !spell.IsReady())
return;
spell.UpdateSourcePosition();
if (spell.GetPrediction(target).Hitchance >= hitChance)
spell.Cast(target, packets());
}
示例11: CastSpellSSAuto
private static void CastSpellSSAuto(Spell spell, Vector3 predpos, Obj_AI_Hero target)
{
Orbwalking.ResetAutoAttackTimer();
spell.Cast(predpos);
if (Player.Distance(target) <= Player.AttackRange)
{
Program.Player.IssueOrder(GameObjectOrder.AttackUnit, target);
}
}
示例12: castSpell
public static void castSpell(Spell p, String menu, Obj_AI_Base target)
{
var Passive = Program.menu.Item(menu).GetValue<bool>();
if (!Program.Passive())
{
Program.passive = false;
}
if (Passive == false && Program.passive)
{
p.Cast(target);
}
else
{
if (!Program.Passive())
{
p.Cast(target);
}
}
}
示例13: CastSpell
private static void CastSpell(Spell spell, BuffType x, Obj_AI_Hero target, float lastpostime)
{
if (x == BuffType.Stun || x == BuffType.Snare || x == BuffType.Knockup || x == BuffType.Fear)
{
if (Game.Time <= lastpostime)
{
spell.Cast(target.ServerPosition);
}
}
else
{
var pred = spell.GetPrediction(target);
if (pred != null && Game.Time <= lastpostime)
{
spell.Cast(pred.CastPosition);
}
}
}
示例14: Cast_BasicSkillshot_Enemy
public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, TargetSelector.PriorityMode prio = TargetSelector.PriorityMode.AutoPriority, float extrarange = 0)
{
if(!spell.IsReady())
return null;
var target = TargetSelector.GetTarget(spell.Range, prio);
if(target == null)
return null;
if (!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.High)
return null;
spell.Cast(target, UsePackets());
return target;
}
示例15: castCircleSkillShot
/// <summary>
/// Casts a basic circle skillshot towards target if hitchance is high
/// </summary>
/// <param name="spell"></param>
/// <param name="damageType"></param>
/// <param name="extrarange"></param>
/// <returns></returns>
public Obj_AI_Base castCircleSkillShot(Spell spell,
SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
{
if (!spell.IsReady())
return null;
Obj_AI_Hero target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);
if (target == null)
return null;
if (target.IsValidTarget(spell.Range + extrarange) &&
spell.GetPrediction(target).Hitchance >= HitChance.High)
spell.Cast(target, true);
return target;
}