Guest User

Morgana Master v.1.2

a guest
Jun 23rd, 2014
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.60 KB | None | 0 0
  1. if myHero.charName ~= "Morgana" then return end
  2.  
  3. require 'VPrediction'
  4.  
  5. function Menu()
  6. MenuMorg = AutoCarry.PluginMenu
  7. MenuMorg:addSubMenu("Combo Settings", "comboConfig")
  8. MenuMorg.comboConfig:addParam("USEQ", "Use Q in Combo", SCRIPT_PARAM_ONOFF, true)
  9. MenuMorg.comboConfig:addParam("USEW", "Use W in Combo", SCRIPT_PARAM_ONOFF, true)
  10. MenuMorg.comboConfig:addParam("USEE", "Use E in Combo", SCRIPT_PARAM_ONOFF, true)
  11. MenuMorg.comboConfig:addParam("USER", "Use R in Combo", SCRIPT_PARAM_ONOFF, true)
  12. MenuMorg.comboConfig:addParam("ENEMYTOR", "Min Enemies to Cast R: ", SCRIPT_PARAM_SLICE, 2, 1, 5, 0)
  13. MenuMorg:addSubMenu("KS Settings", "ksConfig")
  14. MenuMorg.ksConfig:addParam("IGN", "KS Ignite", SCRIPT_PARAM_ONOFF, true)
  15. MenuMorg.ksConfig:addParam("KSQ", "KS Q", SCRIPT_PARAM_ONOFF, true)
  16. MenuMorg.ksConfig:addParam("KSW", "KS W", SCRIPT_PARAM_ONOFF, true)
  17. MenuMorg.ksConfig:addParam("KSULT", "KS R", SCRIPT_PARAM_ONOFF, true)
  18. MenuMorg:addSubMenu("Harras Settings", "harrasConfig")
  19. MenuMorg.harrasConfig:addParam("HQ", "Harras enemy Q", SCRIPT_PARAM_ONKEYTOGGLE, true, GetKey("X"))
  20. MenuMorg.harrasConfig:addParam("MINMPTOQ", "Min % MP To Harras Q", SCRIPT_PARAM_SLICE, 70, 0, 100, 2)
  21. MenuMorg.harrasConfig:addParam("HW", "Harras enemy W", SCRIPT_PARAM_ONKEYTOGGLE, true, GetKey("Z"))
  22. MenuMorg.harrasConfig:addParam("HWS", "Only On Stunned Enemy", SCRIPT_PARAM_ONOFF, true)
  23. MenuMorg.harrasConfig:addParam("MINMPTOW", "Min % MP To Harras W", SCRIPT_PARAM_SLICE, 70, 0, 100, 2)
  24. MenuMorg:addSubMenu("Draw Settings", "drawConfig")
  25. MenuMorg.drawConfig:addParam("DQL", "Draw Q Collision Line", SCRIPT_PARAM_ONOFF, true)
  26. MenuMorg.drawConfig:addParam("DQ", "Draw Q Range", SCRIPT_PARAM_ONOFF, true)
  27. MenuMorg.drawConfig:addParam("DW", "Draw W Range", SCRIPT_PARAM_ONOFF, true)
  28. MenuMorg.drawConfig:addParam("DR", "Draw R Range", SCRIPT_PARAM_ONOFF, true)
  29.  
  30.  
  31. end
  32.  
  33. function Variables()
  34. VP = VPrediction()
  35. IgniteKey = nil;
  36. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
  37. IgniteKey = SUMMONER_1
  38. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
  39. IgniteKey = SUMMONER_2
  40. else
  41. IgniteKey = nil
  42. end
  43. -- Q --
  44. qRange = 1300
  45. qDelay = 250
  46. qSpeed = 1200
  47. qWidth = 60
  48. -- W --
  49. wRange = 900
  50. wDelay = 150
  51. wSpeed = 1200
  52. wWidth = 105
  53. -- E --
  54. eRange = 750
  55. -- R --
  56. rRange = 600
  57. AutoCarry.SkillsCrosshair.range = 1300
  58. end
  59.  
  60. function PluginOnLoad()
  61. Menu()
  62. Variables()
  63. end
  64.  
  65. function PluginOnTick()
  66. Target = AutoCarry.GetAttackTarget()
  67. QReady = (myHero:CanUseSpell(_Q) == READY)
  68. WReady = (myHero:CanUseSpell(_W) == READY)
  69. EReady = (myHero:CanUseSpell(_E) == READY)
  70. RReady = ((myHero:CanUseSpell(_R) ~= NOTLEARNED) and (myHero:CanUseSpell(_R) ~= COOLDOWN))
  71. IReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  72.  
  73. if AutoCarry.MainMenu.AutoCarry and Target ~= nil then
  74. if MenuMorg.comboConfig.USEQ then
  75. CastQ()
  76. end
  77. if MenuMorg.comboConfig.USEW then
  78. CastW()
  79. end
  80. if MenuMorg.comboConfig.USEE then
  81. CastE()
  82. end
  83. if MenuMorg.comboConfig.USER then
  84. CastR()
  85. end
  86. end
  87.  
  88. if MenuMorg.ksConfig.KSQ and QReady then
  89. players = heroManager.iCount
  90. for i = 1, players, 1 do
  91. target = heroManager:getHero(i)
  92. qDmg = getDmg("Q", myHero, target)
  93. if target ~= nil and target.team ~= player.team and not target.dead then
  94. if QReady and qDmg > target.health then
  95. local CastPosition, HitChance, Position = VP:GetLineCastPosition(target, qDelay, qWidth, qRange, qSpeed, myHero, true)
  96. if HitChance >= 2 then
  97. CastSpell(_Q, CastPosition.x, CastPosition.z)
  98. return
  99. end
  100. end
  101. end
  102. end
  103. end
  104.  
  105. if MenuMorg.ksConfig.KSW and WReady then
  106. players = heroManager.iCount
  107. for i = 1, players, 1 do
  108. target = heroManager:getHero(i)
  109. wDmg = getDmg("W", myHero, target)
  110. if target ~= nil and target.team ~= player.team and not target.dead then
  111. if WReady and wDmg > target.health then
  112. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  113. if CastPosition and not target.canMove and HitChance >= 2 then
  114. CastSpell(_W, CastPosition.x, CastPosition.z)
  115. return
  116. end
  117. end
  118. end
  119. end
  120. end
  121.  
  122. if MenuMorg.ksConfig.KSULT and RReady then
  123. players = heroManager.iCount
  124. for i = 1, players, 1 do
  125. target = heroManager:getHero(i)
  126. rDmg = getDmg("R", myHero, target)
  127. if target ~= nil and target.team ~= player.team and not target.dead then
  128. if RReady and rDmg > target.health then
  129. CastSpell(_R)
  130. end
  131. end
  132. end
  133. end
  134.  
  135. if MenuMorg.ksConfig.KSIGNITE and IgniteKey ~= nil then
  136. players = heroManager.iCount
  137. for i = 1, players, 1 do
  138. target = heroManager:getHero(i)
  139. iDmg = getDmg("IGNITE", myHero, Target)
  140. if target ~= nil and target.team ~= player.team and not target.dead then
  141. if IReady and iDmg > target.health then
  142. CastSpell(IgniteKey, target)
  143. end
  144. end
  145. end
  146. end
  147.  
  148. if MenuMorg.harrasConfig.HQ and QReady and ((myHero.mana/myHero.maxMana)*100) > MenuMorg.harrasConfig.MINMPTOQ then
  149. players = heroManager.iCount
  150. for i = 1, players, 1 do
  151. target = heroManager:getHero(i)
  152. if target ~= nil and target.team ~= player.team and not target.dead then
  153. local CastPosition, HitChance, Position = VP:GetLineCastPosition(target, qDelay, qWidth, qRange, qSpeed, myHero, true)
  154. if HitChance >= 2 then
  155. CastSpell(_Q, CastPosition.x, CastPosition.z)
  156. return
  157. end
  158. end
  159. end
  160. end
  161.  
  162. if MenuMorg.harrasConfig.HW and WReady and ((myHero.mana/myHero.maxMana)*100) > MenuMorg.harrasConfig.MINMPTOW then
  163. if MenuMorg.harrasConfig.HWS then
  164. players = heroManager.iCount
  165. for i = 1, players, 1 do
  166. target = heroManager:getHero(i)
  167. if target ~= nil and target.team ~= player.team and not target.dead and not target.canMove then
  168. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  169. if CastPosition and HitChance >= 2 then
  170. CastSpell(_W, CastPosition.x, CastPosition.z)
  171. return
  172. end
  173. end
  174. end
  175. end
  176. if not MenuMorg.harrasConfig.HWS then
  177. players = heroManager.iCount
  178. for i = 1, players, 1 do
  179. target = heroManager:getHero(i)
  180. if target ~= nil and target.team ~= player.team and not target.dead then
  181. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  182. if CastPosition and HitChance >= 2 then
  183. CastSpell(_W, CastPosition.x, CastPosition.z)
  184. return
  185. end
  186. end
  187. end
  188. end
  189. end
  190.  
  191. end
  192.  
  193.  
  194. function CastQ()
  195. if QReady and MenuMorg.comboConfig.USEQ and Target.canMove then
  196. local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, qDelay, qWidth, qRange, qSpeed, myHero, true)
  197. if HitChance >= 2 then
  198. CastSpell(_Q, CastPosition.x, CastPosition.z)
  199. return
  200. end
  201. end
  202. end
  203.  
  204. function CastW()
  205. if WReady and MenuMorg.comboConfig.USEW then
  206. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(Target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  207. if CastPosition and not Target.canMove and HitChance >= 2 then
  208. CastSpell(_W, CastPosition.x, CastPosition.z)
  209. return
  210. end
  211. end
  212. end
  213.  
  214. function CastE()
  215. if EReady and MenuMorg.comboConfig.USEE then
  216. CastSpell(_E)
  217. end
  218. end
  219.  
  220. function CastR()
  221. local enemyCount = EnemyCount(myHero, rRange)
  222. if RReady and MenuMorg.comboConfig.USER and enemyCount >= MenuMorg.comboConfig.ENEMYTOR then
  223. CastSpell(_R)
  224. end
  225. end
  226.  
  227. function EnemyCount(point, range)
  228. local count = 0
  229. for _, enemy in pairs(GetEnemyHeroes()) do
  230. if enemy and not enemy.dead and GetDistance(point, enemy) <= range then
  231. count = count + 1
  232. end
  233. end
  234. return count
  235. end
  236.  
  237. function PluginOnDraw()
  238. if MenuMorg.drawConfig.DQL and ValidTarget(Target, qRange) then
  239. QMark = Target
  240. DrawLine3D(myHero.x, myHero.y, myHero.z, QMark.x, QMark.y, QMark.z, qWidth, ARGB(150,40,4,4))
  241. end
  242. if MenuMorg.drawConfig.DQ and QReady then
  243. DrawCircle(myHero.x, myHero.y, myHero.z, qRange, ARGB(255,0,0,255))
  244. end
  245. if MenuMorg.drawConfig.DW and WReady then
  246. DrawCircle(myHero.x, myHero.y, myHero.z, wRange, ARGB(255,255,0,0))
  247. end
  248. if MenuMorg.drawConfig.DR and RReady then
  249. DrawCircle(myHero.x, myHero.y, myHero.z, rRange, ARGB(255,0,255,0))
  250. end
  251. end
Advertisement
Add Comment
Please, Sign In to add comment