-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathBrewMasterHelper.lua
More file actions
73 lines (66 loc) · 3.56 KB
/
BrewMasterHelper.lua
File metadata and controls
73 lines (66 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
local BrewMasterHelper= {}
BrewMasterHelper.optionEnable = Menu.AddOption({ "Hero Specific","Brew Master"}, "Enable", "Brew Master Help Scrip")
BrewMasterHelper.optionStunKey = Menu.AddKeyOption({ "Hero Specific","Brew Master"}, "Earth Stun", Enum.ButtonCode.KEY_P)
BrewMasterHelper.optionEulKey = Menu.AddKeyOption({ "Hero Specific","Brew Master"}, "Storm Eul", Enum.ButtonCode.KEY_P)
BrewMasterHelper.optionDiffuseKey = Menu.AddKeyOption({ "Hero Specific","Brew Master"}, "Storm Diffuse", Enum.ButtonCode.KEY_P)
BrewMasterHelper.cache = {}
BrewMasterHelper.Pandas ={}
BrewMasterHelper.ultimateLast = {16, 18, 20}
BrewMasterHelper.nextTick = 0
function BrewMasterHelper.OnUpdate()
if not Menu.IsEnabled(BrewMasterHelper.optionEnable) then return end
--if not Menu.IsKeyDown(BrewMasterHelper.optionKey) then return end
local myHero = Heroes.GetLocal()
if myHero == nill then return end
local ultimate = NPC.GetAbilityByIndex(myHero, 3)
if ultimate == nill or Ability.GetCooldownTimeLeft(ultimate) == 0 then return end
if BrewMasterHelper.Pandas["fire"] == nil or not NPCs.Contains(BrewMasterHelper.Pandas["fire"]) then
BrewMasterHelper.Pandas["fire"] = nil
BrewMasterHelper.Pandas["storm"] = nil
BrewMasterHelper.Pandas["earth"] = nil
for i= 1, NPCs.Count() do
local entity = NPCs.Get(i)
local name = NPC.GetUnitName(entity)
if Entity.GetOwner(entity) == myHero then
if name == "npc_dota_brewmaster_fire_1" or name == "npc_dota_brewmaster_fire_2" or name == "npc_dota_brewmaster_fire_3" then
BrewMasterHelper.Pandas["fire"] = entity
end
if name == "npc_dota_brewmaster_storm_1" or name == "npc_dota_brewmaster_storm_2" or name == "npc_dota_brewmaster_storm_3" then
BrewMasterHelper.Pandas["storm"] = entity
end
if name == "npc_dota_brewmaster_earth_1" or name == "npc_dota_brewmaster_earth_2" or name == "npc_dota_brewmaster_earth_3" then
BrewMasterHelper.Pandas["earth"] = entity
end
end
end
end
if BrewMasterHelper.Pandas["fire"] == nill then return end
if Menu.IsKeyDown(BrewMasterHelper.optionStunKey) then
local earth = BrewMasterHelper.Pandas["earth"]
if earth~=nill then
local stun = NPC.GetAbilityByIndex(earth, 0)
Log.Write(Ability.GetName(stun))
local target = Input.GetNearestHeroToCursor(Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_ENEMY)
Player.PrepareUnitOrders(Players.GetLocal(), Enum.UnitOrder.DOTA_UNIT_ORDER_CAST_TARGET, target, Vector(0,0,0), stun, Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, earth)
end
end
if Menu.IsKeyDown(BrewMasterHelper.optionEulKey) then
local storm = BrewMasterHelper.Pandas["storm"]
if storm~=nill then
local eul = NPC.GetAbilityByIndex(storm, 1)
Log.Write(Ability.GetName(eul))
local target = Input.GetNearestHeroToCursor(Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_ENEMY)
Player.PrepareUnitOrders(Players.GetLocal(), Enum.UnitOrder.DOTA_UNIT_ORDER_CAST_TARGET, target, Vector(0,0,0), eul, Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, storm)
end
end
if Menu.IsKeyDown(BrewMasterHelper.optionDiffuseKey) then
local storm = BrewMasterHelper.Pandas["storm"]
if storm~=nill then
local diffuse = NPC.GetAbilityByIndex(storm, 0)
Log.Write(Ability.GetName(diffuse))
local target = Input.GetNearestHeroToCursor(Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_ENEMY)
Player.PrepareUnitOrders(Players.GetLocal(), Enum.UnitOrder.DOTA_UNIT_ORDER_CAST_POSITION, target, NPC.GetAbsOrigin(target), diffuse, Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, storm)
end
end
end
return BrewMasterHelper