-
Notifications
You must be signed in to change notification settings - Fork 2
/
morass.py
240 lines (229 loc) · 8.01 KB
/
morass.py
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
import Character,Context,DataType,Field,Inventory,Key,Npc,Packet,Quest,Terminal,time,GameState,sys,os,Party, json,math,Login
if not any("SunCat" in s for s in sys.path):
sys.path.append(os.getcwd() + "/SunCat")
try:
import SunCat, SCLib, SCHotkey
except:
print("Couldn't find SunCat module")
def startQuest(quest, npc):
print("Starting quest {0} from npc {1}".format(quest, npc))
Quest.StartQuest(quest, npc)
time.sleep(1)
def completeQuest(quest, npc):
print("Completing quest {0} from npc {1}".format(quest, npc))
Quest.StartQuest(quest, npc)
time.sleep(1)
def needQuest(id): # quest hasn't been accepted
return Quest.GetQuestState(id) == 0
def hasQuest(id): # quest is active
return Quest.GetQuestState(id) == 1
def doQuest(id): # quest isn't complete/turned in
return Quest.GetQuestState(id) != 2
def doneQuest(id,npc):
return Quest.CheckCompleteDemand(id, npc) == 0
def rush(mapid):
Terminal.Rush(mapid)
def kami(switch):
Terminal.SetCheckBox("Kami Vac",switch)
q1 = 34249
q2 = 34250
q3 = 34251
q4 = 34252
q5 = 34253
q6 = 34254
q7 = 34255
q8 = 34256
q9 = 34257
q10 = 34258
q11 = 34259
q12 = 34260
q13 = 34261
q14 = 34262
q15 = 34263
npc1 = 3003422
npc2 = 3003420
npc3 = 3003421
npc4 = 3003423
npc5 = 3003424
npc6 = 3003425
npc7 = 3003426
npc8 = 3003427
npc9 = 3003428
npc10= 3003429
npc11= 3003430
#StartQuest(34249, 3003422)
#in map 450005400 , talk to StartQuest(34249, 3003422)
#time sleep(5) until map 450006000
#go to map 450006010 StartQuest(34250, 3003420 teleport to 371 -687 for kanna CompleteQuest(34250, 3003420)
#StartQuest(34251, 3003420) then go to map 450006030 CompleteQuest(34251, 3003421)
#StartQuest(34252, 3003421) teleport to 220 -417 for kanna CompleteQuest(34252, 3003421)
#time.sleep(10) until map 450006040 go to map 450006130 then go to map 450006110 teleport to -2059 -473 StartQuest(34253, 3003423) tp to -465 -656 for kanna
#teleport to -2059 -473 CompleteQuest(34253, 3003424) time.sleep(7) StartQuest(34254, 3003425)
#in map 450006130 teleport to 1956 -449 CompleteQuest(34254, 3003426)
#in map 450006130 StartQuest(34255, 3003426) go to map 450006140
#for kanna tp -963 24 check complete go back 450006130 CompleteQuest(34255, 3003426)
#StartQuest(34256, 3003427) go to map 450006150 for kanna tp -188 -298 done go back to 450006130
#CompleteQuest(34256, 3003427) StartQuest(34257, 3003427) tp to -344 24 CompleteQuest(34257, 3003425) sleep(10)
#in map 450006240 StartQuest(34258, 3003428)
#in map 450006240 CompleteQuest(34258, 3003429) StartQuest(34259, 3003429) go to map 450006210 tp 418 25 for kanna
#find item 2437666 in inventory use it until quest complete
#go back to 450006240 CompleteQuest(34259, 3003429) StartQuest(34260, 3003428) time.sleep(10)
#in map 450006240 StartQuest(34261, 3003429) go to 450006220 for kanna tp 485 25
#go back to 450006240 CompleteQuest(34261, 3003429) sleep(15) StartQuest(34262, 3003428) time.sleep(10)
#in map 450006300 StartQuest(34263, 3003430) for kanna tp 1482 297 go back -233 30 CompleteQuest(34263, 3003430) sleep(10)
currmap = Field.GetID()
job = Character.GetJob()
pos = Character.GetPos()
if GameState.IsInGame():
if doQuest(q1):
if needQuest(q1):
startQuest(q1,npc1)
time.sleep(1)
elif doQuest(q2):
if needQuest(q2):
if currmap == 450006000:
Terminal.Rush(450006010)
elif currmap == 450006010:
time.sleep(5)
startQuest(q2,npc2)
else:
time.sleep(3)
elif hasQuest(q2):
if doneQuest(q2,npc2):
completeQuest(q2,npc2)
elif job == 4212 and pos.x != 371:
Character.Teleport(371,-687)
time.sleep(3)
else:
time.sleep(3)
elif doQuest(q3):
if needQuest(q3):
if currmap == 450006010:
startQuest(q3,npc2)
else:
Terminal.Rush(450006010)
time.sleep(2)
elif hasQuest(q3):
if currmap != 450006030:
Terminal.Rush(450006030)
elif doneQuest(q3,npc3):
completeQuest(q3,npc3)
else:
time.sleep(3)
elif doQuest(q4):
if needQuest(q4):
if currmap != 450006030:
Terminal.Rush(450006030)
elif currmap == 450006030:
startQuest(q4,npc3)
else:
time.sleep(3)
elif hasQuest(q4):
if doneQuest(q4,npc3):
completeQuest(q4,npc3)
time.sleep(10)
elif job == 4212 and pos.x != 220:
Character.Teleport(220,-417)
time.sleep(3)
else:
time.sleep(3)
elif doQuest(q5):
if needQuest(q5):
if currmap == 450006040:
rush(450006130)
time.sleep(3)
elif currmap == 450006130:
rush(450006110)
time.sleep(3)
elif currmap == 450006110:
kami(False)
Character.Teleport(-2059,-473)
time.sleep(1)
startQuest(q5,npc4)
kami(True)
elif hasQuest(q5):
if doneQuest(q5,npc5):
if pos.x != -2059:
kami(False)
Character.Teleport(-2059,-473)
time.sleep(1)
else:
completeQuest(q5,npc5)
time.sleep(7)
kami(True)
elif job == 4212 and pos.x != -465:
Character.Teleport(-465,-656)
time.sleep(3)
else:
time.sleep(3)
elif doQuest(q6):
if needQuest(q6):
if currmap == 450006130:
startQuest(q6,npc6)
else:
rush(450006130)
time.sleep(1)
elif hasQuest(q6):
if doneQuest(q6,npc7):
if currmap == 450006130:
if pos.x != 1956:
kami(False)
Character.Teleport(1956,-449)
time.sleep(1)
else:
completeQuest(q6,npc7)
time.sleep(1)
kami(True)
else:
rush(450006130)
elif doQuest(q7):
if needQuest(q7):
if currmap != 450006130:
rush(450006130)
time.sleep(1)
else:
startQuest(q7,npc7)
elif hasQuest(q7):
if doneQuest(q7,npc7):
if currmap != 450006130:
rush(450006130)
time.sleep(1)
else:
completeQuest(q7,npc7)
time.sleep(1)
elif currmap != 450006140:
rush(450006140)
time.sleep(1)
elif currmap == 450006140:
if job == 4212 and pos.x != -963:
Character.Teleport(-963,24)
time.sleep(1)
else:
kami(True)
print("Wait for quest to be done")
time.sleep(1)
elif doQuest(q8):
if needQuest(q8):
if currmap != 450006130:
rush(450006130)
time.sleep(1)
else:
startQuest(q8,npc8)
elif hasQuest(q8):
if doneQuest(q8,npc8):
if currmap != 450006130:
rush(450006130)
time.sleep(1)
else:
completeQuest(q7,npc7)
time.sleep(1)
elif currmap != 450006150:
rush(450006150)
time.sleep(1)
elif currmap == 450006150:
if job == 4212 and pos.x != -188:
Character.Teleport(-188,-298)
time.sleep(1)
else:
print("Wait for quest to be done")
time.sleep(1)