View difference between Paste ID: Fs0MrZjZ and xXrS46KL
SHOW: | | - or go back to the newest paste.
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 myHero.mana - GetMana() > (myHero.maxMana / 100) * AutoCarry.PluginMenu.MinMana then
21+
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-
                if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and not frostOn and (myHero.mana > (myHero.maxMana / 100) * AutoCarry.PluginMenu.ManaCheck) then
24+
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-
                if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and ((AutoCarry.PluginMenu.ManaCheck and myHero.mana > 100) or not AutoCarry.PluginMenu.ManaCheck) and not MuramanaIsActive() then
32+
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