Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'Utils'
- local target
- local minion
- local ulti=false
- local allyTable = {}
- local enemyTable = {}
- local ally = nil
- local enemy = nil
- local currentally = nil
- local timeulti = 0
- local timeulti2 = 0
- local delayult = 300
- local delayult2 = 1200
- local timeq = 0
- local target2
- local lastqmark = 0
- local player=myHero
- local distancetstarget = 0
- local esavehealth = myHero.health*0.20
- local DFGSlot=GetInventorySlot(3128)
- local HXGSlot=GetInventorySlot(3146)
- local BWCSlot=GetInventorySlot(3144)
- KatarinaConfig = scriptConfig("Samipote's Katarina", "Samipote's Katarina")
- KatarinaConfig:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
- KatarinaConfig:addParam("Killsteal", "Killsteal", SCRIPT_PARAM_ONOFF,true)
- KatarinaConfig:addParam("Farm", "Auto-Farm", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("C"))
- KatarinaConfig:addParam("Autoe", "Auto-E Escape", SCRIPT_PARAM_ONOFF,true)
- KatarinaConfig:addParam('Items', 'Items', SCRIPT_PARAM_ONOFF, true)
- KatarinaConfig:addParam("Ignite", "AutoIgnite", SCRIPT_PARAM_ONOFF,true)
- function main()
- GetCD()
- target = GetWeakEnemy('MAGIC',math.max(QREADY*675,WREADY*375,EREADY*700,RREADY*550,1),'NEARMOUSE')
- minion = GetLowestHealthEnemyMinion(675)
- for i = 1, objManager:GetMaxHeroes() do
- enemy = objManager:GetHero(i)
- if (enemy ~= nil and enemy.team ~= myHero.team and enemy.visible == 1 and enemy.invulnerable == 0 and enemy.dead == 0) then
- table.insert(enemyTable, enemy)
- end
- end
- for i = 1, objManager:GetMaxHeroes() do
- ally = objManager:GetHero(i)
- if (ally ~= nil and ally.team == myHero.team and ally.visible == 1 and ally.dead==0) then
- table.insert(allyTable, ally)
- end
- end
- if target ~= nil then distancetstarget = GetDistance(target) end
- ulti = false
- if IsBuffed(target,'KatarinaRSound',550)==true then
- ulti = true
- timeulti = GetTickCount()
- end
- if GetTickCount()-timeulti < delayult or GetTickCount()-timeulti2 < delayult2 then ulti = true end
- ItemCD()
- Combo()
- Killsteal()
- Farm()
- Autoe()
- Ignite()
- Items()
- end
- function GetCD()
- if myHero.SpellTimeQ > 1 and GetSpellLevel("Q") > 0 then
- QREADY = 1
- else QREADY = 0
- end
- if myHero.SpellTimeW > 1 and GetSpellLevel("W") > 0 then
- WREADY = 1
- else WREADY = 0
- end
- if myHero.SpellTimeE > 1 and GetSpellLevel("E") > 0 then
- EREADY = 1
- else EREADY = 0
- end
- if myHero.SpellTimeR > 1 and GetSpellLevel("R") > 0 then
- RREADY = 1
- else RREADY = 0 end
- end
- function IsBuffed(target,name,range)
- for i = 1, objManager:GetMaxObjects(), 1 do
- obj = objManager:GetObject(i)
- if obj~=nil and target~=nil and string.find(obj.charName,name) and ((range==nil and GetDistance(obj,target)<150) or (range~=nil and GetDistance(obj,target)<=range)) then
- return true
- end
- end
- end
- function ItemCD()
- if GetInventorySlot(3128)==1 and myHero.SpellTime1 >= 1 then DFGREADY = 1
- elseif GetInventorySlot(3128)==2 and myHero.SpellTime2 >= 1 then DFGREADY = 1
- elseif GetInventorySlot(3128)==3 and myHero.SpellTime3 >= 1 then DFGREADY = 1
- elseif GetInventorySlot(3128)==4 and myHero.SpellTime4 >= 1 then DFGREADY = 1
- elseif GetInventorySlot(3128)==5 and myHero.SpellTime5 >= 1 then DFGREADY = 1
- elseif GetInventorySlot(3128)==6 and myHero.SpellTime6 >= 1 then DFGREADY = 1
- else DFGREADY = 0
- end
- if GetInventorySlot(3144)==1 and myHero.SpellTime1 >= 1 then BWCREADY = 1
- elseif GetInventorySlot(3144)==2 and myHero.SpellTime2 >= 1 then BWCREADY = 1
- elseif GetInventorySlot(3144)==3 and myHero.SpellTime3 >= 1 then BWCREADY = 1
- elseif GetInventorySlot(3144)==4 and myHero.SpellTime4 >= 1 then BWCREADY = 1
- elseif GetInventorySlot(3144)==5 and myHero.SpellTime5 >= 1 then BWCREADY = 1
- elseif GetInventorySlot(3144)==6 and myHero.SpellTime6 >= 1 then BWCREADY = 1
- else BWCREADY = 0
- end
- if GetInventorySlot(3146)==1 and myHero.SpellTime1 >= 1 then HXGREADY = 1
- elseif GetInventorySlot(3146)==2 and myHero.SpellTime2 >= 1 then HXGREADY = 1
- elseif GetInventorySlot(3146)==3 and myHero.SpellTime3 >= 1 then HXGREADY = 1
- elseif GetInventorySlot(3146)==4 and myHero.SpellTime4 >= 1 then HXGREADY = 1
- elseif GetInventorySlot(3146)==5 and myHero.SpellTime5 >= 1 then HXGREADY = 1
- elseif GetInventorySlot(3146)==6 and myHero.SpellTime6 >= 1 then HXGREADY = 1
- else HXGREADY = 0
- end
- end
- function Combo()
- if KatarinaConfig.Combo and target~=nil and ulti==false and (Killsteal()==false or Killsteal()==nil or not Killsteal()) then
- AttackTarget(target)
- if DFGREADY==1 then CastSpellTarget(tostring(DFGSlot),target) end
- if QREADY==1 then CastSpellTarget("Q",target) end
- if EREADY==1 then CastSpellTarget("E",target) end
- if WREADY==1 and distancetstarget<375 and (((GetTickCount()-timeq>650 or (GetTickCount()-lastqmark<650) and QREADY==0))) or (RREADY==1) then CastSpellXYZ("W",myHero.x,myHero.y,myHero.z) end
- if HXGREADY==1 then CastSpellTarget(tostring(HXGSlot),target) end
- if BWCREADY==1 then CastSpellTarget(tostring(BWCSlot),target) end
- if RREADY==1 and QREADY==0 and WREADY==0 and EREADY==0 and DFGREADY==0 and HXGREADY==0 and BWCREADY==0 and distancetstarget<275 then
- timeulti = GetTickCount()
- timeulti2 = GetTickCount()
- CastSpellXYZ('R',myHero.x,0,myHero.z)
- end
- end
- end
- function MoveMouse()
- local moveSqr = math.sqrt((mousePos.x - myHero.x)^2+(mousePos.z - myHero.z)^2)
- local moveX = myHero.x + 300*((mousePos.x - myHero.x)/moveSqr)
- local moveZ = myHero.z + 300*((mousePos.z - myHero.z)/moveSqr)
- MoveToXYZ(moveX,0,moveZ)
- end
- function Killsteal()
- if KatarinaConfig.Killsteal and target~=nil and ulti==false then
- local eDmg = CalcMagicDamage(target, 25*(GetSpellLevel("E")-1)+60+(.4*player.ap))
- local wDmg = CalcMagicDamage(target, 35*(GetSpellLevel("W")-1) +40+ (.25*player.ap)+(.6*player.addDamage))
- local qDmg = CalcMagicDamage(target, 25*(GetSpellLevel("Q")-1)+60+(.45*player.ap))
- if target.health < qDmg and GetDistance(target) < 650 and QREADY==1 then
- CastSpellTarget("Q",target)
- return true
- elseif target.health < wDmg and GetDistance(target) < 375 and WREADY==1 then
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- return true
- elseif GetDistance(target) < 360 and target.health < qDmg + wDmg and QREADY==1 and WREADY==1 then
- CastSpellTarget("Q",target)
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- return true
- elseif GetDistance(target) < 375 and GetDistance(target) > 360 and target.health < qDmg + wDmg and QREADY==1 and WREADY==1 then
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- CastSpellTarget("Q",target)
- return true
- elseif target.health < eDmg and GetDistance(target) < 700 and EREADY==1 then
- CastSpellTarget("E",target)
- return true
- elseif GetDistance(target) < 700 and GetDistance(target) > 650 and target.health < qDmg + eDmg and QREADY==1 and EREADY==1 then
- CastSpellTarget("E",target)
- CastSpellTarget("Q",target)
- return true
- elseif GetDistance(target) < 650 and target.health < qDmg + eDmg and QREADY==1 and EREADY==1 then
- CastSpellTarget("Q",target)
- CastSpellTarget("E",target)
- return true
- elseif GetDistance(target) < 700 and GetDistance(target) > 650 and target.health < wDmg + eDmg + qDmg and QREADY==1 and EREADY==1 and WREADY==1 then
- CastSpellTarget("E",target)
- CastSpellTarget("Q",target)
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- return true
- elseif GetDistance(target) < 650 and target.health < wDmg + eDmg + qDmg and QREADY==1 and EREADY==1 and WREADY==1 then
- CastSpellTarget("Q",target)
- CastSpellTarget("E",target)
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- return true
- elseif target.health < eDmg and GetDistance(target) < 700 and EREADY==1 then
- CastSpellTarget("E",target)
- elseif target.health < wDmg + eDmg and GetDistance(target)<700 and EREADY==1 and WREADY==1 then
- CastSpellTarget("E",target)
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- return true
- else
- return false
- end
- else
- return false
- end
- end
- function Farm()
- if KatarinaConfig.Farm and minion~=nil and ulti==false and KatarinaConfig.Combo==false and (Killsteal()==false or Killsteal()==nil or not Killsteal()) then
- local qDmg2 = CalcMagicDamage(minion, 25*(GetSpellLevel("Q")-1)+60+(.45*player.ap))
- if qDmg2>minion.health and QREADY==1 then
- CastSpellTarget("Q",minion)
- end
- local wDmg2 = CalcMagicDamage(minion, 35*(GetSpellLevel("W")-1) +40+ (.25*player.ap)+(.6*player.addDamage))
- if wDmg2>minion.health and WREADY==1 and GetDistance(myHero,minion)<375 then
- CastSpellXYZ("W",myHero.x,myHero.y,myHero.z)
- end
- end
- end
- function Autoe()
- if KatarinaConfig.Autoe and ulti==false and Killsteal==false then
- if myHero.health < esavehealth and EREADY==1 then
- for i, ally in ipairs(allyTable) do
- for i, enemy in ipairs(enemyTable) do
- if GetDistance(ally) < 700 and GetDistance(enemy) < 2000 then
- currentally = ally
- elseif currentally ~= nil then
- if GetDistance(ally,enemy) > GetDistance(currentally,enemy) and GetDistance(ally,enemy) > GetDistance(enemy) then
- currentally = ally
- end
- end
- end
- end
- end
- end
- end
- if currentally ~= nil then
- CastSpellTarget("E",currentally)
- currentally = nil
- end
- function Items()
- if KatarinaConfig.Items then
- if myHero.health<((myHero.maxHealth/100)*20) and Killsteal()==false then
- useZhonyas(myHero)
- useWoogletsWitchcap(myHero)
- end
- if target~=nil and KatarinaConfig.Combo and ulti==false then
- useDeathfireGrasp(target)
- end
- if target~=nil and KatarinaConfig.Combo and ulti==true then
- useTwinShadows(myHero)
- end
- for i, ally in ipairs(allyTable) do
- if target~=nil and ally~=nil then
- if ally.health<((ally.maxHealth/100)*20) then
- useLocketOfTheIronSolari(ally)
- end
- end
- end
- if target~=nil and KatarinaConfig.Combo and ulti==false then
- useGunblade(target)
- end
- if target~=nil and KatarinaConfig.Combo and ulti==false then
- useHydra(target)
- end
- if target~=nil and KatarinaConfig.Combo and ulti==false then
- useOmen(target)
- end
- if myHero.dead==1 then
- useSoulAnchor(myHero)
- end
- end
- end
- function useZhonyas(cible)
- if cible~=nil then
- GetInventorySlot(3157)
- UseItemOnTarget(3157,cible)
- end
- end
- function useDeathfireGrasp(cible)
- if cible ~= nil then
- GetInventorySlot(3128)
- UseItemOnTarget(3128,cible)
- end
- end
- function useTwinShadows(cible)
- if cible ~= nil then
- GetInventorySlot(3023)
- UseItemOnTarget(3023,cible)
- end
- end
- function useWoogletsWitchcap(cible)
- if cible~=nil then
- GetInventorySlot(3090)
- UseItemOnTarget(3090,cible)
- end
- end
- function useLocketOfTheIronSolari(cible)
- if cilbe~=nil then
- GetInventorySlot(3090)
- UseItemOnTarget(3090,cible)
- end
- end
- function useGunblade(cible)
- if cible~=nil then
- GetInventorySlot(3146)
- UseItemOnTarget(3146,cible)
- end
- end
- function useHydra(cible)
- if cible~=nil then
- GetInventorySlot(3074)
- UseItemOnTarget(3074,cible)
- end
- end
- function useOmen(cible)
- if cible~=nil then
- GetInventorySlot(3143)
- UseItemOnTarget(3143,cible)
- end
- end
- function useSoulAnchor(cible)
- if cible~=nil then
- GetInventorySlot(3345)
- UseItemOnTarget(3345,cible)
- end
- end
- function Ignite()
- if KatarinaConfig.Ignite then
- local damage = 50 + (20 * myHero.selflevel)
- target2 = GetWeakEnemy("TRUE", 610)
- if target2 ~= nil and myHero.SummonerD == "SummonerDot" and target2.visible and target2.dead ~= 1 and target2.invulnerable ~= 1 and (target2.health < damage or ulti==true) then
- if IsSpellReady("D") == 1 then
- CastSpellTarget("D",target2)
- end
- end
- if target2 ~= nil and myHero.SummonerF == "SummonerDot" and target2.visible and target2.dead ~= 1 and target2.invulnerable ~= 1 and (target2.health < damage or ulti==true) then
- if IsSpellReady("F") == 1 then
- CastSpellTarget("F",target2)
- end
- end
- end
- end
- function OnProcessSpell(unit, spell)
- if unit ~= nil and spell ~= nil and unit.charName == myHero.charName and spell.name == 'KatarinaQ' then timeq = GetTickCount() end
- end
- function OnCreateObj(obj)
- if obj~=nil then
- if string.find(obj.charName,"katarina_daggered") then
- lastqmark = GetTickCount()
- end
- end
- end
- SetTimerCallback("main")
Advertisement
Add Comment
Please, Sign In to add comment