-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic_mage.4.js
101 lines (84 loc) · 2.1 KB
/
basic_mage.4.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
// Load basic functions from other code snippet
load_code(7);
load_code(8);
// Kiting
var rangeRate = 0.76;
async function fight(target) {
if (character.rip) {
respawn();
return;
}
if (can_attack(target)) {
set_message("Attacking");
await currentStrategy(target);
attack(target);
if (
!is_on_cooldown("burst") &&
target.hp > 3000 &&
target.resistance > 400 &&
character.mp > 2000
) {
log("Maxima Burst!");
use_skill("burst");
}
if (
target["damage_type"] === "magical" &&
!is_on_cooldown("reflection") &&
partyMems.includes(target.target) &&
character.mp > 1000
) {
use_skill("reflection", get_entity(target.target));
}
}
// if (character.mp > 2000 && !is_on_cooldown("alchemy") && !isInvFull()) {
// const sellableSlot = character.items.findIndex((item) =>
// saleAble.includes(item?.name)
// );
// if (sellableSlot !== -1) {
// if (sellableSlot === 0 && saleAble.includes(character.items[0]?.name)) {
// use_skill("alchemy");
// } else {
// swap(0, sellableSlot).then(() => {
// if (saleAble.includes(character.items[0]?.name)) use_skill("alchemy");
// });
// }
// }
// }
if (!smartmoveDebug) {
hitAndRun(target, rangeRate);
angle =
angle +
flipRotation *
Math.asin(
(character.speed * (1 / character.frequency)) /
4 /
(character.range * rangeRate)
) *
2;
} else {
angle = undefined;
}
}
setInterval(function () {
loot();
buff();
if (character.rip) {
respawn();
return;
}
if (smart.moving && !smartmoveDebug) return;
let target = getTarget();
if (goToBoss()) return;
//// EVENTS
target = changeToDailyEventTargets();
//// Logic to targets and farm places
if (!smart.moving && !target && !get_entity(partyMems[0])) {
log("Moving to farming location");
smart_move({
map,
x: mapX,
y: mapY,
}).catch((e) => use_skill("use_town"));
}
fight(target);
}, ((1 / character.frequency) * 1000) / 2);