Guest User

Untitled

a guest
Sep 16th, 2013
4,624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.  
  3.         Auto Carry Plugin - Ashe
  4.  
  5.         Activates Q when attacking enemy hero and disables when attacking minions.
  6.         Activates Muramana when attacking enemy hero.
  7.  
  8. --]]
  9.  
  10.  
  11.  
  12. local frostOn = false
  13. AutoCarry.PluginMenu:addParam("AutoQ", "Activate Q Against Enemy", SCRIPT_PARAM_ONOFF, true)
  14. AutoCarry.PluginMenu:addParam("MMana", "Activate Muramana Against Enemy", SCRIPT_PARAM_ONOFF, true)
  15. AutoCarry.PluginMenu:addParam("ManaCheck", "Maximum % for Q activation", SCRIPT_PARAM_SLICE, 30, 0, 100, 0)    
  16.  
  17.  
  18. function CustomAttackEnemy(enemy)
  19.         if enemy.dead or not enemy.valid or not AutoCarry.CanAttack then return end
  20.  
  21.         if AutoCarry.PluginMenu.AutoQ then
  22.                 if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and not frostOn and (myHero.mana > ((myHero.maxMana / 100) * AutoCarry.PluginMenu.ManaCheck)) then
  23.                         CastSpell(_Q)
  24.                 elseif ValidTarget(enemy) and enemy.type ~= "obj_AI_Hero" and frostOn then
  25.                         CastSpell(_Q)
  26.                 end
  27.         end
  28.  
  29.         if AutoCarry.PluginMenu.MMana then
  30.                 if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and (myHero.mana > ((myHero.maxMana / 100) * AutoCarry.PluginMenu.ManaCheck)) and not MuramanaIsActive() then
  31.                         MuramanaOn()
  32.                 elseif ValidTarget(enemy) and enemy.type ~= "obj_AI_Hero" and MuramanaIsActive() then
  33.                         MuramanaOff()
  34.                 end
  35.         end
  36.  
  37.         myHero:Attack(enemy)
  38.         AutoCarry.shotFired = true
  39. end
  40.  
  41.  
  42. function PluginOnCreateObj(obj)
  43.         if GetDistance(obj) < 100 and obj.name:lower():find("icesparkle") then
  44.                 frostOn = true
  45.         end
  46. end
  47.  
  48. function PluginOnDeleteObj(obj)
  49.         if GetDistance(obj) < 100 and obj.name:lower():find("icesparkle") then
  50.                 frostOn = false
  51.         end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment