Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version = "1.00"
- if myHero.charName ~= "Nasus" then
- return
- end
- function Hello()
- PrintChat("<font color=\"#4000ff\">Nasus - The Curator of the Sands</font>")
- end
- function OnLoad()
- Menu()
- Hello()
- if myHero:GetSpellData(SUMMONER_1).name:find("summonerdot") then Ignite = SUMMONER_1 elseif myHero:GetSpellData(SUMMONER_2).name:find("summonerdot") then Ignite = SUMMONER_2 end
- QStacks = ReadFile(LIB_PATH.."NasusStacks.txt")
- remove(LIB_PATH.."NasusStacks.txt", 0, 25)
- if GetInGameTimer() <= 75 then QStacks = 0 end
- end
- function Menu()
- NasusMenu = scriptConfig("Nasus - The Curator of the Sands", "Nasus")
- NasusMenu:addSubMenu("Auto Ultimate", "autoult")
- NasusMenu.autoult:addParam("autoult", "Auto Ult at % life", SCRIPT_PARAM_SLICE, 20, 0, 100)
- NasusMenu:addSubMenu("Last Hit Settings", "farming")
- NasusMenu.farming:addParam("farmKey", "Farming Key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
- NasusMenu.farming:addParam("qFarm", "Last Hit with (Q)", SCRIPT_PARAM_ONOFF, true)
- end
- function OnTick()
- local QDMG = (20*(myHero:GetSpellData(_Q).level)+10+(myHero.totalDamage+myHero.addDamage)+(QStacks)+PerfectQDMG())
- LastHitKey = NasusMenu.farming.farmKey
- ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 900, DAMAGE_PHYSICAL)
- target = ts.target
- ts:update()
- enemyMinions = minionManager(MINION_ENEMY, 1000, myHero, MINION_SORT_MAXHEALTH_ASC)
- jungleMinions = minionManager(MINION_JUNGLE, 1100, myHero, MINION_SORT_MAXHEALTH_DEC)
- qReady = myHero:CanUseSpell(_Q) == READY
- wReady = myHero:CanUseSpell(_W) == READY
- eReady = myHero:CanUseSpell(_E) == READY
- rReady = myHero:CanUseSpell(_R) == READY
- if myHero.health <= myHero.maxHealth* NasusMenu.autoult.autoult and CountEnemyHeroInRange(500, myHero) ~= nil then
- CastSpell(_R)
- end
- if LastHitKey then
- LastHit()
- end
- end
- function OnApplyBuff(source, unit, buff)
- if buff.name == "sheen" then
- sheen = true
- elseif buff.name == "itemfrozenfist" then
- gauntles = true
- end
- end
- function OnRemoveBuff(unit, buff)
- if buff.name == "sheen" then
- sheen = false
- elseif buff.name == "itemfrozenfist" then
- gauntles = false
- end
- end
- function LastHit()
- enemyMinions:update()
- for each, minions in ipairs(enemyMinions.objects) do
- if minions and ValidTarget(minions) then
- if GetDistance(minions) <= 150 and minions.health <= QDMG() and qReady then
- CastSpell(_Q)
- end
- print (QDMG)
- end
- end
- end
- function PerfectQDMG()
- bonusDmg = 0
- if sheen then
- bonusDmg = QDMG
- end
- end
- function OnCreateObj(obj)
- if obj.name == "DeathsCaress_nova.troy" then
- QStacks = QStacks + 3
- end
- end
- function OnUnload()
- local file = io.open(LIB_PATH.."NasusStacks.txt", "a")
- file:write(QStacks or 0)
- file:close()
- end
- function remove(filename, starting_line, num_lines)
- local fp = io.open( filename, "r" )
- if fp == nil then return nil end
- content = {}
- i = 1;
- for line in fp:lines() do
- if i < starting_line or i >= starting_line + num_lines then
- content[#content+1] = line
- end
- i = i + 1
- end
- fp:close()
- fp = io.open( filename, "w+" )
- for i = 1, #content do
- fp:write( string.format( "%s\n", content[i] ) )
- end
- fp:close()
- end
- function RealADDamage(target, source, spell, additionalDamage)
- --Big Thanks to VPrediction
- -- read initial armor and damage values
- local armorPenPercent = source.armorPenPercent
- local armorPen = source.armorPen
- local totalDamage = source.totalDamage + (additionalDamage or 0)
- local damageMultiplier = spell.name:find("CritAttack") and 2 or 1
- -- minions give wrong values for armorPen and armorPenPercent
- if source.type == "obj_AI_Minion" then
- armorPenPercent = 1
- elseif source.type == "obj_AI_Turret" then
- armorPenPercent = 0.7
- end
- -- turrets ignore armor penetration and critical attacks
- if target.type == "obj_AI_Turret" then
- armorPenPercent = 1
- armorPen = 0
- damageMultiplier = 1
- end
- -- calculate initial damage multiplier for negative and positive armor
- local targetArmor = (target.armor * armorPenPercent) - armorPen
- if targetArmor < 0 then -- minions can't go below 0 armor.
- --damageMultiplier = (2 - 100 / (100 - targetArmor)) * damageMultiplier
- damageMultiplier = 1 * damageMultiplier
- else
- damageMultiplier = 100 / (100 + targetArmor) * damageMultiplier
- end
- -- use ability power or ad based damage on turrets
- if source.type == myHero.type and target.type == "obj_AI_Turret" then
- totalDamage = math.max(source.totalDamage, source.damage + 0.4 * source.ap)
- end
- -- minions deal less damage to enemy heros
- if source.type == "obj_AI_Minion" and target.type == myHero.type and source.team ~= TEAM_NEUTRAL then
- damageMultiplier = 0.60 * damageMultiplier
- end
- -- heros deal less damage to turrets
- if source.type == myHero.type and target.type == "obj_AI_Turret" then
- damageMultiplier = 0.95 * damageMultiplier
- end
- -- minions deal less damage to turrets
- if source.type == "obj_AI_Minion" and target.type == "obj_AI_Turret" then
- damageMultiplier = 0.475 * damageMultiplier
- end
- -- siege minions and superminions take less damage from turrets
- if source.type == "obj_AI_Turret" and (target.charName == "Red_Minion_MechCannon" or target.charName == "Blue_Minion_MechCannon") then
- damageMultiplier = 0.8 * damageMultiplier
- end
- -- caster minions and basic minions take more damage from turrets
- if source.type == "obj_AI_Turret" and (target.charName == "Red_Minion_Wizard" or target.charName == "Blue_Minion_Wizard" or target.charName == "Red_Minion_Basic" or target.charName == "Blue_Minion_Basic") then
- damageMultiplier = (1 / 0.875) * damageMultiplier
- end
- -- turrets deal more damage to all units by default
- if source.type == "obj_AI_Turret" then
- damageMultiplier = 1.05 * damageMultiplier
- end
- -- calculate damage dealt
- local dmg = damageMultiplier * totalDamage
- return dmg
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement