16HeX16

Annie Free Users

Apr 6th, 2013
784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.39 KB | None | 0 0
  1. --[[
  2.  
  3.     -Full combo: Items -> Q -> W -> E -> R
  4.  
  5.     -Supports Deathfire Grasp, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane, Ignite, Iceborn, Liandrys and Blackfire
  6.  
  7.     -Target configuration, Press shift to configure
  8.  
  9.    
  10.  
  11.     By burn, based on Trus sbtw annie script
  12.  
  13.     Fixed by HeX
  14.  
  15. ]]
  16.  
  17. if myHero.charName ~= "Annie" then return end
  18.  
  19. scriptActive = false
  20.  
  21. stunReadyFlag = false
  22.  
  23. existTibbers = false
  24.  
  25. ultiRange = 600        
  26.  
  27. ultiRadius = 230  
  28.  
  29. range = 620
  30.  
  31. killable = {}
  32.  
  33. local myObjectsTable = {}
  34.  
  35. local calculationenemy = 1
  36.  
  37. local waittxt = {}
  38.  
  39. local ts
  40.  
  41. local ignite = nil
  42.  
  43. local player = GetMyHero()
  44.  
  45. function OnLoad()
  46.  
  47.     PrintChat(">> Annie Combo v1.0 loaded!")
  48.  
  49.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  50.  
  51.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  52.  
  53.     else ignite = nil
  54.  
  55.     end
  56.  
  57.     AnnieConfig = scriptConfig("Annie Combo", "anniecombo")
  58.  
  59.     AnnieConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  60.  
  61.     AnnieConfig:addParam("harass", "Harass Enemy", SCRIPT_PARAM_ONKEYDOWN, false, 65) --a
  62.  
  63.     AnnieConfig:addParam("autofarmQ", "Auto farm Q", SCRIPT_PARAM_ONKEYTOGGLE, false, 67)
  64.  
  65.     AnnieConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  66.  
  67.     AnnieConfig:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
  68.  
  69.     AnnieConfig:permaShow("scriptActive")
  70.  
  71.     AnnieConfig:permaShow("harass")
  72.  
  73.     AnnieConfig:permaShow("autofarmQ")
  74.  
  75.    
  76.  
  77.     ts = TargetSelector(TARGET_LOW_HP,range+30,DAMAGE_MAGIC,false)
  78.  
  79.     ts.name = "Annie"
  80.  
  81.     AnnieConfig:addTS(ts)
  82.  
  83.    
  84.  
  85.     for i = 0, objManager.maxObjects, 1 do
  86.  
  87.         local object = objManager:GetObject(i)
  88.  
  89.         if objectIsValid(object) then table.insert(myObjectsTable, object) end
  90.  
  91.     end
  92.  
  93. end
  94.  
  95.  
  96.  
  97. function OnTick()
  98.  
  99.     ts:update()
  100.  
  101.     --if existTibbers then
  102.  
  103.         --PrintChat("Tibers ALIVE!")
  104.  
  105.     --end  
  106.  
  107.     --if existTibbers == false then
  108.  
  109.         --PrintChat("NO tibers!")
  110.  
  111.     --end  
  112.  
  113.     DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  114.  
  115.     IcebornSlot, LiandrysSlot, BlackfireSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)  
  116.  
  117.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  118.  
  119.     WREADY = (myHero:CanUseSpell(_W) == READY)
  120.  
  121.     EREADY = (myHero:CanUseSpell(_E) == READY)
  122.  
  123.     RREADY = (myHero:CanUseSpell(_R) == READY)
  124.  
  125.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  126.  
  127.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  128.  
  129.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  130.  
  131.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  132.  
  133.     DmgCalculation()
  134.  
  135.    
  136.  
  137.     if AnnieConfig.autofarmQ and QREADY then
  138.  
  139.         local myQ = math.floor((myHero:GetSpellData(_Q).level-1)*40 + 85 + myHero.ap * .7)
  140.  
  141.         for i,object in ipairs(myObjectsTable) do
  142.  
  143.             if objectIsValid(object) and object.health <= myHero:CalcDamage(object, myQ) and myHero:GetDistance(object) < 625 then 
  144.  
  145.                     CastSpell(_Q, object)
  146.  
  147.             end
  148.  
  149.         end
  150.  
  151.     end
  152.  
  153.     if AnnieConfig.harass and ts.target then
  154.  
  155.         if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end
  156.  
  157.         if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
  158.  
  159.     end
  160.  
  161.     if AnnieConfig.scriptActive and ts.target then
  162.  
  163.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  164.  
  165.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  166.  
  167.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  168.  
  169.         if stunReadyFlag then
  170.  
  171.             if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  172.  
  173.                 CastSpell(_R, ts.target.x, ts.target.z)
  174.  
  175.             end
  176.  
  177.    end     
  178.  
  179.         if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end  
  180.  
  181.         if stunReadyFlag then
  182.  
  183.             if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  184.  
  185.                 CastSpell(_R, ts.target.x, ts.target.z)
  186.  
  187.             end
  188.  
  189.     end
  190.  
  191.         if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
  192.  
  193.         if EREADY and AnnieConfig.useE and not stunReadyFlag then CastSpell(_E) end
  194.  
  195.         if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
  196.  
  197.             CastSpell(_R, ts.target.x, ts.target.z)
  198.  
  199.         end
  200.  
  201.         if myHero:GetDistance(ts.target) < 650 and existTibbers then
  202.  
  203.             CastSpell(_R,ts.target)
  204.  
  205.         end
  206.  
  207.          
  208.  
  209.     end
  210.  
  211. end
  212.  
  213.  
  214.  
  215. function OnCreateObj(object)
  216.  
  217.     if object.name == "StunReady.troy" then stunReadyFlag = true end
  218.  
  219.     if object.name == "BearFire_foot.troy" then existTibbers = true end
  220.  
  221. end
  222.  
  223.  
  224.  
  225. function OnDeleteObj(object)
  226.  
  227.     if object.name == "StunReady.troy" then stunReadyFlag = false end
  228.  
  229.     if object.name == "BearFire_foot.troy" then existTibbers = false end   
  230.  
  231. end
  232.  
  233.  
  234.  
  235. function OnWndMsg(msg,key)
  236.  
  237. end
  238.  
  239.  
  240.  
  241. function OnSendChat(msg)
  242.  
  243.     ts:OnSendChat(msg, "pri")
  244.  
  245. end
  246.  
  247.  
  248.  
  249. function DmgCalculation()
  250.  
  251.         local enemy = heroManager:GetHero(calculationenemy)
  252.  
  253.         if ValidTarget(enemy) then
  254.  
  255.             local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
  256.  
  257.             local qdamage = getDmg("Q",enemy,myHero)
  258.  
  259.             local wdamage = getDmg("W",enemy,myHero)
  260.  
  261.             local rdamage = getDmg("R",enemy,myHero)
  262.  
  263.             local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  264.  
  265.             local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  266.  
  267.             local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  268.  
  269.             local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  270.  
  271.             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)                         
  272.  
  273.             local onspelldamage = (LiandrysSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BlackfireSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
  274.  
  275.             local combo1 = onspelldamage
  276.  
  277.             local combo2 = onhitdmg + qdamage + wdamage + rdamage + dfgdamage + hxgdamage + bwcdamage + ignitedamage + onspelldamage
  278.  
  279.             if QREADY then
  280.  
  281.                 combo1 = combo1 + qdamage
  282.  
  283.             end
  284.  
  285.             if WREADY then
  286.  
  287.                 combo1 = combo1 + wdamage
  288.  
  289.             end
  290.  
  291.             if (RREADY and not existTibbers) then
  292.  
  293.                 combo1 = combo1 + rdamage
  294.  
  295.             end    
  296.  
  297.             if HXGREADY then              
  298.  
  299.                 combo1 = combo1 + hxgdamage    
  300.  
  301.             end
  302.  
  303.             if BWCREADY then
  304.  
  305.                 combo1 = combo1 + bwcdamage
  306.  
  307.             end
  308.  
  309.             if DFGREADY then        
  310.  
  311.                 combo1 = combo1*1.2 + dfgdamage            
  312.  
  313.             end        
  314.  
  315.             if IREADY then
  316.  
  317.                 combo1 = combo1 + ignitedamage
  318.  
  319.             end
  320.  
  321.             combo1 = combo1 + onhitdmg
  322.  
  323.             if combo1 >= enemy.health then killable[calculationenemy] = 1
  324.  
  325.             elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  326.  
  327.             else killable[calculationenemy] = 0 end
  328.  
  329.         end
  330.  
  331.         if calculationenemy == 1 then
  332.  
  333.             calculationenemy = heroManager.iCount
  334.  
  335.         else
  336.  
  337.             calculationenemy = calculationenemy-1
  338.  
  339.         end
  340.  
  341. end
  342.  
  343.  
  344.  
  345. function OnDraw()
  346.  
  347.     if AnnieConfig.drawcircles and not myHero.dead then
  348.  
  349.         DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x19A712)
  350.  
  351.         if ts.target ~= nil then
  352.  
  353.             for j=0, 5 do
  354.  
  355.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  356.  
  357.             end
  358.  
  359.         end
  360.  
  361.         for i=1, heroManager.iCount do
  362.  
  363.             local enemydraw = heroManager:GetHero(i)
  364.  
  365.             if ValidTarget(enemydraw) then
  366.  
  367.                 if killable[i] == 2 then
  368.  
  369.                     for j=0, 20 do
  370.  
  371.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  372.  
  373.                     end
  374.  
  375.                     PrintFloatText(enemydraw,0,"Skills are not available")
  376.  
  377.                 elseif killable[i] == 1 then
  378.  
  379.                     for j=0, 10 do
  380.  
  381.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  382.  
  383.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  384.  
  385.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  386.  
  387.                     end
  388.  
  389.                     PrintFloatText(enemydraw,0,"Kill him!")
  390.  
  391.                 end
  392.  
  393.             end
  394.  
  395.         end
  396.  
  397.     end
  398.  
  399. end
  400.  
  401.  
  402.  
  403. function objectIsValid(object)
  404.  
  405.    return object and object.valid and string.find(object.name,"Minion_") ~= nil and object.team ~= myHero.team and object.dead == false
  406.  
  407. end
  408.  
  409.  
  410.  
  411. function OnCreateObj(object)
  412.  
  413.    if objectIsValid(object) then table.insert(myObjectsTable, object) end
  414.  
  415. end
Advertisement
Add Comment
Please, Sign In to add comment