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.6 kB

HITS: 11845

  1. Skip to content
  2. Personal Open source Business Explore
  3. Sign upSign inPricingBlogSupport
  4. This repository
  5. Search
  6. Watch 1 Star 2 Fork 13 detuks/GoodGuyJodu
  7. Code Issues 0 Pull requests 0 Pulse Graphs
  8. Branch: master Find file Copy pathGoodGuyJodu/DeadMan/Champions/Corki.cs
  9. 262dc5c on 21 Sep 2015
  10. @detuks detuks Deadman ;D is in well I hope staff guys wont assasinate me
  11. 1 contributor
  12. RawBlameHistory 181 lines (156 sloc) 6.68 KB
  13. #region
  14. using System;
  15. using System.Drawing;
  16. using System.Linq;
  17. using DetuksSharp;
  18. using LeagueSharp;
  19. using LeagueSharp.Common;
  20. #endregion
  21. namespace Marksman.Champions
  22. {
  23. internal class Corki : Champion
  24. {
  25. public Spell E;
  26. public Spell Q;
  27. public Spell R1;
  28. public Spell R2;
  29. public Corki()
  30. {
  31. Utils.Utils.PrintMessage("Corki loaded");
  32. Q = new Spell(SpellSlot.Q, 825f);
  33. E = new Spell(SpellSlot.E, 600f);
  34. R1 = new Spell(SpellSlot.R, 1300f);
  35. R2 = new Spell(SpellSlot.R, 1500f);
  36. Q.SetSkillshot(0.35f, 250f, 1500f, false, SkillshotType.SkillshotCircle);
  37. E.SetSkillshot(0f, (float) (45*Math.PI/180), 1500, false, SkillshotType.SkillshotCone);
  38. R1.SetSkillshot(0.2f, 40f, 2000f, true, SkillshotType.SkillshotLine);
  39. R2.SetSkillshot(0.2f, 40f, 2000f, true, SkillshotType.SkillshotLine);
  40. }
  41. public override void Drawing_OnDraw(EventArgs args)
  42. {
  43. Spell[] spellList = {Q, E, R1};
  44. foreach (var spell in spellList)
  45. {
  46. var menuItem = GetValue<Circle>("Draw" + spell.Slot);
  47. if (menuItem.Active)
  48. Render.Circle.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
  49. }
  50. }
  51. public override void Game_OnGameUpdate(EventArgs args)
  52. {
  53. if (R1.IsReady() && GetValue<bool>("UseRM"))
  54. {
  55. var bigRocket = HasBigRocket();
  56. foreach (
  57. var hero in
  58. ObjectManager.Get<Obj_AI_Hero>()
  59. .Where(
  60. hero =>
  61. hero.IsValidTarget(bigRocket ? R2.Range : R1.Range) &&
  62. R1.GetDamage(hero)*(bigRocket ? 1.5f : 1f) > hero.Health))
  63. {
  64. if (bigRocket)
  65. R2.Cast(hero, false, true);
  66. else
  67. R1.Cast(hero, false, true);
  68. }
  69. }
  70. if ((!ComboActive && !HarassActive) || !DeathWalker.canMove()) return;
  71. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  72. var useE = GetValue<bool>("UseE" + (ComboActive ? "C" : "H"));
  73. var useR = GetValue<bool>("UseR" + (ComboActive ? "C" : "H"));
  74. var rLim = GetValue<Slider>("Rlim" + (ComboActive ? "C" : "H")).Value;
  75. if (useQ && Q.IsReady())
  76. {
  77. var t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
  78. if (t != null)
  79. if (Q.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  80. return;
  81. }
  82. if (useE && E.IsReady())
  83. {
  84. var t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
  85. if (t != null)
  86. if (E.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  87. return;
  88. }
  89. if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
  90. {
  91. var bigRocket = HasBigRocket();
  92. var t = TargetSelector.GetTarget(bigRocket ? R2.Range : R1.Range, TargetSelector.DamageType.Magical);
  93. if (t != null)
  94. if (bigRocket)
  95. R2.Cast(t, false, true);
  96. else
  97. R1.Cast(t, false, true);
  98. }
  99. }
  100. public override void DeathWalker_AfterAttack(AttackableUnit unit, AttackableUnit target)
  101. {
  102. var t = target as Obj_AI_Hero;
  103. if (t == null || (!ComboActive && !HarassActive) || !unit.IsMe)
  104. return;
  105. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  106. var useE = GetValue<bool>("UseE" + (ComboActive ? "C" : "H"));
  107. var useR = GetValue<bool>("UseR" + (ComboActive ? "C" : "H"));
  108. var rLim = GetValue<Slider>("Rlim" + (ComboActive ? "C" : "H")).Value;
  109. if (useQ && Q.IsReady())
  110. if (Q.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  111. return;
  112. if (useE && E.IsReady())
  113. if (E.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
  114. return;
  115. if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
  116. if (HasBigRocket())
  117. R2.Cast(t, false, true);
  118. else
  119. R1.Cast(t, false, true);
  120. }
  121. public bool HasBigRocket()
  122. {
  123. return ObjectManager.Player.Buffs.Any(buff => buff.DisplayName.ToLower() == "corkimissilebarragecounterbig");
  124. }
  125. public override bool ComboMenu(Menu config)
  126. {
  127. config.AddItem(new MenuItem("UseQC" + Id, "Use Q").SetValue(true));
  128. config.AddItem(new MenuItem("UseEC" + Id, "Use E").SetValue(true));
  129. config.AddItem(new MenuItem("UseRC" + Id, "Use R").SetValue(true));
  130. config.AddItem(new MenuItem("RlimC" + Id, "Keep R Stacks").SetValue(new Slider(0, 0, 7)));
  131. return true;
  132. }
  133. public override bool HarassMenu(Menu config)
  134. {
  135. config.AddItem(new MenuItem("UseQH" + Id, "Use Q").SetValue(true));
  136. config.AddItem(new MenuItem("UseEH" + Id, "Use E").SetValue(false));
  137. config.AddItem(new MenuItem("UseRH" + Id, "Use R").SetValue(true));
  138. config.AddItem(new MenuItem("RlimH" + Id, "Keep R Stacks").SetValue(new Slider(3, 0, 7)));
  139. return true;
  140. }
  141. public override bool DrawingMenu(Menu config)
  142. {
  143. config.AddItem(
  144. new MenuItem("DrawQ" + Id, "Q range").SetValue(new Circle(true,
  145. Color.FromArgb(100, 255, 0, 255))));
  146. config.AddItem(
  147. new MenuItem("DrawE" + Id, "E range").SetValue(new Circle(false,
  148. Color.FromArgb(100, 255, 0, 255))));
  149. config.AddItem(
  150. new MenuItem("DrawR" + Id, "R range").SetValue(new Circle(false,
  151. Color.FromArgb(100, 255, 0, 255))));
  152. return true;
  153. }
  154. public override bool MiscMenu(Menu config)
  155. {
  156. config.AddItem(new MenuItem("UseRM" + Id, "Use R To Killsteal").SetValue(true));
  157. return true;
  158. }
  159. public override bool ExtrasMenu(Menu config)
  160. {
  161. return true;
  162. }
  163. public override bool LaneClearMenu(Menu config)
  164. {
  165. return true;
  166. }
  167. }
  168. }
  169. Status API Training Shop Blog About
  170. © 2016 GitHub, Inc. Terms Privacy Security Contact Help

comments powered by Disqus