Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if myHero.charName ~= "Trundle" then return end
- require 'OnWindUp'
- require 'VPrediction'
- local VP = VPrediction()
- local qRange, wRange, eRange, rRange = 300, 900, 1000, 700
- function OnLoad()
- PrintChat("<font color='#CCCCCC'> >> Trundle - Time to Troll loaded <<</font>")
- TrundleConfig = scriptConfig("Trundle - Time to Troll", "Trundle_Time_to_Troll")
- TrundleConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- TrundleConfig:addParam("pillarBlock", "Block with Pillar", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("G"))
- TrundleConfig:addParam("useUlt", "Use Ultimate in Combo", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("H"))
- TrundleConfig:addParam("dynaPillar", "Dynamic Pillar Control", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("T"))
- TrundleConfig:permaShow("dynaPillar")
- TrundleConfig:permaShow("useUlt")
- ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, qRange+100, DAMAGE_PHYSICAL, true)
- es = TargetSelector(TARGET_LESS_CAST_PRIORITY, eRange+100, DAMAGE_PHYSICAL, true)
- ts.name = "Trundle"
- TrundleConfig:addTS(ts)
- end
- function OnTick()
- ts:update()
- es:update()
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- if EREADY and TrundleConfig.pillarBlock then
- if ts.target then
- BlockwithPillar(ts.target)
- elseif es.target then
- BlockwithPillar(es.target)
- end
- end
- if TrundleConfig.scriptActive then
- if ts.target then
- if QREADY and GetDistance(ts.target) < qRange then
- if ts.target.health <= getDmg("Q", ts.target, myHero) then CastSpell(_Q) end
- end
- if WREADY then
- if GetDistance(ts.target) <= 400 then
- CastSpell(_W, myHero.x, myHero.z)
- elseif GetDistance(ts.target) >= 400 and GetDistance(ts.target) <= wRange then
- CastSpell(_W, ts.target.x, ts.target.z)
- end
- end
- if EREADY and ts.target.health <= ts.target.maxHealth*0.25 then
- BlockwithPillar(ts.target)
- end
- if RREADY and TrundleConfig.useUlt and GetDistance(ts.target) < rRange then
- CastSpell(_R, ts.target)
- end
- elseif es.target and es.target.health <= es.target.maxHealth*0.25 then
- BlockwithPillar(es.target)
- end
- end
- end
- function OnWindUp(unit, attack)
- if unit.isMe and ts.target and GetDistance(ts.target) < 225 then CastSpell(_Q) end
- end
- function BlockwithPillar(target)
- if TrundleConfig.dynaPillar then
- local ePred, HitChance = VP:GetCircularCastPosition(target, 0.25, 120, eRange)
- if ePred then
- local blockPos = ePred + (Vector(myHero) - ePred):normalized()*50
- if blockPos then CastSpell(_E, blockPos.x, blockPos.z) end
- end
- else
- local blockPos = target + (Vector(myHero) - target):normalized()*75
- if blockPos then CastSpell(_E, blockPos.x, blockPos.z) end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment