-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic_priest.s.2.js
126 lines (108 loc) · 2.89 KB
/
basic_priest.s.2.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
// Load basic functions from other code snippet
load_code(7);
load_code(8);
// Kiting
var rangeRate = 0.5;
function fight(target) {
if (can_attack(target)) {
set_message("Attacking");
attack(target);
if (character.mp > 1100 && !is_on_cooldown("curse") && target.max_hp > 3000)
use_skill("curse", target);
if (
target &&
!is_on_cooldown("darkblessing") &&
character.mp > G.skills["darkblessing"].mp &&
!character.s?.darkblessing
)
use_skill("darkblessing");
}
if (!smartmoveDebug) {
hitAndRun(target, rangeRate);
angle =
angle +
flipRotation *
Math.asin(
(character.speed * (1 / character.frequency)) /
4 /
(character.range * rangeRate)
) *
2;
} else {
angle = undefined;
}
}
function priestBuff() {
const buffee = getLowestHealth();
if (buffee.hp < buffee.max_hp - buffThreshold * character.heal) {
if (!is_in_range(buffee, "heal")) move(buffee.x, buffee.y);
if (!is_on_cooldown("heal")) {
use_skill("heal", buffee);
set_message("Heal" + buffee.name);
}
}
const allies = parent.party_list
.map((name) => get_entity(name))
.filter((e) => e);
if (
allies &&
(allies.some(
(ally) =>
ally.hp < ally.max_hp - character.level * 10 &&
!is_in_range(ally, "heal")
) ||
allies.every((ally) => ally.hp < ally.max_hp - character.level * 10))
)
if (
is_in_range(buffee, "partyheal") &&
!is_on_cooldown("partyheal") &&
character.mp > 500
) {
use_skill("partyheal", buffee);
set_message("Heal" + buffee.name);
}
partyMems
.filter((member) => member !== character.name && member !== TANKER)
.map((member) => {
if (
Object.keys(parent.entities).some(
(entity) => parent.entities[entity]?.target === member
)
)
if (
is_in_range(get_entity(member), "absorb") &&
!is_on_cooldown("absorb") &&
character.mp > G.skills["absorb"].mp &&
(get_entity(member).ctype !== "warrior" ||
Object.keys(parent.entities).filter(
(entity) => parent.entities[entity]?.target === member
).length > 2)
) {
use_skill("absorb", get_entity(member));
set_message("Absorb " + member);
}
});
}
setInterval(function () {
loot();
buff();
if (character.rip) {
respawn();
return;
}
priestBuff();
if (smart.moving && !smartmoveDebug) return;
let target = getTarget();
//// BOSSES
if (goToBoss()) return;
//// EVENTS
target = changeToDailyEventTargets();
//// Logic to targets and farm places
if (!smart.moving && !target && !get_entity(partyMems[0]))
smart_move({
map,
x: mapX,
y: mapY,
}).catch((e) => use_skill("use_town"));
fight(target);
}, ((1 / character.frequency) * 1000) / 2);