Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if myHero.charName ~= "Mordekaiser" then return end
- require "VPrediction"
- require "SOW"
- function OnLoad()
- PrintChat(">> Challenger Mordekaiser loaded")
- InitiateVariables()
- CreateMenu()
- end
- function OnTick()
- OnTickChecks()
- Combo()
- FlashCombo()
- end
- function OnDraw()
- DrawCircles()
- DrawComboKiller()
- end
- function InitiateVariables()
- --menu
- menu = nil
- --skills
- ignite = nil
- flash = nil
- dfgSlot = nil
- hxgSlot = nil
- bwcSlot = nil
- qReady = false
- wReady = false
- eReady = false
- rReady = false
- igniteReady = false
- flashReady = false
- dfgReady = false
- hxgReady = false
- bwcReady = false
- qRange = 600
- wRange = 750
- eRange = 700
- rRange = 850
- igniteRange = 600
- flashRange = 400
- dfgRange = 750
- hxgRange = 700
- bwcRange = 450
- ghostActive = false
- ghostActiveDelay = 0
- --prediction
- VP = VPrediction(true)
- --orbwalker
- NSOW = SOW(VP)
- --targets
- target = nil
- targetRange = 2000
- --target selector
- enemyCharNameList = {}
- enemyList = {}
- enemyPriorityList = {}
- enemyNum = 0
- GetEnemys()
- --summoners
- GetSummoners()
- end
- function CreateMenu()
- menu = scriptConfig("Challenger Mordekaiser", "Challenger Mordekaiser")
- menu:addSubMenu("Main","main")
- menu.main:addParam("combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- menu.main:addParam("allIn", "All In", SCRIPT_PARAM_ONKEYTOGGLE, false, 85)
- menu.main:addParam("flashCombo", "Flash Combo", SCRIPT_PARAM_ONKEYTOGGLE, false, 84)
- menu:addSubMenu("Draw","draw")
- menu.draw:addParam("drawCircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- menu.draw:addParam("drawComboKiller", "Draw Combo Killer", SCRIPT_PARAM_ONOFF, true)
- menu:addSubMenu("Target Selector","targetSelector")
- for i = 1, enemyNum do
- menu.targetSelector:addParam("enemy" .. i, enemyCharNameList[i], SCRIPT_PARAM_SLICE, 0, 0, 5, 0)
- end
- menu:addSubMenu("Orb Walking", "orbWalking")
- NSOW:LoadToMenu(menu.orbWalking)
- menu.main:permaShow("allIn")
- menu.main:permaShow("flashCombo")
- end
- function OnTickChecks()
- dfgSlot = GetInventorySlotItem(3128)
- hxgSlot = GetInventorySlotItem(3146)
- bwcSlot = GetInventorySlotItem(3144)
- qReady = myHero:CanUseSpell(_Q) == READY
- wReady = myHero:CanUseSpell(_W) == READY
- eReady = myHero:CanUseSpell(_E) == READY
- rReady = myHero:CanUseSpell(_R) == READY
- flashReady = flash and myHero:CanUseSpell(flash) == READY
- dfgReady = (dfgSlot ~= nil and myHero:CanUseSpell(dfgSlot) == READY)
- hxgReady = (hxgSlot ~= nil and myHero:CanUseSpell(hxgSlot) == READY)
- bwcReady = (bwcSlot ~= nil and myHero:CanUseSpell(bwcSlot) == READY)
- igniteReady = ignite and myHero:CanUseSpell(ignite) == READY
- ghostActive = myHero:GetSpellData(_R).name == "mordekaisercotgguide"
- target = GetBestTarget(targetRange)
- enemyPriorityList[1] = menu.targetSelector.enemy1
- enemyPriorityList[2] = menu.targetSelector.enemy2
- enemyPriorityList[3] = menu.targetSelector.enemy3
- enemyPriorityList[4] = menu.targetSelector.enemy4
- enemyPriorityList[5] = menu.targetSelector.enemy5
- end
- --noch machen
- function Combo()
- if ValidTargetA(target, igniteRange) and menu.main.combo then
- if menu.main.allIn then
- if dfgReady then
- CastSpell(dfgSlot, target)
- end
- if igniteReady then
- CastSpell(ignite, target)
- end
- if hxgReady then
- CastSpell(hxgSlot, target)
- end
- if bwcReady and GetDistance(target, myHero) <= bwcRange then
- CastSpell(bwcSlot, target)
- end
- if rReady then
- CastSpell(_R, target)
- end
- end
- if eReady then
- CastSpell(_E, target.x, target.z)
- end
- if qReady then
- CastSpell(_Q)
- end
- if wReady and IsEnemyInRange(wRange) then
- CastSpell(_W, myHero)
- end
- end
- if ValidTargetA(target, eRange) and menu.main.combo then
- if eReady then
- CastSpell(_E, target.x, target.z)
- end
- end
- if ValidTargetA(target) and menu.main.combo and ghostActive and ghostActiveDelay < GetTickCount() then
- CastSpell(_R, target)
- ghostActiveDelay = GetTickCount() + 1000
- end
- end
- function FlashCombo()
- if menu.main.flashCombo and menu.main.combo and target ~= nil and ValidTargetA(target, igniteRange + flashRange) and target.type == myHero.type and target.team ~= myHero.team and flashReady and GetDistance(target, myHero) <= igniteRange + flashRange and GetDistance(target, myHero) >= igniteRange then
- CastSpell(flash, target.x, target.z)
- menu.main.flashCombo = false
- end
- end
- function DrawCircles()
- if menu.draw.drawCircles then
- if target ~= nil and ValidTargetA(target) then
- DrawCircle2(target.x, target.y, target.z, 100, ARGB(255,255,0,0))
- end
- DrawCircle2(myHero.x, myHero.y, myHero.z, eRange, ARGB(255, 125, 0, 225))
- DrawCircle2(myHero.x, myHero.y, myHero.z, igniteRange + flashRange, ARGB(255, 125, 0, 225))
- end
- end
- function GetBestTarget(range)
- local lessToKill = 100
- local lessToKilli = 0
- local toKill = 0
- local damageToHero = 0
- local targetArg = nil
- for priority = 0, 4 do
- if targetArg ~= nil then
- break
- end
- for i = 1, enemyNum do
- if enemyPriorityList[i] == priority and ValidTargetA(enemyList[i], range) then
- damageToHero = myHero:CalcMagicDamage(enemyList[i], 200)
- toKill = enemyList[i].health / damageToHero
- if ((toKill < lessToKill) or (lessToKilli == 0)) then
- lessToKill = toKill
- lessToKilli = i
- targetArg = enemyList[i]
- end
- end
- end
- end
- lessToKill = 150
- for _, enemy in ipairs(GetEnemyHeroes()) do
- if ValidTargetA(enemy, range) then
- toKill = (getDmg("Q", enemy, myHero) + getDmg("E", enemy, myHero) + getDmg("R", enemy, myHero)) / enemy.health
- if toKill > lessToKill then
- lessToKill = toKill
- targetArg = enemy
- end
- end
- end
- if targetArg == nil and menu.main.priority5 then
- lessToKill = 100
- lessToKilli = 0
- for i, enemy in ipairs(GetEnemyHeroes()) do
- if ValidTargetA(enemy, range) then
- damageToHero = myHero:CalcMagicDamage(enemy, 200)
- toKill = enemy.health / damageToHero
- if ((toKill < lessToKill) or (lessToKilli == 0)) then
- lessToKill = toKill
- lessToKilli = i
- targetArg = enemy
- end
- end
- end
- end
- if GetTarget() ~= nil and ValidTargetA(GetTarget(), range) and GetTarget().type == myHero.type and GetTarget().team ~= myHero.team then
- targetArg = GetTarget()
- end
- return targetArg
- end
- --noch machen
- function GetSummoners()
- if string.lower(myHero:GetSpellData(SUMMONER_1).name) == "summonerdot" then
- ignite = SUMMONER_1
- elseif string.lower(myHero:GetSpellData(SUMMONER_2).name) == "summonerdot" then
- ignite = SUMMONER_2
- else
- ignite = nil
- end
- if string.lower(myHero:GetSpellData(SUMMONER_1).name) == "summonerflash" then
- flash = SUMMONER_1
- elseif string.lower(myHero:GetSpellData(SUMMONER_2).name) == "summonerflash" then
- flash = SUMMONER_2
- else
- flash = nil
- end
- end
- function GetEnemys()
- local i = 1
- for j = 1, heroManager.iCount do
- local obj = heroManager:getHero(j)
- if obj ~= nil and obj.team ~= myHero.team then
- enemyCharNameList[i] = obj.charName
- enemyList[i] = obj
- enemyNum = i
- i = i + 1
- end
- end
- end
- function IsEnemyInRange(rangeArg)
- for _, enemy in ipairs(GetEnemyHeroes()) do
- if ValidTargetA(enemy) and GetDistance(enemy, myHero) <= rangeArg then
- return true
- end
- end
- return false
- end
- function DamageCalculation(enemy)
- local dmg = 0
- local dfgDmg, hxgDmg, bwcDmg, iDmg = 0, 0, 0, 0
- local qDmg, wDmg, eDmg, rDmg = 0, 0, 0, 0
- local aDmg = getDmg("AD", enemy, myHero)
- qDmg = getDmg("Q",enemy,myHero) + aDmg
- wDmg = getDmg("W",enemy,myHero)
- eDmg = getDmg("E",enemy,myHero)
- if rReady then rDmg = getDmg("R",enemy,myHero) end
- if dfgReady then dfgDmg = (dfgSlot and getDmg("DFG",enemy,myHero) or 0) end
- if hxgReady then hxgDmg = (hxgSlot and getDmg("HXG",enemy,myHero) or 0) end
- if bwcReady then bwcDmg = (bwcSlot and getDmg("BWC",enemy,myHero) or 0) end
- if igniteReady then iDmg = (ignite and getDmg("IGNITE",enemy,myHero) or 0) end
- local itemsDmg = dfgDmg + hxgDmg + bwcDmg + iDmg
- if dfgDmg == 0 then
- dmg = itemsDmg + eDmg + rDmg
- else
- dmg = itemsDmg + 1.2 * (eDmg + rDmg)
- end
- return dmg
- end
- function DrawComboKiller()
- if menu.draw.drawComboKiller then
- for _, enemy in pairs(GetEnemyHeroes()) do
- if enemy and ValidTargetA(enemy) then
- local position = GetHPBarPos2(enemy)
- DrawText(tostring(math.floor(100 * DamageCalculation(enemy) / enemy.health + 0.5)), 20, position.x, position.y, ARGB(255, 0, 255, 0))
- end
- end
- end
- end
- function ValidTargetA(target, range)
- if target ~= nil and target.type == myHero.type and target.team ~= myHero.team and not target.dead and target.health > 0 then
- if range ~= nil and GetDistance(target) <= range then
- return true
- elseif range ~= nil then
- return false
- end
- return true
- else
- return false
- end
- end
- function GetHPBarPos2(enemy)
- local barPos = WorldToScreen(D3DXVECTOR3(enemy.x, enemy.y, enemy.z))
- local pos = { x = barPos.x - 35, y = barPos.y - 50 }
- return pos
- end
- -- copied functions
- -- barasia, vadash, viseversa
- 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
- radius = radius*.92
- 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
- -- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement