Advertisement
Guest User

Annie(Burn1.1xkjtx).lua

a guest
Jan 29th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.13 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, modded by xkjtx
  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]]-- << removed becasue its not needed any more >> --
  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. tranges = 650
  22. killable = {}
  23. local lastBasicAttack = 0
  24. local swingDelay = 0.15
  25. local swing = 0
  26. local calculationenemy = 1
  27. local waittxt = {}
  28. local ts
  29. local ignite = nil
  30. local player = GetMyHero()
  31. function OnLoad()
  32.     --PrintChat(">> Annie Combo v1.0 loaded!")
  33.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  34.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  35.     else ignite = nil
  36.     end
  37.     AnnieConfig = scriptConfig("Annie Combo", "anniecombo")
  38.     AnnieConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32) -- Space bar
  39.     AnnieConfig:addParam("harass", "Harass Enemy", SCRIPT_PARAM_ONKEYDOWN, false, 83) -- S
  40.     AnnieConfig:addParam("autofarmQ", "Auto farm Q", SCRIPT_PARAM_ONKEYTOGGLE, false, 88) -- X
  41.     AnnieConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  42.     AnnieConfig:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
  43.     AnnieConfig:permaShow("scriptActive")
  44.     AnnieConfig:permaShow("harass")
  45.     AnnieConfig:permaShow("autofarmQ")
  46.     ts = TargetSelector(TARGET_NEAR_MOUSE,tranges,DAMAGE_MAGIC--[[,false]]) -- << you can focus target by selecting(with Lmouse) >> --
  47.     ts.name = "Annie"
  48.     AnnieConfig:addTS(ts)
  49. end
  50.  
  51. function OnTick()
  52.     ts:update()
  53.     if ts.target ~= nil then
  54.         if os.clock() > lastBasicAttack + 0.5 then
  55.             swing = 0
  56.         end  
  57.         if AnnieConfig.harass or AnnieConfig.scriptActive then
  58.             if GetDistance(ts.target) <= range and swing == 0 then
  59.                 myHero:Attack(ts.target)
  60.             end
  61.         end
  62.     end
  63.     --if existTibbers then
  64.         --PrintChat("Tibers ALIVE!")
  65.     --end  
  66.     --if existTibbers == false then
  67.         --PrintChat("NO tibers!")
  68.     --end  
  69.     DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  70.     IcebornSlot, LiandrysSlot, BlackfireSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)  
  71.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  72.     WREADY = (myHero:CanUseSpell(_W) == READY)
  73.     EREADY = (myHero:CanUseSpell(_E) == READY)
  74.     RREADY = (myHero:CanUseSpell(_R) == READY)
  75.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  76.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  77.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  78.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  79.     DmgCalculation()
  80.     if AnnieConfig.autofarmQ and QREADY then
  81.         local myQ = math.floor((myHero:GetSpellData(_Q).level-1)*40 + 85 + myHero.ap * .7)
  82.         for k = 1, objManager.maxObjects do
  83.         local minionObjectI = objManager:GetObject(k)
  84.             if minionObjectI ~= nil and string.find(minionObjectI.name,"Minion_") == 1 and minionObjectI.team ~= myHero.team and minionObjectI.dead == false then
  85.                 if myHero:GetDistance(minionObjectI) <= range and minionObjectI.health <= myHero:CalcMagicDamage(minionObjectI, myQ)then   
  86.                     CastSpell(_Q, minionObjectI)
  87.                 end
  88.             end
  89.         end    
  90.     end
  91.     if AnnieConfig.harass and ts.target then
  92.         if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end
  93.         if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
  94.     end
  95.     if AnnieConfig.scriptActive and ts.target then
  96.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  97.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  98.         if BWCREADY then CastSpell(BWCSlot, 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 ts.target ~= 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 QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end  
  114.         if stunReadyFlag then
  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 ts.target ~= 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.         end  
  128.         if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
  129.         if EREADY and AnnieConfig.useE and not stunReadyFlag then CastSpell(_E) end
  130.         if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  131.                 --[[if mecMethod == 1 then
  132.                     spellPos = FindGroupCenterFromNearestEnemies(ultiRadius,ultiRange)
  133.                 elseif mecMethod == 2 then
  134.                     spellPos = FindGroupCenterNearTarget(ts.target,ultiRadius,ultiRange)
  135.                 end]]
  136.                 if ts.target ~= nil then
  137.                     --CastSpell(_R, spellPos.center.x, spellPos.center.z)
  138.                 --else
  139.                     CastSpell(_R, ts.target.x, ts.target.z)
  140.                 end
  141.          end
  142.          
  143.         if myHero:GetDistance(ts.target) < 650 and existTibbers then
  144.             CastSpell(_R,ts.target)
  145.         end
  146.          
  147.     end
  148. end
  149.  
  150. function OnCreateObj(object)
  151.     if object.name == "StunReady.troy" then stunReadyFlag = true end
  152.     if object.name == "BearFire_foot.troy" then existTibbers = true end
  153. end
  154.  
  155. function OnDeleteObj(object)
  156.     if object.name == "StunReady.troy" then stunReadyFlag = false end
  157.     if object.name == "BearFire_foot.troy" then existTibbers = false end   
  158. end
  159.  
  160. function OnWndMsg(msg,key)
  161.     --SC__OnWndMsg(msg,key)
  162. end
  163.  
  164. function OnSendChat(msg)
  165.     --TargetSelector__OnSendChat(msg)
  166.     ts:OnSendChat(msg, "pri")
  167. end
  168.  
  169. function DmgCalculation()
  170.         local enemy = heroManager:GetHero(calculationenemy)
  171.         if ValidTarget(enemy) then
  172.             local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
  173.             local qdamage = getDmg("Q",enemy,myHero)
  174.             local wdamage = getDmg("W",enemy,myHero)
  175.             local rdamage = getDmg("R",enemy,myHero)
  176.             local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  177.             local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  178.             local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  179.             local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  180.             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)                         
  181.             local onspelldamage = (LiandrysSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BlackfireSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
  182.             local combo1 = onspelldamage
  183.             local combo2 = onhitdmg + qdamage + wdamage + rdamage + dfgdamage + hxgdamage + bwcdamage + ignitedamage + onspelldamage
  184.             if QREADY then
  185.                 combo1 = combo1 + qdamage
  186.             end
  187.             if WREADY then
  188.                 combo1 = combo1 + wdamage
  189.             end
  190.             if (RREADY and not existTibbers) then
  191.                 combo1 = combo1 + rdamage
  192.             end    
  193.             if HXGREADY then              
  194.                 combo1 = combo1 + hxgdamage    
  195.             end
  196.             if BWCREADY then
  197.                 combo1 = combo1 + bwcdamage
  198.             end
  199.             if DFGREADY then        
  200.                 combo1 = combo1*1.2 + dfgdamage            
  201.             end        
  202.             if IREADY then
  203.                 combo1 = combo1 + ignitedamage
  204.             end
  205.             combo1 = combo1 + onhitdmg
  206.             if combo1 >= enemy.health then killable[calculationenemy] = 1
  207.             elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  208.             else killable[calculationenemy] = 0 end
  209.         end
  210.         if calculationenemy == 1 then
  211.             calculationenemy = heroManager.iCount
  212.         else
  213.             calculationenemy = calculationenemy-1
  214.         end
  215. end
  216.  
  217. function OnDraw()
  218.     if AnnieConfig.drawcircles and not myHero.dead then
  219.         DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x990099)
  220.         if ts.target ~= nil then
  221.             for j=0, 5 do
  222.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  223.             end
  224.         end
  225.         for i=1, heroManager.iCount do
  226.             local enemydraw = heroManager:GetHero(i)
  227.             if ValidTarget(enemydraw) then
  228.                 if killable[i] == 2 then
  229.                     for j=0, 20 do
  230.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  231.                     end
  232.                     PrintFloatText(enemydraw,0,"Skills are not available")
  233.                 elseif killable[i] == 1 then
  234.                     for j=0, 10 do
  235.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  236.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  237.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  238.                     end
  239.                     PrintFloatText(enemydraw,0,"Kill him!")
  240.                 end
  241.             end
  242.         end
  243.     end
  244.     --SC__OnDraw()
  245. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement