-
Notifications
You must be signed in to change notification settings - Fork 0
/
MythicDetect.js
52 lines (46 loc) · 2.48 KB
/
MythicDetect.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
import location from "../../utils/location";
import settings from "../../utils/settings";
import { BOLD, DARK_BLUE, DARK_RED, GOLEM_CLASS, GUARDIAN_CLASS, RED, WHITE } from "../../utils/constants";
import { announceMob } from "../../utils/functions/misc";
import { data, registerWhen } from "../../utils/variables";
import { Hitbox, renderEntities } from "../../utils/waypoints";
/**
* Announce to party/all chat whenever player spawns a mythic lava creature.
*/
registerWhen(register("chat", () => {
announceMob(settings.mythicLavaAnnounce, "Lord Jawbus", Player.getX(), Player.getY(), Player.getZ());
}).setCriteria("You have angered a legendary creature... Lord Jawbus has arrived."),
() => location.getWorld() === "Crimson Isle" && settings.mythicLavaAnnounce !== 0);
registerWhen(register("chat", () => {
announceMob(settings.mythicLavaAnnounce, "Thunder", Player.getX(), Player.getY(), Player.getZ());
}).setCriteria("You hear a massive rumble as Thunder emerges."),
() => location.getWorld() === "Crimson Isle" && settings.mythicLavaAnnounce !== 0);
/**
* Detects if any mythic lava creatures are near the player.
*/
let jawbussy = [];
let thunders = [];
registerWhen(register("step", () => {
jawbussy = World.getAllEntitiesOfType(GOLEM_CLASS);
if (jawbussy.length > 0) {
if (jawbussy.find(jawbus => jawbus.getEntity().func_110143_aJ() === 0) !== undefined)
Client.showTitle(`${DARK_RED + BOLD}LORD JAWBUS ${RED}DEAD!`, "", 0, 50, 10);
else Client.showTitle(`${DARK_RED + BOLD}LORD JAWBUS ${WHITE}DETECTED!`, "", 0, 25, 5);
if (!data.moblist.includes("jawbus")) jawbussy = [];
}
thunders = World.getAllEntitiesOfType(GUARDIAN_CLASS).filter(guardian => guardian.getEntity().func_175461_cl());
if (thunders.length > 0) {
if (thunders.find(thunder => thunder.getEntity().func_110143_aJ() === 0) !== undefined)
Client.showTitle(`${DARK_BLUE + BOLD}THUNDER ${RED}DEAD!`, "", 0, 50, 10);
else Client.showTitle(`${DARK_BLUE + BOLD}THUNDER ${WHITE}DETECTED!`, "", 0, 25, 5);
if (!data.moblist.includes("thunder")) thunders = [];
}
}).setFps(2), () => location.getWorld() === "Crimson Isle" && settings.mythicLavaDetect);
new Hitbox(() => location.getWorld() === "Crimson Isle" && settings.mythicLavaDetect, (pt) => {
renderEntities(jawbussy, 0.55, 0, 0, pt, "Jawbussy");
renderEntities(thunders, 0, 0, 0.55, pt, "T1 Zeus");
});
register("worldUnload", () => {
jawbussy = [];
thunders = [];
});