Guest User

Untitled

a guest
Jan 16th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.14 KB | None | 0 0
  1. --if GetObjectName(GetMyHero()) ~= "Vayne" then return end
  2.  
  3. require('Inspired')
  4. require('MapPositionGOS')
  5. LoadIOW()
  6.  
  7. --AutoUpdate("/D3ftsu/GoS/master/Vayne.lua","/D3ftsu/GoS/master/Vayne.version","Vayne.lua",4)
  8.  
  9. local VayneMenu = MenuConfig("Vayne", "Vayne")
  10. VayneMenu:Menu("Combo", "Combo")
  11. VayneMenu.Combo:Menu("Q", "Tumble (Q)")
  12. VayneMenu.Combo.Q:DropDown("Mode", "Mode", 1, {"Reset", "Normal"})
  13. VayneMenu.Combo.Q:Boolean("Enabled", "Enabled", true)
  14. VayneMenu.Combo.Q:Boolean("KeepInvis", "Don't AA While Stealthed", true)
  15. VayneMenu.Combo.Q:Slider("KeepInvisdis", "Only if Distance <", 230, 0, 550, 1)
  16.  
  17. VayneMenu.Combo:Menu("E", "Condemn (E)")
  18. VayneMenu.Combo.E:Boolean("Enabled", "Enabled", true)
  19. VayneMenu.Combo.E:Slider("pushdistance", "E Push Distance", 400, 350, 490, 1)
  20. if Flash ~= nil then VayneMenu.Combo.E:KeyBinding("cf", "Condemn-Flash", string.byte("G")) end
  21.  
  22. VayneMenu.Combo:Menu("R", "Final Hour (R)")
  23. VayneMenu.Combo.R:Boolean("Enabled", "Enabled", true)
  24. VayneMenu.Combo.R:Slider("Rifthp", "if Target Health % <", 70, 1, 100, 1)
  25. VayneMenu.Combo.R:Slider("Rifhp", "if Health % <", 55, 1, 100, 1)
  26. VayneMenu.Combo.R:Slider("Rminally", "Minimum Allies in Range", 2, 0, 4, 1)
  27. VayneMenu.Combo.R:Slider("Rallyrange", "Range", 1000, 1, 2000, 10)
  28. VayneMenu.Combo.R:Slider("Rminenemy", "Minimum Enemies in Range", 2, 1, 5, 1)
  29. VayneMenu.Combo.R:Slider("Renemyrange", "Range", 1000, 1, 2000, 10)
  30. VayneMenu.Combo:Boolean("Items", "Use Items", true)
  31. VayneMenu.Combo:Slider("myHP", "if HP % <", 50, 0, 100, 1)
  32. VayneMenu.Combo:Slider("targetHP", "if Target HP % >", 20, 0, 100, 1)
  33. VayneMenu.Combo:Boolean("QSS", "Use QSS", true)
  34. VayneMenu.Combo:Slider("QSSHP", "if My Health % <", 75, 0, 100, 1)
  35.  
  36. VayneMenu:Menu("Misc", "Misc")
  37. VayneMenu.Misc:Menu("EMenu", "AutoStun")
  38. VayneMenu.Misc:Boolean("lowhp", "Peel with E when low health", true)
  39. if Ignite ~= nil then VayneMenu.Misc:Boolean("AutoIgnite", "Auto Ignite", true) end
  40.  
  41. VayneMenu:Menu("Drawings", "Drawings")
  42. VayneMenu.Drawings:Boolean("Q", "Draw Q Range", true)
  43. VayneMenu.Drawings:Boolean("E", "Draw E Range", true)
  44.  
  45. VayneMenu:Menu("Interrupt", "Interrupt (E)")
  46.  
  47. DelayAction(function()
  48.   local str = {[_Q] = "Q", [_W] = "W", [_E] = "E", [_R] = "R"}
  49.   for i, spell in pairs(CHANELLING_SPELLS) do
  50.     for _,k in pairs(GetEnemyHeroes()) do
  51.         if spell["Name"] == GetObjectName(k) then
  52.         VayneMenu.Interrupt:Boolean(GetObjectName(k).."Inter", "On "..GetObjectName(k).." "..(type(spell.Spellslot) == 'number' and str[spell.Spellslot]), true)  
  53.         end
  54.     end
  55.   end
  56.  
  57.   for _,k in pairs(GetEnemyHeroes()) do
  58.   VayneMenu.Misc.EMenu:Boolean(GetObjectName(k).."Pleb", ""..GetObjectName(k).."", true)
  59.   end
  60. end, 0)
  61.  
  62. OnProcessSpell(function(unit, spell)
  63.   if GetObjectType(unit) == Obj_AI_Hero and GetTeam(unit) ~= GetTeam(myHero) and IsReady(_E) then
  64.     if CHANELLING_SPELLS[spell.name] then
  65.       if IsInDistance(unit, 615) and GetObjectName(unit) == CHANELLING_SPELLS[spell.name].Name and VayneMenu.Interrupt[GetObjectName(unit).."Inter"]:Value() then
  66.       CastTargetSpell(unit, _E)
  67.       end
  68.     end
  69.   end
  70. end)
  71.  
  72. OnDraw(function()
  73.   pos = GetOrigin(myHero)
  74.   if VayneMenu.Drawings.Q:Value() then DrawCircle(pos,GetCastRange(myHero,_Q),1,25,GoS.Pink) end
  75.   if VayneMenu.Drawings.E:Value() then DrawCircle(pos,GetCastRange(myHero,_E),1,25,GoS.Blue) end
  76. end)
  77.  
  78. OnProcessSpellAttack(function(unit,spell)
  79.   DelayAction(function()
  80.   if unit == myHero and IOW:Mode() == "Combo" and spell.target ~= nil and VayneMenu.Combo.Q.Enabled:Value() and IsReady(_Q) then
  81.     local AfterTumblePos = GetOrigin(myHero) + (Vector(GetMousePos()) - GetOrigin(myHero)):normalized() * 300
  82.     local DistanceAfterTumble = GetDistance(AfterTumblePos, spell.target)
  83.                          
  84.     if DistanceAfterTumble < 800 and DistanceAfterTumble > 200 then
  85.     CastSkillShot(_Q,GetMousePos())
  86.     end
  87.  
  88.     if GetDistance(spell.target) > 630 and DistanceAfterTumble < 630 then
  89.     CastSkillShot(_Q,GetMousePos())
  90.     end
  91.   end
  92.   end, GetWindUp(myHero))
  93. end)
  94.  
  95. local IsStealthed = false
  96.  
  97. OnTick(function()
  98.     local target = GetCurrentTarget()
  99.     local QSS = GetItemSlot(myHero,3140) > 0 and GetItemSlot(myHero,3140) or GetItemSlot(myHero,3139) > 0 and GetItemSlot(myHero,3139) or nil
  100.     local BRK = GetItemSlot(myHero,3153) > 0 and GetItemSlot(myHero,3153) or GetItemSlot(myHero,3144) > 0 and GetItemSlot(myHero,3144) or nil
  101.     local YMG = GetItemSlot(myHero,3142) > 0 and GetItemSlot(myHero,3142) or nil
  102.     local mousePos = GetMousePos()
  103.  
  104.     if IOW:Mode() == "Combo" then
  105.        
  106.         if VayneMenu.Combo.Q.Mode:Value() == 2 and target ~= nil and VayneMenu.Combo.Q.Enabled:Value() then
  107.           local AfterTumblePos = GetOrigin(myHero) + (Vector(mousePos) - GetOrigin(myHero)):normalized() * 300
  108.           local DistanceAfterTumble = GetDistance(AfterTumblePos, target)
  109.  
  110.           if GetDistance(target) > 630 and DistanceAfterTumble < 630 then
  111.           CastSkillShot(_Q,mousePos)
  112.           end
  113.         end
  114.        
  115.     if IsReady(_E) and VayneMenu.Combo.E.Enabled:Value() and ValidTarget(target, 710) then
  116.         StunThisPleb(target)
  117.         end
  118.  
  119.         if IsReady(_R) and VayneMenu.Combo.R.Enabled:Value() and ValidTarget(target, VayneMenu.Combo.R.Renemyrange:Value()) and GetPercentHP(target) <= VayneMenu.Combo.R.Rifthp:Value() and GetPercentHP(myHero) <= VayneMenu.Combo.R.Rifhp:Value() and EnemiesAround(GetOrigin(myHero), VayneMenu.Combo.R.Renemyrange:Value()) >= VayneMenu.Combo.R.Rminenemy:Value() and AlliesAround(GetOrigin(myHero), VayneMenu.Combo.R.Rallyrange:Value()) >= VayneMenu.Combo.R.Rminally:Value() then
  120.         CastSpell(_R)
  121.     end
  122.    
  123.     if QSS and IsReady(QSS) and VayneMenu.Combo.QSS:Value() and IsImmobile(myHero) or IsSlowed(myHero) or toQSS and GetPercentHP(myHero) < VayneMenu.Combo.QSSHP:Value() then
  124.         CastSpell(QSS)
  125.         end
  126.        
  127.         if IsStealthed and target ~= nil and GetDistance(target) > VayneMenu.Combo.Q.KeepInvisdis:Value() then
  128.     IOW.attacksEnabled = true
  129.     elseif not IsStealthed then
  130.     IOW.attacksEnabled = true
  131.     elseif IsStealthed and VayneMenu.Combo.Q.KeepInvis:Value() and target ~= nil and GetDistance(target) < VayneMenu.Combo.Q.KeepInvisdis:Value() then
  132.     IOW.attacksEnabled = false
  133.     end
  134.    
  135.    end
  136.  
  137.    local ElitePleb = ClosestEnemy(mousePos)
  138.    if Flash and IsReady(Flash) and IsReady(_E) and VayneMenu.Combo.E.cf:Value() and ValidTarget(ElitePleb, 1100) then
  139.    StunThisPlebV2(ElitePleb)
  140.    end
  141.  
  142.    for i,enemy in pairs(GetEnemyHeroes()) do
  143.        
  144.         if IOW:Mode() == "Combo" then  
  145.       if BRK and IsReady(BRK) and VayneMenu.Combo.Items:Value() and ValidTarget(enemy, 550) and GetPercentHP(myHero) < VayneMenu.Combo.myHP:Value() and GetPercentHP(enemy) > VayneMenu.Combo.targetHP:Value() then
  146.           CastTargetSpell(enemy, BRK)
  147.           end
  148.  
  149.           if YMG and IsReady(YMG) and VayneMenu.Combo.Items:Value() and ValidTarget(enemy, 600) then
  150.           CastSpell(YMG)
  151.           end  
  152.         end
  153.        
  154.           if Ignite and VayneMenu.Misc.AutoIgnite:Value() then
  155.             if IsReady(Ignite) and 20*GetLevel(myHero)+50 > GetCurrentHP(enemy)+GetDmgShield(enemy)+GetHPRegen(enemy)*3 and ValidTarget(enemy, 900) then
  156.             CastTargetSpell(enemy, Ignite)
  157.             end
  158.       end
  159.        
  160.     if IsReady(_E) and VayneMenu.Misc.EMenu[GetObjectName(enemy).."Pleb"]:Value() and ValidTarget(enemy, 710) then
  161.         StunThisPleb(enemy)
  162.         end
  163.  
  164.         if IsReady(_E) and VayneMenu.Misc.lowhp:Value() and GetPercentHP(myHero) <= 15 and ValidTarget(enemy,375) then
  165.         CastTargetSpell(enemy, _E)
  166.         end
  167.  
  168.    end
  169.  
  170. end)
  171.  
  172. OnUpdateBuff(function(unit,buff)
  173.   if unit == myHero and buff.Name == "vaynetumblefade" then
  174.   IsStealthed = true
  175.   end
  176. end)
  177.  
  178. OnRemoveBuff(function(unit,buff)
  179.   if unit == myHero and buff.Name == "vaynetumblefade" then
  180.   IsStealthed = false
  181.   end
  182. end)
  183.  
  184. function StunThisPleb(unit)
  185.         local EPred = GetPredictionForPlayer(GetOrigin(myHero),unit,GetMoveSpeed(unit),2000,250,GetCastRange(myHero,_E),1,false,true)
  186.         local PredPos = Vector(EPred.PredPos)
  187.         local HeroPos = Vector(myHero)
  188.         local maxERange = PredPos - (PredPos - HeroPos) * ( - VayneMenu.Combo.E.pushdistance:Value() / GetDistance(EPred.PredPos))
  189.         local shootLine = Line(Point(PredPos.x, PredPos.y, PredPos.z), Point(maxERange.x, maxERange.y, maxERange.z))
  190.         for i, Pos in pairs(shootLine:__getPoints()) do
  191.           if MapPosition:inWall(Pos) then
  192.           CastTargetSpell(unit, _E)
  193.           end
  194.         end
  195. end
  196.  
  197. function StunThisPlebV2(unit)
  198.         local EPred = GetPredictionForPlayer(GetMousePos(),unit,GetMoveSpeed(unit),2000,250,GetCastRange(myHero,_E),1,false,true)
  199.         local PredPos = Vector(EPred.PredPos)
  200.         local maxERange = PredPos - (PredPos - GetMousePos()) * ( - VayneMenu.Combo.E.pushdistance:Value() / GetDistance(GetMousePos(), EPred.PredPos))
  201.         local shootLine = Line(Point(PredPos.x, PredPos.y, PredPos.z), Point(maxERange.x, maxERange.y, maxERange.z))
  202.         for i, Pos in pairs(shootLine:__getPoints()) do
  203.           if MapPosition:inWall(Pos) then
  204.           CastTargetSpell(unit, _E)
  205.           DelayAction(function() CastSkillShot(Flash,GetMousePos()) end, 1)
  206.           end
  207.         end
  208. end
  209.  
  210.  
  211. Shield = {}
  212. Recalling = {}
  213. Slowed = {}
  214. Immobile = {}
  215. toQSS = false
  216. ccstun = {5,29,30,24}
  217. ccslow = {9,21,22,28}
  218. RecallTable = {"Recall", "RecallImproved", "OdinRecall"}
  219.  
  220. OnUpdateBuff(function(unit,buff)
  221.   if unit == myHero then
  222.     if buff.Name == "itemmagicshankcharge" then
  223.     LudensStacks = buff.Count
  224.     end
  225.  
  226.     if buff.Name == "zedultexecute" or buff.Name == "summonerexhaust"  then
  227.     toQSS = true
  228.     end
  229.    
  230.   end
  231.  
  232.     for i = 1, #RecallTable do
  233.       if buff.Name == RecallTable[i] then
  234.       Recalling[GetNetworkID(unit)] = buff.Count
  235.       end
  236.     end
  237.  
  238.     for i = 1, #ccstun do
  239.       if buff.Type == ccstun[i] then
  240.       Immobile[GetNetworkID(unit)] = buff.Count
  241.       DelayAction(function() Immobile[GetNetworkID(unit)] = 0 end, buff.ExpireTime-buff.StartTime)
  242.       end
  243.     end
  244.  
  245.   if buff.Type == 15 then
  246.   Shield[GetNetworkID(unit)] = buff.Count
  247.   end
  248.  
  249. end)
  250.  
  251. OnRemoveBuff(function(unit,buff)
  252.   if unit == myHero then
  253.  
  254.     if buff.Name == "itemmagicshankcharge" then
  255.     LudensStacks = 0
  256.     end
  257.    
  258.     if buff.Name == "zedultexecute" or buff.Name == "summonerexhaust"  then
  259.     toQSS = false
  260.     end
  261.  
  262.   end
  263.  
  264.   for i = 1, #RecallTable do
  265.     if buff.Name == RecallTable[i] then
  266.     Recalling[GetNetworkID(unit)] = 0
  267.     end
  268.   end
  269.  
  270.   if buff.Type == 15 then
  271.   Shield[GetNetworkID(unit)] = 0
  272.   end
  273.  
  274. end)
  275.  
  276. function HasSpellShield(unit)
  277.    return (Shield[GetNetworkID(unit)] or 0) > 0
  278. end
  279.  
  280. function IsImmobile(unit)
  281.    return (Immobile[GetNetworkID(unit)] or 0) > 0
  282. end
  283.  
  284. function IsSlowed(unit)
  285.    return (Slowed[GetNetworkID(unit)] or 0) > 0
  286. end
  287.  
  288. function IsRecalling(unit)
  289.    return (Recalling[GetNetworkID(unit)] or 0) > 0
  290. end
  291.  
  292. AddGapcloseEvent(_E, 550, true, VayneMenu)
  293.  
  294. PrintChat(string.format("<font color='#1244EA'>Vayne:</font> <font color='#FFFFFF'> By Deftsu Loaded, Have A Good Game ! </font>"))
  295. PrintChat("Have Fun Using D3Carry Scripts: " ..GetObjectBaseName(myHero).." -- Fixed by Inspired because Deftsu is a tard.")
Advertisement
Add Comment
Please, Sign In to add comment