Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Sida's Auto Carry - Reborn
- Lucian plugin by fbragequit
- v1.1.1
- ]]
- function PluginOnLoad()
- qCastRange, qMaxRange, qWidth, qDelay = 680, 1100, 65, 350
- wRange, wSpeed, wWidth, wDelay = 1000, 1.6, 80, 300
- AARange = 680 -- 550
- Menu = AutoCarry.PluginMenu
- Menu:addParam("info", " — Q options —", SCRIPT_PARAM_INFO, "")
- Menu:addParam("qCarry", "Use in Auto Carry Mode", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qHarass", "Use in Mixed Mode", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qPassiveWeave", "Don't cast with passive", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qSheenWeave", "Wait for Sheen/Trinity", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qHarassMana", "Mana manager (Mixed Mode)", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
- Menu:addParam("qAfterAttack", "Cast only after AA (RELOAD)", SCRIPT_PARAM_ONOFF, false)
- Menu:addParam("info", "Custom Q logic (OFF = simple direct casts)", SCRIPT_PARAM_INFO, "")
- Menu:addParam("qLogicCarry", " » in AutoCarry mode", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qLogicHarass", " » in Mixed Mode", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qPrioAoE", "AoE if can multishot >=", SCRIPT_PARAM_SLICE, 3, 3, 5, 0)
- Menu:addParam("info", " — W options —", SCRIPT_PARAM_INFO, "")
- Menu:addParam("wCarry", "Use in Auto Carry Mode", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("wChase", "Only when chasing (>AA range)", SCRIPT_PARAM_ONOFF, false)
- Menu:addParam("wPassiveWeave", "Don't cast with passive (<AA range)", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("wSheenWeave", "Wait for Sheen/Trinity (<AA range)", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("info", " — Drawing —", SCRIPT_PARAM_INFO, "")
- Menu:addParam("qDraw", "Draw Q helpers", SCRIPT_PARAM_ONOFF, true)
- Menu:addParam("qDrawRange", "Draw Q range", SCRIPT_PARAM_ONOFF, false)
- Menu:addParam("wDrawRange", "Draw W range", SCRIPT_PARAM_ONOFF, false)
- AutoCarry.Crosshair:SetSkillCrosshairRange(1000)
- SkillQ = AutoCarry.Skills:NewSkill(false, _Q, qCastRange, "Piercing Light", AutoCarry.SPELL_TARGETED, 0, Menu.qAfterAttack, false, math.huge, qDelay, qWidth, false)
- SkillW = AutoCarry.Skills:NewSkill(false, _W, wRange, "Ardent Blaze", AutoCarry.SPELL_LINEAR_COL, 0, false, false, wSpeed, wDelay, wWidth, true)
- Prod = ProdictManager.GetInstance()
- qProd = Prod:AddProdictionObject(_Q, qMaxRange, math.huge, qDelay/1000, qWidth)
- AdvancedCallback:bind('OnLoseBuff', OnLoseBuff)
- Timer = 0
- end
- function PluginOnTick()
- qReady = myHero:CanUseSpell(_Q) == READY
- wReady = myHero:CanUseSpell(_W) == READY
- eReady = myHero:CanUseSpell(_E) == READY
- Target = AutoCarry.Crosshair:GetTarget(true)
- if Timer ~= 0 then
- if GetGameTimer() - Timer >= 2 then
- sFlag = false
- Timer = 0
- end
- end
- if Target then
- if AutoCarry.Keys.AutoCarry then
- if Menu.qCarry and qReady then
- qCast()
- end
- if Menu.wCarry and wReady then
- wCast()
- end
- end
- if AutoCarry.Keys.MixedMode then
- if qReady and Menu.qHarass and myHero.mana >= (myHero.maxMana * (Menu.qHarassMana / 100)) then
- qCast()
- end
- end
- end
- end
- function qCast()
- if not Menu.qLogicCarry then SkillQ:Cast(Target) return end
- if (Menu.qPassiveWeave and pFlag) or (Menu.qSheenWeave and sFlag) then return end
- local Units = {}
- local Champs = {}
- local i = 1
- for h, hero in pairs(AutoCarry.EnemyTable) do
- if GetDistance(hero) < qCastRange then
- table.insert(Units, hero)
- end
- if GetDistance(hero) < qMaxRange then
- table.insert(Champs, hero)
- Champs[i].prod = qProd:GetPrediction(hero)
- i = i + 1
- end
- end
- if Champs == {} then return end
- for m, minion in pairs(AutoCarry.EnemyMinions().objects) do
- table.insert(Units, minion)
- end
- local bestshot, bestshotHits, bestshotHitsTarget = nil, 0, 0
- for u, unit in pairs(Units) do
- local V = Vector(unit) - Vector(myHero)
- local Vn = V:normalized()
- local Vp = V:perpendicular():normalized()
- local a, b, c = Vn:unpack()
- local x, y, z = Vp:unpack()
- local startLeftX = myHero.x + (x * qWidth)
- local startLeftY = myHero.y + (y * qWidth)
- local startLeftZ = myHero.z + (z * qWidth)
- local startRightX = myHero.x - (x * qWidth)
- local startRightY = myHero.y - (y * qWidth)
- local startRightZ = myHero.z - (z * qWidth)
- local endLeftX = myHero.x + (x * qWidth) + (a * qMaxRange)
- local endLeftY = myHero.y + (y * qWidth) + (b * qMaxRange)
- local endLeftZ = myHero.z + (z * qWidth) + (c * qMaxRange)
- local endRightX = myHero.x - (x * qWidth) + (a * qMaxRange)
- local endRightY = myHero.y - (y * qWidth) + (b * qMaxRange)
- local endRightZ = myHero.z - (z * qWidth) + (c * qMaxRange)
- local startLeft = WorldToScreen(D3DXVECTOR3(startLeftX, startLeftY, startLeftZ))
- local startRight = WorldToScreen(D3DXVECTOR3(startRightX, startRightY, startRightZ))
- local endLeft = WorldToScreen(D3DXVECTOR3(endLeftX, endLeftY, endLeftZ))
- local endRight = WorldToScreen(D3DXVECTOR3(endRightX, endRightY, endRightZ))
- local Poly = Polygon(Point(startLeft.x, startLeft.y), Point(endLeft.x, endLeft.y), Point(endRight.x, endRight.y), Point(startRight.x, startRight.y))
- local hits, hitsTarget = 0, 0
- for c, champ in pairs(Champs) do
- local Pos = champ.prod
- if Pos == nil then Pos = champ end
- local toScreen = WorldToScreen(D3DXVECTOR3(Pos.x, Pos.y, Pos.z))
- local toPoint = Point(toScreen.x, toScreen.y)
- if Poly:contains(toPoint) then
- bestshot = unit
- hits = hits + 1
- if champ == Target then hitsTarget = 1 end
- end
- end
- if (hits > bestshotHits and hitsTarget >= bestshotHitsTarget) or hits >= Menu.qPrioAoE then
- bestshot, bestshotHits, bestshotHitsTarget = unit, hits, hitsTarget
- end
- end
- if bestshot ~= nil then
- SkillQ:Cast(bestshot)
- end
- if Menu.qDraw and Target then
- local V = Vector(Target) - Vector(myHero)
- local Vn = V:normalized()
- local Distance = GetDistance(Target)
- local tx, ty, tz = Vn:unpack()
- local TopX = Target.x - (tx * Distance)
- local TopY = Target.y - (ty * Distance)
- local TopZ = Target.z - (tz * Distance)
- local Vr = V:perpendicular():normalized()
- local Radius = GetDistance(Target, Target.minBBox)
- local tx, ty, tz = Vr:unpack()
- local LeftX = Target.x + (tx * Radius)
- local LeftY = Target.y + (ty * Radius)
- local LeftZ = Target.z + (tz * Radius)
- local RightX = Target.x - (tx * Radius)
- local RightY = Target.y - (ty * Radius)
- local RightZ = Target.z - (tz * Radius)
- Left = WorldToScreen(D3DXVECTOR3(LeftX, LeftY, LeftZ))
- Right = WorldToScreen(D3DXVECTOR3(RightX, RightY, RightZ))
- Top = WorldToScreen(D3DXVECTOR3(TopX, TopY, TopZ))
- end
- end
- function wCast()
- if GetDistance(Target) < AARange then
- if Menu.wChase then return end
- if (Menu.qPassiveWeave and pFlag) or (Menu.qSheenWeave and sFlag) then return end
- end
- SkillW:Cast(Target)
- end
- function OnLoseBuff(unit, buff)
- if unit.isMe then
- if buff.name == "sheen" then
- Timer = GetGameTimer()
- sFlag = true
- end
- if buff.name == "lucianpassivebuff" and pFlag then
- pFlag = false
- end
- end
- end
- function PluginOnProcessSpell(unit, spell)
- if unit.isMe then
- if spell.name == "LucianPassiveAttack" and pFlag then
- pFlag = false
- elseif spell.name == "LucianQ" or spell.name == "LucianW" or spell.name == "LucianE" or spell.name == "LucianR" and not pFlag then
- pFlag = true
- end
- end
- end
- function PluginOnDraw()
- if Menu.qDraw and Left and Right and Top then
- DrawLine(Left.x, Left.y, Right.x, Right.y, 1, 0xFF0000)
- DrawLine(Left.x, Left.y, Top.x, Top.y, 1, 0xFF0000)
- DrawLine(Right.x, Right.y, Top.x, Top.y, 1, 0xFF0000)
- Left, Right, Top = nil, nil, nil
- end
- if not myHero.dead then
- if qReady and Menu.qDrawRange then
- DrawCircle(myHero.x, myHero.y, myHero.z, qCastRange, 0x008080)
- end
- if wReady and Menu.wDrawRange then
- DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x32B2B2)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment