Advertisement
H3stia

Vayne.lua

Dec 3rd, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.31 KB | None | 0 0
  1. --[[
  2. _.--""--._
  3. / _ _ \
  4. _ ( (_\ /_) ) _
  5. { \._\ /\ /_./ }
  6. /_"=-.}______{.-="_\
  7. _ _.=("""")=._ _
  8. (_'"_.-"`~~`"-._"'_)
  9. {_" "_}
  10.  
  11. Vayne's Mighty Assistant 3.14
  12. by Manciuszz [vadash mod, changed prediction to prodiction, on hold only mode].
  13.  
  14. �?» Auto-Condemn = Automatically condemns enemy into walls, structures(inhibitors, towers, nexus).
  15. â�?�¢ Prediction[VIP ONLY]/No Prediction mode
  16. â�?�¢ Takes into account enemy hitboxes.
  17. â�?�¢ Doesn't interrupt recalling.
  18.  
  19. �?» Auto-Condemn on incoming gapclosers!
  20.  
  21. �?» Manual Condemn-Assistant = Draws a circle of predicted position after condemn.
  22. â�?�¢ Draw Arrow/Simple circle
  23.  
  24. �?» Disable Auto-Condemn on certain champions in-game.
  25. ]]
  26.  
  27. if myHero.charName ~= "Vayne" then return end
  28.  
  29. require 'Prodiction'
  30.  
  31. local CONDEMN_DIST = 350
  32.  
  33. local VayneAssistant
  34. local enemyTable = GetEnemyHeroes()
  35. local informationTable = {}
  36. local spellExpired = true
  37. local AllClassMenu = 16
  38.  
  39. -- Code -------------------------------------------
  40.  
  41. function OnLoad()
  42. VayneAssistant = scriptConfig("Vayne's Mighty Assistant", "VayneAssistant")
  43.  
  44. VayneAssistant:addSubMenu("Features & Settings", "settingsSubMenu")
  45. VayneAssistant:addSubMenu("Disable Auto-Condemn on", "condemnSubMenu")
  46.  
  47. VayneAssistant:addParam("autoCondemn", "Auto-Condemn Toggle:", SCRIPT_PARAM_ONKEYDOWN, true, 32)
  48.  
  49. VayneAssistant.settingsSubMenu:addParam("PushAwayGapclosers", "Push Gapclosers Away", SCRIPT_PARAM_ONOFF, true)
  50. VayneAssistant.settingsSubMenu:addParam("CondemnAssistant", "Condemn Visual Assistant:", SCRIPT_PARAM_ONOFF, true)
  51. VayneAssistant.settingsSubMenu:addParam("eyeCandy", "After-Condemn Circle:", SCRIPT_PARAM_ONOFF, true)
  52.  
  53. VayneAssistant:permaShow("autoCondemn")
  54. -- Override in case it's stuck.
  55. VayneAssistant.autoCondemn = true
  56. VayneAssistant.switchKey = false
  57.  
  58. for i, enemy in ipairs(enemyTable) do
  59. VayneAssistant.condemnSubMenu:addParam("disableCondemn"..i, " >> "..enemy.charName, SCRIPT_PARAM_ONOFF, false)
  60. VayneAssistant["disableCondemn"..i] = false -- Override
  61. end
  62. wp = ProdictManager.GetInstance()
  63. ep = wp:AddProdictionObject(_E, 1000, 20000, 0.600)
  64.  
  65. PrintChat(" >> Vayne's Mighty Assistant!")
  66. end
  67.  
  68. function OnDraw()
  69. if myHero.dead then return end
  70.  
  71. if myHero:CanUseSpell(_E) == READY then
  72. if VayneAssistant.settingsSubMenu.PushAwayGapclosers then
  73. if not spellExpired and (GetTickCount() - informationTable.spellCastedTick) <= (informationTable.spellRange/informationTable.spellSpeed)*1000 then
  74. local spellDirection = (informationTable.spellEndPos - informationTable.spellStartPos):normalized()
  75. local spellStartPosition = informationTable.spellStartPos + spellDirection
  76. local spellEndPosition = informationTable.spellStartPos + spellDirection * informationTable.spellRange
  77. local heroPosition = Point(myHero.x, myHero.z)
  78.  
  79. local lineSegment = LineSegment(Point(spellStartPosition.x, spellStartPosition.y), Point(spellEndPosition.x, spellEndPosition.y))
  80. --lineSegment:draw(ARGB(255, 0, 255, 0), 70)
  81.  
  82. if lineSegment:distance(heroPosition) <= (not informationTable.spellIsAnExpetion and 65 or 200) then
  83. _G.CastSpellT(informationTable.spellSource)
  84. end
  85. else
  86. spellExpired = true
  87. informationTable = {}
  88. end
  89. end
  90.  
  91. if VayneAssistant.autoCondemn then
  92. for i, enemyHero in ipairs(enemyTable) do
  93. if not VayneAssistant.condemnSubMenu["disableCondemn"..i] then
  94. if enemyHero ~= nil and enemyHero.valid and not enemyHero.dead and enemyHero.visible and GetDistance(enemyHero) <= 715 and GetDistance(enemyHero) > 0 then
  95. ep:GetPredictionCallBack(enemyHero, EProdiction)
  96. end
  97. end
  98. end
  99. end
  100. end
  101. end
  102.  
  103. function EProdiction(target, pos)
  104. if pos ~= nil and myHero:CanUseSpell(_E) == READY and GetDistance(target) < 715 then
  105. local PushPos = pos + (Vector(pos) - myHero):normalized()*CONDEMN_DIST
  106.  
  107. if target.x > 0 and target.z > 0 and PushPos.x > 0 and PushPos.z > 0 then
  108. local checks = math.ceil((CONDEMN_DIST+65)/65)
  109. local checkDistance = (CONDEMN_DIST+65)/checks
  110. local InsideTheWall = false
  111. for k=1, checks, 1 do
  112. local checksPos = pos + (Vector(pos) - myHero):normalized()*(checkDistance*k)
  113. if IsWall(D3DXVECTOR3(checksPos.x, checksPos.y, checksPos.z)) then
  114. InsideTheWall = true
  115. break
  116. end
  117. end
  118. if InsideTheWall then
  119. _G.CastSpellT(target)
  120. end
  121. end
  122. end
  123. end
  124.  
  125. function OnProcessSpell(unit, spell)
  126. if not VayneAssistant.settingsSubMenu.PushAwayGapclosers then return end
  127.  
  128. local jarvanAddition = unit.charName == "JarvanIV" and unit:CanUseSpell(_Q) ~= READY and _R or _Q -- Did not want to break the table below.
  129. local isAGapcloserUnit = {
  130. -- ['Ahri'] = {true, spell = _R, range = 450, projSpeed = 2200},
  131. ['Aatrox'] = {true, spell = _Q, range = 1000, projSpeed = 1200, },
  132. ['Akali'] = {true, spell = _R, range = 800, projSpeed = 2200, }, -- Targeted ability
  133. ['Alistar'] = {true, spell = _W, range = 650, projSpeed = 2000, }, -- Targeted ability
  134. ['Diana'] = {true, spell = _R, range = 825, projSpeed = 2000, }, -- Targeted ability
  135. ['Gragas'] = {true, spell = _E, range = 600, projSpeed = 2000, },
  136. ['Graves'] = {true, spell = _E, range = 425, projSpeed = 2000, exeption = true },
  137. ['Hecarim'] = {true, spell = _R, range = 1000, projSpeed = 1200, },
  138. ['Irelia'] = {true, spell = _Q, range = 650, projSpeed = 2200, }, -- Targeted ability
  139. ['JarvanIV'] = {true, spell = jarvanAddition, range = 770, projSpeed = 2000, }, -- Skillshot/Targeted ability
  140. ['Jax'] = {true, spell = _Q, range = 700, projSpeed = 2000, }, -- Targeted ability
  141. ['Jayce'] = {true, spell = 'JayceToTheSkies', range = 600, projSpeed = 2000, }, -- Targeted ability
  142. ['Khazix'] = {true, spell = _E, range = 900, projSpeed = 2000, },
  143. ['Leblanc'] = {true, spell = _W, range = 600, projSpeed = 2000, },
  144. ['LeeSin'] = {true, spell = 'blindmonkqtwo', range = 1300, projSpeed = 1800, },
  145. ['Leona'] = {true, spell = _E, range = 900, projSpeed = 2000, },
  146. ['Malphite'] = {true, spell = _R, range = 1000, projSpeed = 1500 + unit.ms},
  147. ['Maokai'] = {true, spell = _Q, range = 600, projSpeed = 1200, }, -- Targeted ability
  148. ['MonkeyKing'] = {true, spell = _E, range = 650, projSpeed = 2200, }, -- Targeted ability
  149. ['Pantheon'] = {true, spell = _W, range = 600, projSpeed = 2000, }, -- Targeted ability
  150. ['Poppy'] = {true, spell = _E, range = 525, projSpeed = 2000, }, -- Targeted ability
  151. --['Quinn'] = {true, spell = _E, range = 725, projSpeed = 2000, }, -- Targeted ability
  152. ['Renekton'] = {true, spell = _E, range = 450, projSpeed = 2000, },
  153. ['Sejuani'] = {true, spell = _Q, range = 650, projSpeed = 2000, },
  154. ['Shen'] = {true, spell = _E, range = 575, projSpeed = 2000, },
  155. ['Tristana'] = {true, spell = _W, range = 900, projSpeed = 2000, },
  156. ['Tryndamere'] = {true, spell = 'Slash', range = 650, projSpeed = 1450, },
  157. ['XinZhao'] = {true, spell = _E, range = 650, projSpeed = 2000, }, -- Targeted ability
  158. }
  159. if unit.type == 'obj_AI_Hero' and unit.team == TEAM_ENEMY and isAGapcloserUnit[unit.charName] and GetDistance(unit) < 2000 and spell ~= nil then
  160. if spell.name == (type(isAGapcloserUnit[unit.charName].spell) == 'number' and unit:GetSpellData(isAGapcloserUnit[unit.charName].spell).name or isAGapcloserUnit[unit.charName].spell) then
  161. if spell.target ~= nil and spell.target.name == myHero.name or isAGapcloserUnit[unit.charName].spell == 'blindmonkqtwo' then
  162. print('Gapcloser: ',unit.charName, ' Target: ', (spell.target ~= nil and spell.target.name or 'NONE'), " ", spell.name, " ", spell.projectileID)
  163. if (myHero:CanUseSpell(_Q) ~= READY and isAGapcloserUnit[unit.charName] == "Leona") or isAGapcloserUnit[unit.charName] ~= "Leona" then
  164. print("Casting E...")
  165. _G.CastSpellT(unit)
  166. end
  167. else
  168. spellExpired = false
  169. informationTable = {
  170. spellSource = unit,
  171. spellCastedTick = GetTickCount(),
  172. spellStartPos = Point(spell.startPos.x, spell.startPos.z),
  173. spellEndPos = Point(spell.endPos.x, spell.endPos.z),
  174. spellRange = isAGapcloserUnit[unit.charName].range,
  175. spellSpeed = isAGapcloserUnit[unit.charName].projSpeed,
  176. spellIsAnExpetion = isAGapcloserUnit[unit.charName].exeption or false,
  177. }
  178. end
  179. end
  180. end
  181. end
  182.  
  183. LoadVIPScript('VjUjKAJMMjdwT015VOpbQ0pGMzN0S0V5TXlWSFJKMzN0bkV5TXFWSdBKc3N0DUU5TXMWSdBTM7N0SUV5TX1dSVBMcFIHPxYJKBU6HVBIMDN0Sxo+TXhWSVBNMzN0SEV5TXhWTFtMMzMySwV5zDlWSZvMMzNyigV5h3lXyFcNcjO+S0T7EPnWSBzM8jMpC0V4UnnWSVdMMzNwTEV5TSk3KjspRzNwTEV5TSoJChEfZzNwQ0V5TQomLDwgeld0T0Z5TXkJDFBIIzN0SzEYPx4zPR4pR0QbOS4wKXlSQ1BMM10RPzIWPxIfDVBINjN0SzYcIx1WSVBMMzJ0S0V5TXlWSVBMMzN0S0V5TXlWSVBNMzN0SkV5TXlWSVBMMzN0S0V5TXlW894217FE62A4B14C062DC8420D1436BB')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement