Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.54 KB | None | 0 0
  1. --[[
  2. _.--""--._
  3. / _ _ \
  4. _ ( (_\ /_) ) _
  5. { \._\ /\ /_./ }
  6. /_"=-.}______{.-="_\
  7. _ _.=("""")=._ _
  8. (_'"_.-"`~~`"-._"'_)
  9. {_" "_}
  10.  
  11. Vayne's Mighty Assistant
  12. by LinuxMaster / NulLSecBG.
  13.  
  14. ]]
  15.  
  16. if myHero.charName ~= "Vayne" then return end
  17. local VayneAssistant
  18.  
  19. local enemyTable = GetEnemyHeroes()
  20.  
  21. local informationTable = {}
  22. local spellExpired = true
  23.  
  24. local tp = TargetPredictionVIP(1000, 2200, 0.25)
  25. local AllClassMenu = 16
  26.  
  27. -- Code -------------------------------------------
  28.  
  29. function OnLoad()
  30. VayneAssistant = scriptConfig("Vayne's Mighty Assistant", "VayneAssistant")
  31.  
  32. VayneAssistant:addSubMenu("Features & Settings", "settingsSubMenu")
  33. VayneAssistant:addSubMenu("Disable Auto-Condemn on", "condemnSubMenu")
  34.  
  35. VayneAssistant:addParam("autoCondemn", "Auto-Condemn Toggle:", SCRIPT_PARAM_ONKEYTOGGLE, true, GetKey("N"))
  36. VayneAssistant:addParam("switchKey", "Switch key mode:", SCRIPT_PARAM_ONOFF, false)
  37.  
  38. VayneAssistant.settingsSubMenu:addParam("PushAwayGapclosers", "Push Gapclosers Away", SCRIPT_PARAM_ONOFF, true)
  39. VayneAssistant.settingsSubMenu:addParam("CondemnAssistant", "Condemn Visual Assistant:", SCRIPT_PARAM_ONOFF, true)
  40. VayneAssistant.settingsSubMenu:addParam("pushDistance", "Push Distance", SCRIPT_PARAM_SLICE, 300, 0, 450, 0) -- Reducing this value means that the enemy has to be closer to the wall, so you could cast condemn.
  41. VayneAssistant.settingsSubMenu:addParam("eyeCandy", "After-Condemn Circle:", SCRIPT_PARAM_ONOFF, true)
  42. if not VIP_USER then
  43. VayneAssistant.settingsSubMenu:addParam("shootingMode", "Currently: No prediction", SCRIPT_PARAM_INFO, "NOT VIP")
  44. else
  45. VayneAssistant.settingsSubMenu:addParam("shootingMode", "Prediction/No prediction:", SCRIPT_PARAM_ONOFF, true)
  46. end
  47.  
  48. VayneAssistant:permaShow("autoCondemn")
  49. -- Override in case it's stuck.
  50. -- VayneAssistant.pushDistance = 300
  51. VayneAssistant.autoCondemn = true
  52. VayneAssistant.switchKey = false
  53.  
  54. for i, enemy in ipairs(enemyTable) do
  55. VayneAssistant.condemnSubMenu:addParam("disableCondemn"..i, " >> "..enemy.charName, SCRIPT_PARAM_ONOFF, false)
  56. VayneAssistant["disableCondemn"..i] = false -- Override
  57. end
  58. PrintChat(" >> Vayne's Mighty Assistant!")
  59. end
  60.  
  61. function OnDraw()
  62. if myHero.dead then return end
  63.  
  64. if IsKeyDown(AllClassMenu) then
  65. VayneAssistant._param[1].pType = VayneAssistant.switchKey and 2 or 3
  66. VayneAssistant._param[1].text = VayneAssistant.switchKey and "Auto-Condemn OnHold:" or "Auto-Condemn Toggle:"
  67. if VayneAssistant.switchKey and VayneAssistant.autoCondemn then
  68. VayneAssistant.autoCondemn = false
  69. end
  70.  
  71. VayneAssistant.settingsSubMenu._param[5].text = VayneAssistant.settingsSubMenu.shootingMode and VIP_USER and "Currently: Using Predictions" or "Currently: No prediction"
  72. if not VIP_USER then VayneAssistant.settingsSubMenu.shootingMode = "NOT VIP" end
  73. end
  74.  
  75. if myHero:CanUseSpell(_E) == READY then
  76. if VayneAssistant.settingsSubMenu.PushAwayGapclosers then
  77. if not spellExpired and (GetTickCount() - informationTable.spellCastedTick) <= (informationTable.spellRange/informationTable.spellSpeed)*1000 then
  78. local spellDirection = (informationTable.spellEndPos - informationTable.spellStartPos):normalized()
  79. local spellStartPosition = informationTable.spellStartPos + spellDirection
  80. local spellEndPosition = informationTable.spellStartPos + spellDirection * informationTable.spellRange
  81. local heroPosition = Point(myHero.x, myHero.z)
  82.  
  83. local lineSegment = LineSegment(Point(spellStartPosition.x, spellStartPosition.y), Point(spellEndPosition.x, spellEndPosition.y))
  84. --lineSegment:draw(ARGB(255, 0, 255, 0), 70)
  85.  
  86. if lineSegment:distance(heroPosition) <= (not informationTable.spellIsAnExpetion and 65 or 200) then
  87. CastSpell(_E, informationTable.spellSource)
  88. end
  89. else
  90. spellExpired = true
  91. informationTable = {}
  92. end
  93. end
  94.  
  95. if VayneAssistant.autoCondemn then
  96. for i, enemyHero in ipairs(enemyTable) do
  97. if not VayneAssistant.condemnSubMenu["disableCondemn"..i] then
  98. if enemyHero ~= nil and enemyHero.valid and not enemyHero.dead and enemyHero.visible and GetDistance(enemyHero) <= 715 and GetDistance(enemyHero) > 0 then
  99. local enemyPosition = VayneAssistant.settingsSubMenu.shootingMode and VIP_USER and tp:GetPrediction(enemyHero) or enemyHero
  100. local PushPos = enemyPosition + (Vector(enemyPosition) - myHero):normalized()*VayneAssistant.settingsSubMenu.pushDistance
  101.  
  102. if enemyHero.x > 0 and enemyHero.z > 0 then
  103. local checks = math.ceil((VayneAssistant.settingsSubMenu.pushDistance)/65)
  104. local checkDistance = (VayneAssistant.settingsSubMenu.pushDistance)/checks
  105. local InsideTheWall = false
  106. for k=1, checks, 1 do
  107. local checksPos = enemyPosition + (Vector(enemyPosition) - myHero):normalized()*(checkDistance*k)
  108. local WallContainsPosition = IsWall(D3DXVECTOR3(checksPos.x, checksPos.y, checksPos.z))
  109. if WallContainsPosition then
  110. InsideTheWall = true
  111. break
  112. end
  113. end
  114.  
  115. if InsideTheWall then CastSpell(_E, enemyHero) end
  116.  
  117. if VayneAssistant.settingsSubMenu.eyeCandy and PushPos.x > 0 and PushPos.z > 0 then
  118. DrawCircle(PushPos.x, PushPos.y, PushPos.z, 65, ARGB(255, 0, 255, 0))
  119. end
  120.  
  121.  
  122. end
  123. end
  124. end
  125. end
  126. end
  127. end
  128. end
  129.  
  130. function OnProcessSpell(unit, spell)
  131. if not VayneAssistant.settingsSubMenu.PushAwayGapclosers then return end
  132.  
  133. local jarvanAddition = unit.charName == "JarvanIV" and unit:CanUseSpell(_Q) ~= READY and _R or _Q -- Did not want to break the table below.
  134. local isAGapcloserUnit = {
  135. -- ['Ahri'] = {true, spell = _R, range = 450, projSpeed = 2200},
  136. ['Aatrox'] = {true, spell = _Q, range = 1000, projSpeed = 1200, },
  137. ['Akali'] = {true, spell = _R, range = 800, projSpeed = 2200, }, -- Targeted ability
  138. ['Alistar'] = {true, spell = _W, range = 650, projSpeed = 2000, }, -- Targeted ability
  139. ['Diana'] = {true, spell = _R, range = 825, projSpeed = 2000, }, -- Targeted ability
  140. ['Gragas'] = {true, spell = _E, range = 600, projSpeed = 2000, },
  141. ['Graves'] = {true, spell = _E, range = 425, projSpeed = 2000, exeption = true },
  142. ['Hecarim'] = {true, spell = _R, range = 1000, projSpeed = 1200, },
  143. ['Irelia'] = {true, spell = _Q, range = 650, projSpeed = 2200, }, -- Targeted ability
  144. ['JarvanIV'] = {true, spell = jarvanAddition, range = 770, projSpeed = 2000, }, -- Skillshot/Targeted ability
  145. ['Jax'] = {true, spell = _Q, range = 700, projSpeed = 2000, }, -- Targeted ability
  146. ['Jayce'] = {true, spell = 'JayceToTheSkies', range = 600, projSpeed = 2000, }, -- Targeted ability
  147. ['Khazix'] = {true, spell = _E, range = 900, projSpeed = 2000, },
  148. ['Leblanc'] = {true, spell = _W, range = 600, projSpeed = 2000, },
  149. ['LeeSin'] = {true, spell = 'blindmonkqtwo', range = 1300, projSpeed = 1800, },
  150. ['Leona'] = {true, spell = _E, range = 900, projSpeed = 2000, },
  151. ['Malphite'] = {true, spell = _R, range = 1000, projSpeed = 1500 + unit.ms},
  152. ['Maokai'] = {true, spell = _Q, range = 600, projSpeed = 1200, }, -- Targeted ability
  153. ['MonkeyKing'] = {true, spell = _E, range = 650, projSpeed = 2200, }, -- Targeted ability
  154. ['Pantheon'] = {true, spell = _W, range = 600, projSpeed = 2000, }, -- Targeted ability
  155. ['Poppy'] = {true, spell = _E, range = 525, projSpeed = 2000, }, -- Targeted ability
  156. --['Quinn'] = {true, spell = _E, range = 725, projSpeed = 2000, }, -- Targeted ability
  157. ['Renekton'] = {true, spell = _E, range = 450, projSpeed = 2000, },
  158. ['Sejuani'] = {true, spell = _Q, range = 650, projSpeed = 2000, },
  159. ['Shen'] = {true, spell = _E, range = 575, projSpeed = 2000, },
  160. ['Tristana'] = {true, spell = _W, range = 900, projSpeed = 2000, },
  161. ['Tryndamere'] = {true, spell = 'Slash', range = 650, projSpeed = 1450, },
  162. ['XinZhao'] = {true, spell = _E, range = 650, projSpeed = 2000, }, -- Targeted ability
  163. }
  164. if unit.type == 'obj_AI_Hero' and unit.team == TEAM_ENEMY and isAGapcloserUnit[unit.charName] and GetDistance(unit) < 2000 and spell ~= nil then
  165. if spell.name == (type(isAGapcloserUnit[unit.charName].spell) == 'number' and unit:GetSpellData(isAGapcloserUnit[unit.charName].spell).name or isAGapcloserUnit[unit.charName].spell) then
  166. if spell.target ~= nil and spell.target.name == myHero.name or isAGapcloserUnit[unit.charName].spell == 'blindmonkqtwo' then
  167. -- print('Gapcloser: ',unit.charName, ' Target: ', (spell.target ~= nil and spell.target.name or 'NONE'), " ", spell.name, " ", spell.projectileID)
  168. CastSpell(_E, unit)
  169. else
  170. spellExpired = false
  171. informationTable = {
  172. spellSource = unit,
  173. spellCastedTick = GetTickCount(),
  174. spellStartPos = Point(spell.startPos.x, spell.startPos.z),
  175. spellEndPos = Point(spell.endPos.x, spell.endPos.z),
  176. spellRange = isAGapcloserUnit[unit.charName].range,
  177. spellSpeed = isAGapcloserUnit[unit.charName].projSpeed,
  178. spellIsAnExpetion = isAGapcloserUnit[unit.charName].exeption or false,
  179. }
  180. end
  181. end
  182. end
  183.  
  184. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement