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

Sprawdź mój plugin do SAC pod niego, castowanie E jest dosyć słabe (rzuca po prostu na środku, nie chciało mi się robić logiki do tego) - możesz wyłączyć. Testowany tylko raz, więc mogą być błędy.

--[[
	Auto Carry Plugin - Veigar
		Author: mathiasmm
		Version: 1.0a
		Dependency: Sida's Auto Carry
 
	How to install:
		- Make sure you already have AutoCarry installed.
		- Name the script EXACTLY "SidasAutoCarryPlugin - Veigar.lua" without the quotes.
		- Place the plugin in BoL/Scripts/Common folder.

	Features:
		- Fully customizable ability options in Auto Carry Mode (Q, W, E, R)
		- Fully customizable ability options in Mixed Mode (Q, W)
		- Mixed Mode with Mana Manager
		- Smart Killsteal (Q, W or R)
				
	Version History:
		1.0 - Initial release
		1.0a - AoE Skillshot Position
--]]

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

function PluginOnLoad()
	mainLoad()
	mainMenu()
end

function PluginOnTick()
	Checks()
	if Carry.AutoCarry then Ownage() end
	if Carry.LaneClear then LaneClear() end
	if Carry.MixedMode then Poke() end
	if Plugin.extras.smartKS then smartKS() end
	if Plugin.extras.farmQ then farmQ() end
end

function Ownage()
	if Target then
		if EREADY and GetDistance(Target) <= eRange and Plugin.autocarry.useE then
			CastE()
		end	

		if WREADY and Plugin.autocarry.useW and not Target.canMove then
			AutoCarry.CastSkillshot(SkillW, Target)
		end
		
		if QREADY and Plugin.autocarry.useQ then
			CastSpell(_Q, Target)
		end
		
		if RREADY and Plugin.autocarry.useR then
			CastSpell(_R, Target)
		end
	end 
end

function CastE()
	local Enemies = AutoCarry.EnemyTable
		local ValidTargets = 0
			for i, Enemy in pairs(Enemies) do
				if Enemy ~= nil and not Enemy.dead and Enemy.visible then
					ValidTargets = ValidTargets + 1
				end
			end
			
	local spellPos = GetAoESpellPosition((eWidth / 2), Target, eDelay)
		if ValidTargets >= Plugin.extras.wMin then
			if Plugin.extras.wMEC then CastSpell(_E, spellPos.x, spellPos.z)
			else CastSpell(_E, Target.x, Target.z) end
		end
end

function smartKS()
	for i = 1, heroManager.iCount, 1 do
		local enemy = heroManager:getHero(i)
			if ValidTarget(enemy) then
				local qDmg = getDmg("Q", enemy, myHero)
				local wDmg = getDmg("W", enemy, myHero)
				local rDmg = getDmg("R", enemy, myHero)
				
				if enemy.health <= qDmg then
					CastSpell(_Q, enemy)
				elseif enemy.health <= wDmg then
					CastSpell(_E, enemy.x, enemy.z)
					if not enemy.canMove then AutoCarry.CastSkillshot(SkillW, enemy) end
				elseif enemy.health <= rDmg then
					CastSpell(_R, enemy)
				elseif enemy.health <= qDmg + rDmg then
					CastSpell(_Q, enemy)
					CastSpell(_R, enemy)
				end
			end
	end
end

function farmQ()
	if not IsMyManaLow() then
		for _, minion in pairs(AutoCarry.EnemyMinions().objects) do
			if ValidTarget(minion) and QREADY and GetDistance(minion) <= qRange then
				if minion.health < getDmg("Q", minion, myHero) then 
					CastSpell(_Q, minion) 
				end
			end
		end
	end
end

function Poke()
	if Target ~= nil and not IsMyManaLow() then
		if WREADY and GetDistance(Target) <= wRange and Plugin.mixedmode.mixedW then
			AutoCarry.CastSkillshot(SkillW, Target)
		end
		if QREADY and GetDistance(Target) <= qRange and Plugin.mixedmode.mixedQ then
			CastSpell(_Q, Target)
		end
	end
end

--[[ menu, checks and other stuff ]]--
function IsMyManaLow()
	if myHero.mana < (myHero.maxMana * (Plugin.extras.minMana / 100)) then
		return true
	else
		return false
	end
end

function Checks()
	QREADY = (myHero:CanUseSpell(_Q) == READY)
	WREADY = (myHero:CanUseSpell(_W) == READY)
	EREADY = (myHero:CanUseSpell(_E) == READY)
	RREADY = (myHero:CanUseSpell(_R) == READY)
	Target = AutoCarry.GetAttackTarget()
end

function mainLoad()
	qRange = 650
	wRange = 900
	eRange = 650
	rRange = 650
	
	eWidth = 375
	wWidth = 185
	
	wDelay = 1200
	eDelay = 500

	wSpeed = 1350
	
	AutoCarry.SkillsCrosshair.range = 900
	SkillW = {spellKey = _W, range = wRange, speed = wSpeed, delay = wDelay, width = wWidth}
	Carry = AutoCarry.MainMenu
	Plugin = AutoCarry.PluginMenu
end

function mainMenu()
	Plugin:addSubMenu("Auto Carry: Settings", "autocarry")
	Plugin.autocarry:addParam("useQ", "Use Baleful Strike (Q) in Auto Carry", SCRIPT_PARAM_ONOFF, true)
	Plugin.autocarry:addParam("useW", "Use Dark Matter (W) in Auto Carry", SCRIPT_PARAM_ONOFF, true)
	Plugin.autocarry:addParam("useE", "Use Event Horizon (E) in Auto Carry", SCRIPT_PARAM_ONOFF, true)
	Plugin.autocarry:addParam("useR", "Use Primordial Burst (R) in Auto Carry", SCRIPT_PARAM_ONOFF, true)

	Plugin:addSubMenu("Mixed Mode: Settings", "mixedmode")
	Plugin.mixedmode:addParam("mixedQ", "Use Baleful Strike (Q) in Mixed Mode", SCRIPT_PARAM_ONOFF, true)
	Plugin.mixedmode:addParam("mixedW", "Use Dark Matter (W) in Mixed Mode", SCRIPT_PARAM_ONOFF, false)
	
	Plugin:addSubMenu("Extras: Settings", "extras")
	Plugin.extras:addParam("smartKS", "Killsteal!", SCRIPT_PARAM_ONOFF, true)
	Plugin.extras:addParam("farmQ", "Farm with Q", SCRIPT_PARAM_ONOFF, true)
	Plugin.extras:addParam("wMEC", "Use AoE MEC with (W)", SCRIPT_PARAM_ONOFF, true)
	Plugin.extras:addParam("wMin", "Minimum enemies to hit with (W)", SCRIPT_PARAM_SLICE, 2, 1, 5, 0)
	Plugin.extras:addParam("minMana", "Mana Manager", SCRIPT_PARAM_SLICE, 40, 0, 100, 0)
end

--[[ 
	AoESkillshotPosition 2.0 by monogato
	
	GetAoESpellPosition(radius, main_target, [delay]) returns best position in order to catch as many enemies as possible with your AoE skillshot, making sure you get the main target.
	Note: You can optionally add delay in ms for prediction (VIP if avaliable, normal else).
]]

function GetCenter(points)
	local sum_x = 0
	local sum_z = 0
	
	for i = 1, #points do
		sum_x = sum_x + points[i].x
		sum_z = sum_z + points[i].z
	end
	
	local center = {x = sum_x / #points, y = 0, z = sum_z / #points}
	
	return center
end

function ContainsThemAll(circle, points)
	local radius_sqr = circle.radius*circle.radius
	local contains_them_all = true
	local i = 1
	
	while contains_them_all and i <= #points do
		contains_them_all = GetDistanceSqr(points[i], circle.center) <= radius_sqr
		i = i + 1
	end
	
	return contains_them_all
end

-- The first element (which is gonna be main_target) is untouchable.
function FarthestFromPositionIndex(points, position)
	local index = 2
	local actual_dist_sqr
	local max_dist_sqr = GetDistanceSqr(points[index], position)
	
	for i = 3, #points do
		actual_dist_sqr = GetDistanceSqr(points[i], position)
		if actual_dist_sqr > max_dist_sqr then
			index = i
			max_dist_sqr = actual_dist_sqr
		end
	end
	
	return index
end

function RemoveWorst(targets, position)
	local worst_target = FarthestFromPositionIndex(targets, position)
	
	table.remove(targets, worst_target)
	
	return targets
end

function GetInitialTargets(radius, main_target)
	local targets = {main_target}
	local diameter_sqr = 4 * radius * radius
	
	for i=1, heroManager.iCount do
		target = heroManager:GetHero(i)
		if target.networkID ~= main_target.networkID and ValidTarget(target) and GetDistanceSqr(main_target, target) < diameter_sqr then table.insert(targets, target) end
	end
	
	return targets
end

function GetPredictedInitialTargets(radius, main_target, delay)
	if VIP_USER and not vip_target_predictor then vip_target_predictor = TargetPredictionVIP(nil, nil, delay/1000) end
	local predicted_main_target = VIP_USER and vip_target_predictor:GetPrediction(main_target) or GetPredictionPos(main_target, delay)
	local predicted_targets = {predicted_main_target}
	local diameter_sqr = 4 * radius * radius
	
	for i=1, heroManager.iCount do
		target = heroManager:GetHero(i)
		if ValidTarget(target) then
			predicted_target = VIP_USER and vip_target_predictor:GetPrediction(target) or GetPredictionPos(target, delay)
			if target.networkID ~= main_target.networkID and GetDistanceSqr(predicted_main_target, predicted_target) < diameter_sqr then table.insert(predicted_targets, predicted_target) end
		end
	end
	
	return predicted_targets
end

-- I don´t need range since main_target is gonna be close enough. You can add it if you do.
function GetAoESpellPosition(radius, main_target, delay)
	local targets = delay and GetPredictedInitialTargets(radius, main_target, delay) or GetInitialTargets(radius, main_target)
	local position = GetCenter(targets)
	local best_pos_found = true
	local circle = Circle(position, radius)
	circle.center = position
	
	if #targets > 2 then best_pos_found = ContainsThemAll(circle, targets) end
	
	while not best_pos_found do
		targets = RemoveWorst(targets, position)
		position = GetCenter(targets)
		circle.center = position
		best_pos_found = ContainsThemAll(circle, targets)
	end
	
	return position
end

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...