Advertisement
Guest User

Untitled

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