Advertisement
Guest User

Untitled

a guest
May 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.81 KB | None | 0 0
  1. #include "PluginSDK.h"
  2. #include <string>
  3. #include "Extention.h"
  4.  
  5. PluginSetup("HelalsDarius")
  6.  
  7.  
  8. IMenu* MainMenu;
  9.  
  10. IMenu* ComboMenu;
  11. IMenu* ComboQset;
  12. IMenuOption* ComboQ;
  13. IMenuOption* ComboQAA;
  14. IMenuOption* ComboQLock;
  15. IMenuOption* ComboEAA;
  16. IMenuOption* ComboW;
  17. IMenuOption* ComboWAA;
  18. IMenuOption* ComboE;
  19. IMenu* Rset;
  20. IMenuOption* ComboR;
  21. IMenuOption* ComboRcheck;
  22.  
  23.  
  24.  
  25. IMenu* HarassMenu;
  26. IMenuOption* HarassQ;
  27. IMenuOption* HarassW;
  28. IMenuOption* HarassE;
  29. IMenuOption* HarassMana;
  30.  
  31.  
  32. IMenu* DrawingMenu;
  33. IMenuOption* DrawQRange;
  34. IMenuOption* DrawERange;
  35. IMenuOption* DrawRRange;
  36. IMenuOption* DrawDamage;
  37. IMenuOption* DrawStacks;
  38.  
  39. IMenu* FarmMenu;
  40. IMenuOption* FarmQ;
  41. IMenuOption* FarmQL;
  42. IMenuOption* FarmW;
  43. IMenuOption* FarmMana;
  44.  
  45. IMenu* KillstealMenu;
  46. IMenuOption* KSQ;
  47. IMenuOption* KSR;
  48. IMenuOption* KSRCheck;
  49.  
  50. IMenu* LastMenu;
  51. IMenuOption* LastQ;
  52. IMenuOption* LastW;
  53.  
  54. IMenu* MiscMenu;
  55. IMenuOption* InterruptE;
  56. IMenuOption* AntiGapE;
  57.  
  58.  
  59. ISpell2* Q;
  60. ISpell2* W;
  61. ISpell2* E;
  62. ISpell2* R;
  63.  
  64. ISpell* Flash;
  65.  
  66.  
  67. IUnit* Qring;
  68. IUnit* Player;
  69. int xOffset = 10;
  70. int yOffset = 20;
  71. int Width = 103;
  72. int Height = 8;
  73. Vec4 Color = Vec4(105, 198, 5, 255);
  74. Vec4 FillColor = Vec4(198, 176, 5, 255);
  75. Vec4 Color2 = Vec4(25, 255, 0, 200);
  76.  
  77.  
  78.  
  79. void LoadSpells()
  80. {
  81. Q = GPluginSDK->CreateSpell2(kSlotQ, kCircleCast, false, false, (kCollidesWithNothing));
  82. Q->SetSkillshot(0.f, 425.f, 1000.f, 440.f);
  83.  
  84. W = GPluginSDK->CreateSpell2(kSlotW, kTargetCast, false, false, (kCollidesWithNothing));
  85. W->SetOverrideRange(300);
  86.  
  87. E = GPluginSDK->CreateSpell2(kSlotE, kConeCast, false, false, (kCollidesWithNothing));
  88. E->SetSkillshot(0.25f, 80.f, 1000.f, 520.f);
  89.  
  90. R = GPluginSDK->CreateSpell2(kSlotR, kTargetCast, false, false, (kCollidesWithNothing));
  91. }
  92.  
  93. void Menu()
  94. {
  95. MainMenu = GPluginSDK->AddMenu("Helalsmoney x Kornis Darius");
  96. ComboMenu = MainMenu->AddMenu("Combo");
  97. {
  98. ComboQset = ComboMenu->AddMenu("Q Settings");
  99. ComboQ = ComboQset->CheckBox("Use Q", true);
  100. ComboQLock = ComboQset->CheckBox("Use Q Outside Lock", false);
  101. ComboQAA = ComboQset->CheckBox("Dont Q if in AA Range", false);
  102. ComboW = ComboMenu->CheckBox("Use W", true);
  103. ComboWAA = ComboMenu->CheckBox("^- Only for AA Reset", true);
  104. ComboE = ComboMenu->CheckBox("Use E", true);
  105. ComboEAA = ComboMenu->CheckBox("^- Only if out of AA Range", true);
  106. Rset = ComboMenu->AddMenu("R Settings");
  107. ComboR = Rset->CheckBox("Use R", true);
  108. ComboRcheck = Rset->AddFloat("Dont waste R if Enemy HP lower than", 0, 500, 50);
  109.  
  110.  
  111.  
  112. }
  113. HarassMenu = MainMenu->AddMenu("Harass");
  114. {
  115. HarassMana = HarassMenu->AddInteger("Mana Percent for Harass", 10, 100, 50);
  116. HarassQ = HarassMenu->CheckBox("Use Q", true);
  117. HarassW = HarassMenu->CheckBox("Use W", true);
  118. HarassE = HarassMenu->CheckBox("Use E", true);
  119. }
  120.  
  121.  
  122. DrawingMenu = MainMenu->AddMenu("Drawings");
  123. {
  124. DrawQRange = DrawingMenu->CheckBox("Draw Q Range", true);
  125. DrawERange = DrawingMenu->CheckBox("Draw E Range", true);
  126. DrawRRange = DrawingMenu->CheckBox("Draw R Range", true);
  127. DrawDamage = DrawingMenu->CheckBox("Draw R Damage", true);
  128. DrawStacks = DrawingMenu->CheckBox("Draw Stack Count", true);
  129. }
  130. KillstealMenu = MainMenu->AddMenu("Killsteal");
  131. {
  132. KSQ = KillstealMenu->CheckBox("Killsteal with Q", true);
  133. KSR = KillstealMenu->CheckBox("Killsteal with R", true);
  134. KSRCheck = KillstealMenu->AddFloat("^- Dont waste R if Enemy HP lower than", 0, 500, 100);
  135.  
  136. }
  137. FarmMenu = MainMenu->AddMenu("Farming");
  138. {
  139. FarmMana = FarmMenu->AddInteger("Mana Percent for LaneClear", 10, 100, 50);
  140. FarmQ = FarmMenu->CheckBox("Clear with Q", true);
  141. FarmQL = FarmMenu->AddFloat("^- if Hits", 1, 6, 3);
  142. FarmW = FarmMenu->CheckBox("Clear with W", true);
  143. }
  144.  
  145. MiscMenu = MainMenu->AddMenu("Misc.");
  146. {
  147. InterruptE = MiscMenu->CheckBox("Interrupt with E", true);
  148. AntiGapE = MiscMenu->CheckBox("AntiGap with E", true);
  149. }
  150. LastMenu = MainMenu->AddMenu("Last Hit");
  151. {
  152. LastW = LastMenu->CheckBox("Last hit W", true);
  153. }
  154.  
  155. }
  156.  
  157. static double RDamage(IUnit* target)
  158. {
  159. if (target == nullptr || !R->IsReady() || target->IsDead() || !target->IsValidTarget() || target->HasBuffOfType(BUFF_SpellShield) || target->HasBuffOfType(BUFF_SpellImmunity))
  160. return 0;
  161. int stuff = 0;
  162. int stuff1 = 0;
  163. if (GEntityList->Player()->GetSpellLevel(kSlotR) == 1)
  164. {
  165. stuff1 = (100 + GEntityList->Player()->BonusDamage() * 0.75);
  166. for (auto Source : GEntityList->GetAllUnits())
  167. {
  168.  
  169. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_01.troy"))
  170. {
  171. stuff = (100 + GEntityList->Player()->BonusDamage() * 0.75) * 0.2;
  172. }
  173. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_02.troy"))
  174. {
  175. stuff = (100 + GEntityList->Player()->BonusDamage() * 0.75) * 0.4;
  176. }
  177. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_03.troy"))
  178. {
  179. stuff = (100 + GEntityList->Player()->BonusDamage() * 0.75) * 0.6;
  180. }
  181. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_04.troy"))
  182. {
  183. stuff = (100 + GEntityList->Player()->BonusDamage() * 0.75) * 0.8;
  184. }
  185. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_05.troy"))
  186. {
  187. stuff = (100 + GEntityList->Player()->BonusDamage() * 0.75);
  188. }
  189. }
  190. }
  191. if (GEntityList->Player()->GetSpellLevel(kSlotR) == 2)
  192. {
  193. stuff1 = (200 + GEntityList->Player()->BonusDamage() * 0.75);
  194. for (auto Source : GEntityList->GetAllUnits())
  195. {
  196. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_01.troy"))
  197. {
  198. stuff = (200 + GEntityList->Player()->BonusDamage() * 0.75) * 0.2;
  199. }
  200. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_02.troy"))
  201. {
  202. stuff = (200 + GEntityList->Player()->BonusDamage() * 0.75) * 0.4;
  203. }
  204. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_03.troy"))
  205. {
  206.  
  207. stuff = (200 + GEntityList->Player()->BonusDamage() * 0.75) * 0.6;
  208. }
  209. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_04.troy"))
  210. {
  211. stuff = (200 + GEntityList->Player()->BonusDamage() * 0.75) * 0.8;
  212. }
  213. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_05.troy"))
  214. {
  215. stuff = (200 + GEntityList->Player()->BonusDamage() * 0.75);
  216. }
  217. }
  218. }
  219. if (GEntityList->Player()->GetSpellLevel(kSlotR) == 3)
  220. {
  221. stuff1 = (300 + GEntityList->Player()->BonusDamage() * 0.75);
  222.  
  223. for (auto Source : GEntityList->GetAllUnits())
  224. {
  225. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_01.troy"))
  226. {
  227. stuff = (300 + GEntityList->Player()->BonusDamage() * 0.75) * 0.2;
  228. }
  229. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_02.troy"))
  230. {
  231. stuff = (300 + GEntityList->Player()->BonusDamage() * 0.75) * 0.4 ;
  232. }
  233. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_03.troy"))
  234. {
  235. stuff = (300 + GEntityList->Player()->BonusDamage() * 0.75) * 0.6 ;
  236. }
  237. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_04.troy"))
  238. {
  239. stuff = (300 + GEntityList->Player()->BonusDamage() * 0.75) * 0.8;
  240. }
  241. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_05.troy"))
  242. {
  243. stuff = (300 + GEntityList->Player()->BonusDamage() * 0.75);
  244. }
  245. }
  246. }
  247. auto calc = stuff + stuff1;
  248. auto damage = GDamage->CalcPhysicalDamage(GEntityList->Player(), target, calc);
  249. return calc;
  250.  
  251. }
  252. static double QDamage(IUnit* target)
  253. {
  254. if ((GEntityList->Player()->GetPosition() - target->GetPosition()).Length2D() > 300 && (GEntityList->Player()->GetPosition() - target->GetPosition()).Length2D() < Q->Range())
  255. {
  256. int helal = 0;
  257. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 1)
  258. {
  259. helal = 40 + GEntityList->Player()->TotalPhysicalDamage() * 1;
  260. }
  261. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 2)
  262. {
  263. helal = 70 + GEntityList->Player()->TotalPhysicalDamage() * 1.10;
  264. }
  265. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 3)
  266. {
  267. helal = 100 + GEntityList->Player()->TotalPhysicalDamage() * 1.20;
  268. }
  269. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 4)
  270. {
  271. helal = 130 + GEntityList->Player()->TotalPhysicalDamage() * 1.30;
  272. }
  273. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 5)
  274. {
  275. helal = 160 + GEntityList->Player()->TotalPhysicalDamage() * 1.40;
  276. }
  277.  
  278. auto calc = helal;
  279. auto damage = GDamage->CalcPhysicalDamage(GEntityList->Player(), target, calc);
  280. return damage;
  281.  
  282. }
  283. if ((GEntityList->Player()->GetPosition() - target->GetPosition()).Length2D() < 300)
  284. {
  285. int helal = 0;
  286. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 1)
  287. {
  288. helal = 40 + GEntityList->Player()->TotalPhysicalDamage() * 1;
  289. }
  290. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 2)
  291. {
  292. helal = 70 + GEntityList->Player()->TotalPhysicalDamage() * 1.10;
  293. }
  294. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 3)
  295. {
  296. helal = 100 + GEntityList->Player()->TotalPhysicalDamage() * 1.20;
  297. }
  298. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 4)
  299. {
  300. helal = 130 + GEntityList->Player()->TotalPhysicalDamage() * 1.30;
  301. }
  302. if (GEntityList->Player()->GetSpellLevel(kSlotQ) == 5)
  303. {
  304. helal = 160 + GEntityList->Player()->TotalPhysicalDamage() * 1.40;
  305. }
  306.  
  307. auto calc = helal * 0.35;
  308. auto damage = GDamage->CalcPhysicalDamage(GEntityList->Player(), target, calc);
  309. return damage;
  310.  
  311. }
  312. }
  313. void dmgdraw()
  314. {
  315. for (auto hero : GEntityList->GetAllHeros(false, true))
  316. {
  317. Vec2 barPos = Vec2();
  318. if (hero->GetHPBarPosition(barPos) && !hero->IsDead())
  319. {
  320. auto RDamages = 0;
  321. if (GEntityList->Player()->GetSpellBook()->GetLevel(kSlotR) > 0)
  322. {
  323. RDamages = RDamage(hero);
  324. }
  325. auto damage = RDamages;
  326. float percentHealthAfterDamage = max(0, hero->GetHealth() - float(damage)) / hero->GetMaxHealth();
  327. float yPos = barPos.y + yOffset;
  328. float xPosDamage = (barPos.x + xOffset) + Width * percentHealthAfterDamage;
  329. float xPosCurrentHp = barPos.x + xOffset + Width * (hero->GetHealth() / hero->GetMaxHealth());
  330. if (!hero->IsDead() && hero->IsValidTarget())
  331. {
  332. float differenceInHP = xPosCurrentHp - xPosDamage;
  333. float pos1 = barPos.x + 9 + (107 * percentHealthAfterDamage);
  334.  
  335. for (int i = 0; i < differenceInHP; i++)
  336. {
  337. if (damage < hero->GetHealth())
  338. {
  339. GRender->DrawLine(Vec2(pos1 + i, yPos), Vec2(pos1 + i, yPos + Height), FillColor);
  340. }
  341. if (damage > hero->GetHealth())
  342. {
  343. GRender->DrawLine(Vec2(pos1 + i, yPos), Vec2(pos1 + i, yPos + Height), Color2);
  344. }
  345.  
  346. }
  347. if (!hero->IsVisible())
  348. {
  349.  
  350. }
  351. }
  352. }
  353. }
  354. }
  355. static void OnCreateObject(IUnit* Source)
  356. {
  357. if (strstr(Source->GetObjectName(), "Darius_Base_Q_Ring.troy"))
  358. {
  359. Qring = Source;
  360. }
  361. }
  362. static void OnDeleteObject(IUnit* Source)
  363. {
  364. if (strstr(Source->GetObjectName(), "Darius_Base_Q_Ring_Windup.troy"))
  365. {
  366. Qring = nullptr;
  367. }
  368. }
  369.  
  370.  
  371. void Qaa()
  372. {
  373. if (GEntityList->Player()->HasBuff("dariusqcast"))
  374. {
  375. GOrbwalking->SetAttacksAllowed(false);
  376. }
  377. else GOrbwalking->SetAttacksAllowed(true);
  378. }
  379. void QLock()
  380. {
  381. if (ComboQLock->Enabled())
  382. {
  383.  
  384. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range());
  385. if (target != nullptr && target->IsValidTarget(GEntityList->Player(), Q->Range()) && target->IsHero() && !target->IsDead())
  386. {
  387. if ((target->GetPosition() - GEntityList->Player()->GetPosition()).Length2D() < 300)
  388. {
  389. if (Qring != nullptr)
  390. {
  391.  
  392. GOrbwalking->SetOverridePosition(target->GetPosition().Extend(GEntityList->Player()->GetPosition(), 350.f));
  393. }
  394.  
  395. }
  396. else GOrbwalking->SetOverridePosition(Vec3(0, 0, 0));
  397. }
  398. }
  399. if (Qring == nullptr)
  400. {
  401.  
  402. GOrbwalking->SetOverridePosition(Vec3(0, 0, 0));
  403. }
  404. }
  405.  
  406. void Combo()
  407. {
  408. {
  409.  
  410. if (ComboW->Enabled() && W->IsReady() && !ComboWAA->Enabled())
  411. {
  412. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, W->Range());
  413. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  414. {
  415. W->CastOnPlayer();
  416. }
  417.  
  418. }
  419. if (ComboQ->Enabled() && Q->IsReady())
  420. {
  421. if (ComboQAA->Enabled())
  422. {
  423. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range());
  424. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  425. {
  426. if ((target->GetPosition() - GEntityList->Player()->GetPosition()).Length2D() > 300)
  427. {
  428. Q->CastOnPlayer();
  429. }
  430. }
  431. }
  432. if (!ComboQAA->Enabled())
  433. {
  434. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range());
  435. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  436. {
  437. Q->CastOnPlayer();
  438. }
  439. }
  440. }
  441. if (ComboE->Enabled() && E->IsReady())
  442. {
  443. if (ComboEAA->Enabled())
  444. {
  445.  
  446. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, E->Range());
  447. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  448. {
  449. if ((target->GetPosition() - GEntityList->Player()->GetPosition()).Length2D() > 300)
  450. {
  451. E->CastOnTarget(target);
  452. }
  453. }
  454. }
  455. if (!ComboEAA->Enabled())
  456. {
  457. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, E->Range());
  458. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  459. {
  460. E->CastOnTarget(target);
  461. }
  462. }
  463. }
  464. if (ComboR->Enabled() && R->IsReady())
  465. {
  466. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, R->Range());
  467. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  468. {
  469. if ((RDamage(target) >= target->GetHealth() && target->GetHealth() > ComboRcheck->GetFloat()))
  470. {
  471. R->CastOnTarget(target);
  472. }
  473. }
  474. }
  475. }
  476. }
  477. void LastHit()
  478. {
  479. for (auto Minion : GEntityList->GetAllMinions(false, true, true))
  480. {
  481. if (!Minion->IsDead() && Minion != nullptr)
  482. {
  483. auto wdmg = GEntityList->Player()->TotalPhysicalDamage() + GEntityList->Player()->TotalPhysicalDamage() * 0.4;
  484. auto calc = GDamage->CalcPhysicalDamage(GEntityList->Player(), Minion, wdmg);
  485. if (LastW->Enabled() && W->IsReady() && Minion->IsValidTarget(GEntityList->Player(), W->Range()) && calc >= Minion->GetHealth())
  486. {
  487. if (W->CastOnPlayer())
  488. {
  489. GOrbwalking->SetOverrideTarget(Minion);
  490. }
  491.  
  492. }
  493. }
  494. }
  495. }
  496.  
  497. void Killsteal()
  498. {
  499. for (auto Enemy : GEntityList->GetAllHeros(false, true))
  500. {
  501.  
  502. if (Enemy != nullptr && !Enemy->IsDead())
  503. {
  504. if (KSQ->Enabled() && Q->IsReady() && QDamage(Enemy) > Enemy->GetHealth() && Enemy->IsValidTarget(GEntityList->Player(), Q->Range()))
  505. {
  506. Q->CastOnTarget(Enemy);
  507. }
  508. if (KSR->Enabled() && R->IsReady() && Enemy->IsValidTarget(GEntityList->Player(), R->Range()) && RDamage(Enemy) > Enemy->GetHealth())
  509. {
  510. if (Enemy->GetHealth() > KSRCheck->GetFloat())
  511. {
  512. R->CastOnTarget(Enemy);
  513. }
  514. }
  515.  
  516. }
  517.  
  518. }
  519. }
  520.  
  521. PLUGIN_EVENT(void) OnInterruptible(InterruptibleSpell const& Args)
  522. {
  523. if (Args.Source != nullptr && InterruptE->Enabled() && (Args.Source->GetPosition() - GEntityList->Player()->GetPosition()).Length() < E->Range() && E->IsReady() && Args.Source->IsValidTarget())
  524. {
  525. E->CastOnTarget(Args.Source);
  526. }
  527. }
  528. PLUGIN_EVENT(void) OnGapCloser(GapCloserSpell const& Args)
  529. {
  530. if (Args.Source != nullptr && Args.Source != GEntityList->Player()
  531. && Args.Source->IsEnemy(GEntityList->Player())
  532. && AntiGapE->Enabled() && E->IsReady())
  533. {
  534. if ((Args.EndPosition - GEntityList->Player()->GetPosition()).Length() < E->Range())
  535. {
  536. E->CastOnTarget(Args.Source);
  537. }
  538.  
  539. }
  540. }
  541. void Mixed()
  542. {
  543. if (Player->ManaPercent() > HarassMana->GetInteger())
  544. {
  545. if (HarassQ->Enabled() && Q->IsReady())
  546. {
  547. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range());
  548. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  549. {
  550. Q->CastOnTarget(target);
  551. }
  552. }
  553. if (HarassW->Enabled() && W->IsReady())
  554. {
  555. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, W->Range());
  556. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  557. {
  558. W->CastOnPlayer();
  559. }
  560.  
  561. }
  562. if (HarassE->Enabled() && E->IsReady())
  563. {
  564. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, E->Range());
  565. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  566. {
  567. E->CastOnTarget(target);
  568. }
  569. }
  570. }
  571. }
  572. static int GetMinionsQ(float range)
  573. {
  574. auto minions = GEntityList->GetAllMinions(false, true, false);
  575. auto minionsInRange = 0;
  576. for (auto minion : minions)
  577. {
  578. if (minion != nullptr && minion->IsValidTarget() && minion->IsEnemy(GEntityList->Player()) && !minion->IsDead())
  579. {
  580. auto minionDistance = (minion->GetPosition() - GEntityList->Player()->GetPosition()).Length2D();
  581. if (minionDistance < range)
  582. {
  583. minionsInRange++;
  584. }
  585. }
  586. }
  587. return minionsInRange;
  588. }
  589. void Farm()
  590. {
  591. if (Player->ManaPercent() > FarmMana->GetInteger())
  592. {
  593. for (auto Minion : GEntityList->GetAllMinions(false, true, true))
  594. {
  595. if (Minion->IsEnemy(GEntityList->Player()) && !Minion->IsDead() && Minion->IsValidTarget() && (Minion->IsCreep() || Minion->IsJungleCreep()))
  596. {
  597. if (GetMinionsQ(Q->Range()) >= FarmQL->GetFloat())
  598. {
  599. if (FarmQ->Enabled() && Q->IsReady() && Minion->IsValidTarget(GEntityList->Player(), Q->Range()))
  600. {
  601. Q->CastOnTarget(Minion);
  602. }
  603. }
  604. if (FarmW->Enabled() && W->IsReady() && Minion->IsValidTarget(GEntityList->Player(), W->Range()))
  605. {
  606. W->CastOnPlayer();
  607. }
  608. }
  609. }
  610. }
  611. }
  612.  
  613. PLUGIN_EVENT(void) OnAfterAttack(IUnit* source, IUnit* target)
  614. {
  615. if (source != Player || target == nullptr || !target->IsHero())
  616. return;
  617.  
  618. switch (GOrbwalking->GetOrbwalkingMode())
  619. {
  620. case kModeCombo:
  621. for (auto hero : GEntityList->GetAllHeros(false, true)) {
  622. if (ComboWAA->Enabled() && W->IsReady() && (hero->GetPosition() - GEntityList->Player()->GetPosition()).Length() < 300)
  623. {
  624. W->CastOnPlayer();
  625. }
  626. }
  627. break;
  628. }
  629. }
  630.  
  631.  
  632. PLUGIN_EVENT(void) OnGameUpdate()
  633. {
  634. Qaa();
  635. if (GOrbwalking->GetOrbwalkingMode() == kModeCombo)
  636. {
  637. Combo();
  638. QLock();
  639. }
  640. if (GOrbwalking->GetOrbwalkingMode() == kModeLaneClear)
  641. {
  642. Farm();
  643. }
  644. if (GOrbwalking->GetOrbwalkingMode() == kModeLastHit)
  645. {
  646. LastHit();
  647. }
  648. if (GOrbwalking->GetOrbwalkingMode() == kModeMixed)
  649. {
  650. Mixed();
  651. }
  652. Killsteal();
  653. }
  654.  
  655.  
  656. PLUGIN_EVENT(void) OnRender()
  657. {
  658. if (DrawQRange->Enabled()) { GPluginSDK->GetRenderer()->DrawOutlinedCircle(GEntityList->Player()->GetPosition(), Vec4(145, 255, 255, 255), Q->Range()); }
  659. if (DrawRRange->Enabled()) { GPluginSDK->GetRenderer()->DrawOutlinedCircle(GEntityList->Player()->GetPosition(), Vec4(255, 255, 0, 255), R->Range()); }
  660. if (DrawERange->Enabled()) { GPluginSDK->GetRenderer()->DrawOutlinedCircle(GEntityList->Player()->GetPosition(), Vec4(255, 255, 0, 255), E->Range()); }
  661. if (DrawDamage->Enabled())
  662. {
  663. dmgdraw();
  664. }
  665. if (DrawStacks->Enabled())
  666. {
  667. auto target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, 1000);
  668. for (auto Source : GEntityList->GetAllUnits())
  669. {
  670. if (target != nullptr && target->IsValidTarget() && !target->IsDead())
  671. {
  672. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_01.troy"))
  673. {
  674. static IFont* pFont = nullptr;
  675.  
  676. if (pFont == nullptr)
  677. {
  678. pFont = GRender->CreateFont("Arial", 20.f, kFontWeightBold);
  679. pFont->SetOutline(true);
  680. pFont->SetLocationFlags(kFontLocationCenter);
  681. }
  682. Vec2 pos;
  683. if (GGame->Projection(target->GetPosition(), &pos))
  684. {
  685. std::string text = std::string("Stacks: 1");
  686. Vec4 clr = Vec4(188, 255, 50, 255);
  687. pFont->SetColor(clr);
  688. pFont->Render(pos.x + 10, pos.y - 100, text.c_str());
  689.  
  690.  
  691. }
  692. }
  693. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_02.troy"))
  694. {
  695.  
  696. static IFont* pFont = nullptr;
  697.  
  698. if (pFont == nullptr)
  699. {
  700. pFont = GRender->CreateFont("Arial", 20.f, kFontWeightBold);
  701. pFont->SetOutline(true);
  702. pFont->SetLocationFlags(kFontLocationCenter);
  703. }
  704. Vec2 pos;
  705. if (GGame->Projection(target->GetPosition(), &pos))
  706. {
  707. std::string text = std::string("Stacks: 2");
  708. Vec4 clr = Vec4(188, 255, 50, 255);
  709. pFont->SetColor(clr);
  710. pFont->Render(pos.x + 10, pos.y - 100, text.c_str());
  711.  
  712.  
  713. }
  714.  
  715. }
  716. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_03.troy"))
  717. {
  718. static IFont* pFont = nullptr;
  719.  
  720. if (pFont == nullptr)
  721. {
  722. pFont = GRender->CreateFont("Arial", 20.f, kFontWeightBold);
  723. pFont->SetOutline(true);
  724. pFont->SetLocationFlags(kFontLocationCenter);
  725. }
  726. Vec2 pos;
  727. if (GGame->Projection(target->GetPosition(), &pos))
  728. {
  729. std::string text = std::string("Stacks: 3");
  730. Vec4 clr = Vec4(188, 255, 50, 255);
  731. pFont->SetColor(clr);
  732. pFont->Render(pos.x + 10, pos.y - 100, text.c_str());
  733.  
  734. }
  735.  
  736. }
  737. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_04.troy"))
  738. {
  739.  
  740. static IFont* pFont = nullptr;
  741.  
  742. if (pFont == nullptr)
  743. {
  744. pFont = GRender->CreateFont("Arial", 20.f, kFontWeightBold);
  745. pFont->SetOutline(true);
  746. pFont->SetLocationFlags(kFontLocationCenter);
  747. }
  748. Vec2 pos;
  749. if (GGame->Projection(target->GetPosition(), &pos))
  750. {
  751. std::string text = std::string("Stacks: 4");
  752. Vec4 clr = Vec4(188, 255, 50, 255);
  753. pFont->SetColor(clr);
  754. pFont->Render(pos.x + 10, pos.y - 100, text.c_str());
  755.  
  756. }
  757. }
  758.  
  759. if (Distance(Source->GetPosition(), target->GetPosition()) <= 10 && Equals(Source->GetObjectName(), "darius_Base_hemo_counter_05.troy"))
  760. {
  761. static IFont* pFont = nullptr;
  762.  
  763. if (pFont == nullptr)
  764. {
  765. pFont = GRender->CreateFont("Arial", 20.f, kFontWeightBold);
  766. pFont->SetOutline(true);
  767. pFont->SetLocationFlags(kFontLocationCenter);
  768. }
  769. Vec2 pos;
  770. if (GGame->Projection(target->GetPosition(), &pos))
  771. {
  772. std::string text = std::string("Stacks: 5");
  773. Vec4 clr = Vec4(188, 255, 50, 255);
  774. pFont->SetColor(clr);
  775. pFont->Render(pos.x + 10, pos.y - 100, text.c_str());
  776.  
  777. }
  778.  
  779.  
  780. }
  781. }
  782. }
  783. }
  784. }
  785.  
  786.  
  787. PLUGIN_API void OnLoad(IPluginSDK* PluginSDK)
  788. {
  789. PluginSDKSetup(PluginSDK);
  790. Menu();
  791. LoadSpells();
  792. Player = GEntityList->Player();
  793.  
  794. GEventManager->AddEventHandler(kEventOnGameUpdate, OnGameUpdate);
  795. GEventManager->AddEventHandler(kEventOnRender, OnRender);
  796. GEventManager->AddEventHandler(kEventOrbwalkAfterAttack, OnAfterAttack);
  797. GEventManager->AddEventHandler(kEventOnInterruptible, OnInterruptible);
  798. GEventManager->AddEventHandler(kEventOnGapCloser, OnGapCloser);
  799. GEventManager->AddEventHandler(kEventOnCreateObject, OnCreateObject);
  800. GEventManager->AddEventHandler(kEventOnDestroyObject, OnDeleteObject);
  801.  
  802. if (strcmp(Player->ChampionName(), "Darius") == 0) {
  803. GGame->PrintChat("<b><font color=\"#FFFFFF\">Darius v1.1<b><font color=\"#f8a101\"> by</font></b> Helalmoney x Kornis<font color=\"#01DF01\"> - Loaded</font></b>");
  804.  
  805. }
  806. else {
  807. GRender->NotificationEx(Vec4(255, 0, 0, 200), 2, true, true, "Darius unloaded. You dont play the Champion!");
  808. }
  809.  
  810. }
  811.  
  812. PLUGIN_API void OnUnload()
  813. {
  814. MainMenu->Remove();
  815. GEventManager->RemoveEventHandler(kEventOnGameUpdate, OnGameUpdate);
  816. GEventManager->RemoveEventHandler(kEventOnRender, OnRender);
  817. GEventManager->RemoveEventHandler(kEventOrbwalkAfterAttack, OnAfterAttack);
  818. GEventManager->RemoveEventHandler(kEventOnInterruptible, OnInterruptible);
  819. GEventManager->RemoveEventHandler(kEventOnGapCloser, OnGapCloser);
  820. GEventManager->RemoveEventHandler(kEventOnCreateObject, OnCreateObject);
  821. GEventManager->RemoveEventHandler(kEventOnDestroyObject, OnDeleteObject);
  822.  
  823. GGame->PrintChat("<b><font color=\"#FFFFFF\">Darius<b> <font color=\"#FF0000\"> - Unloaded</font></b>");
  824. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement