AnonymousBOL

SAC - Twisted Fate plugin v1.1

Jul 20th, 2013
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.97 KB | None | 0 0
  1. if myHero.charName ~= "TwistedFate" then return end
  2.  
  3. function PluginOnLoad()
  4.     --AutoCarry.PluginMenu:addParam("throwQ", "Harras enemy", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A")) -- useless, too hard to get someone hit by bot pred :c
  5.     AutoCarry.PluginMenu:addParam("autoQ", "AutoQ on stuned enemies", SCRIPT_PARAM_ONOFF, true)
  6.     AutoCarry.PluginMenu:addParam("selectgold", "Select Gold Card", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("W"))
  7.     AutoCarry.PluginMenu:addParam("selectblue", "Select Blue Card", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("E"))
  8.     AutoCarry.PluginMenu:addParam("selectred", "Select Red Card", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  9.     AutoCarry.PluginMenu:addParam("drawCircle", "Draw Q range", SCRIPT_PARAM_ONOFF, true)
  10.     AutoCarry.PluginMenu:addParam("drawArrow", "Draw arrow to killable hp enemies", SCRIPT_PARAM_ONOFF, true)
  11.     AutoCarry.PluginMenu:addParam("drawHealth", "Draw HP after GoldCard + Q combo", SCRIPT_PARAM_ONOFF, true)
  12.     AutoCarry.PluginMenu:addParam("selectgoldult", "Select gold card after ult", SCRIPT_PARAM_ONOFF, true)
  13.     --AutoCarry.PluginMenu:addParam("drawQpred", "Draw Q prediction on harras", SCRIPT_PARAM_ONOFF, true) -- cant do this with SAC I think :C
  14.     AutoCarry.PluginMenu:permaShow("autoQ")
  15.     PrintChat("<font color='#E97FA5'>>> TF Helper v2.0 - Rewritten as SAC Plugin!</font>")
  16.     AutoCarry.SkillsCrosshair.range = 1450
  17.     AutoCarry.OverrideCustomChampionSupport = true
  18.     SelectedCard = false
  19.     StackedE = false
  20. end
  21.  
  22. function PluginOnTick()
  23.     if NextCheck ~= nil then
  24.         if GetTickCount() > NextCheck then
  25.             if myHero:CanUseSpell(_W) == READY then
  26.                 if AutoCarry.PluginMenu.selectgold then if myHero:GetSpellData(_W).name == "goldcardlock" then CastSpellEx(_W) elseif myHero:GetSpellData(_W).name == "PickACard" then CastSpellEx(_W) end end
  27.                 if AutoCarry.PluginMenu.selectblue then if myHero:GetSpellData(_W).name == "bluecardlock" then CastSpellEx(_W) elseif myHero:GetSpellData(_W).name == "PickACard" then CastSpellEx(_W) end end
  28.                 if AutoCarry.PluginMenu.selectred then if myHero:GetSpellData(_W).name == "redcardlock" then CastSpellEx(_W) elseif myHero:GetSpellData(_W).name == "PickACard" then CastSpellEx(_W) end end
  29.             end
  30.             if SelectCardForUlt == true then
  31.                 if myHero:GetSpellData(_W).name == "goldcardlock" then
  32.                     CastSpellEx(_W)
  33.                     SelectCardForUlt = false
  34.                 elseif myHero:GetSpellData(_W).name == "PickACard" then
  35.                     CastSpellEx(_W)
  36.                 end
  37.             end
  38.             NextCheck = GetTickCount() + 250
  39.         end
  40.     else
  41.         NextCheck = 0
  42.     end
  43.     if AutoCarry.PluginMenu.autoQ then
  44.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  45.             if ValidTarget(enemy) and not enemy.canMove and GetDistance(enemy) < 1450 then
  46.                 CastSpell(_Q, enemy.x, enemy.z)
  47.             end
  48.         end
  49.     end
  50. end
  51.  
  52. function PluginOnProcessSpell(unit, spell)
  53.     if unit.isMe and spell.name == "gate" then if AutoCarry.PluginMenu.selectgoldult then SelectCardForUlt = true end end
  54. end
  55.  
  56. function PluginOnDraw()
  57.     if not myHero.dead and AutoCarry.PluginMenu.drawCircle then
  58.         DrawCircle(myHero.x, myHero.y, myHero.z, 1450, 0x540069)
  59.     end
  60.     if AutoCarry.PluginMenu.drawArrow and myHero:CanUseSpell(_R) == READY then
  61.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  62.             if ValidTarget(enemy) then
  63.                 local QDmg = myHero:CalcMagicDamage(enemy, math.floor((50*(myHero:GetSpellData(_R).level)+10+(0.65*myHero.ap))+0.5))
  64.                 local WDmg = myHero:CalcMagicDamage(enemy, math.floor((7.5*(myHero:GetSpellData(_R).level)+7.5+(0.4*myHero.ap)+myHero.damage)+0.5))
  65.                 local HPafter = enemy.health - (QDmg+WDmg)
  66.                 if HPafter <= 0 then
  67.                     local startPos = Vector(myHero.x,myHero.y,myHero.z)
  68.                     local endPos = Vector(enemy.x, enemy.y, enemy.z)
  69.                     DrawArrows(D3DXVECTOR3(startPos.x,startPos.y,startPos.z),D3DXVECTOR3(endPos.x,endPos.y,endPos.z),100,0xE97FA5,100)
  70.                 end
  71.             end
  72.         end
  73.     end
  74.     if AutoCarry.PluginMenu.drawHealth then
  75.         for i=1, heroManager.iCount do
  76.             local EnemyHero = heroManager:GetHero(i)
  77.             if ValidTarget(EnemyHero) then
  78.                 local QDmg = myHero:CalcMagicDamage(EnemyHero, math.floor((50*(myHero:GetSpellData(_Q).level)+10+(0.65*myHero.ap))+0.5))
  79.                 local WDmg = myHero:CalcMagicDamage(EnemyHero, math.floor((7.5*(myHero:GetSpellData(_W).level)+7.5+(0.4*myHero.ap)+myHero.damage)+0.5))
  80.                 local HPafter = EnemyHero.health - (QDmg+WDmg)
  81.                 if HPafter <= 0 then
  82.                     PrintFloatText(EnemyHero, 0, "Murder Him")
  83.                 elseif HPafter <= 300 then
  84.                     PrintFloatText(EnemyHero, 0, "Killable")
  85.                 else
  86.                     PrintFloatText(EnemyHero, 0, "Not Killable")
  87.                 end
  88.             end
  89.         end
  90.     end
  91. end
  92.  
  93. function PluginOnApplyParticle(unit, particle)
  94.     if unit then if unit.isMe then
  95.         local LastCard = "Red"
  96.         if particle.name == "Cardmaster_stackready.troy" then StackedE = true end end
  97.         if particle.name == "Card_Red.troy" then LastCard = "Red" end
  98.         if particle.name == "Card_Blue.troy" then LastCard = "Blue" end
  99.         if particle.name == "Card_Gold.troy" then LastCard = "Gold" end
  100.         if particle.name == "AnineSparks.troy" then
  101.             PickedCard = LastCard
  102.         end
  103.     end
  104. end
  105.  
  106. function PluginOnDeleteObj(obj)
  107.     if obj.name == "Cardmaster_stackready.troy" and GetDistance(obj, myHero) < 50 then StackedE = false end
  108.     if obj.name == "Card_Red.troy" or obj.name == "Card_Blue.troy" or obj.name == "Card_Gold.troy" then
  109.         if PickedCard ~= "None" then
  110.             PickedCard = "None"
  111.         end
  112.     end
  113. end
  114.  
  115. function PluginBonusLastHitDamage(minion)
  116.     local TotalBonus = 0
  117.     local EDmg = math.floor(30+(25*myHero:GetSpellData(_E).level)+(myHero.ap*0.4))
  118.     local GoldDmg = math.floor((7.5*(myHero:GetSpellData(_W).level)+7.5+(0.4*myHero.ap)+myHero.damage)+0.5)
  119.     local BlueDmg = math.floor((20*(myHero:GetSpellData(_W).level)+20+(0.4*myHero.ap)+myHero.damage)+0.5)
  120.     local RedDmg = math.floor((15*(myHero:GetSpellData(_W).level)+15+(0.4*myHero.ap)+myHero.damage)+0.5)
  121.     if StackedE == true then TotalBonus = EDmg end
  122.     if PickedCard == "Red" then TotalBonus = TotalBonus + RedDmg end
  123.     if PickedCard == "Blue" then TotalBonus = TotalBonus + BlueDmg end
  124.     if PickedCard == "Gold" then TotalBonus = TotalBonus + GoldDmg end
  125. end
Advertisement
Add Comment
Please, Sign In to add comment