Guest User

Morgana Master v.10

a guest
Jun 12th, 2014
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. if myHero.charName ~= "Morgana" then return end
  2.  
  3. require 'VPrediction'
  4.  
  5. function Menu()
  6. AutoCarry.PluginMenu:addParam("co", "-- Combo Options --", SCRIPT_PARAM_INFO, "")
  7. AutoCarry.PluginMenu:addParam("USEQ", "Use Q in Combo", SCRIPT_PARAM_ONOFF, true)
  8. AutoCarry.PluginMenu:addParam("USEW", "Use W in Combo", SCRIPT_PARAM_ONOFF, true)
  9. AutoCarry.PluginMenu:addParam("USEE", "Use E in Combo", SCRIPT_PARAM_ONOFF, true)
  10. AutoCarry.PluginMenu:addParam("USER", "Use R in Combo", SCRIPT_PARAM_ONOFF, true)
  11. AutoCarry.PluginMenu:addParam("ENEMYTOR", "Min Enemies to Cast R: ", SCRIPT_PARAM_SLICE, 2, 1, 5, 0)
  12. AutoCarry.PluginMenu:addParam("co", "-- End Combo Options --", SCRIPT_PARAM_INFO, "")
  13. AutoCarry.PluginMenu:addParam("aa", "", SCRIPT_PARAM_INFO, "")
  14. AutoCarry.PluginMenu:addParam("ko", "-- KS Options --", SCRIPT_PARAM_INFO, "")
  15. AutoCarry.PluginMenu:addParam("IGN", "KS Ignite", SCRIPT_PARAM_ONOFF, true)
  16. AutoCarry.PluginMenu:addParam("KSQ", "KS Q", SCRIPT_PARAM_ONOFF, true)
  17. AutoCarry.PluginMenu:addParam("KSW", "KS W", SCRIPT_PARAM_ONOFF, true)
  18. AutoCarry.PluginMenu:addParam("KSULT", "KS R", SCRIPT_PARAM_ONOFF, true)
  19. AutoCarry.PluginMenu:addParam("ko", "-- End KS Options --", SCRIPT_PARAM_INFO, "")
  20. AutoCarry.PluginMenu:addParam("aa", "", SCRIPT_PARAM_INFO, "")
  21. AutoCarry.PluginMenu:addParam("ho", "-- Harras Options --", SCRIPT_PARAM_INFO, "")
  22. AutoCarry.PluginMenu:addParam("HQ", "Harras enemy Q", SCRIPT_PARAM_ONOFF, true)
  23. AutoCarry.PluginMenu:addParam("MINMPTOQ", "Min % MP To Harras Q", SCRIPT_PARAM_SLICE, 70, 0, 100, 2)
  24. AutoCarry.PluginMenu:addParam("HW", "Harras enemy W", SCRIPT_PARAM_ONOFF, true)
  25. AutoCarry.PluginMenu:addParam("MINMPTOW", "Min % MP To Harras W", SCRIPT_PARAM_SLICE, 70, 0, 100, 2)
  26. AutoCarry.PluginMenu:addParam("ho", "-- End Harras Options --", SCRIPT_PARAM_INFO, "")
  27.  
  28. end
  29.  
  30. function PluginOnLoad()
  31. Menu()
  32. VP = VPrediction()
  33. IgniteKey = nil;
  34. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
  35. IgniteKey = SUMMONER_1
  36. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
  37. IgniteKey = SUMMONER_2
  38. else
  39. IgniteKey = nil
  40. end
  41. end
  42.  
  43. function PluginOnTick()
  44. Target = AutoCarry.GetAttackTarget()
  45. QReady = (myHero:CanUseSpell(_Q) == READY)
  46. WReady = (myHero:CanUseSpell(_W) == READY)
  47. EReady = (myHero:CanUseSpell(_E) == READY)
  48. RReady = ((myHero:CanUseSpell(_R) ~= NOTLEARNED) and (myHero:CanUseSpell(_R) ~= COOLDOWN))
  49. IReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  50.  
  51. if AutoCarry.MainMenu.AutoCarry and Target ~= nil then
  52. if AutoCarry.PluginMenu.USEQ then
  53. CastQ()
  54. end
  55. if AutoCarry.PluginMenu.USEW then
  56. CastW()
  57. end
  58. if AutoCarry.PluginMenu.USEE then
  59. CastE()
  60. end
  61. if AutoCarry.PluginMenu.USER then
  62. CastR()
  63. end
  64. end
  65.  
  66. if AutoCarry.PluginMenu.KSQ and QReady then
  67. players = heroManager.iCount
  68. for i = 1, players, 1 do
  69. target = heroManager:getHero(i)
  70. qDmg = getDmg("Q", myHero, target)
  71. if target ~= nil and target.team ~= player.team and not target.dead then
  72. if QReady and qDmg > target.health then
  73. qRange, qDelay, qSpeed, qWidth = 1300, 150, 1200, 70
  74. local CastPosition, HitChance, Position = VP:GetLineCastPosition(target, qDelay, qWidth, qRange, qSpeed, myHero, true)
  75. if HitChance >= 2 then
  76. CastSpell(_Q, CastPosition.x, CastPosition.z)
  77. return
  78. end
  79. end
  80. end
  81. end
  82. end
  83.  
  84. if AutoCarry.PluginMenu.KSW and WReady then
  85. players = heroManager.iCount
  86. for i = 1, players, 1 do
  87. target = heroManager:getHero(i)
  88. wDmg = getDmg("W", myHero, target)
  89. if target ~= nil and target.team ~= player.team and not target.dead then
  90. if WReady and wDmg > target.health then
  91. wRange, wDelay, wSpeed, wWidth = 900, 150, 1200, 105
  92. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  93. if CastPosition and not target.canMove and HitChance >= 2 then
  94. CastSpell(_W, CastPosition.x, CastPosition.z)
  95. return
  96. end
  97. end
  98. end
  99. end
  100. end
  101.  
  102. if AutoCarry.PluginMenu.KSULT and RReady then
  103. players = heroManager.iCount
  104. for i = 1, players, 1 do
  105. target = heroManager:getHero(i)
  106. rDmg = getDmg("R", myHero, target)
  107. if target ~= nil and target.team ~= player.team and not target.dead then
  108. if RReady and rDmg > target.health then
  109. CastSpell(_R)
  110. end
  111. end
  112. end
  113. end
  114.  
  115. if AutoCarry.PluginMenu.KSIGNITE and IgniteKey ~= nil then
  116. players = heroManager.iCount
  117. for i = 1, players, 1 do
  118. target = heroManager:getHero(i)
  119. iDmg = getDmg("IGNITE", myHero, Target)
  120. if target ~= nil and target.team ~= player.team and not target.dead then
  121. if IReady and iDmg > target.health then
  122. CastSpell(IgniteKey, target)
  123. end
  124. end
  125. end
  126. end
  127.  
  128. if AutoCarry.PluginMenu.HQ and QReady and ((myHero.mana/myHero.maxMana)*100) > AutoCarry.PluginMenu.MINMPTOQ then
  129. players = heroManager.iCount
  130. for i = 1, players, 1 do
  131. target = heroManager:getHero(i)
  132. if target ~= nil and target.team ~= player.team and not target.dead then
  133. qRange, qDelay, qSpeed, qWidth = 1300, 150, 1200, 70
  134. local CastPosition, HitChance, Position = VP:GetLineCastPosition(target, qDelay, qWidth, qRange, qSpeed, myHero, true)
  135. if HitChance >= 2 then
  136. CastSpell(_Q, CastPosition.x, CastPosition.z)
  137. return
  138. end
  139. end
  140. end
  141. end
  142.  
  143. if AutoCarry.PluginMenu.HW and WReady and ((myHero.mana/myHero.maxMana)*100) > AutoCarry.PluginMenu.MINMPTOW then
  144. players = heroManager.iCount
  145. for i = 1, players, 1 do
  146. target = heroManager:getHero(i)
  147. if target ~= nil and target.team ~= player.team and not target.dead then
  148. wRange, wDelay, wSpeed, wWidth = 900, 150, 1200, 105
  149. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  150. if CastPosition and HitChance >= 2 then
  151. CastSpell(_W, CastPosition.x, CastPosition.z)
  152. return
  153. end
  154. end
  155. end
  156. end
  157.  
  158. end
  159.  
  160.  
  161. function CastQ()
  162. if QReady and AutoCarry.PluginMenu.USEQ and Target.canMove then
  163. qRange, qDelay, qSpeed, qWidth = 1300, 150, 1200, 70
  164. local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, qDelay, qWidth, qRange, qSpeed, myHero, true)
  165. if HitChance >= 2 then
  166. CastSpell(_Q, CastPosition.x, CastPosition.z)
  167. return
  168. end
  169. end
  170. end
  171.  
  172. function CastW()
  173. if WReady and AutoCarry.PluginMenu.USEW then
  174. wRange, wDelay, wSpeed, wWidth = 900, 150, 1200, 105
  175. local CastPosition, HitChance, Position = VP:GetCircularCastPosition(Target, wDelay, wWidth, wRange, wSpeed, myHero, false)
  176. if CastPosition and not Target.canMove and HitChance >= 2 then
  177. CastSpell(_W, CastPosition.x, CastPosition.z)
  178. return
  179. end
  180. end
  181. end
  182.  
  183. function CastE()
  184. if EReady and AutoCarry.PluginMenu.USEE then
  185. CastSpell(_E)
  186. end
  187. end
  188.  
  189. function CastR()
  190. local enemyCount = EnemyCount(myHero, 1300)
  191. if RReady and AutoCarry.PluginMenu.USER and enemyCount >= AutoCarry.PluginMenu.ENEMYTOR then
  192. CastSpell(_R)
  193. end
  194. end
  195.  
  196. function EnemyCount(point, range)
  197. local count = 0
  198. for _, enemy in pairs(GetEnemyHeroes()) do
  199. if enemy and not enemy.dead and GetDistance(point, enemy) <= range then
  200. count = count + 1
  201. end
  202. end
  203. return count
  204. end
Advertisement
Add Comment
Please, Sign In to add comment