本文整理汇总了C#中LeagueSharp.SDK.Events类的典型用法代码示例。如果您正苦于以下问题:C# Events类的具体用法?C# Events怎么用?C# Events使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Events类属于LeagueSharp.SDK命名空间,在下文中一共展示了Events类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (!Vars.getCheckBoxItem(Vars.Menu, "enable") ||
!Vars.getKeyBindItem(Vars.Menu, "keybind") ||
!Vars.getCheckBoxItem(Vars.EMenu, "dashpred"))
{
return;
}
/// <summary>
/// The Dash-Condemn Prediction Logic.
/// </summary>
if (Vars.E.IsReady() &&
Vars.Flash.IsReady() &&
!GameObjects.Player.IsDashing() &&
args.Sender.LSIsValidTarget(Vars.E.Range) &&
!Invulnerable.Check(args.Sender, DamageType.Magical, false) &&
GameObjects.Player.Distance(args.End) >
GameObjects.Player.BoundingRadius &&
Vars.getCheckBoxItem(Vars.WhiteListMenu, args.Sender.ChampionName.ToLower()))
{
for (var i = 1; i < 10; i++)
{
if ((args.End - Vector3.Normalize(args.End - GameObjects.Player.ServerPosition) * (float)(i * 42.5)).LSIsWall() &&
(args.End - Vector3.Normalize(args.End - GameObjects.Player.ServerPosition) * i * 44).LSIsWall())
{
Vars.E.CastOnUnit(args.Sender);
Vars.Flash.Cast(GameObjects.Player.ServerPosition.LSExtend(args.Sender.ServerPosition, Vars.Flash.Range));
}
}
}
}
示例2: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (!args.Sender.IsMelee ||
Invulnerable.Check(args.Sender, DamageType.Magical))
{
return;
}
if (Vars.R.IsReady() &&
args.Sender.IsValidTarget(Vars.R.Range) &&
args.Sender.IsFacing(GameObjects.Player) &&
Vars.getCheckBoxItem(Vars.RMenu, "gapcloser"))
{
Vars.R.Cast(args.Start);
}
if (Vars.W.IsReady() &&
args.Sender.IsValidTarget(Vars.W.Range) &&
GameObjects.Player.Distance(args.End) > 500 &&
Vars.getCheckBoxItem(Vars.WMenu, "gapcloser"))
{
Vars.W.Cast(args.End);
return;
}
}
示例3: Events_OnGapCloser
private void Events_OnGapCloser(object sender, Events.GapCloserEventArgs e)
{
if (e.Sender.IsAlly) return;
if (e.IsDirectedToPlayer && HasQ3() && MiscMenu["qGap"].Cast<CheckBox>().CurrentValue)
{
Q3.CastIfHitchanceMinimum(e.Sender, HitChance.Medium);
}
}
示例4: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (Vars.E.IsReady() &&
args.Sender.LSIsValidTarget(Vars.E.Range) &&
!Invulnerable.Check(args.Sender, DamageType.Magical, false) &&
Vars.getCheckBoxItem(Vars.EMenu, "gapcloser"))
{
Vars.E.Cast(args.End);
}
}
示例5: OnInterruptableTarget
/// <summary>
/// Called on interruptable spell.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The <see cref="Events.InterruptableTargetEventArgs" /> instance containing the event data.</param>
public static void OnInterruptableTarget(object sender, Events.InterruptableTargetEventArgs args)
{
if (Vars.R.IsReady() &&
!Invulnerable.Check(args.Sender) &&
args.Sender.LSIsValidTarget(Vars.R.Range) &&
Vars.getCheckBoxItem(Vars.RMenu, "interrupter"))
{
Vars.R.Cast(args.Sender.ServerPosition);
}
}
示例6: Events_OnDash
private static void Events_OnDash(object sender, Events.DashArgs e)
{
var hero = sender as AIHeroClient;
if (hero == null || !hero.IsMe) return;
startTime = e.StartTick;
endTime = e.EndTick;
startPosition = e.StartPos.ToVector3();
endPosition = e.EndPos.ToVector3();
}
示例7: OnInterruptableTarget
/// <summary>
/// Called on interruptable spell.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The <see cref="Events.InterruptableTargetEventArgs" /> instance containing the event data.</param>
public static void OnInterruptableTarget(object sender, Events.InterruptableTargetEventArgs args)
{
if (Vars.W.IsReady() &&
args.Sender.LSIsValidTarget(Vars.W.Range) &&
!Invulnerable.Check(args.Sender, DamageType.Physical, false) &&
Vars.getCheckBoxItem(Vars.WMenu, "interrupter"))
{
Vars.W.CastOnUnit(args.Sender);
}
}
示例8: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (Vars.W.IsReady() &&
args.Sender.IsMelee &&
args.IsDirectedToPlayer &&
args.Sender.LSIsValidTarget(Vars.W.Range) &&
Vars.getCheckBoxItem(Vars.WMenu, "gapcloser"))
{
Vars.W.Cast(GameObjects.Player.ServerPosition.LSExtend(args.Sender.ServerPosition, -Vars.W.Range));
}
}
示例9: Events_OnGapCloser
private static void Events_OnGapCloser(object sender, Events.GapCloserEventArgs e)
{
if (SpellToAntiGapcloser == null || e.Sender.IsAlly) return;
var spellToUse = SpellToAntiGapcloser.OrderByDescending(s => s.Range).FirstOrDefault(s => s.IsReady());
if (e.IsDirectedToPlayer)
{
spellToUse?.CastIfHitchanceMinimum(e.Sender, HitChance.Medium);
}
}
示例10: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (Vars.E.IsReady() &&
args.Sender.IsMelee &&
args.Sender.LSIsValidTarget(Vars.E.Range) &&
args.SkillType == GapcloserType.Targeted &&
Vars.getCheckBoxItem(Vars.EMenu, "gapcloser"))
{
if (args.Target.IsMe)
{
Vars.E.Cast(GameObjects.Player.ServerPosition.LSExtend(args.Sender.ServerPosition, -475f));
}
}
}
示例11: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (Vars.R.IsReady() &&
args.Sender.IsMelee &&
args.Sender.IsValidTarget(Vars.R.Range) &&
args.SkillType == LeagueSharp.Data.Enumerations.GapcloserType.Targeted &&
Vars.getCheckBoxItem(Vars.RMenu, "gapcloser"))
{
if (args.Target.IsMe)
{
Vars.R.Cast(args.Sender.ServerPosition);
}
}
}
示例12: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (Vars.E.IsReady() &&
GameObjects.Player.Distance(args.End) < 750 &&
Vars.getCheckBoxItem(Vars.EMenu, "gapcloser"))
{
if (Vars.R.IsReady() &&
Vars.getCheckBoxItem(Vars.RMenu, "empe") &&
GameObjects.AllyHeroes.Count(a => a.IsValidTarget(600f, false)) >= 2)
{
Vars.R.Cast();
}
Vars.E.Cast();
}
}
示例13: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (GameObjects.Player.HealthPercent <=
Vars.getSliderItem(Vars.QMenu, "shield") &&
Vars.getSliderItem(Vars.QMenu, "shield") != 0)
{
return;
}
if (Vars.W.IsReady() &&
args.Sender.IsValidTarget(Vars.W.Range) &&
!Invulnerable.Check(args.Sender, DamageType.Magical, false) &&
Vars.getCheckBoxItem(Vars.WMenu, "gapcloser"))
{
Vars.W.CastOnUnit(args.Sender);
}
}
示例14: OnGapCloser
/// <summary>
/// Fired on an incoming gapcloser.
/// </summary>
/// <param name="sender">The object.</param>
/// <param name="args">The <see cref="Events.GapCloserEventArgs" /> instance containing the event data.</param>
public static void OnGapCloser(object sender, Events.GapCloserEventArgs args)
{
if (Vars.Q.IsReady() &&
args.IsDirectedToPlayer &&
!Invulnerable.Check(args.Sender) &&
args.Sender.LSIsValidTarget(Vars.Q.Range) &&
Vars.getCheckBoxItem(Vars.QMenu, "gapcloser"))
{
Vars.Q.Cast(args.End);
}
if (Vars.E.IsReady() &&
!Invulnerable.Check(args.Sender) &&
args.Sender.LSIsValidTarget(Vars.E.Range) &&
Vars.getCheckBoxItem(Vars.EMenu, "gapcloser"))
{
Vars.E.Cast(args.End);
}
}
示例15: OnInterruptableTarget
/// <summary>
/// Called when an interruptable target is in range.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="Events.InterruptableTargetEventArgs"/> instance containing the event data.</param>
private void OnInterruptableTarget(object sender, Events.InterruptableTargetEventArgs e)
{
if (e.DangerLevel < DangerLevel.High || !e.Sender.IsValidTarget()
|| !this.GetSpells()[SpellSlot.Q].IsReady()
|| !AIOVariables.AssemblyMenu["sdkaio.janna.misc"]["QInterrupter"].GetValue<MenuBool>().Value)
{
return;
}
var unit = e.Sender;
if (unit.IsValidTarget(this.GetSpells()[SpellSlot.Q].Range))
{
var qPrediction = this.GetSpells()[SpellSlot.Q].GetPrediction(unit);
if (qPrediction.Hitchance > HitChance.Low)
{
this.GetSpells()[SpellSlot.Q].Cast(qPrediction.CastPosition);
this.GetSpells()[SpellSlot.Q].Cast();
}
}
}