Gnar


SUBMITTED BY: Alerand

DATE: May 7, 2016, 10:50 a.m.

FORMAT: Text only

SIZE: 3.8 kB

HITS: 11315

  1. #region
  2. using System;
  3. using System.Drawing;
  4. using DetuksSharp;
  5. using LeagueSharp;
  6. using LeagueSharp.Common;
  7. #endregion
  8. namespace Marksman.Champions
  9. {
  10. internal class Gnar : Champion
  11. {
  12. private static readonly Obj_AI_Hero vGnar = ObjectManager.Player;
  13. public Spell E;
  14. public Spell Q;
  15. public Spell W;
  16. public Gnar()
  17. {
  18. Utils.Utils.PrintMessage("Gnar loaded.");
  19. Q = new Spell(SpellSlot.Q, 1100);
  20. Q.SetSkillshot(0.5f, 50f, 1200f, false, SkillshotType.SkillshotLine);
  21. W = new Spell(SpellSlot.W, 600);
  22. E = new Spell(SpellSlot.E, 500);
  23. E.SetSkillshot(0.5f, 50f, 1200f, false, SkillshotType.SkillshotCircle);
  24. }
  25. public override void Game_OnGameUpdate(EventArgs args)
  26. {
  27. if (!DeathWalker.canMove())
  28. return;
  29. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  30. if (ComboActive || HarassActive)
  31. {
  32. if (Q.IsReady() && useQ)
  33. {
  34. var t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
  35. if (t != null)
  36. {
  37. Q.Cast(t, false, true);
  38. }
  39. }
  40. }
  41. }
  42. public override void DeathWalker_AfterAttack(AttackableUnit unit, AttackableUnit target)
  43. {
  44. var t = target as Obj_AI_Hero;
  45. if (t != null && (ComboActive || HarassActive) && unit.IsMe)
  46. {
  47. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  48. var useW = GetValue<bool>("UseW" + (ComboActive ? "C" : "H"));
  49. if (W.IsReady() && useW)
  50. {
  51. ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W);
  52. }
  53. else if (Q.IsReady() && useQ)
  54. {
  55. Q.Cast(t);
  56. }
  57. }
  58. }
  59. public override void Drawing_OnDraw(EventArgs args)
  60. {
  61. Spell[] spellList = {Q, W, E};
  62. foreach (var spell in spellList)
  63. {
  64. var menuItem = GetValue<Circle>("Draw" + spell.Slot);
  65. if (menuItem.Active)
  66. Render.Circle.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
  67. }
  68. }
  69. public override bool ComboMenu(Menu config)
  70. {
  71. config.AddItem(new MenuItem("UseQC" + Id, "Use Q").SetValue(true));
  72. config.AddItem(new MenuItem("UseWC" + Id, "Use W").SetValue(true));
  73. return true;
  74. }
  75. public override bool HarassMenu(Menu config)
  76. {
  77. config.AddItem(new MenuItem("UseQH" + Id, "Use Q").SetValue(false));
  78. config.AddItem(new MenuItem("UseWH" + Id, "Use W").SetValue(false));
  79. return true;
  80. }
  81. public override bool DrawingMenu(Menu config)
  82. {
  83. config.AddItem(
  84. new MenuItem("DrawQ" + Id, "Q range").SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
  85. config.AddItem(
  86. new MenuItem("DrawW" + Id, "W range").SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
  87. config.AddItem(
  88. new MenuItem("DrawE" + Id, "E range").SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
  89. return true;
  90. }
  91. public override bool ExtrasMenu(Menu config)
  92. {
  93. return true;
  94. }
  95. public override bool LaneClearMenu(Menu config)
  96. {
  97. return true;
  98. }
  99. }
  100. }

comments powered by Disqus