- Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathMap.lua
More file actions
Latest commit
72 lines (62 loc) · 2.24 KB
/
Copy pathMap.lua
File metadata and controls
72 lines (62 loc) · 2.24 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
localMap= {}
Map.BuildingLocation= {
radiant_fountain=Vector(-7600, -7300, 640),
dire_fountain=Vector(7800, 7250, 640)
}
Map.CampLocation= {
radiant_ancient_camp_1=Vector(-2700, -250, 384),
radiant_ancient_camp_2=Vector(150, -2000, 384),
dire_ancient_camp_1=Vector(-700, 2300, 384),
dire_ancient_camp_2=Vector(3600, -700, 256),
radiant_small_camp=Vector(3250, -4500, 256),
dire_small_camp=Vector(-3050, 4800, 384),
radiant_mid_camp_1=Vector(-3900, 600, 256),
radiant_mid_camp_2=Vector(-1800, 4150, 128),
radiant_mid_camp_3=Vector(650, -4600, 384),
dire_mid_camp_1=Vector(-1650, 4000, 256),
dire_mid_camp_2=Vector(1100, 3500, 384),
dire_mid_camp_3=Vector(2800, 100, 384),
radiant_large_camp_1=Vector(-4700, -350, 256),
radiant_large_camp_2=Vector(-600, -3300, 256),
radiant_large_camp_3=Vector(4500, -4300, 256),
dire_large_camp_1=Vector(-4350, 3700, 256),
dire_large_camp_2=Vector(-300, 3400, 256),
dire_large_camp_3=Vector(4350, 750, 384)
}
Map.RoshanLocation=Vector(-2350, 1800, 160)
-- function Map.OnDraw()
-- local pos = Input.GetWorldCursorPos()
-- Log.Write(tostring(pos) .." ".. tostring(Map.InRoshan(pos)))
-- end
-- valid position can't be like Vector(1.0, 1.0, 1.0) or Vector(350.0, 350.0, 1.0)
functionMap.IsValidPos(pos)
ifnotposthenreturnfalseend
ifpos:GetX() ==math.floor(pos:GetX()) orpos:GetY() ==math.floor(pos:GetY()) thenreturnfalseend
returntrue
end
functionMap.InFountain(pos)
localrange=2000
if (Map.BuildingLocation["radiant_fountain"] -pos):Length() <=rangethenreturntrueend
if (Map.BuildingLocation["dire_fountain"] -pos):Length() <=rangethenreturntrueend
returnfalse
end
-- tell whether given position is ally
functionMap.IsAlly(myHero, pos)
localrange=50
localallies=NPCs.InRadius(pos, range, Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_FRIEND)
ifalliesand#allies>0thenreturntrueend
returnfalse
end
functionMap.InNeutralCamp(pos)
localrange=600
forname, locationinpairs(Map.CampLocation) do
localdis= (location-pos):Length()
ifdis<=rangethenreturntrueend
end
returnfalse
end
functionMap.InRoshan(pos)
localrange=500
return (Map.RoshanLocation-pos):Length() <=range
end
returnMap