Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- AutoMorgana by x7x
- My first script with TS :) Combo: (Q - DFG - (if Q hits and target cant move)W - E - R)
- --Make sure you only use combos when you know it will hit target. Q might hit minion and then combo doesn't work(NO MINION PREDICTION).
- --In the Harass combo, it should cast everything, but Ult(R). (Q-W-E)
- --Harass, Ult toggle and Draw Range added by xkjtx (Also he made this script work again with prediction!!!)
- --Shield, when mouse is hovering over player press hot-key to shield added by xkjtx (3-14-2013)
- ]]
- if myHero.charName ~= "Morgana" then return end
- --require "AllClass"
- --require "spellDmg"
- local AArange = 450
- local QRange = 1200
- local QWidth = 200
- local DFGrange = 750
- local Wrange = 900
- local Erange = 755
- local Rrange = 600
- local ts = TargetSelector(TARGET_LOW_HP,QRange,DAMAGE_MAGIC,true) -- set to true to select target as option(true is Better for focusing)
- --local tq = TargetPrediction(QRange, 1.2, 0, 300, 50) -- not needed any more
- local DFGSlot = nil
- local DFGReady, QREADY, WReady, EReady, RReady = false, false, false, false, false
- -- more locals
- local AttackDelay = 0
- local travelDuration = nil
- local predic = nil
- local startAttackSpeed = 0.579
- local lastBasicAttack = 0
- local swing = 0
- local delay = 200
- local speed = 1.195
- local MorgCombo = 32 -- Space
- local MorgHarass = 83 -- letter 'S'
- local MorgUlt = 88 -- leter 'X' (Can toggle on/off)
- local MorgShield = string.byte("E") -- letter 'E' (Hold mouse over player and press hotkey)
- function OnLoad()
- MorgConfig = scriptConfig("Morgana Combo", "MorganaCombo")
- MorgConfig:addParam("active", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, MorgCombo) -- Space bar
- MorgConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, MorgHarass) -- S
- MorgConfig:addParam("shield", "Shield Ally/Self", SCRIPT_PARAM_ONKEYDOWN, false, MorgShield) -- E
- MorgConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- MorgConfig:addParam("useult", "Use Ultimate in Combo", SCRIPT_PARAM_ONKEYTOGGLE, false, MorgUlt) -- X -- Off by default
- MorgConfig:permaShow("active")
- MorgConfig:permaShow("harass")
- MorgConfig:permaShow("shield")
- MorgConfig:permaShow("useult")
- ts.name = "Morgana"
- MorgConfig:addTS(ts)
- lastBasicAttack = os.clock()
- --PrintChat(">> AutoMorgana loaded! Press shift to configure.")
- end
- function OnTick()
- ts:update()
- if myHero.dead then
- return
- end
- if ts.target ~= nil then
- travelDuration = (delay + GetDistance(myHero, ts.target)/speed)
- ts:SetPrediction(travelDuration)
- predic = ts.nextPosition
- AttackDelay = 1/(myHero.attackSpeed*startAttackSpeed)
- if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
- swing = 0
- end
- if MorgConfig.active or MorgConfig.harass then
- if GetDistance(ts.target)<=AArange+50 and swing == 0 then
- myHero:Attack(ts.target)
- end
- end
- end
- DFGSlot = GetInventorySlotItem(3128)
- DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WReady = (myHero:CanUseSpell(_W) == READY)
- EReady = (myHero:CanUseSpell(_E) == READY)
- RReady = (myHero:CanUseSpell(_R) == READY)
- --TargetPrediction__OnTick() -- not needed any more
- if MorgConfig.active and ts.target ~= nil and QREADY then
- --qpred = tq:GetPrediction(ts.target) -- not needed any more
- if predic ~= nil and GetDistance(ts.target) < QRange then
- CastSpell(_Q, predic.x, predic.z)
- end
- end
- if MorgConfig.active and myHero:CanUseSpell(_Q) == COOLDOWN and ts.target ~= nil then
- if GetDistance(ts.target) < DFGrange then
- if DFGReady then
- CastSpell(DFGSlot, ts.target)
- end
- end
- myHero:Attack(ts.target)
- if GetDistance(ts.target) < Wrange and ts.target.canMove == false then
- if WReady then
- CastSpell(_W, ts.target.x, ts.target.z)
- end
- end
- myHero:Attack(ts.target)
- if GetDistance(ts.target) < AArange then
- if EReady then
- CastSpell(_E)
- end
- end
- myHero:Attack(ts.target)
- if MorgConfig.useult and GetDistance(ts.target) < Rrange then
- if RReady then
- CastSpell(_R)
- end
- end
- end
- if MorgConfig.harass and ts.target ~= nil then
- myHero:Attack(ts.target)
- if predic ~= nil and GetDistance(ts.target) < QRange then
- CastSpell(_Q, predic.x, predic.z)
- end
- if EReady then
- CastSpell(_E)
- end
- if predic ~= nil and GetDistance(predic) < Wrange then
- if WReady then
- CastSpell(_W, predic.x, predic.z)
- end
- end
- end
- if not myHero.dead and MorgConfig.shield then
- -- added by xkjtx: given to by TRUS: this will cast E on self/ally while holding mouse over
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if hero.team == myHero.team and GetDistanceFromMouse(hero)<175 then -- how far mouse need to be from player/ally
- CastSpell(_E,hero)
- end
- end
- end
- end
- function OnDraw()
- --SC__OnDraw() -- not needed any more
- if not myHero.dead and MorgConfig.drawcircles then
- DrawCircle(myHero.x, myHero.y, myHero.z, AArange, 0xFF0000) -- Redish(Attack Range) always on
- if myHero:CanUseSpell(_Q) == READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x000099) -- Blueish(Q Range) only on when off CD
- end
- if myHero:CanUseSpell(_W) == READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, Wrange, 0x009933) -- Greenish(W Range) only on when off CD
- end
- if myHero:CanUseSpell(_E) == READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, Erange, 0xFF9933) -- Orangeish(E range) only on when off CD
- end
- if DFGReady then
- DrawCircle(myHero.x, myHero.y, myHero.z, DFGrange, 0xFFCC00) -- Yellowish(real DFG range) only on when off CD
- end
- if ts ~= nil and ts.target ~= nil then
- for j=0, 10 do
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, (GetDistance(ts.target.minBBox, ts.target.maxBBox)/2) + j*1.5, 0x660066)
- --DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x660066) -- purpleish -- changed from 0x00FF00
- end
- if predic ~= nil then
- DrawCircle(predic.x, predic.y, predic.z, 100, 0x000099) -- blueish (Prediction Point) Only on target
- end
- end
- end
- end
- function OnProcessSpell(unit, spell)
- if unit.isMe and spell and string.find(string.lower(spell.name),"attack") then
- swing = 1
- lastBasicAttack = os.clock()
- end
- end
- function OnWndMsg(msg,key)
- --SC__OnWndMsg(msg,key) -- not needed any more
- end
- function OnSendChat(msg)
- --TargetSelector__OnSendChat(msg) -- not needed any more
- ts:OnSendChat(msg, "pri")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement