Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. version = "1.00"
  2.  
  3.  
  4.  
  5. if myHero.charName ~= "Nasus" then
  6. return
  7. end
  8.  
  9.  
  10. function Hello()
  11.  
  12. PrintChat("<font color=\"#4000ff\">Nasus - The Curator of the Sands</font>")
  13.  
  14. end
  15.  
  16. function OnLoad()
  17.  
  18. Menu()
  19. Hello()
  20.  
  21. 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
  22.  
  23. QStacks = ReadFile(LIB_PATH.."NasusStacks.txt")
  24. remove(LIB_PATH.."NasusStacks.txt", 0, 25)
  25. if GetInGameTimer() <= 75 then QStacks = 0 end
  26. end
  27.  
  28. function Menu()
  29.  
  30. NasusMenu = scriptConfig("Nasus - The Curator of the Sands", "Nasus")
  31.  
  32. NasusMenu:addSubMenu("Auto Ultimate", "autoult")
  33. NasusMenu.autoult:addParam("autoult", "Auto Ult at % life", SCRIPT_PARAM_SLICE, 20, 0, 100)
  34.  
  35. NasusMenu:addSubMenu("Last Hit Settings", "farming")
  36. NasusMenu.farming:addParam("farmKey", "Farming Key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
  37. NasusMenu.farming:addParam("qFarm", "Last Hit with (Q)", SCRIPT_PARAM_ONOFF, true)
  38. end
  39.  
  40. function OnTick()
  41.  
  42. local QDMG = (20*(myHero:GetSpellData(_Q).level)+10+(myHero.totalDamage+myHero.addDamage)+(QStacks)+PerfectQDMG())
  43.  
  44.  
  45. LastHitKey = NasusMenu.farming.farmKey
  46.  
  47.  
  48. ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 900, DAMAGE_PHYSICAL)
  49. target = ts.target
  50. ts:update()
  51.  
  52.  
  53. enemyMinions = minionManager(MINION_ENEMY, 1000, myHero, MINION_SORT_MAXHEALTH_ASC)
  54. jungleMinions = minionManager(MINION_JUNGLE, 1100, myHero, MINION_SORT_MAXHEALTH_DEC)
  55.  
  56. qReady = myHero:CanUseSpell(_Q) == READY
  57. wReady = myHero:CanUseSpell(_W) == READY
  58. eReady = myHero:CanUseSpell(_E) == READY
  59. rReady = myHero:CanUseSpell(_R) == READY
  60.  
  61. if myHero.health <= myHero.maxHealth* NasusMenu.autoult.autoult and CountEnemyHeroInRange(500, myHero) ~= nil then
  62. CastSpell(_R)
  63. end
  64.  
  65.  
  66. if LastHitKey then
  67. LastHit()
  68. end
  69. end
  70.  
  71. function OnApplyBuff(source, unit, buff)
  72.  
  73. if buff.name == "sheen" then
  74. sheen = true
  75. elseif buff.name == "itemfrozenfist" then
  76. gauntles = true
  77. end
  78. end
  79.  
  80. function OnRemoveBuff(unit, buff)
  81.  
  82. if buff.name == "sheen" then
  83. sheen = false
  84. elseif buff.name == "itemfrozenfist" then
  85. gauntles = false
  86. end
  87. end
  88.  
  89.  
  90. function LastHit()
  91.  
  92. enemyMinions:update()
  93.  
  94. for each, minions in ipairs(enemyMinions.objects) do
  95.  
  96. if minions and ValidTarget(minions) then
  97.  
  98. if GetDistance(minions) <= 150 and minions.health <= QDMG() and qReady then
  99. CastSpell(_Q)
  100. end
  101. print (QDMG)
  102. end
  103. end
  104. end
  105.  
  106.  
  107. function PerfectQDMG()
  108.  
  109. bonusDmg = 0
  110.  
  111. if sheen then
  112.  
  113. bonusDmg = QDMG
  114. end
  115. end
  116.  
  117. function OnCreateObj(obj)
  118. if obj.name == "DeathsCaress_nova.troy" then
  119. QStacks = QStacks + 3
  120. end
  121. end
  122.  
  123. function OnUnload()
  124. local file = io.open(LIB_PATH.."NasusStacks.txt", "a")
  125. file:write(QStacks or 0)
  126. file:close()
  127. end
  128.  
  129. function remove(filename, starting_line, num_lines)
  130. local fp = io.open( filename, "r" )
  131. if fp == nil then return nil end
  132. content = {}
  133. i = 1;
  134. for line in fp:lines() do
  135. if i < starting_line or i >= starting_line + num_lines then
  136. content[#content+1] = line
  137. end
  138. i = i + 1
  139. end
  140. fp:close()
  141. fp = io.open( filename, "w+" )
  142. for i = 1, #content do
  143. fp:write( string.format( "%s\n", content[i] ) )
  144. end
  145. fp:close()
  146. end
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. function RealADDamage(target, source, spell, additionalDamage)
  155. --Big Thanks to VPrediction
  156. -- read initial armor and damage values
  157. local armorPenPercent = source.armorPenPercent
  158. local armorPen = source.armorPen
  159. local totalDamage = source.totalDamage + (additionalDamage or 0)
  160. local damageMultiplier = spell.name:find("CritAttack") and 2 or 1
  161.  
  162. -- minions give wrong values for armorPen and armorPenPercent
  163. if source.type == "obj_AI_Minion" then
  164. armorPenPercent = 1
  165. elseif source.type == "obj_AI_Turret" then
  166. armorPenPercent = 0.7
  167. end
  168.  
  169. -- turrets ignore armor penetration and critical attacks
  170. if target.type == "obj_AI_Turret" then
  171. armorPenPercent = 1
  172. armorPen = 0
  173. damageMultiplier = 1
  174. end
  175.  
  176. -- calculate initial damage multiplier for negative and positive armor
  177.  
  178. local targetArmor = (target.armor * armorPenPercent) - armorPen
  179. if targetArmor < 0 then -- minions can't go below 0 armor.
  180. --damageMultiplier = (2 - 100 / (100 - targetArmor)) * damageMultiplier
  181. damageMultiplier = 1 * damageMultiplier
  182. else
  183. damageMultiplier = 100 / (100 + targetArmor) * damageMultiplier
  184. end
  185.  
  186. -- use ability power or ad based damage on turrets
  187. if source.type == myHero.type and target.type == "obj_AI_Turret" then
  188. totalDamage = math.max(source.totalDamage, source.damage + 0.4 * source.ap)
  189. end
  190.  
  191. -- minions deal less damage to enemy heros
  192. if source.type == "obj_AI_Minion" and target.type == myHero.type and source.team ~= TEAM_NEUTRAL then
  193. damageMultiplier = 0.60 * damageMultiplier
  194. end
  195.  
  196. -- heros deal less damage to turrets
  197. if source.type == myHero.type and target.type == "obj_AI_Turret" then
  198. damageMultiplier = 0.95 * damageMultiplier
  199. end
  200.  
  201. -- minions deal less damage to turrets
  202. if source.type == "obj_AI_Minion" and target.type == "obj_AI_Turret" then
  203. damageMultiplier = 0.475 * damageMultiplier
  204. end
  205.  
  206. -- siege minions and superminions take less damage from turrets
  207. if source.type == "obj_AI_Turret" and (target.charName == "Red_Minion_MechCannon" or target.charName == "Blue_Minion_MechCannon") then
  208. damageMultiplier = 0.8 * damageMultiplier
  209. end
  210.  
  211. -- caster minions and basic minions take more damage from turrets
  212. 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
  213. damageMultiplier = (1 / 0.875) * damageMultiplier
  214. end
  215.  
  216. -- turrets deal more damage to all units by default
  217. if source.type == "obj_AI_Turret" then
  218. damageMultiplier = 1.05 * damageMultiplier
  219. end
  220.  
  221. -- calculate damage dealt
  222. local dmg = damageMultiplier * totalDamage
  223. return dmg
  224. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement