Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Darius Dunk v0.35 by Lux - Modified by Mwow
- Changelog:
- v0.35 Added Toggles for Ult and Q Harrass, added config menu, speed up ult usage
- v0.34 different approach to avoid ultimate usage when enemy is immune
- initial support to shield calculation
- v0.33: added some stuff to smooth the ultimate dmg calculation
- v0.32: added anivia's passive check
- v0.31: added drawUltiInfo variable
- v0.3: added blitzcrank's handler, various fix
- v0.2: added trynda/blitz/zilean's ulti check
- based on
- Darius Ownage
- v1.1
- written by Weee
- Modified by Delusional Logic
- ]]
- if GetMyHero().charName ~= "Darius" then return end
- require "AllClass"
- --[[ Config ]]
- local drawQrange = true -- Draw the range of Q
- local useExecutioner = true -- calculate Executioner or not? True / False
- local havocPoints = 3 -- how many points in Havoc? 0 / 1 / 2 / 3
- local drawUltiInfo = true
- -- the R's dmg is multiplied with this value, 1.0 means nothing changes of course
- local smoothMultR = 1.0
- -- change to 0 if you don't want to smooth R's dmg calculation
- local smoothStaticR = -2
- -- -2 means that at lvl 18 the ultimate will be automatically casted on an enemy if his health is < than R's dmg-36
- -- if you put this to false then the dmg removed from R will be the static number written in smoothStaticR
- local smoothStaticPerLvl = true
- -- put to 0 if you don't want to disabled the ulti's smoother at all, I put this to 12 because I don't want to risk
- -- to lose in lane because the ulti isn't casted for like 12hp
- local smoothDisabledBeforeLvl = 12
- --[[ Advanced Config ]]
- local targetFindRange = 80 -- This is a distance between targeted spell coordinates and your real target's coordinates.
- local qBladeRange = 270
- local qRange = 415
- local qORange = 425
- local eRange = 500 -- lowered since most of the times enemies goes out of the E range while you're casting it
- local rRange = 475
- local wDmgRatioPerLvl = 0.2
- local rDmgRatioPerHemo = 0.2
- local hemoTimeOut = 5000
- --[[ Globals ]]
- local enemyToAttack = nil
- local enemyTable = {}
- local player = GetMyHero()
- local hemoTable = {
- [1] = "darius_hemo_counter_01.troy",
- [2] = "darius_hemo_counter_02.troy",
- [3] = "darius_hemo_counter_03.troy",
- [4] = "darius_hemo_counter_04.troy",
- [5] = "darius_hemo_counter_05.troy",
- }
- local damageTable = {
- Q = { base = 35, baseScale = 35, adRatio = 0.7, },
- R = { base = 70, baseScale = 90, adRatio = 0.75, },
- }
- local checkBuffForUlti = {
- {name="Tryndamere", spellName="undyingRage", enabled=false, spellType=0, spellLevel=1, duration=5000, spellParticle="undyingrage_glow"},
- {name="Kayle", spellName="eyeForEye", enabled=false, spellType=0, spellLevel=1, duration=3000, spellParticle="eyeforaneye"},
- {name="Zilean", spellName="nickOfTime", enabled=false, spellType=0, spellLevel=1, duration=7000, spellParticle="nickoftime_tar"},
- {name="Nocturne", spellName="shroudOfDarkness", enabled=false, spellType=0, spellLevel=1,duration=1500,spellParticle="nocturne_shroudofdarkness_shield_cas_02"},
- {name="Blitzcrank", spellName="manaBarrier", enabled=false, spellType=1, spellLevel=1, duration=10000, spellParticle="manabarrier"},
- {name="Sivir", spellName="spellShield", enabled=false, spellType=0, spellLevel=1, duration=3000, spellParticle="spellblock_eff"}
- }
- for i=0, heroManager.iCount, 1 do
- local playerObj = heroManager:GetHero(i)
- if playerObj and playerObj.team ~= player.team then
- playerObj.hemo = { tick = 0, count = 0, }
- playerObj.pauseTickQ = 0
- playerObj.pauseTickR = 0
- playerObj.canBeUlted = true
- playerObj.immuneTimeout = 0
- playerObj.shield = 0
- table.insert(enemyTable,playerObj)
- for i=1, #checkBuffForUlti, 1 do
- if checkBuffForUlti[i].name == playerObj.charName then
- checkBuffForUlti[i].enabled = true
- PrintChat(checkBuffForUlti[i].spellName.." check enabled")
- end
- end
- end
- end
- --[[ Code ]]
- function OnLoad()
- config = scriptConfig("Darius", "Darius Dunk")
- config:addParam("eActive", "Apprehend", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("S"))
- config:addParam("drawQrange", "Draw Ranges", SCRIPT_PARAM_ONOFF, true)
- config:addParam("toggleUlt", "Toggle Auto Ultimate", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("O"))
- config:addParam("toggleQ", "Toggle Decimate harrass", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("P"))
- config:addParam("qHarrass", "Decimate Harrass", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- config:permaShow("toggleUlt")
- config:permaShow("toggleQ")
- end
- function OnWndMsg(msg, keycode )
- end
- function ChampionInfo(champion)
- local results = {}
- for i=1, #checkBuffForUlti, 1 do
- if checkBuffForUlti[i].name == champion or checkBuffForUlti[i].name == "*" then
- table.insert(results, checkBuffForUlti[i])
- end
- end
- return results
- end
- function CanUltiEnemy(target)
- for i, enemy in pairs(enemyTable) do
- if target.networkID == enemy.networkID then
- if enemy.canBeUlted == false and enemy.immuneTimeout < GetTickCount() then
- enemy.canBeUlted = true
- enemy.immuneTimeout = 0
- end
- return enemy.canBeUlted
- end
- end
- end
- function GetShieldValue(enemy,spellName)
- if spellName == "manaBarrier" then
- return enemy.mana*0.5
- end
- end
- function GetDuration(spellName,spellLevel)
- if spellName == "undyingRage" then return 5000 end
- if spellName == "eyeForEye" then return 1500+500*spellLevel end
- if spellName == "nickOfTime" then return 7000 end
- if spellName == "shroudOfDarkness" then return 1500 end
- end
- function OnTick()
- local rDmg = (damageTable.R.base + (damageTable.R.baseScale*player:GetSpellData(_R).level) +
- damageTable.R.adRatio*player.addDamage) * smoothMultR
- if player.level > smoothDisabledBeforeLvl then
- local rDmgInc = smoothStaticR
- if smoothStaticPerLvl == true then
- rDmgInc = rDmgInc * player.level
- end
- rDmg = rDmg + rDmgInc
- end
- local qDmg = damageTable.Q.base + (damageTable.Q.baseScale*player:GetSpellData(_Q).level) +
- damageTable.Q.adRatio*player.addDamage
- for i, enemy in pairs(enemyTable) do
- local enemyHP = enemy.health + enemy.shield
- if (GetTickCount() - enemy.hemo.tick > hemoTimeOut) or (enemy and enemy.dead) then enemy.hemo.count = 0 end
- if enemy and not enemy.dead and enemy.visible == true and enemy.bTargetable and enemy.bInvulnerable == 0 then
- local scale = 1 + havocPoints*0.005
- if useExecutioner and enemyHP < enemy.maxHealth*0.4 then scale = scale + 0.06 end
- qDmg = player:CalcDamage(enemy,qDmg)
- if (config.qHarrass or config.toggleQ) and player:CanUseSpell(_Q) == READY and GetDistance(enemy) < qRange then CastSpell(_Q) end
- if config.eActive and player:CanUseSpell(_E) == READY and GetDistance(enemy) < eRange then CastSpell(_E,enemy.x,enemy.z) end
- --if GetTickCount() - enemy.pauseTickQ >= 500 and GetTickCount() - enemy.pauseTickR >= 200 then
- if qDmg * scale > enemyHP and player:CanUseSpell(_Q) == READY and GetDistance(enemy) < qRange then
- CastSpell(_Q)
- --enemy.pauseTickQ = GetTickCount()
- elseif ( qDmg * 1.5 ) * scale > enemyHP and player:CanUseSpell(_Q) == READY and GetDistance(enemy) < qRange and GetDistance(enemy) >= qBladeRange then
- CastSpell(_Q)
- --enemy.pauseTickQ = GetTickCount()
- elseif config.toggleUlt and rDmg * ( 1.0 + rDmgRatioPerHemo * enemy.hemo.count ) > enemyHP and player:CanUseSpell(_R) == READY and GetDistance(enemy) < rRange and CanUltiEnemy(enemy) == true then
- CastSpell(_R,enemy)
- --enemy.pauseTickR = GetTickCount()
- end
- if player:GetSpellData(_R).level > 0 and player:GetDistance(enemy) < 3500 and drawUltiInfo == true then
- if qDmg + rDmg * ( 1.0 + rDmgRatioPerHemo * enemy.hemo.count ) > enemyHP then
- PrintFloatText(enemy,0,"Killable")
- elseif CanUltiEnemy(enemy) == false then
- PrintFloatText(enemy,0,"IMMUNE")
- elseif rDmg * ( 1.0 + rDmgRatioPerHemo * enemy.hemo.count ) > enemyHP then
- PrintFloatText(enemy,0,"DUNK")
- else
- PrintFloatText(enemy,0,"" .. math.ceil(enemyHP - (rDmg * ( 1.0 + rDmgRatioPerHemo * enemy.hemo.count ))) .. " hp" .. " - " .. enemy.hemo.count)
- end
- end
- --end
- end
- end
- end
- function OnCreateObj( object )
- if object then
- for i=1, #checkBuffForUlti, 1 do
- if string.find(string.lower(object.name),checkBuffForUlti[i].spellParticle) and checkBuffForUlti[i].enabled == true then
- for i, enemy in pairs(enemyTable) do
- if GetDistance2D(enemy,object) < 30 then
- if checkBuffForUlti[i].spellType == 0 then
- enemy.canBeUlted = false
- enemy.immuneTimeout = GetTickCount()+checkBuffForUlti[i].duration
- elseif checkBuffForUlti[i].spellType == 1 then
- enemy.shield = enemy.shield + getShieldValue(checkBuffForUlti[i].spellName)
- end
- end
- end
- end
- end
- if string.find(string.lower(object.name),"darius_hemo_counter") then
- for i, enemy in pairs(enemyTable) do
- if enemy and not enemy.dead and enemy.visible and GetDistance2D(enemy,object) <= targetFindRange then
- for k, hemo in pairs(hemoTable) do
- if object.name == hemo then
- enemy.hemo.tick = GetTickCount()
- enemy.hemo.count = k
- PrintFloatText(enemy,21,k .. " Bleedings")
- end
- end
- end
- end
- end
- end
- end
- function OnDeleteObj(obj)
- if object then
- for i=1, #checkBuffForUlti, 1 do
- if string.find(string.lower(object.name),checkBuffForUlti[i].spellParticle) and checkBuffForUlti[i].enabled == true then
- for i, enemy in pairs(enemyTable) do
- if GetDistance2D(enemy,object) < 30 then
- if checkBuffForUlti[i].spellType == 0 then
- enemy.canBeUlted = true
- enemy.immuneTimeout = 0
- elseif checkBuffForUlti[i].spellType == 1 then
- enemy.shield = enemy.shield - getShieldValue(checkBuffForUlti[i].spellName)
- if enemy.shield < 0 then
- enemy.shield = 0
- end
- end
- end
- end
- end
- end
- end
- end
- function OnDraw()
- if config.drawQrange and not myHero.dead then
- for j=0,1 do
- DrawCircle(player.x, player.y, player.z, qORange+j, 0xFF0000)
- DrawCircle(player.x, player.y, player.z, qBladeRange+j, 0xFF0000)
- DrawCircle(player.x, player.y, player.z, eRange+j, 0x66FFFF)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement