Corki


SUBMITTED BY: Alerand

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

UPDATED: May 7, 2016, 10:45 a.m.

FORMAT: Text only

SIZE: 7.0 kB

HITS: 11845

  1. using System;
  2. using System.Drawing;
  3. using System.Linq;
  4. using DetuksSharp;
  5. using LeagueSharp;
  6. using LeagueSharp.Common;
  7. #endregion
  8. namespace Marksman.Champions
  9. {
  10. internal class Corki : Champion
  11. {
  12. public Spell E;
  13. public Spell Q;
  14. public Spell R1;
  15. public Spell R2;
  16. public Corki()
  17. {
  18. Utils.Utils.PrintMessage("Corki loaded");
  19. Q = new Spell(SpellSlot.Q, 825f);
  20. E = new Spell(SpellSlot.E, 600f);
  21. R1 = new Spell(SpellSlot.R, 1300f);
  22. R2 = new Spell(SpellSlot.R, 1500f);
  23. Q.SetSkillshot(0.35f, 250f, 1500f, false, SkillshotType.SkillshotCircle);
  24. E.SetSkillshot(0f, (float) (45*Math.PI/180), 1500, false, SkillshotType.SkillshotCone);
  25. R1.SetSkillshot(0.2f, 40f, 2000f, true, SkillshotType.SkillshotLine);
  26. R2.SetSkillshot(0.2f, 40f, 2000f, true, SkillshotType.SkillshotLine);
  27. }
  28. public override void Drawing_OnDraw(EventArgs args)
  29. {
  30. Spell[] spellList = {Q, E, R1};
  31. foreach (var spell in spellList)
  32. {
  33. var menuItem = GetValue<Circle>("Draw" + spell.Slot);
  34. if (menuItem.Active)
  35. Render.Circle.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
  36. }
  37. }
  38. public override void Game_OnGameUpdate(EventArgs args)
  39. {
  40. if (R1.IsReady() && GetValue<bool>("UseRM"))
  41. {
  42. var bigRocket = HasBigRocket();
  43. foreach (
  44. var hero in
  45. ObjectManager.Get<Obj_AI_Hero>()
  46. .Where(
  47. hero =>
  48. hero.IsValidTarget(bigRocket ? R2.Range : R1.Range) &&
  49. R1.GetDamage(hero)*(bigRocket ? 1.5f : 1f) > hero.Health))
  50. {
  51. if (bigRocket)
  52. R2.Cast(hero, false, true);
  53. else
  54. R1.Cast(hero, false, true);
  55. }
  56. }
  57. if ((!ComboActive && !HarassActive) || !DeathWalker.canMove()) return;
  58. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  59. var useE = GetValue<bool>("UseE" + (ComboActive ? "C" : "H"));
  60. var useR = GetValue<bool>("UseR" + (ComboActive ? "C" : "H"));
  61. var rLim = GetValue<Slider>("Rlim" + (ComboActive ? "C" : "H")).Value;
  62. if (useQ && Q.IsReady())
  63. {
  64. var t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
  65. if (t != null)
  66. if (Q.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  67. return;
  68. }
  69. if (useE && E.IsReady())
  70. {
  71. var t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
  72. if (t != null)
  73. if (E.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  74. return;
  75. }
  76. if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
  77. {
  78. var bigRocket = HasBigRocket();
  79. var t = TargetSelector.GetTarget(bigRocket ? R2.Range : R1.Range, TargetSelector.DamageType.Magical);
  80. if (t != null)
  81. if (bigRocket)
  82. R2.Cast(t, false, true);
  83. else
  84. R1.Cast(t, false, true);
  85. }
  86. }
  87. public override void DeathWalker_AfterAttack(AttackableUnit unit, AttackableUnit target)
  88. {
  89. var t = target as Obj_AI_Hero;
  90. if (t == null || (!ComboActive && !HarassActive) || !unit.IsMe)
  91. return;
  92. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  93. var useE = GetValue<bool>("UseE" + (ComboActive ? "C" : "H"));
  94. var useR = GetValue<bool>("UseR" + (ComboActive ? "C" : "H"));
  95. var rLim = GetValue<Slider>("Rlim" + (ComboActive ? "C" : "H")).Value;
  96. if (useQ && Q.IsReady())
  97. if (Q.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  98. return;
  99. if (useE && E.IsReady())
  100. if (E.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  101. return;
  102. if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
  103. if (HasBigRocket())
  104. R2.Cast(t, false, true);
  105. else
  106. R1.Cast(t, false, true);
  107. }
  108. public bool HasBigRocket()
  109. {
  110. return ObjectManager.Player.Buffs.Any(buff => buff.DisplayName.ToLower() == "corkimissilebarragecounterbig");
  111. }
  112. public override bool ComboMenu(Menu config)
  113. {
  114. config.AddItem(new MenuItem("UseQC" + Id, "Use Q").SetValue(true));
  115. config.AddItem(new MenuItem("UseEC" + Id, "Use E").SetValue(true));
  116. config.AddItem(new MenuItem("UseRC" + Id, "Use R").SetValue(true));
  117. config.AddItem(new MenuItem("RlimC" + Id, "Keep R Stacks").SetValue(new Slider(0, 0, 7)));
  118. return true;
  119. }
  120. public override bool HarassMenu(Menu config)
  121. {
  122. config.AddItem(new MenuItem("UseQH" + Id, "Use Q").SetValue(true));
  123. config.AddItem(new MenuItem("UseEH" + Id, "Use E").SetValue(false));
  124. config.AddItem(new MenuItem("UseRH" + Id, "Use R").SetValue(true));
  125. config.AddItem(new MenuItem("RlimH" + Id, "Keep R Stacks").SetValue(new Slider(3, 0, 7)));
  126. return true;
  127. }
  128. public override bool DrawingMenu(Menu config)
  129. {
  130. config.AddItem(
  131. new MenuItem("DrawQ" + Id, "Q range").SetValue(new Circle(true,
  132. Color.FromArgb(100, 255, 0, 255))));
  133. config.AddItem(
  134. new MenuItem("DrawE" + Id, "E range").SetValue(new Circle(false,
  135. Color.FromArgb(100, 255, 0, 255))));
  136. config.AddItem(
  137. new MenuItem("DrawR" + Id, "R range").SetValue(new Circle(false,
  138. Color.FromArgb(100, 255, 0, 255))));
  139. return true;
  140. }
  141. public override bool MiscMenu(Menu config)
  142. {
  143. config.AddItem(new MenuItem("UseRM" + Id, "Use R To Killsteal").SetValue(true));
  144. return true;
  145. }
  146. public override bool ExtrasMenu(Menu config)
  147. {
  148. return true;
  149. }
  150. public override bool LaneClearMenu(Menu config)
  151. {
  152. return true;
  153. }
  154. }
  155. }

comments powered by Disqus