[LUA] Can I kill him?


SUBMITTED BY: Guest

DATE: Aug. 27, 2014, 7:56 p.m.

FORMAT: Lua

SIZE: 7.9 kB

HITS: 2351

  1. numSkins = {
  2. Aatrox = 1,Ahri = 4,Akali = 6,Alistar = 7,
  3. Amumu = 7,Anivia = 5,Annie = 8,Ashe = 6,
  4. Blitzcrank = 7,Brand = 4,Braum = 1,Caitlyn = 5,
  5. Cassiopeia = 4,Chogath = 5,Corki = 6,Darius = 3,
  6. Diana = 2,Draven = 3,DrMundo = 7,Elise = 2,
  7. Evelynn = 3,Ezreal = 6,Fiddlesticks = 8,Fiora = 3,
  8. Fizz = 4,Galio = 4,Gangplank = 6,Garen = 6,
  9. Gragas = 7,Graves = 5,Hecarim = 5,Heimerdinger = 4,
  10. Irelia = 4,Janna = 5,JarvanIV = 5,Jax = 8,
  11. Jayce = 2,Jinx = 1,Karma = 3,Karthus = 4,
  12. Kassadin = 4,Katarina = 7,Kayle = 6,Kennen = 5,
  13. Khazix = 1,KogMaw = 7,Leblanc = 3,LeeSin = 6,
  14. Leona = 4,Lissandra = 2,Lucian = 2,Lulu = 4,
  15. Lux = 5,Malphite = 5,Malzahar = 4,Maokai = 5,
  16. Masteryi = 5,MasterYi = 5,
  17. MissFortune = 6,MonkeyKing = 3,Mordekaiser = 4,Morgana = 5,
  18. Nami = 2,Nasus = 5,Nautilus = 3,Nidalee = 6,
  19. Nocturne = 5,Nunu = 6,Olaf = 4,Orianna = 4,
  20. Pantheon = 6,Poppy = 6,Quinn = 2,Rammus = 6,
  21. Random = 0,Renekton = 6,Rengar = 2,Riven = 5,
  22. Rumble = 3,Ryze = 8,Sejuani = 4,Shaco = 6,
  23. Shen = 6,Shyvana = 4,Singed = 6,Sion = 4,
  24. Sivir = 6,Skarner = 2,Sona = 5,Soraka = 3,
  25. Swain = 3,Syndra = 2,Talon = 3,Taric = 3,
  26. Teemo = 7,Thresh = 2,Tristana = 6,Trundle = 3,
  27. Tryndamere = 6,TwistedFate = 8,Twitch = 5,Udyr = 3,
  28. Urgot = 3,Varus = 3,Vayne = 5,Veigar = 7,
  29. Velkoz = 1,Viktor = 3,Vi = 2,Vladimir = 5,
  30. Volibear = 3,Warwick = 7,Xerath = 3,XinZhao = 5,
  31. Yasuo = 1,Yorick = 2,Zac = 1,Zed = 3,
  32. Ziggs = 4,Zilean = 4,Zyra = 3,Gnar = 2
  33. }
  34. currSkinId = 0
  35. canChange = true -- Shalzuth
  36. --[[
  37. ██████╗ █████╗ ███╗ ██╗ ██╗ ██╗ ██╗██╗██╗ ██╗ ██╗ ██╗██╗███╗ ███╗██████╗
  38. ██╔════╝██╔══██╗████╗ ██║ ██║ ██║ ██╔╝██║██║ ██║ ██║ ██║██║████╗ ████║╚════██╗
  39. ██║ ███████║██╔██╗ ██║ ██║ █████╔╝ ██║██║ ██║ ███████║██║██╔████╔██║ ▄███╔╝
  40. ██║ ██╔══██║██║╚██╗██║ ██║ ██╔═██╗ ██║██║ ██║ ██╔══██║██║██║╚██╔╝██║ ▀▀══╝
  41. ╚██████╗██║ ██║██║ ╚████║ ██║ ██║ ██╗██║███████╗███████╗ ██║ ██║██║██║ ╚═╝ ██║ ██╗
  42. ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝
  43. Author: Mr Slave
  44. Version: 1
  45. Thanks to: Shalzuth ( skinhack ), Roach ( dmg indicator )
  46. ]]
  47. function OnLoad()
  48. Variables()
  49. menu()
  50. end
  51. function Variables()
  52. lastSkin = 0
  53. enemyCount = 0
  54. enemyTable = {}
  55. for i = 1, heroManager.iCount do
  56. local champ = heroManager:GetHero(i)
  57. if champ.team ~= player.team then
  58. enemyCount = enemyCount + 1
  59. enemyTable[enemyCount] = { player = champ, indicatorText = "", damageGettingText = "", ultAlert = false, ready = true}
  60. end
  61. end
  62. end
  63. function OnTick()
  64. ---Skins
  65. if VIP_USER and myConfig.skin.skinList then
  66. if canChange then
  67. canChange = false
  68. GenModelPacket(myHero.charName, currSkinId)
  69. if (numSkins[myHero.charName] > currSkinId) then currSkinId = currSkinId + 1 else currSkinId = 0 end -- Shalzuth
  70. end
  71. else
  72. canChange = true
  73. end
  74. -- skins
  75. DmgCalc()
  76. end
  77. function menu()
  78. myConfig = scriptConfig("Can I kill him?","can i kill him?")
  79. myConfig:addSubMenu("Drawing Settings", "drawing")
  80. myConfig.drawing:addParam("drawText", "Draw Enemy Text", SCRIPT_PARAM_ONOFF, true)
  81. for i, enemy in ipairs(GetEnemyHeroes()) do
  82. myConfig.drawing:addParam(enemy.charName,"Draw for: " .. enemy.charName .. "?", SCRIPT_PARAM_LIST, 1, {"YES", "NO"})
  83. end
  84. myConfig:addSubMenu("Skin hack", "skin")
  85. myConfig.skin:addParam("skinList", "Choose your skin", SCRIPT_PARAM_ONKEYDOWN, false, 0x60)
  86. PrintChat("<font color='#C4296F'> Can I kill him? </font><font color='#ef9d02'>loaded. Good luck, " .. player.name .. ".</font>")
  87. end
  88. -- shalzuth
  89. function GenModelPacket(champ, skinId)
  90. p = CLoLPacket(0x97)
  91. p:EncodeF(myHero.networkID)
  92. p.pos = 1
  93. t1 = p:Decode1()
  94. t2 = p:Decode1()
  95. t3 = p:Decode1()
  96. t4 = p:Decode1()
  97. p:Encode1(t1)
  98. p:Encode1(t2)
  99. p:Encode1(t3)
  100. p:Encode1(bit32.band(t4,0xB))
  101. p:Encode1(1)
  102. p:Encode4(skinId)
  103. for i = 1, #champ do
  104. p:Encode1(string.byte(champ:sub(i,i)))
  105. end
  106. for i = #champ + 1, 64 do
  107. p:Encode1(0)
  108. end
  109. p:Hide()
  110. RecvPacket(p)
  111. end
  112. function DmgCalc()
  113. for i = 1, enemyCount do
  114. local enemy = enemyTable[i].player
  115. if ValidTarget(enemy) and enemy.visible then
  116. SpellQ = getDmg("Q", enemy, myHero)
  117. SpellW = getDmg("W", enemy, myHero)
  118. SpellE = getDmg("E", enemy, myHero)
  119. SpellR = getDmg("R", enemy, myHero)
  120. SpellI = getDmg("IGNITE", enemy, myHero)
  121. if enemy.health < SpellR then
  122. enemyTable[i].indicatorText = "R Kill"
  123. elseif enemy.health < SpellQ then
  124. enemyTable[i].indicatorText = "Q Kill"
  125. elseif enemy.health < SpellW then
  126. enemyTable[i].indicatorText = "WKill"
  127. elseif enemy.health < SpellE then
  128. enemyTable[i].indicatorText = "E Kill"
  129. elseif enemy.health < SpellQ + SpellR then
  130. enemyTable[i].indicatorText = "Q + R Kill"
  131. elseif enemy.health < SpellW + SpellR then
  132. enemyTable[i].indicatorText = "W + R Kill"
  133. elseif enemy.health < SpellE + SpellR then
  134. enemyTable[i].indicatorText = "E + R Kill"
  135. elseif enemy.health < SpellQ + SpellW + SpellR then
  136. enemyTable[i].indicatorText = "Q + W + R Kill"
  137. elseif enemy.health < SpellQ + SpellE + SpellR then
  138. enemyTable[i].indicatorText = "Q + E + R Kill"
  139. else
  140. local dmgTotal = (SpellQ + SpellW + SpellE + SpellR)
  141. local hpLeft = math.round(enemy.health - dmgTotal)
  142. local percentLeft = math.round(hpLeft / enemy.maxHealth * 100)
  143. enemyTable[i].indicatorText = "Cant kill him ( " .. percentLeft .. "% )"
  144. end
  145. local myAD = getDmg("AD", enemy, myHero)
  146. enemyTable[i].damageGettingText = "I kill " .. enemy.charName .. " with " .. math.ceil(enemy.health / myAD) .. " hits"
  147. -- Thanks to Roach
  148. end
  149. end
  150. end
  151. function OnDraw()
  152. if myConfig.drawing.drawText then
  153. for i = 1, enemyCount do
  154. local enemy = enemyTable[i].player
  155. if ValidTarget(enemy) and enemy.visible and myConfig.drawing[enemy.charName] == 1 then
  156. local barPos = WorldToScreen(D3DXVECTOR3(enemy.x, enemy.y, enemy.z))
  157. local pos = { X = barPos.x - 35, Y = barPos.y - 50 }
  158. --Roach
  159. DrawText(enemyTable[i].indicatorText, 15, pos.X + 20, pos.Y, (enemyTable[i].ready and ARGB(255, 0, 255, 0)) or ARGB(255, 255, 220, 0))
  160. DrawText(enemyTable[i].damageGettingText, 15, pos.X + 20, pos.Y + 15, ARGB(255, 255, 0, 0))
  161. end
  162. end
  163. end
  164. end

comments powered by Disqus