[LUA] Can he kill me? [POLISH]


SUBMITTED BY: Guest

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

FORMAT: Lua

SIZE: 10.3 kB

HITS: 1448

  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. Tlumaczenie: Panda
  46. Thanks to: Shalzuth ( skinhack ), Roach ( dmg indicator )
  47. ]]
  48. function OnLoad()
  49. Variables()
  50. menu()
  51. end
  52. function Variables()
  53. lastSkin = 0
  54. enemyCount = 0
  55. enemyTable = {}
  56. for i = 1, heroManager.iCount do
  57. local champ = heroManager:GetHero(i)
  58. if champ.team ~= player.team then
  59. enemyCount = enemyCount + 1
  60. enemyTable[enemyCount] = { player = champ, indicatorText = "", damageGettingText = "", ultAlert = false, ready = true}
  61. end
  62. end
  63. end
  64. function OnTick()
  65. ---Skins
  66. if VIP_USER and myConfig.skin.skinList then
  67. if canChange then
  68. canChange = false
  69. GenModelPacket(myHero.charName, currSkinId)
  70. if (numSkins[myHero.charName] > currSkinId) then currSkinId = currSkinId + 1 else currSkinId = 0 end -- Shalzuth
  71. end
  72. else
  73. canChange = true
  74. end
  75. -- skins
  76. DmgCalc()
  77. end
  78. function menu()
  79. myConfig = scriptConfig("Czy zabije mnie ?","can he kill me?")
  80. myConfig:addSubMenu("Ustawienia graficzne", "drawing")
  81. myConfig.drawing:addParam("drawText", "Pokaz text dla", SCRIPT_PARAM_ONOFF, true)
  82. for i, enemy in ipairs(GetEnemyHeroes()) do
  83. myConfig.drawing:addParam(enemy.charName,"Rysuj dla: " .. enemy.charName .. "?", SCRIPT_PARAM_LIST, 1, {"Tak", "Nie"})
  84. end
  85. myConfig:addSubMenu("Skin hack", "skin")
  86. myConfig.skin:addParam("skinList", "Zmien skin", SCRIPT_PARAM_ONKEYDOWN, false, 0x60)
  87. PrintChat("<font color='#C4296F'> Może mnie zabić? </font><font color='#ef9d02'>loaded. Good luck, " .. player.name .. ".</font>")
  88. end
  89. -- shalzuth
  90. function GenModelPacket(champ, skinId)
  91. p = CLoLPacket(0x97)
  92. p:EncodeF(myHero.networkID)
  93. p.pos = 1
  94. t1 = p:Decode1()
  95. t2 = p:Decode1()
  96. t3 = p:Decode1()
  97. t4 = p:Decode1()
  98. p:Encode1(t1)
  99. p:Encode1(t2)
  100. p:Encode1(t3)
  101. p:Encode1(bit32.band(t4,0xB))
  102. p:Encode1(1)
  103. p:Encode4(skinId)
  104. for i = 1, #champ do
  105. p:Encode1(string.byte(champ:sub(i,i)))
  106. end
  107. for i = #champ + 1, 64 do
  108. p:Encode1(0)
  109. end
  110. p:Hide()
  111. RecvPacket(p)
  112. end
  113. function DmgCalc()
  114. for i = 1, enemyCount do
  115. local enemy = enemyTable[i].player
  116. if ValidTarget(enemy) and enemy.visible then
  117. SpellQ = getDmg("Q", myHero, enemy)
  118. SpellW = getDmg("W", myHero, enemy)
  119. SpellE = getDmg("E", myHero, enemy)
  120. SpellR = getDmg("R", myHero, enemy)
  121. SpellI = getDmg("IGNITE", myHero, enemy)
  122. if myHero.health < SpellR then
  123. enemyTable[i].indicatorText = "Zabije mnie z: R"
  124. elseif myHero.health < SpellQ then
  125. enemyTable[i].indicatorText = "Zabije mnie z: Q"
  126. elseif myHero.health < SpellW then
  127. enemyTable[i].indicatorText = "Zabije mnie z: W"
  128. elseif myHero.health < SpellE then
  129. enemyTable[i].indicatorText = "Zabije mnie z: E"
  130. elseif myHero.health < SpellQ + SpellR then
  131. enemyTable[i].indicatorText = "Zabije mnie z: Q + R"
  132. elseif myHero.health < SpellW + SpellR then
  133. enemyTable[i].indicatorText = "Zabije mnie z: W + R"
  134. elseif myHero.health < SpellE + SpellR then
  135. enemyTable[i].indicatorText = "Zabije mnie z: E + R"
  136. elseif myHero.health < SpellQ + SpellW + SpellR then
  137. enemyTable[i].indicatorText = "Zabije mnie z: Q + W + R"
  138. elseif myHero.health < SpellQ + SpellE + SpellR then
  139. enemyTable[i].indicatorText = "Zabije mnie z: Q + E + R"
  140. else
  141. local dmgTotal = (SpellQ + SpellW + SpellE + SpellR)
  142. local hpLeft = math.round(myHero.health - dmgTotal)
  143. local percentLeft = math.round(hpLeft / myHero.maxHealth * 100)
  144. enemyTable[i].indicatorText = "Nie zabije mnie ( " .. percentLeft .. "% )"
  145. end
  146. local enemyAD = getDmg("AD", myHero, enemy)
  147. enemyTable[i].damageGettingText = enemy.charName .. " zabije mnie z " .. math.ceil(myHero.health / enemyAD) .. " uderzen"
  148. -- Thanks to Roach
  149. end
  150. end
  151. end
  152. function OnDraw()
  153. if myConfig.drawing.drawText then
  154. for i = 1, enemyCount do
  155. local enemy = enemyTable[i].player
  156. if ValidTarget(enemy) and enemy.visible and myConfig.drawing[enemy.charName] == 1 then
  157. local barPos = WorldToScreen(D3DXVECTOR3(enemy.x, enemy.y, enemy.z))
  158. local pos = { X = barPos.x - 35, Y = barPos.y - 50 }
  159. --Roach
  160. 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))
  161. DrawText(enemyTable[i].damageGettingText, 15, pos.X + 20, pos.Y + 15, ARGB(255, 255, 0, 0))
  162. end
  163. end
  164. end
  165. end

comments powered by Disqus