Guest User

Auto Carry Plugin - Ashe

a guest
Jun 20th, 2013
892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Ashe Edition  --- DeniCevap
  4.  
  5.         Activates Q when attacking enemy hero and disables when attacking minions.
  6.  
  7. --]]
  8.  
  9. if myHero.charName ~= "Ashe" then return end
  10.  
  11. local frostOn = false
  12. AutoCarry.PluginMenu:addParam("AutoQ", "Activate Q Against Enemy", SCRIPT_PARAM_ONOFF, true)
  13. AutoCarry.PluginMenu:addParam("ManaCheck", "Do not activate Q if low on mana", SCRIPT_PARAM_ONOFF, true)
  14.  
  15. function CustomAttackEnemy(enemy)
  16.         if enemy.dead or not enemy.valid or not AutoCarry.CanAttack then return end
  17.         if AutoCarry.PluginMenu.AutoQ then
  18.                 if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and not frostOn and ((AutoCarry.PluginMenu.ManaCheck and myHero.mana > 100) or not AutoCarry.PluginMenu.ManaCheck) then
  19.                         CastSpell(_Q)
  20.                 elseif ValidTarget(enemy) and enemy.type ~= "obj_AI_Hero" and frostOn then
  21.                         CastSpell(_Q)
  22.                 end
  23.         end
  24.         myHero:Attack(enemy)
  25.         AutoCarry.shotFired = true
  26. end
  27.  
  28. function PluginOnCreateObj(obj)
  29.         if GetDistance(obj) < 100 and obj.name:lower():find("icesparkle") then
  30.                 frostOn = true
  31.         end
  32. end
  33.  
  34. function PluginOnDeleteObj(obj)
  35.         if GetDistance(obj) < 100 and obj.name:lower():find("icesparkle") then
  36.                 frostOn = false
  37.         end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment