Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Rekomendowane odpowiedzi

Opublikowano

Tak napisał hellsing w temacie MehAio:
 
 

Gonna have this thread closed if you continue this s**t talk guys. I told you now several times that those errors have nothing to do with my scripts... Just wait the f**k till BoL updates...
Opublikowano

Używaj tego

 

 

if myHero.charName ~= "Orianna" then return end

local version = 1.188
local AUTOUPDATE = true
local SCRIPT_NAME = "Orianna"

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local SOURCELIB_URL = "https://raw.github.com/TheRealSource/public/master/common/SourceLib.lua"
local SOURCELIB_PATH = LIB_PATH.."SourceLib.lua"

if FileExist(SOURCELIB_PATH) then
	require("SourceLib")
else
	DOWNLOADING_SOURCELIB = true
	DownloadFile(SOURCELIB_URL, SOURCELIB_PATH, function() print("Required libraries downloaded successfully, please reload") end)
end

if DOWNLOADING_SOURCELIB then print("Downloading required libraries, please wait...") return end

if AUTOUPDATE then
	 SourceUpdater(SCRIPT_NAME, version, "raw.github.com", "/Hellsing/BoL/master/"..SCRIPT_NAME..".lua", SCRIPT_PATH .. GetCurrentEnv().FILE_NAME, "/Hellsing/BoL/master/version/"..SCRIPT_NAME..".version"):CheckUpdate()
end

local RequireI = Require("SourceLib")
RequireI:Add("vPrediction", "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua")
RequireI:Add("SOW", "https://raw.github.com/Hellsing/BoL/master/common/SOW.lua")
RequireI:Check()

if RequireI.downloadNeeded == true then return end

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local InitiatorsList = 
	{
	  ["Vi"] = "ViQ",--R
	  ["Vi"] = "ViR",--R
	  ["Malphite"] = "Landslide",--R UFSlash
	  ["Nocturne"] = "NocturneParanoia",--R
	  ["Zac"] = "ZacE",--E
	  ["MonkeyKing"] = "MonkeyKingNimbus",--R
	  ["MonkeyKing"] = "MonkeyKingSpinToWin",--R
	  ["MonkeyKing"] = "SummonerFlash",--Flash
	  ["Shyvana"] = "ShyvanaTransformCast",--R
	  ["Thresh"] = "threshqleap",--Q2
	  ["Aatrox"] = "AatroxQ",--Q
	  ["Renekton"] = "RenektonSliceAndDice",--E
	  ["Kennen"] = "KennenLightningRush",--E
	  ["Kennen"] = "SummonerFlash",--Flash
	  ["Olaf"] = "OlafRagnarok",--R
	  ["Udyr"] = "UdyrBearStance",--E
	  ["Volibear"] = "VolibearQ",--Q
	  ["Talon"] = "TalonCutthroat",--e?
	  ["JarvanIV"] = "JarvanIVDragonStrike",--Q
	  ["Warwick"] = "InfiniteDuress",--R
	  ["Jax"] = "JaxLeapStrike",--Q
	  ["Yasuo"] = "YasuoRKnockUpComboW",--Q
	  ["Diana"] = "DianaTeleport",
	  ["LeeSin"] = "BlindMonkQTwo",
	  ["Shen"] = "ShenShadowDash",
	  ["Alistar"] = "Headbutt",
	  ["Amumu"] = "BandageToss",
	  ["Urgot"] = "UrgotSwap2",
	  ["Rengar"] = "RengarR",
	}

local InterruptList = 
	{
	  ["Katarina"] = "KatarinaR",
	  ["Malzahar"] = "AlZaharNetherGrasp",
	  ["Warwick"] = "InfiniteDuress",
	  ["Velkoz"] = "VelkozR"
	}
	
--[[Spell data]]
local Qradius = 80
local Wradius = 245
local Eradius = 80
local Rradius = 380

local Qrange = 825
local Erange = 1095

local Qdelay = 0
local Wdelay = 0.25
local Edelay = 0.25
local Rdelay = 0.6

local BallSpeed = 1200--Q
local BallSpeedE = 1700--E

_IGNITE = nil
_AA = 142857

--[[Spell damage]]
local Qdamage = {60, 90, 120, 150, 180}
local Qscaling = 0.5
local Wdamage = {70, 115, 160, 205, 250}
local Wscaling = 0.7
local Edamage = {60, 90, 120, 150, 180}
local Escaling = 0.3
local Rdamage = {150, 225, 300}
local Rscaling = 0.7
local AAdamage = {10, 10, 10, 18, 18, 18, 26, 26, 26, 34, 34, 34, 42, 42, 42, 50, 50, 50}
local AAscaling = 0.15

local MainCombo = {_AA, _AA, _Q, _W, _R, _Q, _IGNITE}
local Far = 1.3

--[[Ball]]
local BallPos = myHero
local BallMoving = false

--[[CDS]]
local QREADY = true
local WREADY = true
local EREADY = true
local RREADY = true
local IGNITEREADY = true

--[[VPrediction]]
local VP

local Menu = nil

local SelectedTarget = nil

local DamageToHeros = {}
local lastrefresh = 0

local ComboMode
local _ST, _TF  = 1,2

local LastChampionSpell = {}

--[[Ball location]]
function OnCreateObj(obj)
	--[[Casting Q creates this object when ball lands]]
        if obj.name:lower():find("yomu_ring_green") then
                BallPos = obj
                BallMoving = false
        end
        
        --[[When ball goes out of range it returns to Orianna and creates this object]]
        if (obj.name:lower():find("orianna_ball_flash_reverse")) then
            BallPos = myHero
			BallMoving = false
        end
end

function OnProcessSpell(unit, spell)
	if unit.isMe and spell.name:lower():find("orianaizunacommand") then--Q
		BallMoving = true
		DelayAction(function(p) BallPos = Vector(p) end, GetDistance(spell.endPos, BallPos) / BallSpeed - GetLatency()/1000 - 0.35, {Vector(spell.endPos)})
	end

	if unit.isMe and spell.name:lower():find("orianaredactcommand") then--E
		BallMoving = true
		BallPos = spell.target
	end

	if unit.type == "obj_AI_Hero" then
		LastChampionSpell[unit.networkID] = {name = spell.name, time=os.clock()}
	end
end

function OnGainBuff(unit, buff)
	--[[When the ball reaches an ally]]
	if unit.team == myHero.team and buff.name:lower():find("orianaghostself") then
		BallMoving = false
		BallPos = unit
	end
end
--[[End of ball location]]


function OnLoad()
	Menu = scriptConfig("Orianna", "Orianna")
	--[[Combo]]

	VP = VPrediction()
	SOWi = SOW(VP)
	Menu:addSubMenu("Orbwalking", "Orbwalking")
	SOWi:LoadToMenu(Menu.Orbwalking)

	Menu:addSubMenu("Combo", "Combo")
		Menu.Combo:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF , true)
		Menu.Combo:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseR", "Use R", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseRN", "Use R at least in", SCRIPT_PARAM_LIST, 1, { "1 target", "2 targets", "3 targets", "4 targets" , "5 targets"})
		Menu.Combo:addParam("UseI", "Use Ignite if enemy is killable", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("Enabled", "Normal combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)

	Menu:addSubMenu("Misc", "Misc")
		Menu.Misc:addParam("UseW", "Auto-W if it will hit", SCRIPT_PARAM_LIST, 1, { "No", ">0 targets", ">1 targets", ">2 targets", ">3 targets", ">4 targets" })
		Menu.Misc:addParam("UseR", "Auto-ultimate if it will hit", SCRIPT_PARAM_LIST, 1, { "No", ">0 targets", ">1 targets", ">2 targets", ">3 targets", ">4 targets" })
		Menu.Misc:addParam("EQ", "Use E + Q if tEQ < %x * tQ", SCRIPT_PARAM_SLICE, 100, 0, 200)
		Menu.Misc:addSubMenu("Auto-E on initiators", "AutoEInitiate")
		local added = false
		for champion, spell in pairs(InitiatorsList) do
			for i, ally in ipairs(GetAllyHeroes()) do
				if ally.charName == champion then
					added = true
					Menu.Misc.AutoEInitiate:addParam(champion..spell, champion.." ("..spell..")", SCRIPT_PARAM_ONOFF, true)
				end
			end
		end
	
		if not added then
			Menu.Misc.AutoEInitiate:addParam("info", "Info", SCRIPT_PARAM_INFO, "Not supported initiators found")
		else
			Menu.Misc.AutoEInitiate:addParam("Active", "Active", SCRIPT_PARAM_ONOFF, true)
		end
		Menu.Misc:addParam("Interrupt", "Auto interrupt important spells", SCRIPT_PARAM_ONOFF, true)
		Menu.Misc:addParam("BlockR", "Block R if it is not going to hit", SCRIPT_PARAM_ONOFF, true)

	--[[Harassing]]
	Menu:addSubMenu("Harass", "Harass")
		Menu.Harass:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF , true)
		Menu.Harass:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, false)
		Menu.Harass:addParam("ManaCheck", "Don't harass if mana < %", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Harass:addParam("Enabled", "Harass!", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
		Menu.Harass:addParam("Enabled2", "Harass (TOGGLE)!", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("L"))
	
	--[[Farming]]
	Menu:addSubMenu("Farm", "Farm")
		Menu.Farm:addParam("UseQ",  "Use Q", SCRIPT_PARAM_LIST, 4, { "No", "Freezing", "LaneClear", "Both" })
		Menu.Farm:addParam("UseW",  "Use W", SCRIPT_PARAM_LIST, 3, { "No", "Freezing", "LaneClear", "Both" })
		Menu.Farm:addParam("UseE",  "Use E", SCRIPT_PARAM_LIST, 3, { "No", "Freezing", "LaneClear", "Both" })
		Menu.Farm:addParam("ManaCheck", "Don't laneclear if mana < %", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Farm:addParam("Freeze", "Farm Freezing", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("C"))
		Menu.Farm:addParam("LaneClear", "Farm LaneClear", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("V"))
	
	--[[Jungle farming]]
	Menu:addSubMenu("JungleFarm", "JungleFarm")
		Menu.JungleFarm:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("Enabled", "Farm jungle!", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("V"))
	
	--[[Drawing]]
	Menu:addSubMenu("Drawing", "Drawing")
		Menu.Drawing:addParam("AArange", "Draw AA range", SCRIPT_PARAM_ONOFF, true)
		Menu.Drawing:addParam("Qrange", "Draw Q range", SCRIPT_PARAM_ONOFF, true)
		Menu.Drawing:addParam("Wrange", "Draw W radius", SCRIPT_PARAM_ONOFF, false)
		Menu.Drawing:addParam("Rrange", "Draw R radius", SCRIPT_PARAM_ONOFF, false)
		Menu.Drawing:addParam("DrawDamage", "Draw damage after combo in healthbars", SCRIPT_PARAM_ONOFF, true)
		Menu.Drawing:addParam("DrawBall", "Draw ball position", SCRIPT_PARAM_ONOFF, true)
		
	Menu:addParam("Version", "Version", SCRIPT_PARAM_INFO, version)
	
	EnemyMinions = minionManager(MINION_ENEMY, Qrange, myHero, MINION_SORT_MAXHEALTH_DEC)
	JungleMinions = minionManager(MINION_JUNGLE, Qrange, myHero, MINION_SORT_MAXHEALTH_DEC)
	
 	if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
		_IGNITE = SUMMONER_1
	elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
		_IGNITE = SUMMONER_2
	else
		_IGNITE = nil
	end
	PrintChat("<font color=\"#81BEF7\">[Orianna] Command: Load succesfully executed!</font>")
end

function GetComboDamage(Combo, Unit)
	local totaldamage = 0
	for i, spell in ipairs(Combo) do
		totaldamage = totaldamage + GetDamage(spell, Unit)
	end
	return totaldamage
end

function GetDamage(Spell, Unit)
	local truedamage = 0
	if Spell == _Q and myHero:GetSpellData(_Q).level ~= 0 then
		truedamage = myHero:CalcMagicDamage(Unit, Qdamage[myHero:GetSpellData(_Q).level] + myHero.ap * Qscaling)
	elseif Spell == _W and myHero:GetSpellData(_W).level ~= 0 and WREADY then
		truedamage = myHero:CalcMagicDamage(Unit, Wdamage[myHero:GetSpellData(_W).level] + myHero.ap * Wscaling)
	elseif Spell == _E and myHero:GetSpellData(_E).level ~= 0 then
		truedamage = myHero:CalcMagicDamage(Unit, Edamage[myHero:GetSpellData(_E).level] + myHero.ap * Escaling)
	elseif Spell == _R and myHero:GetSpellData(_R).level ~= 0 and RREADY then
		truedamage = myHero:CalcMagicDamage(Unit, Rdamage[myHero:GetSpellData(_R).level] + myHero.ap * Rscaling)
	elseif Spell == _AA and myHero:GetSpellData(_AA).level ~= 0 then
		truedamage = myHero:CalcDamage(Unit, myHero.totalDamage) + myHero:CalcMagicDamage(Unit, AAdamage[myHero.level] + myHero.ap * AAscaling)
	elseif Spell == _IGNITE and _IGNITE and IGNITEREADY then
		truedamage = 50 + 20 * myHero.level
	end
	return truedamage
end

--[[Check the number of enemies hit by casting W]]
function CheckEnemiesHitByW()
	local enemieshit = {}
	for i, enemy in ipairs(GetEnemyHeroes()) do
		local position = VP:GetPredictedPos(enemy, Wdelay)
		if ValidTarget(enemy) and GetDistance(position, BallPos) <= Wradius and GetDistance(enemy.visionPos, BallPos) <= Wradius then
			table.insert(enemieshit, enemy)
		end
	end
	return #enemieshit, enemieshit
end

--[[Check the number of enemies hit by casting E]]
function CheckEnemiesHitByE(To)
	local enemieshit = {}
	local StartPoint = Vector(BallPos.x, 0, BallPos.z)
	local EndPoint = Vector(To.x, 0, To.z)
	for i, enemy in ipairs(GetEnemyHeroes()) do
		local cp, hc, position = VP:GetLineCastPosition(enemy, Edelay, Eradius, math.huge, BallSpeedE, StartPoint)
		if position then
			local PointInLine, tmp, isOnSegment = VectorPointProjectionOnLineSegment(StartPoint, EndPoint, position)
			if ValidTarget(enemy) and isOnSegment and GetDistance(PointInLine, position) <= (Eradius + VP:GetHitBox(enemy)) and GetDistance(PointInLine, enemy.visionPos) < (Eradius) * 2 + 30 then
				table.insert(enemieshit, enemy)
			end
		end
	end
	return #enemieshit, enemieshit
end

--[[Check number of enemies hit by casting R]]
function CheckEnemiesHitByR()
	local enemieshit = {}
	for i, enemy in ipairs(GetEnemyHeroes()) do
		local position = VP:GetPredictedPos(enemy, Rdelay)
		if ValidTarget(enemy) and GetDistance(position, BallPos) <= Rradius and GetDistance(enemy.visionPos, BallPos) <= 1.25 * Rradius  then
			table.insert(enemieshit, enemy)
		end
	end
	return #enemieshit, enemieshit
end

function CastQ(target, fast)
	local Speed = BallSpeed * 1.5
	local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(target, Qdelay, Qradius, math.huge, Speed, BallPos)
	local CastPoint = CastPosition

	if (HitChance < 2) then return end

	if GetDistance(myHero.visionPos, Position) > Qrange + Wradius + VP:GetHitBox(target) then
		target2 = GetBestTarget(Qrange, target)
		if target2 then
			CastPosition,  HitChance,  Position = VP:GetLineCastPosition(target2, Qdelay, Qradius, math.huge, Speed, BallPos)
			CastPoint = CastPosition
		else
			do return end
		end
	end

	if GetDistance(myHero.visionPos, Position) > (Qrange + Wradius + VP:GetHitBox(target))  then
		do return end
	end

	if EREADY and Menu.Misc.EQ ~= 0 then
		local TravelTime = GetDistance(BallPos, CastPoint) / BallSpeed
		local MinTravelTime = GetDistance(myHero, CastPoint) / BallSpeed + GetDistance(myHero, BallPos) / BallSpeedE
		local Etarget = myHero

		for i, ally in ipairs(GetAllyHeroes()) do
			if ValidTarget(ally, Erange, false) then
				local t = GetDistance(ally, CastPoint) / BallSpeed + GetDistance(ally, BallPos) / BallSpeedE
				if t < MinTravelTime then
					MinTravelTime = t
					Etarget = ally
				end
			end
		end


		if MinTravelTime < (Menu.Misc.EQ / 100) * TravelTime and (not Etarget.isMe or GetDistance(BallPos, myHero) > 100) and GetDistance(Etarget) < GetDistance(CastPoint) then
			CastE(Etarget)
			do return end
		end
	end
	if GetDistanceSqr(myHero.visionPos, CastPoint) < Qrange * Qrange then
		CastSpell(_Q, CastPoint.x, CastPoint.z)
	else
		CastPoint = Vector(myHero.visionPos) + Qrange * (Vector(CastPoint) - Vector(myHero)):normalized()
		CastSpell(_Q, CastPoint.x, CastPoint.z)
	end
end

function CastW()
	local hitcount, hit = CheckEnemiesHitByW()
	if hitcount >= 1 then
		Packet('S_CAST', {spellId=_W}):send()
	end
end

function CastE(target)
	if target then
		CastSpell(_E, target)
	end
end

function CastECH(target, n)
	local hitcount, hit = CheckEnemiesHitByE(target)
	if hitcount >= n then
		CastE(target)
	end
end

function CastR(target)
	local position = VP:GetPredictedPos(target, Rdelay)
	if GetDistance(position, BallPos) < Rradius and GetDistance(target, BallPos) < Rradius then
		Packet('S_CAST', {spellId = _R}):send()
	end
end

function GetNMinionsHit(Pos, radius)
	local count = 0
	for i, minion in pairs(EnemyMinions.objects) do
		if GetDistance(minion, Pos) < radius then
			count = count + 1
		end
	end
	return count
end

function GetNMinionsHitE(Pos)
	local count = 0
	local StartPoint = Vector(Pos.x, 0, Pos.z)
	local EndPoint = Vector(myHero.x, 0, myHero.z)
	for i, minion in pairs(EnemyMinions.objects) do
		local position = Vector(minion.x, 0, minion.z)
		local PointInLine = VectorPointProjectionOnLineSegment(StartPoint, EndPoint, position)
		if GetDistance(PointInLine, position) < Eradius then
			count = count + 1
		end
	end
	return count
end

function Farm(Mode)
	local UseQ
	local UseW
	local UseE
	if not SOWi:CanMove() then return end

	EnemyMinions:update()
	if Mode == "Freeze" then
		UseQ =  Menu.Farm.UseQ == 2
		UseW =  Menu.Farm.UseW == 2 
		UseE =  Menu.Farm.UseE == 2 
	elseif Mode == "LaneClear" then
		UseQ =  Menu.Farm.UseQ == 3
		UseW =  Menu.Farm.UseW == 3 
		UseE =  Menu.Farm.UseE == 3 
	end
	
	UseQ =  Menu.Farm.UseQ == 4 or UseQ
	UseW =  Menu.Farm.UseW == 4  or UseW
	UseE =  Menu.Farm.UseE == 4 or UseE
	
	if UseQ and QREADY then
		if UseW then
			local MaxHit = 0
			local MaxPos = 0
			for i, minion in pairs(EnemyMinions.objects) do
				if GetDistance(minion) <= Qrange then
					local MinionPos = VP:GetPredictedPos(minion, Qdelay, BallSpeed, BallPos)
					local Hit = GetNMinionsHit(minion, Wradius)
					if Hit >= MaxHit then
						MaxHit = Hit
						MaxPos = MinionPos
					end
				end
			end
			if MaxHit > 0 and MaxPos then
				CastSpell(_Q, MaxPos.x, MaxPos.z)
			end
		else
			for i, minion in pairs(EnemyMinions.objects) do
				if minion.health + 15 < GetDamage(_Q, minion) and not SOWi:InRange(minion) then
					local MinionPos = VP:GetPredictedPos(minion, Qdelay, BallSpeed, BallPos)
					CastSpell(_Q, MinionPos.x, MinionPos.z)
					break
				end
			end
		end
	end

	if UseW and WREADY then
		local Hit = GetNMinionsHit(BallPos, Wradius)
		if Hit >= 3 then
			Packet('S_CAST', {spellId=_W}):send()
		end
	end
	
	if UseE and EREADY then
		local Hit = GetNMinionsHitE(BallPos)
		if Hit >= 3 and (not WREADY or not UseW) then
			CastE(myHero)
		end
	end
end

function FarmJungle()
	JungleMinions:update()
	local UseQ = Menu.JungleFarm.UseQ 
	local UseW = Menu.JungleFarm.UseW 
	local UseE = Menu.JungleFarm.UseE 
	
	local Minion = JungleMinions.objects[1] and JungleMinions.objects[1] or nil
	
	if Minion then
		local Position = VP:GetPredictedPos(Minion, Qdelay, BallSpeed, BallPos)
		if UseQ and QREADY then
			CastSpell(_Q, Position.x, Position.z)
		end
		
		if UseW and WREADY and GetDistance(BallPos, Minion) < Wradius then
			Packet('S_CAST', {spellId=_W}):send()
		end
		
		if UseE and (not WREADY or not UseW) and EREADY and GetDistance(Minion) < 700 then
			local starget = myHero
			local dist = GetDistanceSqr(Minion)
			for i, ally in ipairs(GetAllyHeroes()) do
				local dist2 = GetDistanceSqr(ally, Minion)
				if ValidTarget(ally, Erange, false) and dist2 < dist then
					dist = dist2
					starget = ally
				end
			end
			CastE(starget)
		end
	end
end

function FindBestLocationToQ(target)
	local points = {}
	local targets = {}
	
	local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(target, Qdelay, Qradius, Qrange, BallSpeed, BallPos)
	table.insert(points, Position)
	table.insert(targets, target)
	
	for i, enemy in ipairs(GetEnemyHeroes()) do
		if ValidTarget(enemy, Qrange + Rradius) and enemy.networkID ~= target.networkID then
			CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, Qdelay, Qradius, Qrange, BallSpeed, BallPos)
			table.insert(points, Position)
			table.insert(targets, enemy)
		end
	end
	

	for o = 1, 5 do
		local MECa = MEC(points)
		local Circle = MECa:Compute()
		
		if Circle.radius <= Rradius and #points >= 3 and RREADY then
			return Circle.center, 3
		end
	
		if Circle.radius <= Wradius and #points >= 2 and WREADY then
			return Circle.center, 2
		end
		
		if #points == 1 then
			return Circle.center, 1
		elseif Circle.radius <= (Qradius + 50) and #points >= 1 then
			return Circle.center, 2
		end
		
		local Dist = -1
		local MyPoint = points[1]
		local index = 0
		
		for i=2, #points, 1 do
			if GetDistance(points[i], MyPoint) >= Dist then
				Dist = GetDistance(points[i], MyPoint)
				index = i
			end
		end
		if index > 0 then
			table.remove(points, index)
		end
	end
end


function GetBestTarget(Range, Ignore)
	local LessToKill = 100
	local LessToKilli = 0
	local target = nil
	
	for i, enemy in ipairs(GetEnemyHeroes()) do
		if ValidTarget(enemy, Range) then
			DamageToHero = myHero:CalcMagicDamage(enemy, 200)
			ToKill = enemy.health / DamageToHero
			if ((ToKill < LessToKill) or (LessToKilli == 0)) and (Ignore == nil or (Ignore.networkID ~= enemy.networkID)) then
				LessToKill = ToKill
				LessToKilli = i
				target = enemy
			end
		end
	end
	
	if SelectedTarget ~= nil and ValidTarget(SelectedTarget, Range) and (Ignore == nil or (Ignore.networkID ~= SelectedTarget.networkID)) then
		target = SelectedTarget
	end
	
	return target
end

function OnTickChecks()
	QREADY = (myHero:CanUseSpell(_Q) == READY) or ((myHero:GetSpellData(_Q).currentCd < 1) and (myHero:GetSpellData(_Q).level > 0))
	WREADY = (myHero:CanUseSpell(_W) == READY) or ((myHero:GetSpellData(_W).currentCd < 1) and (myHero:GetSpellData(_W).level > 0))
	EREADY = (myHero:CanUseSpell(_E) == READY) or ((myHero:GetSpellData(_E).currentCd < 1) and (myHero:GetSpellData(_E).level > 0))
	RREADY = (myHero:CanUseSpell(_R) == READY) or ((myHero:GetSpellData(_R).currentCd < 1) and (myHero:GetSpellData(_R).level > 0))

	IGNITEREADY = _IGNITE and myHero:CanUseSpell(_IGNITE) == READY or false
	
	if CountEnemyHeroInRange(Qrange + Rradius, myHero) == 1 then
		ComboMode = _ST
	else
		ComboMode = _TF
	end
	
	RefreshKillableTexts()
	
	if Menu.Misc.UseW > 1 and WREADY then
		local hitcount, hit = CheckEnemiesHitByW()
		if hitcount >= (Menu.Misc.UseW -1) then
			Packet('S_CAST', {spellId=_W}):send()
		end		
	end
	
	if Menu.Misc.UseR > 1 and RREADY then
		local hitcount, hit = CheckEnemiesHitByR()
		if (hitcount >= (Menu.Misc.UseR - 1)) and GetDistanceToClosestAlly(BallPos) < Qrange * Far then
			Packet('S_CAST', {spellId = _R}):send()
		end		
	end
	
	if Menu.Misc.AutoEInitiate.Active and EREADY then
		for i, unit in ipairs(GetAllyHeroes()) do
			if GetDistance(unit) < Erange then
				for champion, spell in pairs(InitiatorsList) do
					if LastChampionSpell[unit.networkID] and LastChampionSpell[unit.networkID].name ~=nil and Menu.Misc.AutoEInitiate[champion.. LastChampionSpell[unit.networkID].name] and (os.clock() - LastChampionSpell[unit.networkID].time < 1.5) then
						CastE(unit)
					end
				end
			end
		end
	end
	
	if Menu.Misc.Interrupt then
		for i, unit in ipairs(GetEnemyHeroes()) do
			for champion, spell in pairs(InterruptList) do
				if GetDistance(unit) <= Qrange and LastChampionSpell[unit.networkID] and spell == LastChampionSpell[unit.networkID].name and (os.clock() - LastChampionSpell[unit.networkID].time < 1) then
					CastSpell(_Q, unit.x, unit.z)
					if GetDistance(BallPos, unit) < Rradius then
						Packet('S_CAST', {spellId = _R}):send()
					end
				end
			end
		end
	end
end

function OnWndMsg(Msg, Key)
	if Msg == WM_LBUTTONDOWN then
		local minD = 0
		local starget = nil
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) then
				if GetDistance(enemy, mousePos) <= minD or starget == nil then
					minD = GetDistance(enemy, mousePos)
					starget = enemy
				end
			end
		end
		
		if starget and minD < 100 then
			if SelectedTarget and starget.charName == SelectedTarget.charName then
				SelectedTarget = nil
			else
				SelectedTarget = starget
				print("<font color=\"#FF0000\">Orianna: New target selected: "..starget.charName.."</font>")
			end
		end
	end
end

function Harass(target)
	if Menu.Harass.UseQ and target then
		CastQ(target)
	end
	if Menu.Harass.UseW then
		CastW()
	end
end

function GetDistanceToClosestAlly(p)
	local d = GetDistance(p, myHero)
	for i, ally in ipairs(GetAllyHeroes()) do
		if ValidTarget(ally, math.huge, false) then
			local dist = GetDistance(p, ally)
			if dist < d then
				d = dist
			end
		end
	end
	return d
end

function CountAllyHeroInRange(range, point)
	local n = 0
	for i, ally in ipairs(GetAllyHeroes()) do
		if ValidTarget(ally, math.huge, false) and GetDistanceSqr(point, ally) <= range * range then
			n = n + 1
		end
	end
	return n
end

function Combo(target)
	if ComboMode == _ST then--Single Target
		if target and ((GetDistanceSqr(target) < 300 * 300) or ((myHero.health/myHero.maxHealth <= 0.25) and (myHero.health/myHero.maxHealth < target.health/target.maxHealth))) then
			SOWi:DisableAttacks()
		end

		if target and Menu.Combo.UseR and CountEnemyHeroInRange(1000, target) >= CountAllyHeroInRange(1000, target)  then
			if target and GetComboDamage(MainCombo, target) > target.health and GetDistanceToClosestAlly(BallPos) < Qrange * Far then
				local hitcount, hit = CheckEnemiesHitByR()
				if hitcount >= Menu.Combo.UseRN then
					CastR(target)
				end
			end
		end

		if Menu.Combo.UseW then
			CastW()
		end
		
		if Menu.Combo.UseQ and target and QREADY then
			CastQ(target)
		end
		
		if Menu.Combo.UseE then
			for i, ally in ipairs(GetAllyHeroes()) do
				if ValidTarget(ally, math.huge, false) and GetDistance(ally) < Erange and CountEnemyHeroInRange(400, ally) >= 1 and (target == nil or GetDistance(ally, target) < 400) then
					CastE(ally)
				end
			end
		end
		
		if Menu.Combo.UseE then
			CastECH(myHero, 1)
		end
	else
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) and (GetDistanceSqr(enemy) < 300 * 300) and (myHero.health/myHero.maxHealth <= 0.25) then
				SOWi:DisableAttacks()
			end
		end
		if Menu.Combo.UseR then
			if CountEnemyHeroInRange(800, BallPos) > 1 then
				local hitcount, hit = CheckEnemiesHitByR()
				local potentialkills, kills = 0, 0
				if hitcount >= 2 then
					for i, champion in ipairs(hit) do
						if (champion.health - GetComboDamage(MainCombo, champion)) < 0.4*champion.maxHealth or (GetComboDamage(MainCombo, champion) >= 0.4*champion.maxHealth) then
							potentialkills = potentialkills + 1
						end
						if (champion.health - GetComboDamage(MainCombo, champion)) < 0 then
							kills = kills + 1
						end
					end
				end
				if (((GetDistanceToClosestAlly(BallPos) < Qrange * Far) and ((hitcount >= CountEnemyHeroInRange(800, BallPos))) or (potentialkills >= 2)) or kills >= 1) and hitcount >= Menu.Combo.UseRN then
					Packet('S_CAST', {spellId = _R}):send()
				end
			elseif Menu.Combo.UseRN == 1 then
				if target and GetComboDamage({_Q, _W, _R}, target) > target.health and GetDistanceToClosestAlly(BallPos) < Qrange * Far then
					CastR(target)
				end
			end
		end
		
		if Menu.Combo.UseW then
			CastW()
		end
		if target and SOWi:InRange(target) then
			SOWi:ForceTarget(target)
		end

		if Menu.Combo.UseQ and target then
			local Qposition, hit = FindBestLocationToQ(target)
			
			if Qposition and hit > 1 then
				CastSpell(_Q, Qposition.x, Qposition.z)
			else
				CastQ(target)
			end
		end
		
		if Menu.Combo.UseE and EREADY then
			if CountEnemyHeroInRange(800, BallPos) <= 2 then
				CastECH(myHero, 1)
			else
				CastECH(myHero, 2)
			end
			
			
			for i, ally in ipairs(GetAllyHeroes()) do
				if ValidTarget(ally, Erange, false) and CountEnemyHeroInRange(300, ally) >= 3 and (target == nil or GetDistance(ally, target) < 300) then
					CastSpell(_E, ally)
				end
			end
		end
	end
end

function OnTick()
	OnTickChecks()
	SOWi:EnableAttacks()
	SOWi:ForceTarget()
	local target = GetBestTarget(Qrange + Qradius)
	if not target then
		target = GetBestTarget(Qrange + Qradius * 2)
	end
	if Menu.Combo.Enabled then
		Combo(target)
	elseif (Menu.Harass.Enabled or Menu.Harass.Enabled2) and (Menu.Harass.ManaCheck <= (myHero.mana / myHero.maxMana * 100)) then
		Harass(target)
	end

	if Menu.Farm.Freeze or Menu.Farm.LaneClear then
		local Mode = Menu.Farm.Freeze and "Freeze" or "LaneClear"
		if Menu.Farm.ManaCheck >= (myHero.mana / myHero.maxMana * 100) then
			Mode = "Freeze"
		end

		Farm(Mode)
	end
	
	if Menu.JungleFarm.Enabled then
		FarmJungle()
	end
end


function OnSendPacket(p)
	if Menu.Misc.BlockR and p.header == Packet.headers.S_CAST then
		local packet = Packet(p)
		if packet:get('spellId') == _R then
			local hitnumber, hit = CheckEnemiesHitByR()
			if hitnumber == 0 then
				p:Block()
			end
		end
	end
end
--[[Drawing stuff: ]]

--[[Update the bar texts]]
function RefreshKillableTexts()
	if ((os.clock() - lastrefresh) > 0.3) and Menu.Drawing.DrawDamage then
		for i=1, heroManager.iCount do
			local enemy = heroManager:GetHero(i)
			if ValidTarget(enemy) then
				DamageToHeros[i] =  GetComboDamage(MainCombo, enemy) 
			end
		end
		lastrefresh = os.clock()
	end
end
	
--[[	Credits to zikkah	]]
function GetHPBarPos(enemy)
	enemy.barData = GetEnemyBarData()
	local barPos = GetUnitHPBarPos(enemy)
	local barPosOffset = GetUnitHPBarOffset(enemy)
	local barOffset = { x = enemy.barData.PercentageOffset.x, y = enemy.barData.PercentageOffset.y }
	local barPosPercentageOffset = { x = enemy.barData.PercentageOffset.x, y = enemy.barData.PercentageOffset.y }
	local BarPosOffsetX = 171
	local BarPosOffsetY = 46
	local CorrectionY =  0
	local StartHpPos = 31
	barPos.x = barPos.x + (barPosOffset.x - 0.5 + barPosPercentageOffset.x) * BarPosOffsetX + StartHpPos
	barPos.y = barPos.y + (barPosOffset.y - 0.5 + barPosPercentageOffset.y) * BarPosOffsetY + CorrectionY 
						
	local StartPos = Vector(barPos.x , barPos.y, 0)
	local EndPos =  Vector(barPos.x + 108 , barPos.y , 0)

	return Vector(StartPos.x, StartPos.y, 0), Vector(EndPos.x, EndPos.y, 0)
end

function DrawIndicator(unit, health)
	local SPos, EPos = GetHPBarPos(unit)
	local barlenght = EPos.x - SPos.x
	local Position = SPos.x + (health / unit.maxHealth) * barlenght
	if Position < SPos.x then
		Position = SPos.x
	end
	DrawText("|", 13, Position, SPos.y+10, ARGB(255,0,255,0))
end

function DrawOnHPBar(unit, health)
	local Pos = GetHPBarPos(unit)
	if health < 0 then
		DrawCircle2(unit.x, unit.y, unit.z, 100, ARGB(255, 255, 0, 0))	
		DrawText("HP: "..health,13, Pos.x, Pos.y, ARGB(255,255,0,0))
	else
		DrawText("HP: "..health,13, Pos.x, Pos.y, ARGB(255,0,255,0))
	end
end

--[[Credits to barasia, vadash and viseversa for anti-lag circles]]
function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
	radius = radius or 300
	quality = math.max(8,math.floor(180/math.deg((math.asin((chordlength/(2*radius)))))))
	quality = 2 * math.pi / quality
	local points = {}
	for theta = 0, 2 * math.pi + quality, quality do
		local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
		points[#points + 1] = D3DXVECTOR2(c.x, c.y)
	end
	DrawLines2(points, width or 1, color or 4294967295)
end

function DrawCircle2(x, y, z, radius, color)
	local vPos1 = Vector(x, y, z)
	local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
	local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
	local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
	if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y })  then
		DrawCircleNextLvl(x, y, z, radius, 1, color, 75)	
	end
end


function OnDraw()
	if Menu.Drawing.AArange then
		DrawCircle2(myHero.x, myHero.y, myHero.z, SOWi:MyRange() + 50, ARGB(255, 0, 255, 0))
	end

	if Menu.Drawing.Qrange then
		DrawCircle2(myHero.x, myHero.y, myHero.z, Qrange, ARGB(255, 0, 255, 0))
	end
	
	if Menu.Drawing.Erange then
		DrawCircle2(myHero.x, myHero.y, myHero.z, Erange, ARGB(255, 0, 255, 0))
	end
	
	if Menu.Drawing.Wrange then
		DrawCircle2(BallPos.x, BallPos.y, BallPos.z, Wradius, ARGB(255,0,255,0))
	end
	
	if Menu.Drawing.Rrange then
		DrawCircle2(BallPos.x, BallPos.y, BallPos.z, Rradius, ARGB(255,0,255,0))
	end
	
	if Menu.Drawing.DrawBall then
		DrawCircle2(BallPos.x, BallPos.y, BallPos.z, 100, ARGB(255,0,255,0))
	end
	
	--[[HealthBar HP tracker]]
	if Menu.Drawing.DrawDamage then
		for i=1, heroManager.iCount do
			local enemy = heroManager:GetHero(i)
			if ValidTarget(enemy) then
				if DamageToHeros[i] ~= nil then
					RemainingHealth = enemy.health - DamageToHeros[i]
				end
				if RemainingHealth ~= nil then
					DrawIndicator(enemy, math.floor(RemainingHealth))
					DrawOnHPBar(enemy, math.floor(RemainingHealth))
				end
			end
		end
	end

	if SelectedTarget ~= nil and ValidTarget(SelectedTarget) then
		DrawCircle2(SelectedTarget.x, SelectedTarget.y, SelectedTarget.z, 100, ARGB(255,255,0,0))
	end
end
 

 

 

QUhIR7.png

Opublikowano

Pomogło Ci bo autor zaktualizował skrypt

Wgrywacie sobie :

 

if myHero.charName ~= "Syndra" then return end
local version = 1.6
local AUTOUPDATE = true
local SCRIPT_NAME = "Syndra"

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local SOURCELIB_URL = "https://raw.github.com/TheRealSource/public/master/common/SourceLib.lua"
local SOURCELIB_PATH = LIB_PATH.."SourceLib.lua"

if FileExist(SOURCELIB_PATH) then
	require("SourceLib")
else
	DOWNLOADING_SOURCELIB = true
	DownloadFile(SOURCELIB_URL, SOURCELIB_PATH, function() PrintChat("Required libraries downloaded successfully, please reload") end)
end

if DOWNLOADING_SOURCELIB then PrintChat("Downloading required libraries, please wait...") return end

if AUTOUPDATE then
	 SourceUpdater(SCRIPT_NAME, version, "raw.github.com", "/princer007/BoL/master/"..SCRIPT_NAME..".lua", SCRIPT_PATH .. GetCurrentEnv().FILE_NAME, "/princer007/BoL/master/"..SCRIPT_NAME..".version"):CheckUpdate()
end

local RequireI = Require("SourceLib")
RequireI:Add("vPrediction", "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua")
RequireI:Add("SOW", "https://raw.github.com/Hellsing/BoL/master/common/SOW.lua")
if VIP_USER and FileExist(LIB_PATH.."Prodiction.lua") then
	require("Prodiction")
end
RequireI:Check()

if RequireI.downloadNeeded == true then return end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

_D = 1338111
local MainCombo = {_D, _Q, _W, _E, _R, _R, _R, _IGNITE}
local _QE = 1337
local WObject
--SpellData
local Ranges = {[_Q] = 800,       [_W] = 920,  [_E] = 700,       [_R] = 675}
local Widths = {[_Q] = 180,       [_W] = 200,  [_E] = 45 * 0.5,  [_R] = 1,    [_QE] = 60}
local Delays = {[_Q] = 0.25,      [_W] = 0.5,  [_E] = 0.5,       [_R] = 0.25, [_QE] = 1800} ---_QE delay updates in function of _E delay + Speed and the distance to the ball
local Speeds = {[_Q] = 3000,	  [_W] = 1450, [_E] = 2500,      [_R] = 1100, [_QE] = 1600}
local FocusJungleNames = {"GiantWolf8.1.1","AncientGolem7.1.1","Wraith9.1.1","LizardElder10.1.1","Golem11.1.2","GiantWolf2.1.1","AncientGolem1.1.1",
"Wraith3.1.1","LizardElder4.1.1","Golem5.1.2","GreatWraith13.1.1","GreatWraith14.1.1"}

local pets = {"annietibbers", "shacobox", "malzaharvoidling", "heimertyellow", "heimertblue", "yorickdecayedghoul"}

local Balls = {}
local BallDuration = 6.9

local QERange = (Ranges[_Q] + 500)

local QECombo = 0
local WECombo = 0
local EQCombo = 0

local DrawPrediction = nil

local DontUseRTime = 0
local UseRTime = 0

local RegisterCallbacks = {}
function OnLoad()
	VP = VPrediction()
	SOWi = SOW(VP)
	STS = SimpleTS(STS_PRIORITY_LESS_CAST_MAGIC)
	DLib = DamageLib()
	DManager = DrawManager()

	Menu = scriptConfig("Syndra", "Syndra")

	Menu:addSubMenu("Orbwalking", "Orbwalking")
		SOWi:LoadToMenu(Menu.Orbwalking)

	Menu:addSubMenu("Target selector", "STS")
		STS:AddToMenu(Menu.STS)

	Menu:addSubMenu("Combo", "Combo")
		Menu.Combo:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseEQ", "Use EQ", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseR", "Use R", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("Enabled", "Use Combo!", SCRIPT_PARAM_ONKEYDOWN, false, 32)

	Menu:addSubMenu("Harass", "Harass")
		Menu.Harass:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
		Menu.Harass:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, false)
		Menu.Harass:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF, false)
		Menu.Harass:addParam("UseEQ", "Use EQ", SCRIPT_PARAM_ONOFF, false)
		Menu.Harass:addParam("ManaCheck", "Don't harass if mana < %", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Harass:addParam("Enabled", "Harass!", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
		Menu.Harass:addParam("PP", "Perfect Poke(Harras when enemy do AA)", SCRIPT_PARAM_ONOFF, true)
		Menu.Harass:addParam("Enabled2", "Harass (toggle)!", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("L"))

	Menu:addSubMenu("Farm", "Farm")
		Menu.Farm:addParam("UseQ",  "Use Q", SCRIPT_PARAM_LIST, 3, { "No", "Freeze", "LaneClear", "Both" })
		Menu.Farm:addParam("UseW",  "Use W", SCRIPT_PARAM_LIST, 3, { "No", "Freeze", "LaneClear", "Both" })
		Menu.Farm:addParam("UseE",  "Use E", SCRIPT_PARAM_LIST, 1, { "No", "Freeze", "LaneClear", "Both" })
		Menu.Farm:addParam("ManaCheck2", "Don't farm if mana < % (freeze)", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Farm:addParam("ManaCheck", "Don't farm if mana < % (laneclear)", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Farm:addParam("Freeze", "Farm freezing", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("C"))
		Menu.Farm:addParam("LaneClear", "Farm LaneClear", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("V"))

	Menu:addSubMenu("JungleFarm", "JungleFarm")
		Menu.JungleFarm:addParam("UseQ",  "Use Q", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("UseW",  "Use W", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("UseE",  "Use E", SCRIPT_PARAM_ONOFF, false)
		Menu.JungleFarm:addParam("Enabled", "Farm!", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("V"))

	Menu:addSubMenu("EQ combo settings", "EQ")
		Menu.EQ:addParam("Order",  "Combo mode", SCRIPT_PARAM_LIST, 1, {"E -> Q" , "Q - > E"})
		Menu.EQ:addParam("Range", "Place Q at range:", SCRIPT_PARAM_SLICE, 700, 0, Ranges[_Q])

	Menu:addSubMenu("Ultimate", "R")
		Menu.R:addSubMenu("Don't use R on", "Targets")
		for i, enemy in ipairs(GetEnemyHeroes()) do
			Menu.R.Targets:addParam(enemy.hash,  enemy.charName, SCRIPT_PARAM_ONOFF, false)
		end
		Menu.R:addParam("CastR", "Force ultimate cast", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("J"))
		Menu.R:addParam("DontUseR", "Don't use R in the next 10 seconds", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("G"))

	Menu:addSubMenu("Misc", "Misc")
		if VIP_USER then
			Menu.Misc:addParam("WPet",  "Auto grab pets using W", SCRIPT_PARAM_ONOFF, true)
		end
		Menu.Misc:addParam("PRQ", "Prediction sensitivity(Q)", SCRIPT_PARAM_SLICE, 2, 1, 4)
		
		Menu.Misc:addParam("Whitchance", "W min hitchance(1 - insta cast)", SCRIPT_PARAM_SLICE, 1, 1, 2)

		Menu.Misc:addSubMenu("Auto-Interrupt", "Interrupt")
			Interrupter(Menu.Misc.Interrupt, OnInterruptSpell)

		Menu.Misc:addSubMenu("Anti-Gapclosers", "AG")
			AntiGapcloser(Menu.Misc.AG, OnGapclose)

		Menu.Misc:addParam("MEQ", "Manual E+Q Combo", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("T"))

	Menu:addSubMenu("Drawings", "Drawings")
		DManager:CreateCircle((myHero), SOWi:MyRange() + 50, 1, {255, 255, 255, 255}):AddToMenu(Menu.Drawings, "AA Range", true, true, true)
		--[[Spell ranges]]
		for spell, range in pairs(Ranges) do
			DManager:CreateCircle((myHero), range, 1, {255, 255, 255, 255}):AddToMenu(Menu.Drawings, SpellToString(spell).." Range", true, true, true)
		end
		DManager:CreateCircle((myHero), QERange, 1, {255, 255, 255, 255}):AddToMenu(Menu.Drawings, "Q+E Range", true, true, true)
		
	Menu:addSubMenu("Debug", "Debug")
		Menu.Debug:addParam("DebugBall",  "Track balls", SCRIPT_PARAM_ONOFF, false)
		Menu.Debug:addParam("DebugCast",  "Cast output", SCRIPT_PARAM_ONOFF, false)
		Menu.Debug:addParam("DebugQ",  "Draw Q prediction", SCRIPT_PARAM_ONOFF, false)
		--Menu.Debug:addParam("DebugW",  "Debug W state", SCRIPT_PARAM_ONOFF, false)
		--Menu.Debug:permaShow("DebugW")
	--[[Predicted damage on healthbars]]
	Menu.Drawings:addParam("DrawPredictedHealth",  "Draw Predicted Health", SCRIPT_PARAM_ONOFF, true)
	--DLib:AddToMenu(Menu.Drawings, MainCombo)

	
	Q = Spell(_Q, Ranges[_Q], VIP_USER)
	W = Spell(_W, Ranges[_W], false)
	W2 = Spell(_W, Ranges[_W], false) 
	E = Spell(_E, Ranges[_E], false)
	EQ = Spell(_E, Ranges[_E], false)
	R = Spell(_R, Ranges[_R], VIP_USER)
	if VIP_USER then
		Q:TrackCasting("SyndraQ")
		Q:RegisterCastCallback(OnCastQ)
		
		W:TrackCasting("SyndraW")
		W:RegisterCastCallback(function() end)
		
		W2:TrackCasting("syndrawcast")
		W2:RegisterCastCallback(OnCastW)
		
		E:TrackCasting({"SyndraE", "syndrae5"})
		E:RegisterCastCallback(OnCastE)
	else
		WTrack = false
		--RegisterCallbacks = {"SyndraQ", "SyndraW", "syndraw2", "SyndraE", "syndrae5"}
	end

	Q:SetSkillshot (VP, SKILLSHOT_CIRCULAR, Widths[_Q], Delays[_Q], Speeds[_Q], false)
	W:SetSkillshot (VP, SKILLSHOT_CIRCULAR, Widths[_W], Delays[_W], Speeds[_W], false)
	W2:SetSkillshot(VP, SKILLSHOT_CIRCULAR, Widths[_W], Delays[_W], Speeds[_W], false)
	E:SetSkillshot (VP, SKILLSHOT_CONE, Widths[_E], Delays[_E], Speeds[_E], false) --E
	EQ:SetSkillshot(VP, SKILLSHOT_LINEAR, 70, Delays[_E], Speeds[_E], false) --EQ

	Q:SetAOE(true)
	W:SetAOE(true)
	DLib:RegisterDamageSource(_D, _MAGIC, 0,  0,  _MAGIC, _AP, 0,    function() return GetInventoryItemIsCastable(ItemManager:GetItem("DFG"):GetId()) end, function(target) return 0.15 * target.maxHealth end)
	DLib:RegisterDamageSource(_Q, _MAGIC, 30, 40, _MAGIC, _AP, 0.60, function() return (player:CanUseSpell(_Q) == READY) end)--Without the 15% increase at rank 5
	DLib:RegisterDamageSource(_W, _MAGIC, 40, 40, _MAGIC, _AP, 0.70, function() return (player:CanUseSpell(_W) == READY) end)
	DLib:RegisterDamageSource(_E, _MAGIC, 25, 45, _MAGIC, _AP, 0.40, function() return (player:CanUseSpell(_E) == READY) end)--70 / 115 / 160 / 205 / 250 (+ 40% AP)
	DLib:RegisterDamageSource(_R, _MAGIC, 45, 45, _MAGIC, _AP, 0.20, function() return (player:CanUseSpell(_R) == READY) end)--1 sphere

	
	EnemyMinions = minionManager(MINION_ENEMY, W.range, myHero, MINION_SORT_MAXHEALTH_DEC)
	JungleMinions = minionManager(MINION_JUNGLE, QERange, myHero, MINION_SORT_MAXHEALTH_DEC)
	PosiblePets = minionManager(MINION_OTHER, W.range, myHero, MINION_SORT_MAXHEALTH_DEC)
	PrintChat("Syndra: Loaded <font color=\"#6699ff\"><b> Bronze DFG fixes!</b>")
end
function OnRecvPacket(p)
	if p.header == 113 then
		p.pos = 1
		local NetworkID = p:DecodeF()
		local Active = p:Decode1()

		if NetworkID and Active == 1 then
			if not WObject then
				for i, ball in ipairs(Balls) do
					if ball.networkID == NetworkID then
						Balls[i].endT = os.clock() + BallDuration - GetLatency()/2000
					end
				end
			end
			WObject = objManager:GetObjectByNetworkId(NetworkID)
		else
			WObject = nil
		end
	end
end
------------------------------------------------------------------------------------------------------------------------------------------------------------v
------------------------------------------------------------------------------------------------------------------------------------------------------------v
------------------------------------------------------------------------------------------------------------------------------------------------------------v

--Change the combo table depending on the active balls count.
function GetCombo()
	local result = {}
	for i, spell in ipairs(MainCombo) do
		table.insert(result, spell)
	end
	for i = 1, #GetValidBalls() do
		table.insert(result, _R)
	end
	return result
end

--Track the balls :p
function GetValidBalls(all)
	local result = {}
	for i, ball in ipairs(Balls) do
		if (ball['added'] or ball['startT'] <= os.clock()) and Balls[i]['endT'] >= os.clock() and ball['object']['valid'] then
			if not WObject or ball.object.networkID ~= WObject.networkID then
				table.insert(result, ball)
			end
		end
	end
	return result
end

function AddBall(obj)
	for i = #Balls, 1, -1 do
		if not Balls[i].added and GetDistanceSqr(Balls[i].object, obj) < 50*50 then
			Balls[i].added = true
			Balls[i].object = obj
			do return end
		end
	end

	--R balls
	local BallInfo = {
							 added = true, 
							 object = obj,
							 startT = os.clock(),
							 endT = os.clock() + BallDuration - GetLatency()/2000
					}
	table.insert(Balls, BallInfo)						
end

function OnCreateObj(obj)
	if obj and obj.valid then
		if GetDistanceSqr(obj) < Q.rangeSqr * 2 then
			if obj.name:find("Seed") then
				DelayAction(AddBall, 0, {obj})
			end
		end
	end
end

function OnDeleteObj(obj)
	if obj.name:find("Syndra_") and (obj.name:find("_Q_idle.troy") or obj.name:find("_Q_Lv5_idle.troy")) then
		for i = #Balls, 1, -1 do
			if Balls[i].object and Balls[i].object.valid and GetDistanceSqr(Balls[i].object, obj) < 50 * 50 then
				table.remove(Balls, i)
				break
			end
		end
	end
end

--Remove the non-active balls to save memory
function BTOnTick()
	for i = #Balls, 1, -1 do
		if Balls[i].endT <= os.clock() then
			table.remove(Balls, i)
		end
	end
end

function BTOnDraw()--For testings
	local activeballs = GetValidBalls()
	for i, ball in ipairs(activeballs) do
		DrawCircle(ball['object']['x'], myHero.y, ball['object']['z'], 100, ARGB(255,255,255,255))
	end
end

function IsPet(name) 
	return table.contains(pets, name:lower())
end

function IsPetDangerous(name)
	return (name:lower() == "annietibbers") or (name:lower() == "heimertblue")
end

function AutoGrabPets()
	if W:IsReady() and W.status == 0 then
		local pet = GetPet(true)
		if pet then
			W:Cast(pet.x, pet.z)
			if Menu.Debug.DebugCast then PrintChat("Grab pet by W") end
		end
	end
end

function GetPet(dangerous)
	PosiblePets:update()
	--Priorize Enemy Pet's
	for i, object in ipairs(PosiblePets.objects) do
		if object and object.valid and object.team ~= myHero.team and IsPet(object.charName) and (not dangerous or IsPetDangerous(object.charName)) then
			return object
		end
	end
end

function GetWValidBall(OnlyBalls)
	local all = GetValidBalls()
	local inrange = {}

	local Pet = GetPet(true)
	if Pet then
		return {object = Pet}
	end

	--Get the balls in W range
	for i, ball in ipairs(all) do
		if GetDistanceSqr(ball.object, myHero.visionPos) <= W.rangeSqr then
			table.insert(inrange, ball)
		end
	end

	local minEnd = math.huge
	local minBall

	--Get the ball that will expire earlier
	for i, ball in ipairs(inrange) do
		if ball.endT < minEnd then
			minBall = ball
			minEnd = ball.endT
		end
	end

	if minBall then
		return minBall
	end
	if OnlyBalls then 
		return 
	end

	Pet = GetPet()
	if Pet then
		return {object = Pet}
	end

	EnemyMinions:update()
	JungleMinions:update()
	PosiblePets:update()
	local t = MergeTables(MergeTables(EnemyMinions.objects, JungleMinions.objects), PosiblePets.objects)
	SelectUnits(t, function(t) return ValidTarget(t) and GetDistanceSqr(myHero.visionPos, t) < W.rangeSqr end)
	if t[1] then
		return {object = t[1]}
	end
end

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function OnProcessSpell(unit, spell)
if not VIP_USER and unit == myHero then
--RegisterCallbacks = {"SyndraQ", "SyndraW", "syndraw2", "SyndraE", "syndrae5"} 
	if spell.name:lower():find("syndraq") then
		OnCastQ(spell)
	elseif spell.name:lower():find("syndrawcast") then
		OnCastW(spell)
	elseif spell.name:lower():find("syndraw") then
		OnCastWB(spell)
	elseif spell.name:lower():find("syndrae") or spell.name:lower():find("syndrae5") then
		OnCastE(spell)
	end
end
if (Menu.Harass.Enabled or Menu.Harass.Enabled2) and Menu.Harass.PP then
		if unit.team ~= myHero.team then
		    if unit.type == myHero.type and unit ~= nil then
		    	if spell.name:lower():find("attack") then
					Harass(target)
		        end
			end
		end
	end
end
function OnInterruptSpell(unit, spell)
	if GetDistanceSqr(unit.visionPos, myHero.visionPos) < E.rangeSqr and E:IsReady() then
		
		if Q:IsReady() then
			if unit.charName ~= "Warwick" then StartEQCombo(unit, false)
			else StartEQCombo(spell.endPos, false) end
			if Menu.Debug.DebugCast then PrintChat("Interrupt, EQ to unit pos") end
		else
			if unit.charName ~= "Warwick" then E:Cast(unit.visionPos.x, unit.visionPos.z)
			else E:Cast(spell.endPos.x, spell.endPos.z) end
			if Menu.Debug.DebugCast then PrintChat("Interrupt, E to unit pos") end
		end

	elseif GetDistanceSqr(unit.visionPos,  myHero.visionPos) < QERange * QERange and Q:IsReady() and E:IsReady() then
		if unit.charName ~= "Warwick" then StartEQCombo(unit)
		else StartEQCombo(spell.endPos) end
		if Menu.Debug.DebugCast then PrintChat("Interrupt, EQ to unit pos") end
	end 
end

function OnGapclose(unit, data)
	if E:IsReady() and GetDistanceSqr(unit) < E.rangeSqr * 4 then
		Qdistance = 300
		StartEQCombo(unit, true)
	end
end

function OnCastQ(spell)
	local BallInfo = {
						added = false, 
						object = {valid = true, x = spell.endPos.x, y = myHero.y, z = spell.endPos.z},
						startT = os.clock() + math.max(0, 0.25 - GetDistance(myHero.visionPos, spell.endPos)/1500) - GetLatency()/2000,
						endT = os.clock() + BallDuration + 1 - GetLatency()/2000
					 }

	table.insert(Balls, BallInfo)
	if os.clock() - QECombo < 1.5 then
		CastSpell(_E, spell.endPos.x, spell.endPos.z)
		QECombo = 0
	end
	Qdistance = nil
	EQTarget = nil
	EQCombo = 0
end
local DPP = nil
function OnCastW(spell)
	if not VIP_USER then WTrack = 0 end
end
function OnCastWB(spell)
	WTrack = 1
end
function OnCastE(spell)
--[[
	if os.clock() - EQCombo < 1.5 and EQTarget then
		DelayAction(function(t) Cast2Q(EQTarget) end, 0.6, {EQTarget})
	end
]]
end

function StartEQCombo(unit, Qfirst)
	if (Menu.EQ.Order == 1 or Qfirst == false) and Qfirst ~= true then
		EQCombo = os.clock()
		EQTarget = unit
		Cast2Q(EQTarget)
		E:Cast(unit.visionPos.x, unit.visionPos.z)
		if Menu.Debug.DebugCast then PrintChat("Cast E to ball pos in direction of enemy (EQCombo)") end
	else 
		QECombo = os.clock()
		Cast2Q(unit)
	end
end

function Cast2Q(target)
	if not Q:IsReady() then return end
	if GetDistanceSqr(target) > Q.rangeSqr then
		EQ.delay = Q.delay
		local spos = Vector(myHero.visionPos) + Menu.EQ.Range * (Vector(target) - Vector(myHero.visionPos)):normalized()
		EQ:SetSource(spos)

		local QEtargetPos, Hitchance, Position = EQ:GetPrediction(target)
		local pos = Vector(myHero.visionPos) + Menu.EQ.Range * (Vector(QEtargetPos) - Vector(myHero.visionPos)):normalized()
		Q:Cast(pos.x, pos.z)
		if Menu.Debug.DebugCast then PrintChat("Cast Q to max alllowed distance in the direction of enemy (EQCombo)") end
	else
		if Qdistance then
			local pos = Vector(myHero.visionPos) + Qdistance * (Vector(target) - Vector(myHero.visionPos)):normalized()
			Q:Cast(pos.x, pos.z)
			if Menu.Debug.DebugCast then PrintChat("Cast Q in direction of enemy (EQ Combo)") end
		else
			Q:Cast(target)
			if Menu.Debug.DebugCast then PrintChat("Cast Q on enemy (EQ Combo)") end
		end
	end
end

function UseSpells(UseQ, UseW, UseE, UseEQ, UseR, target)
	local Qtarget = STS:GetTarget(Q.range)
	local Wtarget = STS:GetTarget(W.range)
	local QEtarget = STS:GetTarget(QERange)
	local Rtarget = STS:GetTarget(R.range)
	local DFGUsed = false
	if target then
		Qtarget = target
		Wtarget = target
		QEtarget = target
	end

	if (os.clock() - DontUseRTime < 10) then
		UseR = false
	end
	if UseW then
		if Wtarget and W.status == 1 then
			if not VIP_USER then 
				W:Cast(Wtarget)
				if Menu.Debug.DebugCast then PrintChat("Cast W on target in combo") end
			end
			if WObject ~= nil and (WObject.charName == nil or WObject.charName:lower() ~= "heimertblue") then --Don't throw the giant tower 
				W:Cast(Wtarget)
				if Menu.Debug.DebugCast then PrintChat("Cast W on target in combo") end
			end
		elseif Wtarget and W.status == 0 then
			local validball = GetWValidBall()
			if validball and validball.object then
				W:Cast(validball.object.x, validball.object.z)
				if Menu.Debug.DebugCast then PrintChat("Cast W on ball") end
			elseif validball then
				W:Cast(Wtarget)
				if Menu.Debug.DebugCast then PrintChat("Cast W on target for get W object") end
			end
		end

		if not Qtarget and QEtarget and E:IsReady() and W.status == 1 and (WObject and WObject.name and WObject.name:find("Seed")) then
			--Update the EQ speed and the range
			EQ.delay = Q.range / E.speed + E.delay 
			local QEtargetPos, Hitchance, Position = EQ:GetPrediction(QEtarget)
			local pos = Vector(myHero.visionPos) + W.range * (Vector(QEtargetPos) - Vector(myHero.visionPos)):normalized()
			if QEtargetPos and GetDistance(QEtargetPos, pos) <= (-0.6 * W.range + 966) then
				WECombo = os.clock()
				if Menu.Debug.DebugCast then PrintChat("Throw ball in WE combo") end
				W:Cast(pos.x, pos.z)
				DelayAction(function() E:Cast(pos.x, pos.z) end, Delays[_W])
			end
		end
	end

	if UseQ then
		if Qtarget and os.clock() - W:GetLastCastTime() > 0.25 and os.clock() - E:GetLastCastTime() > 0.25 then
			VP.ShotAtMaxRange = true
			Q.speed = (Speeds[_Q]*tonumber(Menu.Misc.PRQ))
			--local QtargetPos, hitchance = VP:GetCircularAOECastPosition(Qtarget, Delays[_Q], Widths[_Q], Ranges[_Q], (Speeds[_Q]*tonumber(Menu.Misc.PRQ)), myHero)
			local QtargetPos, hitchance = Q:GetPrediction(Qtarget)
			if QtargetPos and hitchance and hitchance>=2 then
				Q:Cast(QtargetPos.x, QtargetPos.z)
				DrawPrediction = QtargetPos
				if Menu.Debug.DebugCast then PrintChat("Cast Q on target in combo") end
			end
			Q.speed = Speeds[_Q]
			VP.ShotAtMaxRange = false
		end
	end

	if UseEQ then
		if not Qtarget and QEtarget and E:IsReady() and Q:IsReady() then--E + Q at max range
			--Update the EQ speed and the range
			EQ.delay = Q.range / E.speed 
			local QEtargetPos, Hitchance = EQ:GetPrediction(QEtarget)
			local pos = Vector(myHero.visionPos) + Q.range * (Vector(QEtargetPos) - Vector(myHero.visionPos)):normalized()
			if GetDistance(QEtargetPos, pos) <= (-0.6 * Q.range + 966) then
				StartEQCombo(QEtarget)
			end
		end
	end

	if UseE and WECombo == 0 then
		--Check to stun people with E
		local validballs = GetValidBalls()
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) then
				local tmp1, tmp2, enemyPos = VP:GetPredictedPos(enemy, 0.25, QESpeed, myHero.visionPos, false)
				if enemyPos and enemyPos.z then
					for i, ball in ipairs(validballs) do
						if GetDistanceSqr(ball.object, myHero.visionPos) < Q.rangeSqr then
							local Delay = E.delay + GetDistance(myHero.visionPos, ball.object) / E.speed
							local QESpeed = Speeds[_QE]
							local EP = Vector(ball.object) +  (100+(-0.6 * GetDistance(ball.object, myHero.visionPos) + 966)) * (Vector(ball.object) - Vector(myHero.visionPos)):normalized()
							local SP = Vector(ball.object) - 100 * (Vector(ball.object) - Vector(myHero.visionPos)):normalized()
							local pointSegment, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(SP, EP, enemyPos)
							if isOnSegment and GetDistanceSqr(pointLine, enemyPos) <= (Widths[_QE] + VP:GetHitBox(enemy))^2 then
								CastSpell(_E, ball.object.x, ball.object.z)
								if Menu.Debug.DebugCast then PrintChat("Cast E to ball in direction of enemys in combo") end
							end
						end
					end
				end
			end
		end
	end

	if Rtarget and UseR then
		if IsKillable(Qtarget, GetCombo()) or (os.clock() - UseRTime < 10) then
			--ItemManager:CastOffensiveItems(Rtarget)
			CastItem(ItemManager:GetItem("DFG"):GetId(), Rtarget)
			DFG = ItemManager:GetItem("DFG"):GetSlot()
			if DFG and myHero:CanUseSpell(DFG) == READY then
				DFGUsed = true
			end
		end

		if _IGNITE and GetDistanceSqr(Qtarget.visionPos, myHero.visionPos) < 600 * 600 and (IsKillable(Rtarget, GetCombo())  or (os.clock() - UseRTime < 10)) then
			CastSpell(_IGNITE, Rtarget)
			if Menu.Debug.DebugCast then PrintChat("Cast ignite on target") end
		end
	end
	if UseR and not Q:IsReady() and R:IsReady() and not DFGUsed then
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) and (not Menu.R.Targets[enemy.hash] or (os.clock() - UseRTime < 10)) and GetDistanceSqr(enemy.visionPos, myHero.visionPos) < R.rangeSqr then
				if IsKillable(enemy, GetCombo())  or (os.clock() - UseRTime < 10) then
					if not IsKillable(enemy, {_Q, _E, _W}) and IsKillable(enemy, GetCombo()) or (os.clock() - UseRTime < 10) then
						if not HasBuff(enemy, "UndyingRage") and not HasBuff(enemy, "JudicatorIntervention") then
							R:Cast(enemy)
							if Menu.Debug.DebugCast then PrintChat("UR FACE MY BALLS (R in combo) to target: " .. enemy.charName) end
						end
					end
				end
			end
		end
	end
end


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

function Farm()
	if (Menu.Farm.ManaCheck > (myHero.mana / myHero.maxMana) * 100 and Menu.Farm.LaneClear) or (Menu.Farm.ManaCheck2 > (myHero.mana / myHero.maxMana) * 100 and Menu.Farm.Freeze) then return end
	EnemyMinions:update()
	local UseQ = Menu.Farm.LaneClear and (Menu.Farm.UseQ >= 3) or (Menu.Farm.UseQ == 2 or Menu.Farm.UseQ == 4)
	local UseW = Menu.Farm.LaneClear and (Menu.Farm.UseW >= 3) or (Menu.Farm.UseW == 2 or Menu.Farm.UseW == 4)
	local UseE = Menu.Farm.LaneClear and (Menu.Farm.UseE >= 3) or (Menu.Farm.UseE == 2 or Menu.Farm.UseE == 4)
	
	local CasterMinions = SelectUnits(EnemyMinions.objects, function(t) return (t.charName:lower():find("wizard") or t.charName:lower():find("caster")) and ValidTarget(t) and GetDistanceSqr(t) < W.rangeSqr end)
	local MeleeMinions = SelectUnits(EnemyMinions.objects, function(t) return (t.charName:lower():find("basic") or t.charName:lower():find("cannon")) and ValidTarget(t) and GetDistanceSqr(t) < W.rangeSqr end)
	
	if UseW and W:IsReady() then
		if W.status == 0 then
			if #MeleeMinions > 1 then
				W:Cast(MeleeMinions[1].x, MeleeMinions[1].z)
				if Menu.Debug.DebugCast then PrintChat("Cast W to first melee minion") end
			elseif #CasterMinions > 1 then
				W:Cast(CasterMinions[1].x, CasterMinions[1].z)
				if Menu.Debug.DebugCast then PrintChat("Cast W to first caster minion") end
			end
		else
			local BestPos1, BestHit1 = GetBestCircularFarmPosition(Ranges[_W], Widths[_W]*1.1, CasterMinions)
			local BestPos2, BestHit2 = GetBestCircularFarmPosition(Ranges[_W], Widths[_W]*1.1, MeleeMinions)

			if BestHit1 > 2 or (BestPos1 and #CasterMinions <= 2) then
				W:Cast(BestPos1.x, BestPos1.z)
				if Menu.Debug.DebugCast then PrintChat("Cast W on best hit position (Caster)") end
			elseif BestHit2 > 2 or (BestPos2 and #MeleeMinions <= 2) then
				W:Cast(BestPos2.x, BestPos2.z)
				if Menu.Debug.DebugCast then PrintChat("Cast W on best hit position (Melee)") end
			end
		end
	end

	if UseQ and ( not UseW or W.status == 0 ) and Q:IsReady() then
		CasterMinions = GetPredictedPositionsTable(VP, CasterMinions, Delays[_Q], Widths[_Q], Ranges[_Q] + Widths[_Q], math.huge, myHero, false)
		MeleeMinions = GetPredictedPositionsTable(VP, MeleeMinions, Delays[_Q], Widths[_Q], Ranges[_Q] + Widths[_Q], math.huge, myHero, false)

		local BestPos1, BestHit1 = GetBestCircularFarmPosition(Ranges[_Q] + Widths[_Q], Widths[_Q], CasterMinions)
		local BestPos2, BestHit2 = GetBestCircularFarmPosition(Ranges[_Q] + Widths[_Q], Widths[_Q], MeleeMinions)

		if BestPos1 and BestHit1 > 1 then
			CastSpell(_Q, BestPos1.x, BestPos1.z)
			if Menu.Debug.DebugCast then PrintChat("Cast Q on best hit position (Caster)") end
		elseif BestPos2 and BestHit2 > 1 then
			CastSpell(_Q, BestPos2.x, BestPos2.z)
			if Menu.Debug.DebugCast then PrintChat("Cast Q on best hit position (Melee)") end
		end
	end
 
	if UseE and (not Q:IsReady() or not UseQ) and E:IsReady() then
		local AllMinions = SelectUnits(EnemyMinions.objects, function(t) return ValidTarget(t) and GetDistanceSqr(t) < E.rangeSqr end)
		local BestPos, BestHit = GetBestCircularFarmPosition(E.range, Widths[_Q], AllMinions)
		if BestHit > 4 then
			E:Cast(BestPos.x, BestPos.z)
			if Menu.Debug.DebugCast then PrintChat("Cast E if hit >4 minions") end
		else
			local validballs = GetValidBalls()
			local maxcount = 0
			local maxpos

			for i, ball in ipairs(validballs) do
				if GetDistanceSqr(ball.object, myHero.visionPos) < Q.rangeSqr then
					local Count = 0
					for i, minion in ipairs(AllMinions) do
						local EP = Vector(ball.object) +  (100+(-0.6 * GetDistance(ball.object, myHero.visionPos) + 966)) * (Vector(ball.object) - Vector(myHero.visionPos)):normalized()
						local SP = Vector(myHero.visionPos)
						local pointSegment, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(SP, EP, minion)
						if isOnSegment and GetDistanceSqr(pointLine, enemyPos) < Widths[_QE] * Widths[_QE] then
							Count = Count + 1
						end
					end
					if Count > maxcount then
						maxcount = Count
						maxpos = Vector(ball.object)
					end
				end
			end
			if maxcount > 2 then
				E:Cast(maxpos.x, maxpos.z)
				if Menu.Debug.DebugCast then PrintChat("Cast E in farm counting balls") end
			end
		end
	end
end

function JungleFarm()
	JungleMinions:update()
	local UseQ = Menu.JungleFarm.UseQ
	local UseW = Menu.JungleFarm.UseW
	local UseE = Menu.JungleFarm.UseE
	local CloseMinions = SelectUnits(JungleMinions.objects, function(t) return GetDistanceSqr(t) <= W.rangeSqr and ValidTarget(t) end)
	local AllMinions = SelectUnits(JungleMinions.objects, function(t) return ValidTarget(t) end)

	local CloseMinion = CloseMinions[1]
	local FarMinion = AllMinions[1]
	if not CloseMinion and os.clock()-Q:GetLastCastTime()>0.5 then 
		W:__Cast(myHero.x, myHero.z)
	end
	
	if WStatus == "JungleSteal" then
		W:__Cast(myHero.x, myHero.z)
		WStatus = nil
	end
	if ValidTarget(CloseMinion) then
		local selectedTarget = GetTarget()

		if selectedTarget and selectedTarget.type == CloseMinion.type then
			DrawJungleStealingIndicator = true
			SOWi:DisableAttacks()
			if ValidTarget(selectedTarget) and DLib:IsKillable(selectedTarget, {_W}) and GetDistanceSqr(myHero.visionPos, selectedTarget) <= W.rangeSqr and W:IsReady() then
				if WStatus == nil then
					W:__Cast(selectedTarget.x, selectedTarget.z)
					WStatus = "JungleSteal"
				end
			end
		else
			if UseQ and Q:IsReady() then
				Q:__Cast(CloseMinion)
			end
			if UseW then
				local targetBall = nil
				local activeballs = GetValidBalls()
				for i, ball in ipairs(activeballs) do
					targetBall = ball
				end
				if (os.clock()-Q:GetLastCastTime() > Q.delay+0.1) and WStatus == nil and targetBall ~= nil then
					DelayAction(function() return W:__Cast(targetBall.object.x, targetBall.object.z) end, 0.1)
					--W:Cast(targetBall.object.x, targetBall.object.z)
					WStatus = "HaveBall"
				elseif WStatus == "HaveBall" then
					local ValidMinion = nil
					----=== Valid minion
					for i, minion in ipairs(JungleMinions.objects) do
						for j=1, 12 do
							if minion.name == FocusJungleNames[j] then 
								ValidMinion = minion
							end
						end
					end
					if not ValidMinion ~= nil then 
						ValidMinion = CloseMinion 
					end
					----=== Finished
					WStatus = nil
					W:__Cast(ValidMinion.x, ValidMinion.z)
					--W:Cast(myHero.x, myHero.z)
				end
			end
				

			if UseE and os.clock() - Q:GetLastCastTime() > 1 then
				E:__Cast(CloseMinion)
			end
		end
	elseif ValidTarget(FarMinion) and GetDistanceSqr(FarMinion) <= (Q.range + 588)^2 and GetDistanceSqr(FarMinion) > Q.rangeSqr and DLib:IsKillable(FarMinion, {_E}) then
		if Q:IsReady() and E:IsReady() then
			local QPos = Vector(myHero.visionPos) + Q.range * (Vector(FarMinion) - Vector(myHero)):normalized()
			Q:__Cast(QPos.x, QPos.z)
			QECombo = os.clock()
		end
	end	
end

function UpdateSpellData()
	if E.width ~= 2 * Widths[_E] and E:GetLevel() == 5 then
		E.width = 2 * Widths[_E]
	end
	
	if R.range ~= (Ranges[_R] + 75) and R:GetLevel() == 5 then
		R:SetRange(Ranges[_R] + 75)
	end
	if VIP_USER then
		W.status = WObject and 1 or 0
	else 
		W.status = WTrack
	end
end

function Combo()
	W:SetHitChance(Menu.Misc.Whitchance)
	SOWi:DisableAttacks()
	if not Q:IsReady() and (not W:IsReady() or not E:IsReady()) then
		SOWi:EnableAttacks()
	end
	UseSpells(Menu.Combo.UseQ, Menu.Combo.UseW, Menu.Combo.UseE, Menu.Combo.UseEQ, Menu.Combo.UseR)
end

function Harass(target)
	if Menu.Harass.ManaCheck > (myHero.mana / myHero.maxMana) * 100 then return end
	UseSpells(Menu.Harass.UseQ, Menu.Harass.UseW, Menu.Harass.UseE, Menu.Harass.UseEQ, false, target)
end

function OnTick()
	DrawPrediction = nil
	W.packetCast = false
	DrawJungleStealingIndicator = false
	BTOnTick()
	SOWi:EnableAttacks()
	DLib.combo = GetCombo()
	UpdateSpellData()--update the spells data
	DrawEQIndicators = false
	--Menu.Debug.DebugW = WTrack or W.status
	--if WTrack == 1 then PrintChat("OLOLOLO") end
	if os.clock() - W:GetLastCastTime() > 1 and not W:IsReady() then
		WStatus = nil
	end
	
	if Menu.Combo.Enabled then
		Combo()
	elseif (Menu.Harass.Enabled or Menu.Harass.Enabled2) and not Menu.Harass.PP then
		Harass()
	end

	if Menu.Farm.LaneClear or Menu.Farm.Freeze then
		Farm()
	end

	if Menu.JungleFarm.Enabled then
		JungleFarm()
	end

	if Menu.R.UseR then
		local Rtarget = STS:GetTarget(R.range)
		if Rtarget then
			R:Cast(Rtarget)
		end
	end

	if Menu.Misc.WPet then
		AutoGrabPets()
	end

	if Menu.R.DontUseR then
		DontUseRTime = os.clock()
		UseRTime = 0
	end

	if Menu.R.CastR then
		UseRTime = os.clock()
		DontUseRTime = 0
	end

	if Menu.Misc.MEQ and Q:IsReady() and E:IsReady() then
		DrawEQIndicators = true
		local PosibleTargets = GetEnemyHeroes()
		local ClosestTargetMouse 
		local closestdist = 200 * 200
		for i, target in ipairs(PosibleTargets) do
			local dist = GetDistanceSqr(mousePos, target)
			if ValidTarget(target) and dist < closestdist then
				ClosestTargetMouse = target
				closestdist = dist
			end
		end
		if ClosestTargetMouse and GetDistanceSqr(ClosestTargetMouse, myHero.visionPos) < (QERange + 300)^2 then
			if GetDistanceSqr(ClosestTargetMouse) < Q.rangeSqr then
				StartEQCombo(ClosestTargetMouse, true)
			else
				StartEQCombo(ClosestTargetMouse)
			end
		end
	end
end

function GetDistanceToClosestHero(p)
	local result = math.huge
	for i, enemy in ipairs(GetEnemyHeroes()) do
		if ValidTarget(enemy) then
			result = math.min(result, GetDistanceSqr(p, enemy))
		end
	end
	return result
end

myHero.barData = {PercentageOffset = {x = 0, y = 0}}

function OnDraw()
	if DPP ~= nil then DrawCircle3D(DPP.x, myHero.y, DPP.z, 40, 3, ARGB(255, 255, 0, 111), 20) end
	if Menu.Drawings.DrawPredictedHealth then
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) then
				DrawIndicator(enemy)
			end
		end
	end
	if Menu.Debug.DebugBall then
		BTOnDraw()
	end
	if DrawEQIndicators then
		DrawCircle3D(mousePos.x, mousePos.y, mousePos.z, 200, 3, GetDistanceToClosestHero(mousePos) < 200 * 200 and ARGB(200, 255, 0, 0) or ARGB(200, 0, 255, 0), 20)--sorry for colorblind people D:
	end

	if GetTarget() and GetTarget().type == 'obj_AI_Minion' and GetTarget().team == TEAM_NEUTRAL then
		DrawCircle3D(GetTarget().x, GetTarget().y, GetTarget().z, 100, 2, Menu.JungleFarm.Enabled and ARGB(175, 255, 0, 0) or ARGB(175, 0, 255, 0), 25) --sorry for colorblind people D:
	end

	if DrawJungleStealingIndicator then
		local pos = GetEnemyHPBarPos(myHero) + Vector(20, -4)
		pos.x = math.floor(pos.x)
		pos.y = math.floor(pos.y)

		DrawText(tostring("JungleStealing"), 16, pos.x+1, pos.y+1, ARGB(255, 0, 0, 0))
		DrawText(tostring("JungleStealing"), 16, pos.x, pos.y, ARGB(255, 255, 255, 255))
	end

	if Menu.Harass.Enabled2 then
		local pos = GetEnemyHPBarPos(myHero) + Vector(0, -4)
		pos.x = math.floor(pos.x)
		pos.y = math.floor(pos.y)

		DrawText(tostring("AH"), 16, pos.x+1, pos.y+1, ARGB(255, 0, 0, 0))
		DrawText(tostring("AH"), 16, pos.x, pos.y, ARGB(255, 255, 255, 255))
	end
	if Menu.Harass.PP and (Menu.Harass.Enabled2 or Menu.Harass.Enabled) then
		local pos = GetEnemyHPBarPos(myHero) + Vector(0, -4)
		pos.x = math.floor(pos.x)
		pos.y = math.floor(pos.y)

		DrawText(tostring("PP"), 16, pos.x+20, pos.y+1, ARGB(255, 0, 0, 0))
		DrawText(tostring("PP"), 16, pos.x+20, pos.y, ARGB(255, 255, 255, 255))
	end
	if DrawPrediction ~= nil and Menu.Debug.DebugQ then
		DrawCircle3D(DrawPrediction.x, DrawPrediction.y, DrawPrediction.z, 100, 3, ARGB(200, 255, 111, 111), 20)--sorry for colorblind people D:
	end
end

function IsChasing(target)
	
end
function IsKillable(target, combo)
	dmg = DLib:CalcComboDamage(target, combo)	
	if ActDFGed(target) then dmg = dmg*1.2 end
	if target.health <= dmg then
		return true
	else
		return false
	end
end

function ActDFGed(target)
	if TargetHaveBuff("deathfiregraspspell", target) or GetInventoryItemIsCastable(ItemManager:GetItem("DFG"):GetId()) then
		return true
	else
		return false
	end
end

function DrawIndicator(enemy)
	local damage = DLib:CalcComboDamage(enemy, GetCombo())
	if ActDFGed(enemy) then damage = damage*1.2 end
    local SPos, EPos = GetEnemyHPBarPos(enemy)

    -- Validate data
    if not SPos then return end

    local barwidth = EPos.x - SPos.x
    local Position = SPos.x + math.max(0, (enemy.health - damage) / enemy.maxHealth) * barwidth

    DrawText("|", 16, math.floor(Position), math.floor(SPos.y + 8), ARGB(255,0,255,0))
    DrawText("HP: "..math.floor(enemy.health - damage), 13, math.floor(SPos.x), math.floor(SPos.y), (enemy.health - damage) > 0 and ARGB(255, 0, 255, 0) or  ARGB(255, 255, 0, 0))

end 

 

 

i bez 2x f9 powinno działać.

QUhIR7.png

Opublikowano

Wkleiłem to twoje i mi nie działa, wyskakuje problem z sourcelib. Wrzuc swoje sourcelib jakbys mogl

g0Tef.jpg

Opublikowano

Używaj tego

 

 

if myHero.charName ~= "Orianna" then return end

local version = 1.188
local AUTOUPDATE = true
local SCRIPT_NAME = "Orianna"

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local SOURCELIB_URL = "https://raw.github.com/TheRealSource/public/master/common/SourceLib.lua"
local SOURCELIB_PATH = LIB_PATH.."SourceLib.lua"

if FileExist(SOURCELIB_PATH) then
	require("SourceLib")
else
	DOWNLOADING_SOURCELIB = true
	DownloadFile(SOURCELIB_URL, SOURCELIB_PATH, function() print("Required libraries downloaded successfully, please reload") end)
end

if DOWNLOADING_SOURCELIB then print("Downloading required libraries, please wait...") return end

if AUTOUPDATE then
	 SourceUpdater(SCRIPT_NAME, version, "raw.github.com", "/Hellsing/BoL/master/"..SCRIPT_NAME..".lua", SCRIPT_PATH .. GetCurrentEnv().FILE_NAME, "/Hellsing/BoL/master/version/"..SCRIPT_NAME..".version"):CheckUpdate()
end

local RequireI = Require("SourceLib")
RequireI:Add("vPrediction", "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua")
RequireI:Add("SOW", "https://raw.github.com/Hellsing/BoL/master/common/SOW.lua")
RequireI:Check()

if RequireI.downloadNeeded == true then return end

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local InitiatorsList = 
	{
	  ["Vi"] = "ViQ",--R
	  ["Vi"] = "ViR",--R
	  ["Malphite"] = "Landslide",--R UFSlash
	  ["Nocturne"] = "NocturneParanoia",--R
	  ["Zac"] = "ZacE",--E
	  ["MonkeyKing"] = "MonkeyKingNimbus",--R
	  ["MonkeyKing"] = "MonkeyKingSpinToWin",--R
	  ["MonkeyKing"] = "SummonerFlash",--Flash
	  ["Shyvana"] = "ShyvanaTransformCast",--R
	  ["Thresh"] = "threshqleap",--Q2
	  ["Aatrox"] = "AatroxQ",--Q
	  ["Renekton"] = "RenektonSliceAndDice",--E
	  ["Kennen"] = "KennenLightningRush",--E
	  ["Kennen"] = "SummonerFlash",--Flash
	  ["Olaf"] = "OlafRagnarok",--R
	  ["Udyr"] = "UdyrBearStance",--E
	  ["Volibear"] = "VolibearQ",--Q
	  ["Talon"] = "TalonCutthroat",--e?
	  ["JarvanIV"] = "JarvanIVDragonStrike",--Q
	  ["Warwick"] = "InfiniteDuress",--R
	  ["Jax"] = "JaxLeapStrike",--Q
	  ["Yasuo"] = "YasuoRKnockUpComboW",--Q
	  ["Diana"] = "DianaTeleport",
	  ["LeeSin"] = "BlindMonkQTwo",
	  ["Shen"] = "ShenShadowDash",
	  ["Alistar"] = "Headbutt",
	  ["Amumu"] = "BandageToss",
	  ["Urgot"] = "UrgotSwap2",
	  ["Rengar"] = "RengarR",
	}

local InterruptList = 
	{
	  ["Katarina"] = "KatarinaR",
	  ["Malzahar"] = "AlZaharNetherGrasp",
	  ["Warwick"] = "InfiniteDuress",
	  ["Velkoz"] = "VelkozR"
	}
	
--[[Spell data]]
local Qradius = 80
local Wradius = 245
local Eradius = 80
local Rradius = 380

local Qrange = 825
local Erange = 1095

local Qdelay = 0
local Wdelay = 0.25
local Edelay = 0.25
local Rdelay = 0.6

local BallSpeed = 1200--Q
local BallSpeedE = 1700--E

_IGNITE = nil
_AA = 142857

--[[Spell damage]]
local Qdamage = {60, 90, 120, 150, 180}
local Qscaling = 0.5
local Wdamage = {70, 115, 160, 205, 250}
local Wscaling = 0.7
local Edamage = {60, 90, 120, 150, 180}
local Escaling = 0.3
local Rdamage = {150, 225, 300}
local Rscaling = 0.7
local AAdamage = {10, 10, 10, 18, 18, 18, 26, 26, 26, 34, 34, 34, 42, 42, 42, 50, 50, 50}
local AAscaling = 0.15

local MainCombo = {_AA, _AA, _Q, _W, _R, _Q, _IGNITE}
local Far = 1.3

--[[Ball]]
local BallPos = myHero
local BallMoving = false

--[[CDS]]
local QREADY = true
local WREADY = true
local EREADY = true
local RREADY = true
local IGNITEREADY = true

--[[VPrediction]]
local VP

local Menu = nil

local SelectedTarget = nil

local DamageToHeros = {}
local lastrefresh = 0

local ComboMode
local _ST, _TF  = 1,2

local LastChampionSpell = {}

--[[Ball location]]
function OnCreateObj(obj)
	--[[Casting Q creates this object when ball lands]]
        if obj.name:lower():find("yomu_ring_green") then
                BallPos = obj
                BallMoving = false
        end
        
        --[[When ball goes out of range it returns to Orianna and creates this object]]
        if (obj.name:lower():find("orianna_ball_flash_reverse")) then
            BallPos = myHero
			BallMoving = false
        end
end

function OnProcessSpell(unit, spell)
	if unit.isMe and spell.name:lower():find("orianaizunacommand") then--Q
		BallMoving = true
		DelayAction(function(p) BallPos = Vector(p) end, GetDistance(spell.endPos, BallPos) / BallSpeed - GetLatency()/1000 - 0.35, {Vector(spell.endPos)})
	end

	if unit.isMe and spell.name:lower():find("orianaredactcommand") then--E
		BallMoving = true
		BallPos = spell.target
	end

	if unit.type == "obj_AI_Hero" then
		LastChampionSpell[unit.networkID] = {name = spell.name, time=os.clock()}
	end
end

function OnGainBuff(unit, buff)
	--[[When the ball reaches an ally]]
	if unit.team == myHero.team and buff.name:lower():find("orianaghostself") then
		BallMoving = false
		BallPos = unit
	end
end
--[[End of ball location]]


function OnLoad()
	Menu = scriptConfig("Orianna", "Orianna")
	--[[Combo]]

	VP = VPrediction()
	SOWi = SOW(VP)
	Menu:addSubMenu("Orbwalking", "Orbwalking")
	SOWi:LoadToMenu(Menu.Orbwalking)

	Menu:addSubMenu("Combo", "Combo")
		Menu.Combo:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF , true)
		Menu.Combo:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseR", "Use R", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("UseRN", "Use R at least in", SCRIPT_PARAM_LIST, 1, { "1 target", "2 targets", "3 targets", "4 targets" , "5 targets"})
		Menu.Combo:addParam("UseI", "Use Ignite if enemy is killable", SCRIPT_PARAM_ONOFF, true)
		Menu.Combo:addParam("Enabled", "Normal combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)

	Menu:addSubMenu("Misc", "Misc")
		Menu.Misc:addParam("UseW", "Auto-W if it will hit", SCRIPT_PARAM_LIST, 1, { "No", ">0 targets", ">1 targets", ">2 targets", ">3 targets", ">4 targets" })
		Menu.Misc:addParam("UseR", "Auto-ultimate if it will hit", SCRIPT_PARAM_LIST, 1, { "No", ">0 targets", ">1 targets", ">2 targets", ">3 targets", ">4 targets" })
		Menu.Misc:addParam("EQ", "Use E + Q if tEQ < %x * tQ", SCRIPT_PARAM_SLICE, 100, 0, 200)
		Menu.Misc:addSubMenu("Auto-E on initiators", "AutoEInitiate")
		local added = false
		for champion, spell in pairs(InitiatorsList) do
			for i, ally in ipairs(GetAllyHeroes()) do
				if ally.charName == champion then
					added = true
					Menu.Misc.AutoEInitiate:addParam(champion..spell, champion.." ("..spell..")", SCRIPT_PARAM_ONOFF, true)
				end
			end
		end
	
		if not added then
			Menu.Misc.AutoEInitiate:addParam("info", "Info", SCRIPT_PARAM_INFO, "Not supported initiators found")
		else
			Menu.Misc.AutoEInitiate:addParam("Active", "Active", SCRIPT_PARAM_ONOFF, true)
		end
		Menu.Misc:addParam("Interrupt", "Auto interrupt important spells", SCRIPT_PARAM_ONOFF, true)
		Menu.Misc:addParam("BlockR", "Block R if it is not going to hit", SCRIPT_PARAM_ONOFF, true)

	--[[Harassing]]
	Menu:addSubMenu("Harass", "Harass")
		Menu.Harass:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF , true)
		Menu.Harass:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, false)
		Menu.Harass:addParam("ManaCheck", "Don't harass if mana < %", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Harass:addParam("Enabled", "Harass!", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
		Menu.Harass:addParam("Enabled2", "Harass (TOGGLE)!", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("L"))
	
	--[[Farming]]
	Menu:addSubMenu("Farm", "Farm")
		Menu.Farm:addParam("UseQ",  "Use Q", SCRIPT_PARAM_LIST, 4, { "No", "Freezing", "LaneClear", "Both" })
		Menu.Farm:addParam("UseW",  "Use W", SCRIPT_PARAM_LIST, 3, { "No", "Freezing", "LaneClear", "Both" })
		Menu.Farm:addParam("UseE",  "Use E", SCRIPT_PARAM_LIST, 3, { "No", "Freezing", "LaneClear", "Both" })
		Menu.Farm:addParam("ManaCheck", "Don't laneclear if mana < %", SCRIPT_PARAM_SLICE, 0, 0, 100)
		Menu.Farm:addParam("Freeze", "Farm Freezing", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("C"))
		Menu.Farm:addParam("LaneClear", "Farm LaneClear", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("V"))
	
	--[[Jungle farming]]
	Menu:addSubMenu("JungleFarm", "JungleFarm")
		Menu.JungleFarm:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("UseW", "Use W", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF, true)
		Menu.JungleFarm:addParam("Enabled", "Farm jungle!", SCRIPT_PARAM_ONKEYDOWN, false,   string.byte("V"))
	
	--[[Drawing]]
	Menu:addSubMenu("Drawing", "Drawing")
		Menu.Drawing:addParam("AArange", "Draw AA range", SCRIPT_PARAM_ONOFF, true)
		Menu.Drawing:addParam("Qrange", "Draw Q range", SCRIPT_PARAM_ONOFF, true)
		Menu.Drawing:addParam("Wrange", "Draw W radius", SCRIPT_PARAM_ONOFF, false)
		Menu.Drawing:addParam("Rrange", "Draw R radius", SCRIPT_PARAM_ONOFF, false)
		Menu.Drawing:addParam("DrawDamage", "Draw damage after combo in healthbars", SCRIPT_PARAM_ONOFF, true)
		Menu.Drawing:addParam("DrawBall", "Draw ball position", SCRIPT_PARAM_ONOFF, true)
		
	Menu:addParam("Version", "Version", SCRIPT_PARAM_INFO, version)
	
	EnemyMinions = minionManager(MINION_ENEMY, Qrange, myHero, MINION_SORT_MAXHEALTH_DEC)
	JungleMinions = minionManager(MINION_JUNGLE, Qrange, myHero, MINION_SORT_MAXHEALTH_DEC)
	
 	if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
		_IGNITE = SUMMONER_1
	elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
		_IGNITE = SUMMONER_2
	else
		_IGNITE = nil
	end
	PrintChat("<font color=\"#81BEF7\">[Orianna] Command: Load succesfully executed!</font>")
end

function GetComboDamage(Combo, Unit)
	local totaldamage = 0
	for i, spell in ipairs(Combo) do
		totaldamage = totaldamage + GetDamage(spell, Unit)
	end
	return totaldamage
end

function GetDamage(Spell, Unit)
	local truedamage = 0
	if Spell == _Q and myHero:GetSpellData(_Q).level ~= 0 then
		truedamage = myHero:CalcMagicDamage(Unit, Qdamage[myHero:GetSpellData(_Q).level] + myHero.ap * Qscaling)
	elseif Spell == _W and myHero:GetSpellData(_W).level ~= 0 and WREADY then
		truedamage = myHero:CalcMagicDamage(Unit, Wdamage[myHero:GetSpellData(_W).level] + myHero.ap * Wscaling)
	elseif Spell == _E and myHero:GetSpellData(_E).level ~= 0 then
		truedamage = myHero:CalcMagicDamage(Unit, Edamage[myHero:GetSpellData(_E).level] + myHero.ap * Escaling)
	elseif Spell == _R and myHero:GetSpellData(_R).level ~= 0 and RREADY then
		truedamage = myHero:CalcMagicDamage(Unit, Rdamage[myHero:GetSpellData(_R).level] + myHero.ap * Rscaling)
	elseif Spell == _AA and myHero:GetSpellData(_AA).level ~= 0 then
		truedamage = myHero:CalcDamage(Unit, myHero.totalDamage) + myHero:CalcMagicDamage(Unit, AAdamage[myHero.level] + myHero.ap * AAscaling)
	elseif Spell == _IGNITE and _IGNITE and IGNITEREADY then
		truedamage = 50 + 20 * myHero.level
	end
	return truedamage
end

--[[Check the number of enemies hit by casting W]]
function CheckEnemiesHitByW()
	local enemieshit = {}
	for i, enemy in ipairs(GetEnemyHeroes()) do
		local position = VP:GetPredictedPos(enemy, Wdelay)
		if ValidTarget(enemy) and GetDistance(position, BallPos) <= Wradius and GetDistance(enemy.visionPos, BallPos) <= Wradius then
			table.insert(enemieshit, enemy)
		end
	end
	return #enemieshit, enemieshit
end

--[[Check the number of enemies hit by casting E]]
function CheckEnemiesHitByE(To)
	local enemieshit = {}
	local StartPoint = Vector(BallPos.x, 0, BallPos.z)
	local EndPoint = Vector(To.x, 0, To.z)
	for i, enemy in ipairs(GetEnemyHeroes()) do
		local cp, hc, position = VP:GetLineCastPosition(enemy, Edelay, Eradius, math.huge, BallSpeedE, StartPoint)
		if position then
			local PointInLine, tmp, isOnSegment = VectorPointProjectionOnLineSegment(StartPoint, EndPoint, position)
			if ValidTarget(enemy) and isOnSegment and GetDistance(PointInLine, position) <= (Eradius + VP:GetHitBox(enemy)) and GetDistance(PointInLine, enemy.visionPos) < (Eradius) * 2 + 30 then
				table.insert(enemieshit, enemy)
			end
		end
	end
	return #enemieshit, enemieshit
end

--[[Check number of enemies hit by casting R]]
function CheckEnemiesHitByR()
	local enemieshit = {}
	for i, enemy in ipairs(GetEnemyHeroes()) do
		local position = VP:GetPredictedPos(enemy, Rdelay)
		if ValidTarget(enemy) and GetDistance(position, BallPos) <= Rradius and GetDistance(enemy.visionPos, BallPos) <= 1.25 * Rradius  then
			table.insert(enemieshit, enemy)
		end
	end
	return #enemieshit, enemieshit
end

function CastQ(target, fast)
	local Speed = BallSpeed * 1.5
	local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(target, Qdelay, Qradius, math.huge, Speed, BallPos)
	local CastPoint = CastPosition

	if (HitChance < 2) then return end

	if GetDistance(myHero.visionPos, Position) > Qrange + Wradius + VP:GetHitBox(target) then
		target2 = GetBestTarget(Qrange, target)
		if target2 then
			CastPosition,  HitChance,  Position = VP:GetLineCastPosition(target2, Qdelay, Qradius, math.huge, Speed, BallPos)
			CastPoint = CastPosition
		else
			do return end
		end
	end

	if GetDistance(myHero.visionPos, Position) > (Qrange + Wradius + VP:GetHitBox(target))  then
		do return end
	end

	if EREADY and Menu.Misc.EQ ~= 0 then
		local TravelTime = GetDistance(BallPos, CastPoint) / BallSpeed
		local MinTravelTime = GetDistance(myHero, CastPoint) / BallSpeed + GetDistance(myHero, BallPos) / BallSpeedE
		local Etarget = myHero

		for i, ally in ipairs(GetAllyHeroes()) do
			if ValidTarget(ally, Erange, false) then
				local t = GetDistance(ally, CastPoint) / BallSpeed + GetDistance(ally, BallPos) / BallSpeedE
				if t < MinTravelTime then
					MinTravelTime = t
					Etarget = ally
				end
			end
		end


		if MinTravelTime < (Menu.Misc.EQ / 100) * TravelTime and (not Etarget.isMe or GetDistance(BallPos, myHero) > 100) and GetDistance(Etarget) < GetDistance(CastPoint) then
			CastE(Etarget)
			do return end
		end
	end
	if GetDistanceSqr(myHero.visionPos, CastPoint) < Qrange * Qrange then
		CastSpell(_Q, CastPoint.x, CastPoint.z)
	else
		CastPoint = Vector(myHero.visionPos) + Qrange * (Vector(CastPoint) - Vector(myHero)):normalized()
		CastSpell(_Q, CastPoint.x, CastPoint.z)
	end
end

function CastW()
	local hitcount, hit = CheckEnemiesHitByW()
	if hitcount >= 1 then
		Packet('S_CAST', {spellId=_W}):send()
	end
end

function CastE(target)
	if target then
		CastSpell(_E, target)
	end
end

function CastECH(target, n)
	local hitcount, hit = CheckEnemiesHitByE(target)
	if hitcount >= n then
		CastE(target)
	end
end

function CastR(target)
	local position = VP:GetPredictedPos(target, Rdelay)
	if GetDistance(position, BallPos) < Rradius and GetDistance(target, BallPos) < Rradius then
		Packet('S_CAST', {spellId = _R}):send()
	end
end

function GetNMinionsHit(Pos, radius)
	local count = 0
	for i, minion in pairs(EnemyMinions.objects) do
		if GetDistance(minion, Pos) < radius then
			count = count + 1
		end
	end
	return count
end

function GetNMinionsHitE(Pos)
	local count = 0
	local StartPoint = Vector(Pos.x, 0, Pos.z)
	local EndPoint = Vector(myHero.x, 0, myHero.z)
	for i, minion in pairs(EnemyMinions.objects) do
		local position = Vector(minion.x, 0, minion.z)
		local PointInLine = VectorPointProjectionOnLineSegment(StartPoint, EndPoint, position)
		if GetDistance(PointInLine, position) < Eradius then
			count = count + 1
		end
	end
	return count
end

function Farm(Mode)
	local UseQ
	local UseW
	local UseE
	if not SOWi:CanMove() then return end

	EnemyMinions:update()
	if Mode == "Freeze" then
		UseQ =  Menu.Farm.UseQ == 2
		UseW =  Menu.Farm.UseW == 2 
		UseE =  Menu.Farm.UseE == 2 
	elseif Mode == "LaneClear" then
		UseQ =  Menu.Farm.UseQ == 3
		UseW =  Menu.Farm.UseW == 3 
		UseE =  Menu.Farm.UseE == 3 
	end
	
	UseQ =  Menu.Farm.UseQ == 4 or UseQ
	UseW =  Menu.Farm.UseW == 4  or UseW
	UseE =  Menu.Farm.UseE == 4 or UseE
	
	if UseQ and QREADY then
		if UseW then
			local MaxHit = 0
			local MaxPos = 0
			for i, minion in pairs(EnemyMinions.objects) do
				if GetDistance(minion) <= Qrange then
					local MinionPos = VP:GetPredictedPos(minion, Qdelay, BallSpeed, BallPos)
					local Hit = GetNMinionsHit(minion, Wradius)
					if Hit >= MaxHit then
						MaxHit = Hit
						MaxPos = MinionPos
					end
				end
			end
			if MaxHit > 0 and MaxPos then
				CastSpell(_Q, MaxPos.x, MaxPos.z)
			end
		else
			for i, minion in pairs(EnemyMinions.objects) do
				if minion.health + 15 < GetDamage(_Q, minion) and not SOWi:InRange(minion) then
					local MinionPos = VP:GetPredictedPos(minion, Qdelay, BallSpeed, BallPos)
					CastSpell(_Q, MinionPos.x, MinionPos.z)
					break
				end
			end
		end
	end

	if UseW and WREADY then
		local Hit = GetNMinionsHit(BallPos, Wradius)
		if Hit >= 3 then
			Packet('S_CAST', {spellId=_W}):send()
		end
	end
	
	if UseE and EREADY then
		local Hit = GetNMinionsHitE(BallPos)
		if Hit >= 3 and (not WREADY or not UseW) then
			CastE(myHero)
		end
	end
end

function FarmJungle()
	JungleMinions:update()
	local UseQ = Menu.JungleFarm.UseQ 
	local UseW = Menu.JungleFarm.UseW 
	local UseE = Menu.JungleFarm.UseE 
	
	local Minion = JungleMinions.objects[1] and JungleMinions.objects[1] or nil
	
	if Minion then
		local Position = VP:GetPredictedPos(Minion, Qdelay, BallSpeed, BallPos)
		if UseQ and QREADY then
			CastSpell(_Q, Position.x, Position.z)
		end
		
		if UseW and WREADY and GetDistance(BallPos, Minion) < Wradius then
			Packet('S_CAST', {spellId=_W}):send()
		end
		
		if UseE and (not WREADY or not UseW) and EREADY and GetDistance(Minion) < 700 then
			local starget = myHero
			local dist = GetDistanceSqr(Minion)
			for i, ally in ipairs(GetAllyHeroes()) do
				local dist2 = GetDistanceSqr(ally, Minion)
				if ValidTarget(ally, Erange, false) and dist2 < dist then
					dist = dist2
					starget = ally
				end
			end
			CastE(starget)
		end
	end
end

function FindBestLocationToQ(target)
	local points = {}
	local targets = {}
	
	local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(target, Qdelay, Qradius, Qrange, BallSpeed, BallPos)
	table.insert(points, Position)
	table.insert(targets, target)
	
	for i, enemy in ipairs(GetEnemyHeroes()) do
		if ValidTarget(enemy, Qrange + Rradius) and enemy.networkID ~= target.networkID then
			CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, Qdelay, Qradius, Qrange, BallSpeed, BallPos)
			table.insert(points, Position)
			table.insert(targets, enemy)
		end
	end
	

	for o = 1, 5 do
		local MECa = MEC(points)
		local Circle = MECa:Compute()
		
		if Circle.radius <= Rradius and #points >= 3 and RREADY then
			return Circle.center, 3
		end
	
		if Circle.radius <= Wradius and #points >= 2 and WREADY then
			return Circle.center, 2
		end
		
		if #points == 1 then
			return Circle.center, 1
		elseif Circle.radius <= (Qradius + 50) and #points >= 1 then
			return Circle.center, 2
		end
		
		local Dist = -1
		local MyPoint = points[1]
		local index = 0
		
		for i=2, #points, 1 do
			if GetDistance(points[i], MyPoint) >= Dist then
				Dist = GetDistance(points[i], MyPoint)
				index = i
			end
		end
		if index > 0 then
			table.remove(points, index)
		end
	end
end


function GetBestTarget(Range, Ignore)
	local LessToKill = 100
	local LessToKilli = 0
	local target = nil
	
	for i, enemy in ipairs(GetEnemyHeroes()) do
		if ValidTarget(enemy, Range) then
			DamageToHero = myHero:CalcMagicDamage(enemy, 200)
			ToKill = enemy.health / DamageToHero
			if ((ToKill < LessToKill) or (LessToKilli == 0)) and (Ignore == nil or (Ignore.networkID ~= enemy.networkID)) then
				LessToKill = ToKill
				LessToKilli = i
				target = enemy
			end
		end
	end
	
	if SelectedTarget ~= nil and ValidTarget(SelectedTarget, Range) and (Ignore == nil or (Ignore.networkID ~= SelectedTarget.networkID)) then
		target = SelectedTarget
	end
	
	return target
end

function OnTickChecks()
	QREADY = (myHero:CanUseSpell(_Q) == READY) or ((myHero:GetSpellData(_Q).currentCd < 1) and (myHero:GetSpellData(_Q).level > 0))
	WREADY = (myHero:CanUseSpell(_W) == READY) or ((myHero:GetSpellData(_W).currentCd < 1) and (myHero:GetSpellData(_W).level > 0))
	EREADY = (myHero:CanUseSpell(_E) == READY) or ((myHero:GetSpellData(_E).currentCd < 1) and (myHero:GetSpellData(_E).level > 0))
	RREADY = (myHero:CanUseSpell(_R) == READY) or ((myHero:GetSpellData(_R).currentCd < 1) and (myHero:GetSpellData(_R).level > 0))

	IGNITEREADY = _IGNITE and myHero:CanUseSpell(_IGNITE) == READY or false
	
	if CountEnemyHeroInRange(Qrange + Rradius, myHero) == 1 then
		ComboMode = _ST
	else
		ComboMode = _TF
	end
	
	RefreshKillableTexts()
	
	if Menu.Misc.UseW > 1 and WREADY then
		local hitcount, hit = CheckEnemiesHitByW()
		if hitcount >= (Menu.Misc.UseW -1) then
			Packet('S_CAST', {spellId=_W}):send()
		end		
	end
	
	if Menu.Misc.UseR > 1 and RREADY then
		local hitcount, hit = CheckEnemiesHitByR()
		if (hitcount >= (Menu.Misc.UseR - 1)) and GetDistanceToClosestAlly(BallPos) < Qrange * Far then
			Packet('S_CAST', {spellId = _R}):send()
		end		
	end
	
	if Menu.Misc.AutoEInitiate.Active and EREADY then
		for i, unit in ipairs(GetAllyHeroes()) do
			if GetDistance(unit) < Erange then
				for champion, spell in pairs(InitiatorsList) do
					if LastChampionSpell[unit.networkID] and LastChampionSpell[unit.networkID].name ~=nil and Menu.Misc.AutoEInitiate[champion.. LastChampionSpell[unit.networkID].name] and (os.clock() - LastChampionSpell[unit.networkID].time < 1.5) then
						CastE(unit)
					end
				end
			end
		end
	end
	
	if Menu.Misc.Interrupt then
		for i, unit in ipairs(GetEnemyHeroes()) do
			for champion, spell in pairs(InterruptList) do
				if GetDistance(unit) <= Qrange and LastChampionSpell[unit.networkID] and spell == LastChampionSpell[unit.networkID].name and (os.clock() - LastChampionSpell[unit.networkID].time < 1) then
					CastSpell(_Q, unit.x, unit.z)
					if GetDistance(BallPos, unit) < Rradius then
						Packet('S_CAST', {spellId = _R}):send()
					end
				end
			end
		end
	end
end

function OnWndMsg(Msg, Key)
	if Msg == WM_LBUTTONDOWN then
		local minD = 0
		local starget = nil
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) then
				if GetDistance(enemy, mousePos) <= minD or starget == nil then
					minD = GetDistance(enemy, mousePos)
					starget = enemy
				end
			end
		end
		
		if starget and minD < 100 then
			if SelectedTarget and starget.charName == SelectedTarget.charName then
				SelectedTarget = nil
			else
				SelectedTarget = starget
				print("<font color=\"#FF0000\">Orianna: New target selected: "..starget.charName.."</font>")
			end
		end
	end
end

function Harass(target)
	if Menu.Harass.UseQ and target then
		CastQ(target)
	end
	if Menu.Harass.UseW then
		CastW()
	end
end

function GetDistanceToClosestAlly(p)
	local d = GetDistance(p, myHero)
	for i, ally in ipairs(GetAllyHeroes()) do
		if ValidTarget(ally, math.huge, false) then
			local dist = GetDistance(p, ally)
			if dist < d then
				d = dist
			end
		end
	end
	return d
end

function CountAllyHeroInRange(range, point)
	local n = 0
	for i, ally in ipairs(GetAllyHeroes()) do
		if ValidTarget(ally, math.huge, false) and GetDistanceSqr(point, ally) <= range * range then
			n = n + 1
		end
	end
	return n
end

function Combo(target)
	if ComboMode == _ST then--Single Target
		if target and ((GetDistanceSqr(target) < 300 * 300) or ((myHero.health/myHero.maxHealth <= 0.25) and (myHero.health/myHero.maxHealth < target.health/target.maxHealth))) then
			SOWi:DisableAttacks()
		end

		if target and Menu.Combo.UseR and CountEnemyHeroInRange(1000, target) >= CountAllyHeroInRange(1000, target)  then
			if target and GetComboDamage(MainCombo, target) > target.health and GetDistanceToClosestAlly(BallPos) < Qrange * Far then
				local hitcount, hit = CheckEnemiesHitByR()
				if hitcount >= Menu.Combo.UseRN then
					CastR(target)
				end
			end
		end

		if Menu.Combo.UseW then
			CastW()
		end
		
		if Menu.Combo.UseQ and target and QREADY then
			CastQ(target)
		end
		
		if Menu.Combo.UseE then
			for i, ally in ipairs(GetAllyHeroes()) do
				if ValidTarget(ally, math.huge, false) and GetDistance(ally) < Erange and CountEnemyHeroInRange(400, ally) >= 1 and (target == nil or GetDistance(ally, target) < 400) then
					CastE(ally)
				end
			end
		end
		
		if Menu.Combo.UseE then
			CastECH(myHero, 1)
		end
	else
		for i, enemy in ipairs(GetEnemyHeroes()) do
			if ValidTarget(enemy) and (GetDistanceSqr(enemy) < 300 * 300) and (myHero.health/myHero.maxHealth <= 0.25) then
				SOWi:DisableAttacks()
			end
		end
		if Menu.Combo.UseR then
			if CountEnemyHeroInRange(800, BallPos) > 1 then
				local hitcount, hit = CheckEnemiesHitByR()
				local potentialkills, kills = 0, 0
				if hitcount >= 2 then
					for i, champion in ipairs(hit) do
						if (champion.health - GetComboDamage(MainCombo, champion)) < 0.4*champion.maxHealth or (GetComboDamage(MainCombo, champion) >= 0.4*champion.maxHealth) then
							potentialkills = potentialkills + 1
						end
						if (champion.health - GetComboDamage(MainCombo, champion)) < 0 then
							kills = kills + 1
						end
					end
				end
				if (((GetDistanceToClosestAlly(BallPos) < Qrange * Far) and ((hitcount >= CountEnemyHeroInRange(800, BallPos))) or (potentialkills >= 2)) or kills >= 1) and hitcount >= Menu.Combo.UseRN then
					Packet('S_CAST', {spellId = _R}):send()
				end
			elseif Menu.Combo.UseRN == 1 then
				if target and GetComboDamage({_Q, _W, _R}, target) > target.health and GetDistanceToClosestAlly(BallPos) < Qrange * Far then
					CastR(target)
				end
			end
		end
		
		if Menu.Combo.UseW then
			CastW()
		end
		if target and SOWi:InRange(target) then
			SOWi:ForceTarget(target)
		end

		if Menu.Combo.UseQ and target then
			local Qposition, hit = FindBestLocationToQ(target)
			
			if Qposition and hit > 1 then
				CastSpell(_Q, Qposition.x, Qposition.z)
			else
				CastQ(target)
			end
		end
		
		if Menu.Combo.UseE and EREADY then
			if CountEnemyHeroInRange(800, BallPos) <= 2 then
				CastECH(myHero, 1)
			else
				CastECH(myHero, 2)
			end
			
			
			for i, ally in ipairs(GetAllyHeroes()) do
				if ValidTarget(ally, Erange, false) and CountEnemyHeroInRange(300, ally) >= 3 and (target == nil or GetDistance(ally, target) < 300) then
					CastSpell(_E, ally)
				end
			end
		end
	end
end

function OnTick()
	OnTickChecks()
	SOWi:EnableAttacks()
	SOWi:ForceTarget()
	local target = GetBestTarget(Qrange + Qradius)
	if not target then
		target = GetBestTarget(Qrange + Qradius * 2)
	end
	if Menu.Combo.Enabled then
		Combo(target)
	elseif (Menu.Harass.Enabled or Menu.Harass.Enabled2) and (Menu.Harass.ManaCheck <= (myHero.mana / myHero.maxMana * 100)) then
		Harass(target)
	end

	if Menu.Farm.Freeze or Menu.Farm.LaneClear then
		local Mode = Menu.Farm.Freeze and "Freeze" or "LaneClear"
		if Menu.Farm.ManaCheck >= (myHero.mana / myHero.maxMana * 100) then
			Mode = "Freeze"
		end

		Farm(Mode)
	end
	
	if Menu.JungleFarm.Enabled then
		FarmJungle()
	end
end


function OnSendPacket(p)
	if Menu.Misc.BlockR and p.header == Packet.headers.S_CAST then
		local packet = Packet(p)
		if packet:get('spellId') == _R then
			local hitnumber, hit = CheckEnemiesHitByR()
			if hitnumber == 0 then
				p:Block()
			end
		end
	end
end
--[[Drawing stuff: ]]

--[[Update the bar texts]]
function RefreshKillableTexts()
	if ((os.clock() - lastrefresh) > 0.3) and Menu.Drawing.DrawDamage then
		for i=1, heroManager.iCount do
			local enemy = heroManager:GetHero(i)
			if ValidTarget(enemy) then
				DamageToHeros[i] =  GetComboDamage(MainCombo, enemy) 
			end
		end
		lastrefresh = os.clock()
	end
end
	
--[[	Credits to zikkah	]]
function GetHPBarPos(enemy)
	enemy.barData = GetEnemyBarData()
	local barPos = GetUnitHPBarPos(enemy)
	local barPosOffset = GetUnitHPBarOffset(enemy)
	local barOffset = { x = enemy.barData.PercentageOffset.x, y = enemy.barData.PercentageOffset.y }
	local barPosPercentageOffset = { x = enemy.barData.PercentageOffset.x, y = enemy.barData.PercentageOffset.y }
	local BarPosOffsetX = 171
	local BarPosOffsetY = 46
	local CorrectionY =  0
	local StartHpPos = 31
	barPos.x = barPos.x + (barPosOffset.x - 0.5 + barPosPercentageOffset.x) * BarPosOffsetX + StartHpPos
	barPos.y = barPos.y + (barPosOffset.y - 0.5 + barPosPercentageOffset.y) * BarPosOffsetY + CorrectionY 
						
	local StartPos = Vector(barPos.x , barPos.y, 0)
	local EndPos =  Vector(barPos.x + 108 , barPos.y , 0)

	return Vector(StartPos.x, StartPos.y, 0), Vector(EndPos.x, EndPos.y, 0)
end

function DrawIndicator(unit, health)
	local SPos, EPos = GetHPBarPos(unit)
	local barlenght = EPos.x - SPos.x
	local Position = SPos.x + (health / unit.maxHealth) * barlenght
	if Position < SPos.x then
		Position = SPos.x
	end
	DrawText("|", 13, Position, SPos.y+10, ARGB(255,0,255,0))
end

function DrawOnHPBar(unit, health)
	local Pos = GetHPBarPos(unit)
	if health < 0 then
		DrawCircle2(unit.x, unit.y, unit.z, 100, ARGB(255, 255, 0, 0))	
		DrawText("HP: "..health,13, Pos.x, Pos.y, ARGB(255,255,0,0))
	else
		DrawText("HP: "..health,13, Pos.x, Pos.y, ARGB(255,0,255,0))
	end
end

--[[Credits to barasia, vadash and viseversa for anti-lag circles]]
function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
	radius = radius or 300
	quality = math.max(8,math.floor(180/math.deg((math.asin((chordlength/(2*radius)))))))
	quality = 2 * math.pi / quality
	local points = {}
	for theta = 0, 2 * math.pi + quality, quality do
		local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
		points[#points + 1] = D3DXVECTOR2(c.x, c.y)
	end
	DrawLines2(points, width or 1, color or 4294967295)
end

function DrawCircle2(x, y, z, radius, color)
	local vPos1 = Vector(x, y, z)
	local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
	local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
	local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
	if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y })  then
		DrawCircleNextLvl(x, y, z, radius, 1, color, 75)	
	end
end


function OnDraw()
	if Menu.Drawing.AArange then
		DrawCircle2(myHero.x, myHero.y, myHero.z, SOWi:MyRange() + 50, ARGB(255, 0, 255, 0))
	end

	if Menu.Drawing.Qrange then
		DrawCircle2(myHero.x, myHero.y, myHero.z, Qrange, ARGB(255, 0, 255, 0))
	end
	
	if Menu.Drawing.Erange then
		DrawCircle2(myHero.x, myHero.y, myHero.z, Erange, ARGB(255, 0, 255, 0))
	end
	
	if Menu.Drawing.Wrange then
		DrawCircle2(BallPos.x, BallPos.y, BallPos.z, Wradius, ARGB(255,0,255,0))
	end
	
	if Menu.Drawing.Rrange then
		DrawCircle2(BallPos.x, BallPos.y, BallPos.z, Rradius, ARGB(255,0,255,0))
	end
	
	if Menu.Drawing.DrawBall then
		DrawCircle2(BallPos.x, BallPos.y, BallPos.z, 100, ARGB(255,0,255,0))
	end
	
	--[[HealthBar HP tracker]]
	if Menu.Drawing.DrawDamage then
		for i=1, heroManager.iCount do
			local enemy = heroManager:GetHero(i)
			if ValidTarget(enemy) then
				if DamageToHeros[i] ~= nil then
					RemainingHealth = enemy.health - DamageToHeros[i]
				end
				if RemainingHealth ~= nil then
					DrawIndicator(enemy, math.floor(RemainingHealth))
					DrawOnHPBar(enemy, math.floor(RemainingHealth))
				end
			end
		end
	end

	if SelectedTarget ~= nil and ValidTarget(SelectedTarget) then
		DrawCircle2(SelectedTarget.x, SelectedTarget.y, SelectedTarget.z, 100, ARGB(255,255,0,0))
	end
end
 

 

 

ten sam błąd ;/ 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...