naturus

sivir

Dec 23rd, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.25 KB | None | 0 0
  1. --[[        Auto Update     ]]
  2. local sversion = "1.1"
  3. local AUTOUPDATE = true
  4. local UPDATE_HOST = "raw.github.com"
  5. local UPDATE_PATH = "/BoLFantastik/BoL/master/Fantastik Sivir.lua".."?rand="..math.random(1,10000)
  6. local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
  7. local UPDATE_URL = "https://"..UPDATE_HOST..UPDATE_PATH
  8.  
  9. function AutoupdaterMsg(msg) print("<font color=\"#6699ff\"><b>Fantastik Sivir:</b></font> <font color=\"#FFFFFF\">"..msg..".</font>") end
  10. if AUTOUPDATE then
  11.     local ServerData = GetWebResult(UPDATE_HOST, "/BoLFantastik/BoL/master/version/Fantastik Sivir.version")
  12.     if ServerData then
  13.         ServerVersion = type(tonumber(ServerData)) == "number" and tonumber(ServerData) or nil
  14.         if ServerVersion then
  15.             if tonumber(sversion) < ServerVersion then
  16.                 AutoupdaterMsg("New version available"..ServerVersion)
  17.                 AutoupdaterMsg("Updating, please don't press F9")
  18.                 DelayAction(function() DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..sversion.." => "..ServerVersion.."), press F9 twice to load the updated version.") end) end, 3)
  19.             else
  20.                 AutoupdaterMsg("You have got the latest version ("..ServerVersion..")")
  21.             end
  22.         end
  23.     else
  24.         AutoupdaterMsg("Error downloading version info")
  25.     end
  26. end
  27.  
  28. local REQUIRED_LIBS =
  29.     {
  30.         ["VPrediction"] = "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua",
  31.         ["SOW"] = "https://raw.github.com/Hellsing/BoL/master/common/SOW.lua",
  32. --      if VIP_USER then ["Prodiction"] = "https://bitbucket.org/Klokje/public-klokjes-bol-scripts/raw/7f8427d943e993667acd4a51a39cf9aa2b71f222/Test/Prodiction/Prodiction.lua" end,
  33.     }      
  34. local DOWNLOADING_LIBS = false
  35. local DOWNLOAD_COUNT = 0
  36. local SELF_NAME = GetCurrentEnv() and GetCurrentEnv().FILE_NAME or ""
  37.  
  38. for DOWNLOAD_LIB_NAME, DOWNLOAD_LIB_URL in pairs(REQUIRED_LIBS) do
  39.     if FileExist(LIB_PATH .. DOWNLOAD_LIB_NAME .. ".lua") then
  40.         require(DOWNLOAD_LIB_NAME)
  41.     else
  42.         DOWNLOADING_LIBS = true
  43.         DOWNLOAD_COUNT = DOWNLOAD_COUNT + 1
  44.  
  45.         print("<font color=\"#00FF00\">Fantastik Sivir:</font><font color=\"#FFDFBF\"> Not all required libraries are installed. Downloading: <b><u><font color=\"#73B9FF\">"..DOWNLOAD_LIB_NAME.."</font></u></b> now! Please don't press [F9]!</font>")
  46.         print("Download started")
  47.         DownloadFile(DOWNLOAD_LIB_URL, LIB_PATH .. DOWNLOAD_LIB_NAME..".lua", AfterDownload)
  48.         print("Download finished")
  49.     end
  50. end
  51.  
  52. function AfterDownload()
  53.     DOWNLOAD_COUNT = DOWNLOAD_COUNT - 1
  54.     if DOWNLOAD_COUNT == 0 then
  55.         DOWNLOADING_LIBS = false
  56.         print("<font color=\"#00FF00\">Fantastik Sivir:</font><font color=\"#FFDFBF\"> Required libraries downloaded successfully, please reload (double [F9]).</font>")
  57.     end
  58. end
  59. if DOWNLOADING_LIBS then return end
  60.  
  61. --[[        Code        ]]
  62. local sauthor = "Fantastik"
  63. local QREADY, WREADY, EREADY, RREADY = false
  64. local Qrange, Qwidth, Qspeed, Qdelay = 1075, 85, 1350, 0.250
  65. local Rrange = 1000
  66. local ignite = nil
  67. local iDmg = 0
  68. local target = nil
  69. local ts
  70. local ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, Qrange, DAMAGE_PHYSICAL, true)
  71. local Announcer = ""
  72. local isSOW = false
  73. local isSAC = false
  74. local isMMA = false
  75.  
  76. --[[    Drawings    ]]
  77. TextList = {"Poke", "1 AA kill!", "2 AA kill!", "3 AA kill!", "Q kill!", "Q + 1 AA kill!", "Q + 2 AA kill!", "Q + 3 AA kill!", "Q + 4 AA kill!"}
  78. KillText = {}
  79. colorText = ARGB(255,255,204,0)
  80.  
  81. ----------------------------------------------
  82.  
  83. function GetCustomTarget()
  84.     ts:update()
  85.     if _G.MMA_Target and _G.MMA_Target.type == myHero.type then return _G.MMA_Target end
  86.     if _G.AutoCarry and _G.AutoCarry.Crosshair and _G.AutoCarry.Attack_Crosshair and _G.AutoCarry.Attack_Crosshair.target and _G.AutoCarry.Attack_Crosshair.target.type == myHero.type then return _G.AutoCarry.Attack_Crosshair.target end
  87.     return ts.target
  88. end
  89.  
  90. function OnLoad()
  91.     PrintChat("<font color=\"#00FF00\">Fantastik Sivir version ["..sversion.."] by Fantastik loaded.</font>")
  92.     if _G.MMA_Loaded ~= nil then
  93.         PrintChat("<font color = \"#00FF00\">Fantastik Sivir MMA Status:</font> <font color = \"#fff8e7\"> Loaded</font>")
  94.         isMMA = true
  95.     elseif _G.AutoCarry ~= nil then
  96.         PrintChat("<font color = \"#00FF00\">Fantastik Sivir SAC Status:</font> <font color = \"#fff8e7\"> Loaded</font>")
  97.         isSAC = true
  98.     else
  99.         isSOW = true
  100.     end
  101.     if _G.Evadeee_Loaded then
  102.     PrintChat("<font color=\"##58D3F7\"><b>Evadeee</b> found! You can use Evadeee integration!")
  103.     _G.Evadeee_Enabled = true
  104.     end
  105.     IgniteCheck()
  106.     SLoadLib()
  107.     Announcer()
  108. end
  109.  
  110.  
  111. function OnTick()
  112.     ts:update()
  113.     target = GetCustomTarget()
  114.     Checks()
  115.    
  116.   if ValidTarget(target) then
  117.         if SivMenu.Extra.KS then KS(target) end
  118.         if SivMenu.Extra.Ignite then AutoIgnite(target) end
  119.     end
  120.    
  121.    if SivMenu.combokey then
  122.         Combo()
  123.    end
  124.    if SivMenu.pokekey then
  125.         Poke()
  126.    end
  127.    if SivMenu.farmkey then
  128.         FarmQ()
  129.         FarmW()
  130.    end
  131.    if SivMenu.Extra.Evade then
  132.        EvadeeeHelper()
  133.    end
  134. end
  135.  
  136. function Checks()
  137.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  138.     WREADY = (myHero:CanUseSpell(_W) == READY)
  139.     EREADY = (myHero:CanUseSpell(_E) == READY)
  140.     RREADY = (myHero:CanUseSpell(_R) == READY)
  141.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  142.    
  143.     Qrangec = SivMenu.Combo.Qrangemin
  144.    
  145.     SkinHack()
  146.     if SivMenu.Extra.autolev.enabled then
  147.         AutoLevel()
  148.     end
  149.     calcDmg()
  150. end
  151.  
  152. function IgniteCheck()
  153.     if myHero:GetSpellData(SUMMONER_1).name:find("summonerdot") then
  154.             ignite = SUMMONER_1
  155.     elseif myHero:GetSpellData(SUMMONER_2).name:find("summonerdot") then
  156.             ignite = SUMMONER_2
  157.     end
  158. end
  159.  
  160. function OnDraw()
  161.     if SivMenu.Drawing.DrawAA and isSOW then
  162.      SOWi:DrawAARange()
  163.     end
  164.    
  165.    if SivMenu.Drawing.DrawQ then
  166.      if QREADY then
  167.      DrawCircle(myHero.x, myHero.y, myHero.z, Qrangec, 0xF7FE2E)
  168.      end
  169.    end
  170.    
  171.     if SivMenu.Drawing.DrawT then
  172.         for i = 1, heroManager.iCount do
  173.             local target = heroManager:GetHero(i)
  174.             if ValidTarget(target) and target ~= nil then
  175.                 local barPos = WorldToScreen(D3DXVECTOR3(target.x, target.y, target.z))
  176.                 local PosX = barPos.x - 35
  177.                 local PosY = barPos.y - 10
  178.                
  179.                 DrawText(TextList[KillText[i]], 16, PosX, PosY, colorText)
  180.             end
  181.         end
  182.     end
  183. end
  184.  
  185. function SLoadLib()
  186.     EnemyMinions = minionManager(MINION_ENEMY, Qrange, myHero, MINION_SORT_MAXHEALTH_DEC)
  187.     VP = VPrediction(true)
  188.     if isSOW then
  189.         SOWi = SOW(VP)
  190.     end
  191.     SMenu()
  192.     CurSkin = 0
  193. end
  194.  
  195. function SMenu()
  196.  
  197.     SivMenu = scriptConfig("Fantastik Sivir", "Sivir")
  198.     SivMenu:addParam("combokey", "Combo key(Space)", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  199.     SivMenu:addParam("pokekey", "Poke key(C)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  200.     SivMenu:addParam("farmkey", "Farm key(V)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V"))
  201.     SivMenu:addParam("Version", "Version", SCRIPT_PARAM_INFO, sversion)
  202.     SivMenu:addParam("Author", "Author", SCRIPT_PARAM_INFO, sauthor)
  203.    
  204.     SivMenu:addTS(ts)
  205.    
  206.     SivMenu:addSubMenu("Combo", "Combo")
  207.     SivMenu.Combo:addParam("comboQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  208.     SivMenu.Combo:addSubMenu("Use Q on:", "targets")
  209.     for _, enemy in ipairs(GetEnemyHeroes()) do
  210.         SivMenu.Combo.targets:addParam(enemy.charName, enemy.charName, SCRIPT_PARAM_ONOFF, true)
  211.     end
  212.     SivMenu.Combo:addParam("Qrangemin", "Min. range for Q ", SCRIPT_PARAM_SLICE, 950, 600, 1075, 0)
  213.     SivMenu.Combo:addParam("comboW", "Use W", SCRIPT_PARAM_ONOFF, true)
  214.     SivMenu.Combo:addParam("comboR", "Use R", SCRIPT_PARAM_ONOFF, true)
  215.     SivMenu.Combo:addParam("minEnemiesR", "Min. no. of enemies for R ", SCRIPT_PARAM_SLICE, 1, 1, 5, 0)
  216.     SivMenu.Combo:addParam("manapls", "Min. % mana for spells ", SCRIPT_PARAM_SLICE, 30, 1, 100, 0)
  217.    
  218.     SivMenu:addSubMenu("Poke", "Poke")
  219.     SivMenu.Poke:addParam("pokeQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  220.     SivMenu.Poke:addParam("manapls", "Min. % mana for spells ", SCRIPT_PARAM_SLICE, 30, 1, 100, 0)
  221.  
  222.     SivMenu:addSubMenu("Farm", "Farm")
  223.     SivMenu.Farm:addParam("farmQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  224.     SivMenu.Farm:addParam("farmW", "Use W", SCRIPT_PARAM_ONOFF, true)
  225.     SivMenu.Farm:addParam("manafarm", "Min. % mana to farm", SCRIPT_PARAM_SLICE, 30, 1, 100, 0)
  226.    
  227.     SivMenu:addSubMenu("Drawing", "Drawing")
  228.     if isSOW then
  229.     SivMenu.Drawing:addParam("DrawAA", "Draw AA Range", SCRIPT_PARAM_ONOFF, true)
  230.     end
  231.     SivMenu.Drawing:addParam("DrawQ", "Draw Q Range", SCRIPT_PARAM_ONOFF, true)
  232.     SivMenu.Drawing:addParam("DrawT", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  233.     if isSOW then
  234.         SivMenu:addSubMenu("Orbwalker", "Orbwalker")
  235.         SOWi:LoadToMenu(SivMenu.Orbwalker)
  236.     end
  237.    
  238.     SivMenu:addSubMenu("Extra", "Extra")
  239.     SivMenu.Extra:addParam("KS", "Auto Killsteal", SCRIPT_PARAM_ONOFF, true)
  240.     SivMenu.Extra:addParam("Ignite", "Use Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  241.     SivMenu.Extra:addParam("Hitchance", "Hitchance Combo", SCRIPT_PARAM_LIST, 2, {"LOW", "MEDIUM"})
  242.     SivMenu.Extra:addParam("HitchanceP", "Hitchance Poke", SCRIPT_PARAM_LIST, 2, {"LOW", "MEDIUM"})
  243.     SivMenu.Extra:addSubMenu("Auto level spells", "autolev")
  244.     SivMenu.Extra.autolev:addParam("enabled", "Enable auto level spells", SCRIPT_PARAM_ONOFF, false)
  245.     SivMenu.Extra.autolev:addParam("lvlseq", "Select your auto level sequence: ", SCRIPT_PARAM_LIST, 1, {"R>Q>W>E", "R>W>Q>E", "R>E>Q>W"})
  246.     SivMenu.Extra:addSubMenu("Skin Hack - VIP ONLY", "skinhax")
  247.     SivMenu.Extra.skinhax:addParam("enabled", "Enable Skin Hack", SCRIPT_PARAM_ONOFF, false)
  248.     SivMenu.Extra.skinhax:addParam("skinid", "Choose skin: ", SCRIPT_PARAM_LIST, 1, {"No Skin", "Warrior Princess", "Spectacular", "Huntress", "Bandit", "PAX", "Snowstorm"})
  249.     if _G.Evadeee_Loaded then
  250.         SivMenu.Extra:addParam("Evade", "Use Evadeee Integration", SCRIPT_PARAM_ONOFF, true)
  251.     end
  252.     if VIP_USER then
  253.         SivMenu.Extra:addParam("packetcast", "Use Packet Cast", SCRIPT_PARAM_ONOFF, false)
  254.     end
  255.     SivMenu:permaShow("combokey")
  256.     SivMenu:permaShow("pokekey")
  257.     SivMenu:permaShow("farmkey")
  258. end
  259.  
  260. function KS(Target)
  261.     if QREADY and getDmg("Q", Target, myHero) > Target.health then
  262.         local CastPos = VP:GetLineCastPosition(Target, Qdelay, Qwidth, Qrange, Qspeed, myHero, false)
  263.         if GetDistance(Target) <= Qrange and QREADY then
  264.             if not VIP_USER or not SivMenu.Extra.packetcast then
  265.                 CastSpell(_Q, CastPos.x, CastPos.z)
  266.             elseif VIP_USER and SivMenu.Extra.packetcast then
  267.                 PacketCast(_Q, CastPos)
  268.             end
  269.         end
  270.     end
  271. end
  272.  
  273. function AutoIgnite(enemy)
  274.     iDmg = ((IREADY and getDmg("IGNITE", enemy, myHero)) or 0)
  275.     if enemy.health <= iDmg and GetDistance(enemy) <= 600 and ignite ~= nil
  276.         then
  277.             if IREADY then CastSpell(ignite, enemy) end
  278.     end
  279. end
  280.  
  281. function EvadeeeHelper()
  282.     if _G.Evadeee_impossibleToEvade then
  283.         CastSpell(_E)
  284.     end
  285. end
  286.  
  287. function Combo()
  288.     if ValidTarget(target) and ManaManager() then
  289.         if QREADY and SivMenu.Combo.comboQ and SivMenu.Combo.targets[target.charName] then
  290.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Qdelay, Qwidth, Qrangec, Qspeed, myHero, false)
  291.             if HitChance >= SivMenu.Extra.Hitchance and GetDistance(CastPosition) <= Qrangec and QREADY then
  292.                 if not VIP_USER or not SivMenu.Extra.packetcast then
  293.                     CastSpell(_Q, CastPosition.x, CastPosition.z)
  294.                 elseif VIP_USER and SivMenu.Extra.packetcast then
  295.                     PacketCast(_Q, CastPosition)
  296.                 end
  297.             end
  298.         end
  299.         if RREADY and SivMenu.Combo.comboR and GetDistance(target) <= 600 then
  300.             CastR()
  301.         end
  302.     end
  303. end
  304.  
  305. function Poke()
  306.   if ValidTarget(target) and ManaManagerPoke() then
  307.         if SivMenu.Poke.pokeQ and QREADY and SivMenu.Combo.targets[target.charName] then
  308.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Qdelay, Qwidth, Qrange, Qspeed, myHero, false)
  309.             if HitChance >= SivMenu.Extra.HitchanceP and GetDistance(CastPosition) <= Qrange and QREADY then
  310.                 if not VIP_USER or not SivMenu.Extra.packetcast then
  311.                     CastSpell(_Q, CastPosition.x, CastPosition.z)
  312.                 elseif VIP_USER and SivMenu.Extra.packetcast then
  313.                     PacketCast(_Q, CastPosition)
  314.                 end
  315.             end
  316.         end
  317.     end
  318. end
  319.  
  320. function GetBestQPositionFarm()
  321.   local MaxQPos
  322.   local MaxQ = 0
  323.   for i, minion in pairs(EnemyMinions.objects) do
  324.     local hitQ = CountMinionsHit(minion)
  325.     if hitQ > MaxQ or MaxQPos == nil then
  326.       MaxQPos = minion
  327.       MaxQ = hitQ
  328.     end
  329.   end
  330.  
  331.   if MaxQPos then
  332.     return MaxQPos
  333.   else
  334.     return nil
  335.   end
  336. end
  337.  
  338. function CastQFarm(to)
  339.     if not VIP_USER or not SivMenu.Extra.packetcast then
  340.         CastSpell(_Q, to.x, to.z)
  341.     elseif VIP_USER and SivMenu.Extra.packetcast then
  342.         PacketCast(_Q, to)
  343.     end
  344. end
  345.  
  346. function FarmQ()
  347.     if ManaManagerFarm() then
  348.     EnemyMinions:update()
  349.     if SivMenu.Farm.farmQ then
  350.         if QREADY and #EnemyMinions.objects > 3 then
  351.             for i, minion in pairs(EnemyMinions.objects) do
  352.             if GetDistance(minion) < Qrange then
  353.                 local QPos = GetBestQPositionFarm()
  354.                 if QPos then
  355.                     CastQFarm(QPos)
  356.                 end
  357.             end
  358.         end
  359.     end
  360.     end
  361. end
  362. end
  363.  
  364. function FarmW()
  365.     if ManaManagerFarm() then
  366.     EnemyMinions:update()
  367.     if SivMenu.Farm.farmW then
  368.         if WREADY and #EnemyMinions.objects > 3 then
  369.             for i, minion in pairs(EnemyMinions.objects) do
  370.             if GetDistance(minion) < 500 then
  371.                 CastSpell(_W)
  372.             end
  373.         end
  374.     end
  375.     end
  376. end
  377. end
  378.  
  379. function OnProcessSpell(unit, spell)
  380. if unit == myHero and spell.name:lower():find("attack") then
  381.     if SivMenu.combokey and WREADY and SivMenu.Combo.comboW and GetDistance(target) <= 600 then
  382.         if not VIP_USER or not SivMenu.Extra.packetcast then
  383.             DelayAction(function() CastSpell(_W) end, spell.windUpTime + GetLatency() / 2000)
  384.         elseif VIP_USER and SivMenu.Extra.packetcast then
  385.             DelayAction(function() PacketCast(_W, myHero) end, spell.windUpTime + GetLatency() / 2000)
  386.         end
  387.     end
  388. end
  389. end
  390.  
  391. function ManaManagerFarm()
  392.     if myHero.mana >= myHero.maxMana * (SivMenu.Farm.manafarm / 100) then
  393.     return true
  394.     else
  395.     return false
  396.     end  
  397. end
  398.  
  399. function ManaManager()
  400.     if myHero.mana >= myHero.maxMana * (SivMenu.Combo.manapls / 100) then
  401.     return true
  402.     else
  403.     return false
  404.     end  
  405. end
  406.  
  407. function ManaManagerPoke()
  408.     if myHero.mana >= myHero.maxMana * (SivMenu.Poke.manapls / 100) then
  409.     return true
  410.     else
  411.     return false
  412.     end  
  413. end
  414.  
  415. function CastR()
  416.     if SivMenu.Combo.minEnemiesR <= CountEnemyHeroInRange(600) then
  417.         if not VIP_USER or not SivMenu.Extra.packetcast then
  418.             CastSpell(_R)
  419.         elseif VIP_USER and SivMenu.Extra.packetcast then
  420.             PacketCast(_R, myHero)
  421.         end
  422.     end
  423. end
  424.  
  425. function CountMinionsHit(QPos)
  426.   local LineEnd = Vector(myHero) + Qrange * (Vector(QPos) - Vector(myHero)):normalized()
  427.   local n = 0
  428.   for i, minion in pairs(EnemyMinions.objects) do
  429.     local pointSegment, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(Vector(myHero), LineEnd, minion)
  430.     if isOnSegment and GetDistance(minion, pointSegment) <= 85*1.25 then
  431.       n = n + 1
  432.     end
  433.   end
  434.   return n
  435. end
  436.  
  437. function AutoLevel()
  438.         if SivMenu.Extra.autolev.lvlseq == 1 then seq = {1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3}
  439.         elseif SivMenu.Extra.autolev.lvlseq == 2 then seq = {2, 1, 2, 3, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3}
  440.         elseif SivMenu.Extra.autolev.lvlseq == 3 then seq = {3, 1, 3, 2, 3, 4, 3, 1, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2,}
  441.         end
  442.         autoLevelSetSequence(seq)
  443. end
  444.  
  445. function SkinHack()
  446.     if SivMenu.Extra.skinhax.enabled and CurSkin ~= SivMenu.Extra.skinhax.skinid then
  447.         local SkinIdSwap = { [1] = 7, [2] = 1, [3] = 2, [4] = 3, [5] = 4, [6] = 5, [7] = 6 }
  448.         CurSkin = SivMenu.Extra.skinhax.skinid
  449.         SkinChanger(myHero.charName, SkinIdSwap[CurSkin])
  450.     end
  451. end
  452.  
  453. function SkinChanger(champ, skinId) -- Credits to shalzuth
  454.     p = CLoLPacket(0x97)
  455.     p:EncodeF(myHero.networkID)
  456.     p.pos = 1
  457.     t1 = p:Decode1()
  458.     t2 = p:Decode1()
  459.     t3 = p:Decode1()
  460.     t4 = p:Decode1()
  461.     p:Encode1(t1)
  462.     p:Encode1(t2)
  463.     p:Encode1(t3)
  464.     p:Encode1(bit32.band(t4,0xB))
  465.     p:Encode1(1)
  466.     p:Encode4(skinId)
  467.     for i = 1, #champ do
  468.         p:Encode1(string.byte(champ:sub(i,i)))
  469.     end
  470.     for i = #champ + 1, 64 do
  471.         p:Encode1(0)
  472.     end
  473.     p:Hide()
  474.     RecvPacket(p)
  475. end
  476.  
  477. function calcDmg()
  478.     for i=1, heroManager.iCount do
  479.         local target = heroManager:GetHero(i)
  480.         if ValidTarget(target) and target ~= nil then
  481.             qDmg = ((QREADY and getDmg("Q", target, myHero)) or 0)
  482.             aDmg = ((getDmg("AD", target, myHero)) or 0)
  483.             aDmg2 = (aDmg * 2)
  484.             aDmg3 = (aDmg * 3)
  485.             aDmg4 = (aDmg * 4)
  486.            
  487.             if target.health > (qDmg + aDmg4) then
  488.                 KillText[i] = 1
  489.             elseif target.health <= aDmg then
  490.                 KillText[i] = 2
  491.             elseif target.health <= aDmg2 then
  492.                 KillText[i] = 3
  493.             elseif target.health <= aDmg3 then
  494.                 KillText[i] = 4
  495.             elseif target.health <= qDmg then
  496.                 KillText[i] = 5
  497.             elseif target.health <= (qDmg + aDmg) then
  498.                 KillText[i] = 6
  499.             elseif target.health <= (qDmg + aDmg2) then
  500.                 KillText[i] = 7
  501.             elseif target.health <= (qDmg + aDmg3) then
  502.                 KillText[i] = 8
  503.             elseif target.health <= (qDmg + aDmg4) then
  504.                 KillText[i] = 9
  505.             end
  506.         end
  507.     end
  508. end
  509.  
  510. --[[    Announcer   ]]
  511. function AnnouncerMsg(msg) print("<font color=\"#6699ff\"><b>Fantastik Sivir Announce:</b></font> <font color=\"#FFFFFF\">"..msg.."</font>") end
  512. function Announcer()
  513.     local Announce
  514.     local AnnouncerData = GetWebResult(UPDATE_HOST, "/BoLFantastik/BoL/master/Announcer/Fantastik Sivir")
  515.     if AnnouncerData then
  516.         Announcer = AnnouncerData or nil
  517.         if Announcer then
  518.             AnnouncerMsg(""..Announcer.."")
  519.         end
  520.     end
  521. end
  522.  
  523. function PacketCast(spell, position)
  524.     Packet("S_CAST", {spellId = spell, fromX =  position.x, fromY =  position.z, toX =  position.x, toY =  position.z}):send()
  525. end
Advertisement
Add Comment
Please, Sign In to add comment