forked from GrafNikola/tera-guide
-
Notifications
You must be signed in to change notification settings - Fork 17
/
3026.js
380 lines (334 loc) · 14.1 KB
/
3026.js
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
// Corrupted Skynest
//
// made by michengs / HSDN / ZC
module.exports = (dispatch, handlers, guide, lang) => {
guide.type = SP;
const { player } = dispatch.require.library;
const { MARKER_ITEM } = module.parent.exports.spawn;
let debuff = null;
let timer1 = null;
let timer2 = null;
let timer3 = null;
let timer4 = null;
let timer5 = null;
let boss_ent = null;
let boss_offset = 0;
let qbacting = null;
let blue = false;
let red = false;
let debuff_tracker_started = false;
const mech_messages = {
0: { message: "IN", message_RU: "К НЕМУ" },
1: { message: "OUT", message_RU: "ОТ НЕГО" }
};
const qbacting_messages = {
0: { message: "different", message_RU: "разные" },
1: { message: "same", message_RU: "одинаковые" }
};
const debuff_messages = {
0: { message: "Ready to get Fire debuff", message_RU: "Готовность к переключению на Огонь" },
1: { message: "Ready to get Ice debuff", message_RU: "Готовность к переключению на Лед" }
};
// NULL % 2 = 0
// 1 % 2 = 1
// 0 % 2 = 0
// 2 % 2 = 0
function spawn_marker(out) {
if (!boss_ent) return;
let distance = 220;
let caption = "IN";
if (out) {
distance = 620;
caption = "OUT";
}
handlers.event([
{ type: "spawn", func: "marker", args: [false, 45 + boss_offset, distance, 0, 4000, true, [caption, "SAFE"]] },
{ type: "spawn", func: "marker", args: [false, 135 + boss_offset, distance, 0, 4000, true, [caption, "SAFE"]] },
{ type: "spawn", func: "marker", args: [false, 225 + boss_offset, distance, 0, 4000, true, [caption, "SAFE"]] },
{ type: "spawn", func: "marker", args: [false, 315 + boss_offset, distance, 0, 4000, true, [caption, "SAFE"]] }
], boss_ent);
}
function debuff_added(id) {
debuff_removed();
debuff = id; // debuff event id
timer1 = dispatch.setTimeout(() => {
if (debuff != null) {
handlers.text({
sub_type: "message",
message: "Debuff 20 seconds",
message_RU: "Дебафф 20 сек."
});
}
}, 70000);
timer2 = dispatch.setTimeout(() => {
if (debuff != null) {
dispatch.setTimeout(() => {
handlers.text({
sub_type: "alert",
message: (`${debuff_messages[debuff % 2].message}`),
message_RU: (`${debuff_messages[debuff % 2].message_RU}`)
});
}, 2000);
handlers.text({
sub_type: "message",
message: "Debuff 50 seconds",
message_RU: "Дебафф 50 сек."
});
}
}, 40000);
timer3 = dispatch.setTimeout(() => {
if (debuff != null) {
handlers.text({
sub_type: "message",
message: "Warning! Debuff 15 seconds",
message_RU: "Дебафф 15 сек."
});
}
}, 75000);
timer4 = dispatch.setTimeout(() => {
if (debuff != null) {
handlers.text({
sub_type: "message",
message: "Warning! Debuff 10 seconds",
message_RU: "Дебафф 10 сек."
});
}
}, 80000);
timer5 = dispatch.setTimeout(() => {
if (debuff != null) {
handlers.text({
sub_type: "message",
message: "Warning! Debuff 5 seconds",
message_RU: "Дебафф 5 сек."
});
}
}, 85000);
if (blue) {
handlers.text({
sub_type: "message",
message: (`${mech_messages[(qbacting + debuff + 1) % 2].message}`),
message_RU: (`${mech_messages[(qbacting + debuff + 1) % 2].message_RU}`)
});
spawn_marker((qbacting + debuff + 1) % 2);
} else if (red) {
handlers.text({
sub_type: "message",
message: (`${mech_messages[(qbacting + debuff) % 2].message}`),
message_RU: (`${mech_messages[(qbacting + debuff) % 2].message_RU}`)
});
spawn_marker((qbacting + debuff) % 2);
}
}
function debuff_removed() {
debuff = null;
dispatch.clearTimeout(timer1);
dispatch.clearTimeout(timer2);
dispatch.clearTimeout(timer3);
dispatch.clearTimeout(timer4);
dispatch.clearTimeout(timer5);
}
function skilld_event(skillid, ent) {
const abnormality_change = (added, event) => {
// Fire/Ice debuff
if (player.isMe(event.target.toString()) && [30260001, 30260002, 31260001, 31260002].includes(event.id)) {
if (added) {
debuff_added(event.id);
} else {
debuff_removed();
}
}
// Argon Priest Essence buff
if (player.isMe(event.target.toString()) && [30261701, 31261701].includes(event.id)) {
if (added && boss_ent) {
handlers.spawn({ // spawn teleport mark
sub_type: "item",
id: MARKER_ITEM,
sub_delay: 50000,
pos: {
x: 53192,
y: 100761,
z: 14233
}
}, boss_ent);
}
}
};
// In-Out quest balloons (qbacting => ярость 0, ужас 1)
if ([3026004, 3126004, 3026005, 3126005].includes(skillid)) {
qbacting = skillid % 2;
}
// Fire/Ice debuff (debuff % 2 => синий 0, красный 1)
if ([30260001, 31260001, 30260002, 31260002].includes(skillid) && !debuff_tracker_started) {
debuff_added(skillid);
}
// In-Out identification
if ([212, 213, 214, 215].includes(skillid)) {
boss_ent = ent;
handlers.event([
{ type: "spawn", func: "circle", args: [false, 445, 0, 0, 8, 440, 200, 8000] },
{ type: "spawn", func: "circle", args: [false, 445, 0, 0, 4, 840, 200, 8000] }
]);
}
if ([212, 214].includes(skillid)) { // Fire claw (141, 142)
boss_offset = 10;
handlers.event([
{ type: "spawn", func: "vector", args: [553, 0, 0, 190, 840, 200, 8000] },
{ type: "spawn", func: "vector", args: [553, 0, 0, 10, 840, 200, 8000] }
]);
}
if ([213, 215].includes(skillid)) { // Ice claw (143, 144)
boss_offset = -10;
handlers.event([
{ type: "spawn", func: "vector", args: [553, 0, 0, 170, 840, 200, 8000] },
{ type: "spawn", func: "vector", args: [553, 0, 0, 350, 840, 200, 8000] }
]);
}
if ([213, 214].includes(skillid)) { // Ice inside
dispatch.setTimeout(() => {
if (debuff != null) {
handlers.text({
sub_type: "message",
message: (`Ice inside (${qbacting_messages[qbacting].message}) | ${mech_messages[(qbacting + debuff + 1) % 2].message}`),
message_RU: (`Внутри лед (${qbacting_messages[qbacting].message_RU}) | ${mech_messages[(qbacting + debuff + 1) % 2].message_RU}`)
});
spawn_marker((qbacting + debuff + 1) % 2);
} else {
handlers.text({
sub_type: "message",
message: (`Ice inside (${qbacting_messages[qbacting].message})`),
message_RU: (`Внутри лед (${qbacting_messages[qbacting].message_RU})`)
});
}
}, 500);
blue = true;
red = false;
dispatch.setTimeout(() => blue = false, 6500); //6700
}
if ([212, 215].includes(skillid)) { // Fire inside
dispatch.setTimeout(() => {
if (debuff != null) {
handlers.text({
sub_type: "message",
message: (`Fire inside (${qbacting_messages[qbacting].message}) | ${mech_messages[(qbacting + debuff) % 2].message}`),
message_RU: (`Внутри огонь (${qbacting_messages[qbacting].message_RU}) | ${mech_messages[(qbacting + debuff) % 2].message_RU}`)
});
spawn_marker((qbacting + debuff) % 2);
} else {
handlers.text({
sub_type: "message",
message: (`Fire inside (${qbacting_messages[qbacting].message})`),
message_RU: (`Внутри огонь (${qbacting_messages[qbacting].message_RU})`)
});
}
}, 500);
blue = false;
red = true;
dispatch.setTimeout(() => red = false, 6500);
}
if (!debuff_tracker_started) {
dispatch.hook("S_ABNORMALITY_BEGIN", dispatch._mod.majorPatchVersion >= 107 ? 5 : 4, abnormality_change.bind(null, true));
dispatch.hook("S_ABNORMALITY_END", 1, abnormality_change.bind(null, false));
debuff_tracker_started = true;
}
}
const skills = {
"112-0": [{ type: "text", sub_type: "message", message: "Ice DOT", message_RU: "Лед (полоса)" }],
"110-0": [{ type: "text", sub_type: "message", message: "Fire DOT", message_RU: "Огонь (лужа)" }],
"108-0": [
{ type: "text", sub_type: "message", message: "Turn Right (Repel)", message_RU: "Поворот вправо (откид)" },
{ type: "spawn", func: "circle", args: [false, 912, 0, 0, 8, 440, 0, 2000] }
],
"158-0": [
{ type: "text", sub_type: "message", message: "Turn Right (Repel)", message_RU: "Поворот вправо (откид)" },
{ type: "spawn", func: "circle", args: [false, 912, 0, 0, 8, 440, 0, 2000] }
],
"109-0": [
{ type: "text", sub_type: "message", message: "Turn Left (Repel)", message_RU: "Поворот влево (откид)" },
{ type: "spawn", func: "circle", args: [false, 912, 0, 0, 8, 440, 0, 2000] }
],
"159-0": [
{ type: "text", sub_type: "message", message: "Turn Left (Repel)", message_RU: "Поворот влево (откид)" },
{ type: "spawn", func: "circle", args: [false, 912, 0, 0, 8, 440, 0, 2000] }
],
"120-0": [{ type: "text", sub_type: "message", message: "Together", message_RU: "Яростный рев" }],
"145-0": [{ type: "text", sub_type: "message", message: "Stun", message_RU: "Стан" }],
"157-0": [{ type: "text", sub_type: "message", message: "Change", message_RU: "Смена" }],
"103-0": [
{ type: "text", sub_type: "message", message: "Tail (Flying)", message_RU: "Хвост (полет)" },
{ type: "text", sub_type: "message", message: "Arise!", message_RU: "Удочка!", delay: 1500, class_position: "priest" },
{ type: "spawn", func: "semicircle", args: [140, 260, 912, 0, 0, 10, 500, 0, 2000] },
{ type: "spawn", func: "vector", args: [912, 0, 0, 135, 500, 0, 2000] },
{ type: "spawn", func: "vector", args: [912, 0, 0, 260, 500, 0, 2000] }
],
"153-0": [
{ type: "text", sub_type: "message", message: "Tail (Flying)", message_RU: "Хвост (полет!!)" },
{ type: "text", sub_type: "message", message: "Arise!", message_RU: "Удочка!", delay: 1500, class_position: "priest" },
{ type: "spawn", func: "semicircle", args: [140, 260, 912, 0, 0, 10, 500, 0, 2000] },
{ type: "spawn", func: "vector", args: [912, 0, 0, 135, 500, 0, 2000] },
{ type: "spawn", func: "vector", args: [912, 0, 0, 260, 500, 0, 2000] }
],
// AOE лед (большой)
"104-0": [
{ type: "text", sub_type: "message", message: "Ice Storm DOTs", message_RU: "Ледяные лужи" },
{ type: "spawn", func: "circle", args: [false, 553, 0, 0, 8, 500, 0, 5000] }
],
// AOE огонь (большой)
"105-0": [
{ type: "text", sub_type: "message", message: "Fire Bombs", message_RU: "Огненные бомбы" },
{ type: "spawn", func: "circle", args: [false, 553, 135, 500, 10, 270, 0, 3000] },
{ type: "spawn", func: "circle", args: [false, 553, 315, 500, 10, 270, 0, 3250] },
{ type: "spawn", func: "circle", args: [false, 553, 45, 500, 10, 270, 0, 3500] },
{ type: "spawn", func: "circle", args: [false, 553, 235, 500, 10, 270, 0, 3750] },
{ type: "spawn", func: "circle", args: [false, 553, 90, 500, 10, 270, 0, 4000] },
{ type: "spawn", func: "circle", args: [false, 553, 270, 500, 10, 270, 0, 4250] },
{ type: "spawn", func: "circle", args: [false, 553, 0, 500, 10, 270, 0, 4500] },
{ type: "spawn", func: "circle", args: [false, 553, 180, 500, 10, 270, 0, 4750] }
],
// AOE лед (малый)
"154-0": [
{ type: "text", sub_type: "message", message: "Ice Storm", message_RU: "Ледяной шторм" },
{ type: "spawn", func: "circle", args: [false, 553, 0, 0, 8, 500, 0, 6000] }
],
// AOE огонь (малый)
"155-0": [{ type: "text", sub_type: "message", message: "Fire (Knockdown)", message_RU: "Огненный столб (опрокид)" },
{ type: "text", sub_type: "message", delay: 1200, message: "Dodge", message_RU: "Эвейд" }
],
"206-0": [{ type: "text", sub_type: "message", message: "Jump Back", message_RU: "Прыжок назад" }],
"206-2": [{ type: "spawn", func: "circle", args: [false, 553, 0, 0, 15, 350, 0, 3000] }],
"137-0": [{ type: "text", sub_type: "message", message: "Knockdown", message_RU: "Опрокидывание" }],
"138-0": [{ type: "text", sub_type: "message", message: "AOE", message_RU: "AOE" }],
"139-0": [{ type: "text", sub_type: "message", message: "Fire to all", message_RU: "Огонь всем" }],
"140-0": [{ type: "text", sub_type: "message", message: "Ice to all", message_RU: "Лед всем" }],
"die": [{ type: "func", func: debuff_removed }],
"nd-3026-1000": [
{ type: "stop_timers" },
{ type: "despawn_all" }
],
"s-3026-1000-1118-0": [{ type: "text", sub_type: "message", message: "Jump", message_RU: "Прыжок" }],
"s-3026-1000-2118-0": [{ type: "text", sub_type: "message", message: "Jump", message_RU: "Прыжок" }],
"s-3026-1000-1118-1": [{ type: "text", sub_type: "message", message: "Dodge!", message_RU: "Эвейд!", delay: 615 }],
"s-3026-1000-2118-1": [{ type: "text", sub_type: "message", message: "Dodge!", message_RU: "Эвейд!", delay: 625 }],
"s-3026-1000-1212-0": [{ type: "func", func: skilld_event, args: [212] }],
"s-3026-1000-1215-0": [{ type: "func", func: skilld_event, args: [215] }],
"s-3026-1000-1213-0": [{ type: "func", func: skilld_event, args: [213] }],
"s-3026-1000-1214-0": [{ type: "func", func: skilld_event, args: [214] }],
"qb-3026-1000-3026005": [{ type: "func", func: skilld_event, args: [3026005] }], // ужас, одинаковые цвета
"qb-3026-1000-3026004": [{ type: "func", func: skilld_event, args: [3026004] }], // ярость, разные цвета
"qb-3026-1000-3126005": [{ type: "func", func: skilld_event, args: [3126005] }], // ужас, одинаковые цвета
"qb-3026-1000-3126004": [{ type: "func", func: skilld_event, args: [3126004] }], // ярость, разные цвета
"am-3026-1000-30260001": [{ type: "func", func: skilld_event, args: [30260001] }], // красный
"am-3026-1000-30260002": [{ type: "func", func: skilld_event, args: [30260002] }], // синий
"am-3026-1000-31260001": [{ type: "func", func: skilld_event, args: [31260001] }], // красный
"am-3026-1000-31260002": [{ type: "func", func: skilld_event, args: [31260002] }] // синий
};
const object = {};
for (const [key, value] of Object.entries(skills)) {
if (key.length === 5) {
object[`s-3026-1000-1${key}`] = value;
object[`s-3026-1000-2${key}`] = value;
} else {
object[key] = value;
}
}
return object;
};