-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_camp.inc
executable file
·122 lines (99 loc) · 2.82 KB
/
p3_camp.inc
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
SUB p3_camp_init {
/call p3RegisterCommand FOLLOW campFollow 50
/call p3RegisterCommand ROAMLOCK campRoamStarted 55
/call p3RegisterCommand CAMPON campCampOn 20
/declare campCheckTimer timer outer
/declare campEnabled bool outer FALSE
/declare campStartZoneID int outer
/declare campX int outer
/declare campY int outer
/declare campZ int outer
/declare campSpawnID int outer 0
/RETURN
}
SUB campRoamStarted(string cmd, string opts) {
/if (${campEnabled}==TRUE) {
/varset campEnabled FALSE
/bc Camp disabled to allow roam.
}
/RETURN
}
SUB campFollow(string cmd, string opts) {
/if (${campEnabled}==TRUE) {
/varset campEnabled FALSE
/bc Camp disabled to engage follow.
}
/RETURN
}
SUB campCampOff(string cmd, string opts) {
/declare sourceName string local ${getStackCommandOpt[${opts},SOURCENAME]}
/if (${Spawn[=${sourceName}].ID}==NULL) /RETURN
/if (${campEnabled}==TRUE) {
/varset campEnabled FALSE
/bc Camp mode disabled.
}
/RETURN
}
SUB campCampOn(string cmd, string opts) {
/declare campType string local ${getStackCommandOpt[${opts},TYPE]}
/declare spawnTargetID int local
/declare sourceName string local
/if (${campType.Equal[SPAWN]}) {
/varset spawnTargetID ${getStackCommandOpt[${opts},SPAWNTARGETID]}
/if (${Spawn[id ${spawnTargetID}].ID}==NULL) /RETURN RESET
/bc Using spawn ${Spawn[id ${spawnTargetID}]} as camp location.
/varset campSpawnID ${spawnTargetID}
/varset campEnabled TRUE
/varset campStartZoneID ${Zone.ID}
}
/if (${campType.Equal[LOC]}) {
/varset sourceName ${getStackCommandOpt[${opts},SOURCENAME]}
/if (${Spawn[=${sourceName}].ID}==NULL) /RETURN RESET
/varset campSpawnID 0
/varset campX ${Spawn[${sourceName}].X}
/varset campY ${Spawn[${sourceName}].Y}
/varset campZ ${Spawn[${sourceName}].Z}
/varset campEnabled TRUE
/varset campStartZoneID ${Zone.ID}
/bc Now camping at ${sourceName}'s location.
}
/RETURN
}
SUB campMaintenance() {
/if (${campEnabled}==TRUE) /call checkCamp
/RETURN
}
SUB checkCamp() {
/if (${campCheckTimer}>0) /RETURN
/if (${Me.Moving}==TRUE) /return
/varset campCheckTimer 5
/if (${Zone.ID}!=${campStartZoneID}) {
/call stopCamping
/return
}
/if (${Stick.Active}==TRUE || ${Navigation.Active}==TRUE) /RETURN
/if (${combatStateTimer}>0) /RETURN
/if (${campSpawnID}!=0) {
/varset campX ${Spawn[id ${campSpawnID}].X}
/varset campY ${Spawn[id ${campSpawnID}].Y}
/varset campZ ${Spawn[id ${campSpawnID}].Z}
}
/if (${Math.Distance[${campY}, ${campX}, ${campZ}]}>15) {
/if (${Navigation.MeshLoaded}==TRUE && ${Navigation.Active}==FALSE && ) {
/bc Returning to camp.
/nav locxyz ${campX} ${campY} ${campZ}
} else {
/moveto dist 15
/moveto loc ${campY} ${campX}
}
} else {
}
/RETURN
}
SUB stopCamping() {
/if (${campEnabled}==TRUE) {
/varset campEnabled FALSE
/bc Camp mode disabled.
}
/RETURN
}