16HeX16

Diana - Scorn of the Moon 1.1.1

Mar 30th, 2013
3,758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.86 KB | None | 0 0
  1. -- ############################################################################################
  2. -- ##                               Diana - Scorn of the Moon 1.1.1                            ##
  3. -- ##                                      by HeX                                            ##
  4. -- ############################################################################################
  5.  
  6. -- ############################################################################################
  7. -- ##                                       Killable Marks                                         ##
  8. -- ############################################################################################
  9. -- ## Green circle: Marks the current target to which you will do the combo                  ##
  10. -- ## Blue circle: Killed with a combo, if all the skills were available                     ##
  11. -- ## Red circle: Killed using Items + 3 Attacks(Including Passive) + Q + W + R + Ignite     ##
  12. -- ## 2 Red circles: Killed using Items + Q + W + R + Ignite                                 ##
  13. -- ## 3 Red circles: Killed using Q + R                                                      ##
  14. -- ############################################################################################
  15. if myHero.charName ~= "Diana" then return end
  16.  
  17. --[[    Ranges  ]]--
  18. local aaRange = 400
  19. local qRange = 1100
  20. local wRange = 250
  21. local eRange = 400
  22. local eBuffer = 225
  23. local rRange = 825
  24. --[[    Moonlight   ]]--
  25. local MoonLightEnemy = {}
  26. local MoonLightTS = 0
  27. local MoonLight = false
  28. --[[    Damage Calculation  ]]--
  29. local waittxt = {}
  30. local calculationenemy = 1
  31. local floattext = {"Skills are not available","Able to fight","Killable","Murder him!"}
  32. local killable = {}
  33. --[[    Prediction  ]]--
  34. local tp = TargetPrediction(qRange, 1800, 250)
  35. --[[    Ready   ]]--
  36. local ignite = nil
  37. local QREADY, WREADY, EREADY, RREADY = false, false, false, false
  38. local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = nil, nil, nil, nil, nil, nil, nil, nil
  39. local BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY, YGBREADY, IREADY = false, false, false, false, false, false, false, false, false
  40.  
  41. function OnLoad()
  42.     Menu()
  43. end
  44.  
  45. function OnTick()
  46.     ts:update()
  47.     ReadyCheck()
  48.     --[[    Prediction  ]]--
  49.     if ts.target ~= nil then
  50.         qPred = tp:GetPrediction(ts.target)
  51.     end
  52.     --[[    Combos  ]]--
  53.     if ts.index ~= nil then MoonLightTS = MoonLightEnemy[ts.index] end
  54.     if DCConfig.TeamFight and ts.target then
  55.         UseItems(ts.target)
  56.         TeamFight(ts.target)
  57.     end
  58.     if DCConfig.BurstCombo and ts.target then
  59.         UseItems(ts.target)
  60.         BurstCombo(ts.target)
  61.     end
  62.     --[[    Harass  ]]--
  63.     if DCConfig.Harass and ts.target then
  64.         Harass(ts.target)
  65.     end
  66.     --[[    Ignite  ]]--
  67.     if DCConfig.autoignite then
  68.         AutoIgnite()
  69.     end
  70. end
  71.  
  72. function OnDraw()
  73.     Draw()
  74. end
  75.  
  76. --[[                                                                                    CODE                                                                                ]]--
  77. --[[    Functions   ]]--
  78. function Menu()
  79.     PrintChat("<font color='#CCCCCC'> >> Diana - Scorn of the Moon 1.1.1 loaded! <<</font>")
  80.     DCConfig = scriptConfig("Diana Combo", "DianaCombo")
  81.     DCConfig:addParam("TeamFight", "Basic Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  82.     DCConfig:addParam("BurstCombo", "Burst Combo", SCRIPT_PARAM_ONKEYDOWN, false, 90)
  83.     DCConfig:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  84.     DCConfig:addParam("autoignite", "Auto Ignite killable", SCRIPT_PARAM_ONOFF, true)
  85.     DCConfig:addParam("ultKS", "Use ultimate to kill", SCRIPT_PARAM_ONOFF, false)
  86.     DCConfig:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
  87.     DCConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, true)
  88.     DCConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, true)
  89.     DCConfig:addParam("drawText", "Draw Text - Enemy", SCRIPT_PARAM_ONOFF, true)
  90.     DCConfig:permaShow("TeamFight")
  91.     DCConfig:permaShow("BurstCombo")
  92.     DCConfig:permaShow("Harass")
  93.    
  94.     ts = TargetSelector(TARGET_LOW_HP,qRange+100,DAMAGE_MAGIC)
  95.     ts.name = "Diana"
  96.     DCConfig:addTS(ts)
  97.    
  98.     for i=1, heroManager.iCount do
  99.         MoonLightEnemy[i] = 0
  100.         waittxt[i] = i*3
  101.     end
  102.    
  103.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  104.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  105.     end
  106. end
  107.  
  108. --[[    Auto Ignite ]]--
  109. function AutoIgnite()
  110.     if IREADY then
  111.         local ignitedmg = 0    
  112.         for i = 1, heroManager.iCount, 1 do
  113.             local enemyhero = heroManager:getHero(i)
  114.             if ValidTarget(enemyhero, 600) then
  115.                 ignitedmg = 50 + 20 * myHero.level
  116.                 if enemyhero.health <= ignitedmg then
  117.                     CastSpell(ignite, enemyhero)
  118.                 end
  119.             end
  120.         end
  121.     end
  122. end
  123.  
  124. --[[    Ready and Items ]]--
  125. function ReadyCheck()
  126.     BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074),  GetInventorySlotItem(3143), GetInventorySlotItem(3142)
  127.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  128.     WREADY = (myHero:CanUseSpell(_W) == READY)
  129.     EREADY = (myHero:CanUseSpell(_E) == READY)
  130.     RREADY = (myHero:CanUseSpell(_R) == READY)
  131.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  132.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  133.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  134.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  135.     TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
  136.     RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
  137.     RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  138.     YGBREADY = (YGBSlot ~= nil and myHero:CanUseSpell(YGBSlot) == READY)
  139.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  140. end
  141.  
  142. function UseItems(target)
  143.     if GetDistance(target) < 550 then
  144.         if DFGREADY then CastSpell(DFGSlot, target) end
  145.         if HXGREADY then CastSpell(HXGSlot, target) end
  146.         if BWCREADY then CastSpell(BWCSlot, target) end
  147.         if BRKREADY then CastSpell(BRKSlot, target) end
  148.         if YGBREADY then CastSpell(YGBSlot, target) end
  149.         if TMTREADY and GetDistance(target) < 275 then CastSpell(TMTSlot) end
  150.         if RAHREADY and GetDistance(target) < 275 then CastSpell(RAHSlot) end
  151.         if RNDREADY and GetDistance(target) < 275 then CastSpell(RNDSlot) end
  152.     end
  153. end
  154.  
  155. --[[    Combos  ]]--
  156. function TeamFight(target)
  157.     RDMG =  getDmg("R", target, myHero)
  158.     if qPred ~= nil and QREADY and GetDistance(qPred) <= qRange then
  159.         CastSpell(_Q, qPred.x, qPred.z)
  160.         myHero:Attack(target)
  161.     end
  162.     if WREADY and GetDistance(target) <= wRange then
  163.         CastSpell(_W)
  164.     end
  165.     if EREADY and GetDistance(target) > eBuffer and GetDistance(target) < eRange and DCConfig.useE then
  166.         CastSpell(_E)
  167.     end
  168.     if RREADY and MoonLightEnemy[ts.index] == true and GetDistance(target) <= rRange then
  169.         CastSpell(_R, target)
  170.         CastSpell(_W)
  171.         elseif DCConfig.ultKS and RREADY and ts.target.health < RDMG and GetDistance(target) <= rRange then
  172.         CastSpell(_R, target)
  173.     end
  174.     if GetDistance(target) <= aaRange then
  175.         myHero:Attack(target)
  176.     end
  177. end
  178.  
  179. function BurstCombo(target)
  180.     if qPred ~= nil and QREADY and GetDistance(qPred) <= qRange then
  181.         CastSpell(_Q, qPred.x, qPred.z)
  182.         myHero:Attack(target)
  183.         QTick = GetTickCount()
  184.         RDelay = (250 + (GetDistance(qPred)/1.8))
  185.     end
  186.     if WREADY and GetDistance(target) <= wRange then
  187.         CastSpell(_W)
  188.     end
  189.     if EREADY and GetDistance(target) > eBuffer and GetDistance(target) < eRange and DCConfig.useE then
  190.         CastSpell(_E)
  191.     end
  192.     if RREADY and GetDistance(target) <= rRange and QTick ~= nil then
  193.         if GetTickCount() - QTick >= RDelay-400 and MoonLight == false then
  194.             CastSpell(_W)
  195.             CastSpell(_R, target)
  196.             MoonLight = true
  197.         end
  198.     end
  199.     if GetDistance(target) <= aaRange then
  200.         myHero:Attack(target)
  201.     end
  202. end
  203.  
  204. --[[    Harass  ]]--
  205. function Harass(target)
  206.     if qPred ~= nil and QREADY and GetDistance(qPred) <= qRange then
  207.         CastSpell(_Q, qPred.x, qPred.z)
  208.     end
  209. end
  210.  
  211. --[[    OnDraw  ]]--
  212. function Draw()
  213.     if tick == nil or GetTickCount()-tick>=100 then
  214.         tick = GetTickCount()
  215.         DmgCalculation()
  216.     end
  217.     if DCConfig.drawcirclesSelf and not myHero.dead then
  218.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x19A712)
  219.         DrawCircle(myHero.x, myHero.y, myHero.z, eRange, 0x00CCCC)
  220.     end
  221.     if DCConfig.drawcirclesEnemy and ts.target ~= nil then
  222.         for j=0, 10 do
  223.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  224.         end
  225.     end
  226.     for i=1, heroManager.iCount do
  227.         local enemydraw = heroManager:GetHero(i)
  228.         if ValidTarget(enemydraw) then
  229.             if DCConfig.drawcirclesEnemy then
  230.                 if killable[i] == 1 then
  231.                     for j=0, 20 do
  232.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  233.                     end
  234.                     elseif killable[i] == 2 then
  235.                     for j=0, 10 do
  236.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  237.                     end
  238.                     elseif killable[i] == 3 then
  239.                     for j=0, 10 do
  240.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  241.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  242.                     end
  243.                     elseif killable[i] == 4 then
  244.                     for j=0, 10 do
  245.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  246.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  247.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  248.                     end
  249.                 end
  250.             end
  251.             if DCConfig.drawText and waittxt[i] == 1 and killable[i] ~= 0 then
  252.                 PrintFloatText(enemydraw,0,floattext[killable[i]])
  253.             end
  254.         end
  255.         if waittxt[i] == 1 then waittxt[i] = 30
  256.             else waittxt[i] = waittxt[i]-1
  257.         end
  258.     end
  259. end
  260.  
  261. --[[    Ultimate Refresh    ]]--
  262. function OnCreateObj(Object)
  263.     if Object.name:find("Diana_Q_moonlight_champ.troy") then
  264.         for i=1, heroManager.iCount do
  265.             local enemy = heroManager:GetHero(i)
  266.             if enemy.team ~= myHero.team and GetDistance(Object, enemy) < 50 then
  267.                 MoonLightEnemy[i] = true
  268.             end
  269.         end
  270.     end
  271. end
  272.  
  273. function OnProcessSpell(unit, spell)
  274.     if unit.isMe and spell.name == "DianaArc" then MoonLight = false end
  275. end
  276.  
  277. function OnDeleteObj(Object)
  278.     if Object.name:find("Diana_Q_moonlight_champ.troy") then
  279.         for i=1, heroManager.iCount do
  280.             local enemy = heroManager:GetHero(i)
  281.             if enemy.team ~= myHero.team and GetDistance(Object, enemy) < 50 then
  282.                 MoonLightEnemy[i] = false
  283.             end
  284.         end
  285.     end
  286. end
  287.  
  288. --[[    Damage Calculation  ]]--
  289. function DmgCalculation()
  290.     local enemy = heroManager:GetHero(calculationenemy)
  291.     if ValidTarget(enemy) then
  292.         local ignitedamage, dfgdamage, hxgdamage, bwcdamage, brkdamage, tmtdamage, rahdamage = 0, 0, 0, 0, 0, 0, 0
  293.         local pdamage = getDmg("P",enemy,myHero)
  294.         local qdamage = getDmg("Q",enemy,myHero)
  295.         local wdamage = getDmg("W",enemy,myHero)
  296.         local rdamage = getDmg("R",enemy,myHero,1)
  297.         local hitdamage = getDmg("AD",enemy,myHero)
  298.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  299.         local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  300.         local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  301.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  302.         local brkdamage = (BRKSlot and getDmg("RUINEDKING",enemy,myHero) or 0)
  303.         local tmtdamage = (TMTSlot and getDmg("TIAMAT",enemy,myHero) or 0)
  304.         local rahdamage = (RAHSlot and getDmg("HYDRA",enemy,myHero) or 0)
  305.         local combo1 = hitdamage*2 + pdamage + qdamage + wdamage + rdamage
  306.         local combo2 = hitdamage*2 + pdamage
  307.         local combo3 = 0
  308.         local combo4 = 0
  309.     if QREADY then
  310.         combo2 = combo2 + qdamage
  311.         combo3 = combo3 + qdamage
  312.         combo4 = combo4 + qdamage
  313.         end
  314.     if WREADY then
  315.         combo2 = combo2 + wdamage
  316.         combo3 = combo3 + wdamage
  317.     end
  318.     if RREADY then
  319.         combo2 = combo2 + rdamage
  320.         combo3 = combo3 + rdamage
  321.         combo4 = combo4 + rdamage
  322.     end
  323.     if DFGREADY then
  324.         combo1 = combo1 + dfgdamage
  325.         combo2 = combo2 + dfgdamage
  326.         combo3 = combo3 + dfgdamage
  327.     end
  328.     if HXGREADY then
  329.         combo1 = combo1 + hxgdamage
  330.         combo2 = combo2 + hxgdamage
  331.         combo3 = combo3 + hxgdamage
  332.     end
  333.     if BWCREADY then
  334.         combo1 = combo1 + bwcdamage
  335.         combo2 = combo2 + bwcdamage
  336.         combo3 = combo3 + bwcdamage
  337.     end
  338.     if BRKREADY then
  339.         combo1 = combo1 + brkdamage
  340.         combo2 = combo2 + brkdamage
  341.         combo3 = combo3 + brkdamage
  342.     end
  343.     if TMTREADY then
  344.         combo1 = combo1 + tmtdamage
  345.         combo2 = combo2 + tmtdamage
  346.         combo3 = combo3 + tmtdamage
  347.     end
  348.     if RAHREADY then
  349.         combo1 = combo1 + rahdamage
  350.         combo2 = combo2 + rahdamage
  351.         combo3 = combo3 + rahdamage
  352.     end
  353.     if IREADY then
  354.         combo1 = combo1 + ignitedamage
  355.         combo2 = combo2 + ignitedamage
  356.         combo3 = combo3 + ignitedamage
  357.     end
  358.     if combo4 >= enemy.health then killable[calculationenemy] = 4
  359.         elseif combo3 >= enemy.health then killable[calculationenemy] = 3
  360.         elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  361.         elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  362.         else killable[calculationenemy] = 0 end
  363.     end
  364.     if calculationenemy == 1 then calculationenemy = heroManager.iCount
  365.         else calculationenemy = calculationenemy-1
  366.     end
  367. end
Advertisement
Add Comment
Please, Sign In to add comment