Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if GetMyHero().charName ~= "Karma" then return end
- -- Setting
- local QRange = 950
- local WRange = 675
- local ERange = 800
- local RRange = 0
- local NRange = 525
- local comborange = 800
- local eren = 400
- abilitySequence = {1,3,2,1,1,4,1,3,3,1,4,3,3,2,2,4,2,2}
- local travelDuration = 0
- local predic = nil
- local ignite = nil
- local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, TMTSlot, RAHSlot, RNDSlot, STDSlot = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
- local QREADY, WREADY, EREADY, RREADY, DFGREADY, HXGREADY, BWCREADY, IREADY, TMTREADY, RAHREADY, RNDREADY, STDREADY, BRKREADY = false, false, false, false, false, false, false, false, false, false, false, false, false
- local ts
- function OnLoad()
- ts = TargetSelector(TARGET_LOW_HP,WRange,DAMAGE_MAGIC)
- ts.name = "Karma"
- Config = scriptConfig("LX Karma 0.1", "LX-Karma")
- Config:addParam("combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- Config:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- Config:addParam("autolvl","Automatic Level",SCRIPT_PARAM_ONOFF, true)
- Config:addParam("spamQ","Spam Q Enemy",SCRIPT_PARAM_ONOFF, true)
- Config:addParam("autoE","Auto E",SCRIPT_PARAM_ONOFF, true)
- Config:addParam("autoW","Auto W",SCRIPT_PARAM_ONOFF, true)
- Config:addParam("move","Auto Move to mice",SCRIPT_PARAM_ONOFF, true)
- Config: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
- enemyMinions = minionManager(MINION_ENEMY, QRange, player)
- end
- function OnTick()
- if Config.autolvl then
- if myHero:GetSpellData(_Q).level + myHero:GetSpellData(_W).level + myHero:GetSpellData(_E).level + myHero:GetSpellData(_R).level - 1< myHero.level then
- local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, }
- local level = { 0, 0, 0, 1 }
- for i = 1, myHero.level, 1 do
- level[abilitySequence[i]] = level[abilitySequence[i]] + 1
- end
- for i, v in ipairs({ myHero:GetSpellData(_Q).level, myHero:GetSpellData(_W).level, myHero:GetSpellData(_E).level, myHero:GetSpellData(_R).level }) do
- if v < level[i] then LevelSpell(spellSlot[i]) end
- end
- end
- end
- DFGSlot, BRKSlot, HXGSlot, BWCSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144)
- DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
- BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
- BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
- TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
- RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
- RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
- 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)
- ts:update()
- enemyMinions:update()
- if ts.target ~= nil then
- travelDuration = (50 + GetDistance(myHero, ts.target))
- ts:SetPrediction(travelDuration)
- predic = ts.nextPosition
- end
- if Config.spamQ then
- if ts.target ~= nil and QREADY then
- if predic ~= nil and GetDistance(predic) < QRange and not minionCollision(predic, 75, QRange) then
- if RREADY then
- CastSpell(_R)
- end
- CastSpell(_Q, predic.x, predic.z)
- end
- end
- end
- if Config.autoE then
- if ts.target ~= nil and EREADY then
- if predic ~= nil and GetDistance(predic) < 300 then
- if RREADY then
- CastSpell(_R)
- end
- CastSpell(_E,myHero)
- end
- end
- end
- if Config.autoW then
- if ts.target ~= nil and WREADY then
- if predic ~= nil and GetDistance(predic) < WRange then
- if RREADY then
- CastSpell(_R)
- end
- CastSpell(_W,ts.target)
- end
- end
- end
- if Config.combo then
- if Config.move then
- myHero:MoveTo(mousePos.x, mousePos.z)
- end
- if ts.target ~= nil and comborange <= GetDistance(ts.target) then
- if GetDistance(ts.target) < 598 then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
- if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
- if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
- end
- if WREADY then
- if GetDistance(ts.target) < WRange then
- CastSpell(_W,ts.target)
- end
- end
- if QREADY then
- if predic ~= nil and GetDistance(predic) < QRange and not minionCollision(predic, 75, QRange) then
- if RREADY and eren > GetDistance(ts.target) then
- CastSpell(_R)
- end
- CastSpell(_Q, predic.x, predic.z)
- end
- end
- if EREADY then
- if RREADY and eren <= GetDistance(ts.target) then
- CastSpell(_R)
- end
- CastSpell(_E,myHero)
- end
- end
- end
- if iReady then
- local ignitedmg = 0
- for i = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(i)
- if ValidTarget(enemyhero,600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= ignitedmg then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end
- function minionCollision(predic, width, range)
- for _, minionObjectE in pairs(enemyMinions.objects) do
- if predic ~= nil and player:GetDistance(minionObjectE) < range then
- ex = player.x
- ez = player.z
- tx = predic.x
- tz = predic.z
- dx = ex - tx
- dz = ez - tz
- if dx ~= 0 then
- m = dz/dx
- c = ez - m*ex
- end
- mx = minionObjectE.x
- mz = minionObjectE.z
- distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
- if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
- return true
- end
- end
- end
- return false
- end
- function OnDraw()
- if Config.drawcircles and not myHero.dead then
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- if QREADY then
- Q = QRange
- else
- Q = 0
- end
- if WREADY then
- W = WRange
- else
- W = 0
- end
- if EREADY then
- E = ERange
- else
- E = 0
- end
- N = NRange
- HighestRange = math.max(Q,W,E,N)
- DrawCircle(myHero.x, myHero.y, myHero.z, HighestRange, 0x099B2299)
- local coloraqua=ARGB(0xFF,0x00,0xFF,0xFF)
- DrawCircle(myHero.x, myHero.y, myHero.z, comborange, coloraqua)
- if ValidTarget(ts.target) then
- DrawText("Targetting: " .. ts.target.charName, 18, 750, 40, 0xFFFF0000)
- for i=0, 10 do
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, 60 + i*1.5, coloraqua)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement