CtScript


SUBMITTED BY: Alerand

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

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

FORMAT: Text only

SIZE: 10.0 kB

HITS: 12054

  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/Caitlyn.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 247 lines (213 sloc) 9.04 KB
  13. #region
  14. using System;
  15. using System.Drawing;
  16. using DetuksSharp;
  17. using LeagueSharp;
  18. using LeagueSharp.Common;
  19. #endregion
  20. namespace Marksman.Champions
  21. {
  22. internal class Caitlyn : Champion // Base done by xQx, Drawings and improvements added by Dibes.
  23. {
  24. public static Spell R;
  25. public Spell E;
  26. public Spell Q;
  27. public bool ShowUlt;
  28. public string UltTarget;
  29. public Spell W;
  30. public Caitlyn()
  31. {
  32. Utils.Utils.PrintMessage("Caitlyn loaded.");
  33. Q = new Spell(SpellSlot.Q, 1240);
  34. W = new Spell(SpellSlot.W, 820);
  35. E = new Spell(SpellSlot.E, 800);
  36. R = new Spell(SpellSlot.R, 2000);
  37. Q.SetSkillshot(0.25f, 60f, 2000f, false, SkillshotType.SkillshotLine);
  38. E.SetSkillshot(0.25f, 80f, 1600f, true, SkillshotType.SkillshotLine);
  39. AntiGapcloser.OnEnemyGapcloser += AntiGapcloser_OnEnemyGapcloser;
  40. Drawing.OnEndScene += DrawingOnOnEndScene;
  41. }
  42. public void AntiGapcloser_OnEnemyGapcloser(ActiveGapcloser gapcloser)
  43. {
  44. if (E.IsReady() && gapcloser.Sender.IsValidTarget(E.Range))
  45. E.CastOnUnit(gapcloser.Sender);
  46. }
  47. public override void Drawing_OnDraw(EventArgs args)
  48. {
  49. Spell[] spellList = {Q, E, R};
  50. foreach (var spell in spellList)
  51. {
  52. var menuItem = GetValue<Circle>("Draw" + spell.Slot);
  53. if (menuItem.Active)
  54. Render.Circle.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
  55. }
  56. var drawUlt = GetValue<Circle>("DrawUlt");
  57. if (drawUlt.Active && ShowUlt)
  58. {
  59. //var playerPos = Drawing.WorldToScreen(ObjectManager.Player.Position);
  60. //Drawing.DrawText(playerPos.X - 65, playerPos.Y + 20, drawUlt.Color, "Hit R To kill " + UltTarget + "!");
  61. }
  62. }
  63. private static void DrawingOnOnEndScene(EventArgs args)
  64. {
  65. var rCircle2 = Program.Config.Item("Draw.UltiMiniMap").GetValue<Circle>();
  66. if (rCircle2.Active)
  67. {
  68. Utility.DrawCircle(ObjectManager.Player.Position, R.Range, rCircle2.Color, 1, 23, true);
  69. }
  70. }
  71. public override void Game_OnGameUpdate(EventArgs args)
  72. {
  73. R.Range = 500*(R.Level == 0 ? 1 : R.Level) + 1500;
  74. Obj_AI_Hero t;
  75. if (W.IsReady() && GetValue<bool>("AutoWI"))
  76. {
  77. t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
  78. if (t.IsValidTarget(W.Range) &&
  79. (t.HasBuffOfType(BuffType.Stun) || t.HasBuffOfType(BuffType.Snare) ||
  80. t.HasBuffOfType(BuffType.Taunt) || t.HasBuff("zhonyasringshield") ||
  81. t.HasBuff("Recall")))
  82. {
  83. W.Cast(t.Position);
  84. }
  85. }
  86. if (Q.IsReady() && GetValue<bool>("AutoQI"))
  87. {
  88. t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
  89. if (t.IsValidTarget(Q.Range) &&
  90. (t.HasBuffOfType(BuffType.Stun) || t.HasBuffOfType(BuffType.Snare) ||
  91. t.HasBuffOfType(BuffType.Taunt) &&
  92. (t.Health <= ObjectManager.Player.GetSpellDamage(t, SpellSlot.Q) ||
  93. !DeathWalker.inAutoAttackRange(t))))
  94. {
  95. Q.Cast(t, false, true);
  96. }
  97. }
  98. if (R.IsReady())
  99. {
  100. t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
  101. if (t.IsValidTarget(R.Range) && t.Health <= R.GetDamage(t))
  102. {
  103. if (GetValue<KeyBind>("UltHelp").Active)
  104. R.Cast(t);
  105. UltTarget = t.ChampionName;
  106. ShowUlt = true;
  107. }
  108. else
  109. {
  110. ShowUlt = false;
  111. }
  112. }
  113. else
  114. {
  115. ShowUlt = false;
  116. }
  117. if (GetValue<KeyBind>("Dash").Active && E.IsReady())
  118. {
  119. var pos = ObjectManager.Player.ServerPosition.To2D().Extend(Game.CursorPos.To2D(), -300).To3D();
  120. E.Cast(pos, true);
  121. }
  122. if (GetValue<KeyBind>("UseEQC").Active && E.IsReady() && Q.IsReady())
  123. {
  124. t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
  125. if (t.IsValidTarget(E.Range) &&
  126. t.Health <
  127. ObjectManager.Player.GetSpellDamage(t, SpellSlot.Q) +
  128. ObjectManager.Player.GetSpellDamage(t, SpellSlot.E) + 20 && E.CanCast(t))
  129. {
  130. E.Cast(t);
  131. Q.Cast(t, false, true);
  132. }
  133. }
  134. // PQ you broke it D:
  135. if ((!ComboActive && !HarassActive) || !DeathWalker.canMove()) return;
  136. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  137. var useE = GetValue<bool>("UseEC");
  138. var useR = GetValue<bool>("UseRC");
  139. if (Q.IsReady() && useQ)
  140. {
  141. t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
  142. if (t != null)
  143. Q.Cast(t, false, true);
  144. }
  145. else if (E.IsReady() && useE)
  146. {
  147. t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
  148. if (t != null && t.Health <= E.GetDamage(t))
  149. E.Cast(t);
  150. }
  151. if (R.IsReady() && useR)
  152. {
  153. t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
  154. if (t != null && t.Health <= R.GetDamage(t) &&
  155. !DeathWalker.inAutoAttackRange(t))
  156. {
  157. R.CastOnUnit(t);
  158. }
  159. }
  160. }
  161. public override void DeathWalker_AfterAttack(AttackableUnit unit, AttackableUnit target)
  162. {
  163. var t = target as Obj_AI_Hero;
  164. if (t != null || (!ComboActive && !HarassActive) || unit.IsMe)
  165. return;
  166. var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
  167. if (useQ)
  168. Q.Cast(t, false, true);
  169. }
  170. public override bool ComboMenu(Menu config)
  171. {
  172. config.AddItem(new MenuItem("UseQC" + Id, "Use Q").SetValue(true));
  173. config.AddItem(new MenuItem("UseEC" + Id, "Use E").SetValue(true));
  174. config.AddItem(new MenuItem("UseRC" + Id, "Use R").SetValue(true));
  175. return true;
  176. }
  177. public override bool HarassMenu(Menu config)
  178. {
  179. config.AddItem(new MenuItem("UseQH" + Id, "Use Q").SetValue(true));
  180. return true;
  181. }
  182. public override bool DrawingMenu(Menu config)
  183. {
  184. config.AddItem(new MenuItem("Champion.Drawings", ObjectManager.Player.ChampionName + " Draw Options"));
  185. config.AddItem(
  186. new MenuItem("DrawQ" + Id, Program.MenuSpace + "Q range").SetValue(new Circle(true,
  187. Color.FromArgb(100, 255, 0, 255))));
  188. config.AddItem(
  189. new MenuItem("DrawE" + Id, Program.MenuSpace + "E range").SetValue(new Circle(false,
  190. Color.FromArgb(100, 255, 255, 255))));
  191. config.AddItem(
  192. new MenuItem("DrawR" + Id, Program.MenuSpace + "R range").SetValue(new Circle(false,
  193. Color.FromArgb(100, 255, 255, 255))));
  194. config.AddItem(
  195. new MenuItem("DrawUlt" + Id, Program.MenuSpace + "Ult Text").SetValue(new Circle(true,
  196. Color.FromArgb(255, 255, 255, 255))));
  197. config.AddItem(
  198. new MenuItem("Draw.UltiMiniMap", Program.MenuSpace + "Draw Ulti Minimap").SetValue(new Circle(true,
  199. Color.FromArgb(255, 255, 255, 255))));
  200. return true;
  201. }
  202. public override bool MiscMenu(Menu config)
  203. {
  204. config.AddItem(
  205. new MenuItem("UltHelp" + Id, "Ult Target on R").SetValue(new KeyBind("R".ToCharArray()[0],
  206. KeyBindType.Press)));
  207. config.AddItem(
  208. new MenuItem("UseEQC" + Id, "Use E-Q Combo").SetValue(new KeyBind("T".ToCharArray()[0],
  209. KeyBindType.Press)));
  210. config.AddItem(
  211. new MenuItem("Dash" + Id, "Dash to Mouse").SetValue(new KeyBind("Z".ToCharArray()[0], KeyBindType.Press)));
  212. return true;
  213. }
  214. public override bool ExtrasMenu(Menu config)
  215. {
  216. config.AddItem(new MenuItem("AutoQI" + Id, "Auto Q (Stun/Snare/Taunt/Slow)").SetValue(true));
  217. config.AddItem(new MenuItem("AutoWI" + Id, "Auto W (Stun/Snare/Taunt)").SetValue(true));
  218. return true;
  219. }
  220. public override bool LaneClearMenu(Menu config)
  221. {
  222. return true;
  223. }
  224. }
  225. }
  226. Status API Training Shop Blog About
  227. © 2016 GitHub, Inc. Terms Privacy Security Contact Help

comments powered by Disqus