Advertisement
haxlife

Untitled

Dec 15th, 2012
10,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.55 KB | None | 0 0
  1. --[[
  2. -Full combo: Items -> Q -> W -> E -> R
  3. -Supports Deathfire Grasp, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane, Ignite, Iceborn, Liandrys and Blackfire
  4. -Target configuration, Press shift to configure
  5.  
  6. By burn, based on Trus sbtw annie script
  7. ]]
  8. if myHero.charName ~= "Annie" then return end
  9. local LIB_PATH = debug.getinfo(1).source:sub(debug.getinfo(1).source:find(".*\\")):sub(2).."Common/"
  10. local AllClassFile = LIB_PATH.."AllClass.lua"
  11. local spellDmgFile = LIB_PATH.."spellDmg.lua"
  12. if file_exists(AllClassFile) then require "AllClass" end
  13. if file_exists(spellDmgFile) then require "spellDmg" end
  14. mecMethod = 2 --> 2 will hit our target and maybe other people, 1 will hit a lot of people and maybe also our target (not guarantee this last)
  15. scriptActive = false
  16. stunReadyFlag = false
  17. existTibbers = false
  18. ultiRange = 600
  19. ultiRadius = 230
  20. range = 620
  21. killable = {}
  22. local calculationenemy = 1
  23. local waittxt = {}
  24. local ts
  25. local ignite = nil
  26. local player = GetMyHero()
  27. function OnLoad()
  28. PrintChat(">> Annie Combo v1.0 loaded!")
  29. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  30. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  31. else ignite = nil
  32. end
  33. AnnieConfig = scriptConfig("Annie Combo", "anniecombo")
  34. AnnieConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  35. AnnieConfig:addParam("harass", "Harass Enemy", SCRIPT_PARAM_ONKEYDOWN, false, 65) --a
  36. AnnieConfig:addParam("autofarmQ", "Auto farm Q", SCRIPT_PARAM_ONKEYTOGGLE, false, 67)
  37. AnnieConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  38. AnnieConfig:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
  39. AnnieConfig:permaShow("harass")
  40. AnnieConfig:permaShow("autofarmQ")
  41. ts = TargetSelector(TARGET_LOW_HP,range+30,DAMAGE_MAGIC,false)
  42. ts.name = "Annie"
  43. AnnieConfig:addTS(ts)
  44. end
  45.  
  46. function OnTick()
  47. ts:update()
  48. --if existTibbers then
  49. --PrintChat("Tibers ALIVE!")
  50. --end
  51. --if existTibbers == false then
  52. --PrintChat("NO tibers!")
  53. --end
  54. DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  55. IcebornSlot, LiandrysSlot, BlackfireSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)
  56. QREADY = (myHero:CanUseSpell(_Q) == READY)
  57. WREADY = (myHero:CanUseSpell(_W) == READY)
  58. EREADY = (myHero:CanUseSpell(_E) == READY)
  59. RREADY = (myHero:CanUseSpell(_R) == READY)
  60. DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  61. HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  62. BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  63. IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  64. DmgCalculation()
  65. if AnnieConfig.autofarmQ and QREADY then
  66. local myQ = math.floor((myHero:GetSpellData(_Q).level-1)*40 + 85 + myHero.ap * .7)
  67. for k = 1, objManager.maxObjects do
  68. local minionObjectI = objManager:GetObject(k)
  69. if minionObjectI ~= nil and string.find(minionObjectI.name,"Minion_") == 1 and minionObjectI.team ~= myHero.team and minionObjectI.dead == false then
  70. if myHero:GetDistance(minionObjectI) <= range and minionObjectI.health <= myHero:CalcMagicDamage(minionObjectI, myQ)then
  71. CastSpell(_Q, minionObjectI)
  72. end
  73. end
  74. end
  75. end
  76. if AnnieConfig.harass and ts.target then
  77. if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end
  78. if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
  79. end
  80. if AnnieConfig.scriptActive and ts.target then
  81. if DFGREADY then CastSpell(DFGSlot, ts.target) end
  82. if HXGREADY then CastSpell(HXGSlot, ts.target) end
  83. if BWCREADY then CastSpell(BWCSlot, ts.target) end
  84. if stunReadyFlag then
  85. if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  86. if mecMethod == 1 then
  87. spellPos = FindGroupCenterFromNearestEnemies(ultiRadius,ultiRange)
  88. elseif mecMethod == 2 then
  89. spellPos = FindGroupCenterNearTarget(ts.target,ultiRadius,ultiRange)
  90. end
  91. if spellPos ~= nil then
  92. CastSpell(_R, spellPos.center.x, spellPos.center.z)
  93. else
  94. CastSpell(_R, ts.target.x, ts.target.z)
  95. end
  96. end
  97. end
  98. if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end
  99. if stunReadyFlag then
  100. if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  101. if mecMethod == 1 then
  102. spellPos = FindGroupCenterFromNearestEnemies(ultiRadius,ultiRange)
  103. elseif mecMethod == 2 then
  104. spellPos = FindGroupCenterNearTarget(ts.target,ultiRadius,ultiRange)
  105. end
  106. if spellPos ~= nil then
  107. CastSpell(_R, spellPos.center.x, spellPos.center.z)
  108. else
  109. CastSpell(_R, ts.target.x, ts.target.z)
  110. end
  111. end
  112. end
  113. if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
  114. if EREADY and AnnieConfig.useE and not stunReadyFlag then CastSpell(_E) end
  115. if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  116. if mecMethod == 1 then
  117. spellPos = FindGroupCenterFromNearestEnemies(ultiRadius,ultiRange)
  118. elseif mecMethod == 2 then
  119. spellPos = FindGroupCenterNearTarget(ts.target,ultiRadius,ultiRange)
  120. end
  121. if spellPos ~= nil then
  122. CastSpell(_R, spellPos.center.x, spellPos.center.z)
  123. else
  124. CastSpell(_R, ts.target.x, ts.target.z)
  125. end
  126. end
  127.  
  128. if myHero:GetDistance(ts.target) < 650 and existTibbers then
  129. CastSpell(_R,ts.target)
  130. end
  131.  
  132. end
  133. end
  134.  
  135. function OnCreateObj(object)
  136. if object.name == "StunReady.troy" then stunReadyFlag = true end
  137. if object.name == "BearFire_foot.troy" then existTibbers = true end
  138. end
  139.  
  140. function OnDeleteObj(object)
  141. if object.name == "StunReady.troy" then stunReadyFlag = false end
  142. if object.name == "BearFire_foot.troy" then existTibbers = false end
  143. end
  144.  
  145. function OnWndMsg(msg,key)
  146. SC__OnWndMsg(msg,key)
  147. end
  148.  
  149. function OnSendChat(msg)
  150. TargetSelector__OnSendChat(msg)
  151. ts:OnSendChat(msg, "pri")
  152. end
  153.  
  154. function DmgCalculation()
  155. local enemy = heroManager:GetHero(calculationenemy)
  156. if ValidTarget(enemy) then
  157. local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage = 0, 0, 0, 0, 0, 0, 0
  158. local qdamage = getDmg("Q",enemy,myHero)
  159. local wdamage = getDmg("W",enemy,myHero)
  160. local rdamage = getDmg("R",enemy,myHero)
  161. local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  162. local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  163. local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  164. local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  165. local onhitdmg = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)+(TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)+(LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0)+(IcebornSlot and getDmg("ICEBORN",enemy,myHero) or 0)
  166. local onspelldamage = (LiandrysSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BlackfireSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
  167. local combo1 = onspelldamage
  168. local combo2 = onhitdmg + qdamage + wdamage + rdamage + dfgdamage + hxgdamage + bwcdamage + ignitedamage + onspelldamage
  169. if QREADY then
  170. combo1 = combo1 + qdamage
  171. end
  172. if WREADY then
  173. combo1 = combo1 + wdamage
  174. end
  175. if (RREADY and not existTibbers) then
  176. combo1 = combo1 + rdamage
  177. end
  178. if HXGREADY then
  179. combo1 = combo1 + hxgdamage
  180. end
  181. if BWCREADY then
  182. combo1 = combo1 + bwcdamage
  183. end
  184. if DFGREADY then
  185. combo1 = combo1*1.2 + dfgdamage
  186. end
  187. if IREADY then
  188. combo1 = combo1 + ignitedamage
  189. end
  190. combo1 = combo1 + onhitdmg
  191. if combo1 >= enemy.health then killable[calculationenemy] = 1
  192. elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  193. else killable[calculationenemy] = 0 end
  194. end
  195. if calculationenemy == 1 then
  196. calculationenemy = heroManager.iCount
  197. else
  198. calculationenemy = calculationenemy-1
  199. end
  200. end
  201.  
  202. function OnDraw()
  203. if AnnieConfig.drawcircles and not myHero.dead then
  204. DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x19A712)
  205. if ts.target ~= nil then
  206. for j=0, 5 do
  207. DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  208. end
  209. end
  210. for i=1, heroManager.iCount do
  211. local enemydraw = heroManager:GetHero(i)
  212. if ValidTarget(enemydraw) then
  213. if killable[i] == 2 then
  214. for j=0, 20 do
  215. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  216. end
  217. PrintFloatText(enemydraw,0,"Skills are not available")
  218. elseif killable[i] == 1 then
  219. for j=0, 10 do
  220. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  221. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  222. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  223. end
  224. PrintFloatText(enemydraw,0,"Kill him!")
  225. end
  226. end
  227. end
  228. end
  229. SC__OnDraw()
  230. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement