Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Thresh the beast v1.0
- -- Grabbed 99% code from the Blitz script by burn
- - Modded to work for Thresh by xkjtx
- - Features:
- - Combo (spells will cast only in range) Q-E-R and it will try to AA when
- ever possible.
- - Harass will harass with Q and if Q hits then it will E-Auto-Attack
- - Damage calculation, for combos you could do to kill the target. It will
- display red circles and text.
- -- Todo:
- - Auto kill with E or R (maybe even Q.. :-))
- -
- ]]
- if myHero.charName ~= "Thresh" then return end
- local player = GetMyHero()
- local playing_AD = true --<-- CHANGE THIS TO 'true' IF YOU WANT TO PLAY AD OR TO 'false' IF PLAYING AP <------------- <------------- <-------------
- local attackrange = 475
- local qrange = 1025 -- lowered to stop missing..
- local wrange = 950
- local erange = 375
- local ultirange = 450
- local waittxt = {}
- local floattext = {"Skills are not available","Able to fight","Killable","Murder Now!"}
- local killable = {}
- local calculationenemy = 1
- local ignite = nil
- local SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil
- local QREADY, WREADY, EREADY, RREADY, IREADY = false, false, false, false, false
- -- better Q prediction
- local delay = 250
- local qspeed = 1.525
- local travelDuration = 600
- -- hot keys
- local comboKey = 32 -- Space Bar
- local grabKey = string.byte("S") -- letter S
- local useUltKey = string.byte("X") -- letter X
- local moveKey = string.byte("V") -- letter V
- local minionCol = string.byte("U") -- letter U
- function OnLoad()
- PrintChat(">> Thresh Combo 1.0 loaded!")
- ThreConfig = scriptConfig("Thresh", "threshcombo")
- ThreConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, comboKey)
- ThreConfig:addParam("grabQ", "Grab Q", SCRIPT_PARAM_ONKEYDOWN, false, grabKey) -- S
- ThreConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- ThreConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
- ThreConfig:addParam("useUlti", "Toggle Use Ultimate in Combo", SCRIPT_PARAM_ONKEYTOGGLE, true, useUltKey) -- X
- ThreConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, false) -- Of by default(I use my own)
- ThreConfig:addParam("MoveToMouse", "Move to Mouse: Hot Key toggle", SCRIPT_PARAM_ONKEYTOGGLE, false, moveKey) -- V -- Off by default(will only work with harass)(when On, Nautilus will not AA while moving, but will cast all spells)
- ThreConfig:addParam("checkCollision", "Use minion collision", SCRIPT_PARAM_ONKEYTOGGLE, false, minionCol) -- U -- off by default(FPS DROP) (when off it will grab minions in the way so watch out)
- ThreConfig:permaShow("scriptActive")
- ThreConfig:permaShow("grabQ")
- ThreConfig:permaShow("useUlti")
- ThreConfig:permaShow("MoveToMouse")
- ThreConfig:permaShow("checkCollision")
- if playing_AD == true then
- ts = TargetSelector(TARGET_LOW_HP,qrange,DAMAGE_PHYSICAL)
- else
- ts = TargetSelector(TARGET_LOW_HP,qrange,DAMAGE_MAGIC)
- end
- ts.name = "Thresh"
- ThreConfig:addTS(ts)
- if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
- for i=1, heroManager.iCount do waittxt[i] = i*3 end
- end
- function OnTick()
- ts:update()
- if myHero.dead then return end
- if ts.target ~= nil then
- travelDuration = (delay + GetDistance(myHero, ts.target)/qspeed)
- end
- ts:SetPrediction(travelDuration)
- if (ts.target ~= nil or myHero:CanUseSpell(_Q) == READY) then predic = ts.nextPosition end
- SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- if tick == nil or GetTickCount()-tick>=100 then
- tick = GetTickCount()
- SCDmgCalculation()
- end
- if ThreConfig.MoveToMouse and ThreConfig.grabQ then
- player:MoveTo(mousePos.x, mousePos.z) -- move to mouse(when On, Nautilus will not AA while moving, but will cast all spells)
- end
- if ThreConfig.autoignite then
- if IREADY then
- local ignitedmg = 0
- for j = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(j)
- if ValidTarget(enemyhero,600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= ignitedmg then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end
- if ThreConfig.grabQ and ts.target ~= nil then
- if ThreConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange and not GetMinionCollision(myHero,ts.nextPosition, 180) then
- CastSpell(_Q, predic.x, predic.z)
- elseif not ThreConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange then
- CastSpell(_Q, predic.x, predic.z)
- end
- if (EREADY or WREADY) and GetDistance(ts.target) <= wrange then
- CastSpell(_E, mousePos.x, mousePos.z)
- --CastSpell(_W)
- myHero:Attack(ts.target)
- end
- end
- if ThreConfig.scriptActive then
- if ts.target ~= nil then
- if ThreConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange and not GetMinionCollision(myHero,ts.nextPosition, 180) then
- CastSpell(_Q, predic.x, predic.z)
- elseif not ThreConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange then
- CastSpell(_Q, predic.x, predic.z)
- end
- if EREADY and GetDistance(ts.target) <= erange then
- CastSpell(_E, ts.target.x, ts.target.z)
- end
- --if WREADY and GetDistance(ts.target) <= wrange then
- --CastSpell(_W)
- --end
- if GetDistance(ts.target) <= attackrange then
- myHero:Attack(ts.target)
- end
- if ThreConfig.useUlti and RREADY and GetDistance(ts.target) < ultirange then
- CastSpell(_R, ts.target)
- end
- end
- end
- end
- function SCDmgCalculation()
- local enemy = heroManager:GetHero(calculationenemy)
- if ValidTarget(enemy) then
- local ignitedamage, Sheendamage, Trinitydamage = 0, 0, 0
- local qdamage = getDmg("Q",enemy,myHero)
- local edamage = getDmg("E",enemy,myHero)
- local rdamage = getDmg("R",enemy,myHero,1)
- local hitdamage = getDmg("AD",enemy,myHero)
- local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
- local Sheendamage = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)
- local Trinitydamage = (TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)
- local combo1 = hitdamage*2 + qdamage + edamage + rdamage + Sheendamage + Trinitydamage
- local combo2 = hitdamage*2 + Sheendamage + Trinitydamage
- local combo3 = hitdamage*1 + Sheendamage + Trinitydamage
- local combo4 = 0
- if QREADY then
- combo2 = combo2 + qdamage
- combo3 = combo3 + qdamage
- end
- if EREADY then
- combo2 = combo2 + edamage
- combo3 = combo3 + edamage
- end
- if RREADY then
- combo2 = combo2 + rdamage
- combo4 = combo4 + rdamage
- end
- if IREADY then
- combo1 = combo1 + ignitedamage
- combo2 = combo2 + ignitedamage
- combo3 = combo3 + ignitedamage
- end
- if combo4 >= enemy.health then killable[calculationenemy] = 4
- elseif combo3 >= enemy.health then killable[calculationenemy] = 3
- elseif combo2 >= enemy.health then killable[calculationenemy] = 2
- elseif combo1 >= enemy.health then killable[calculationenemy] = 1
- else killable[calculationenemy] = 0 end
- end
- if calculationenemy == 1 then calculationenemy = heroManager.iCount
- else calculationenemy = calculationenemy-1 end
- end
- function OnDraw()
- if ThreConfig.drawcircles and not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, attackrange, 0xCCFF99)
- DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0xCCFF33)
- DrawCircle(myHero.x, myHero.y, myHero.z, ultirange, 0xFF6600)
- if ts ~= nil and ts.target ~= nil then
- for j=0, 10 do
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
- end
- end
- for i=1, heroManager.iCount do
- local enemydraw = heroManager:GetHero(i)
- if ValidTarget(enemydraw) then
- if ThreConfig.drawcircles then
- if killable[i] == 1 then
- for j=0, 20 do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
- end
- elseif killable[i] == 2 then
- for j=0, 10 do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
- end
- elseif killable[i] == 3 then
- for j=0, 10 do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
- end
- elseif killable[i] == 4 then
- for j=0, 10 do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
- end
- end
- end
- if ThreConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
- PrintFloatText(enemydraw,0,floattext[killable[i]])
- end
- end
- if waittxt[i] == 1 then waittxt[i] = 30
- else waittxt[i] = waittxt[i]-1 end
- end
- end
- end
- function OnSendChat(msg)
- ts:OnSendChat(msg, "pri")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement