Fix boss detection: remove SP bar check, only use gold border

At Lv100+ / Hell difficulty, all normal monsters also have SP bars
(the red nbarred.png). This made the script think every monster was
a boss, triggering debuffs (Imperil/Weaken) on every fight and
draining MP.

Changes:
- isRareMonster() no longer checks for nbarred.png
- Only gold border (BD7400/E6CCA3) indicates a real boss
- Debuffs now only fire on gold-border bosses, not on ≤2 monsters
This commit is contained in:
GaboGG 2026-07-23 17:53:47 -04:00
parent 3777de77fa
commit 3a041f41da
3 changed files with 27 additions and 30 deletions

View file

@ -708,16 +708,14 @@ function isRareMonster(idx) {
// Boss/rare monsters have distinct visual cues:
// 1. Gold border: style="border-color:#BD7400"
// 2. Gold background on label: style="background:#E6CCA3"
// 3. SP bar present (third btm5 child with nbarred.png)
// NOTE: At high levels/difficulties, normal monsters also get SP bars,
// so we can't use nbarred.png as a boss indicator anymore.
const style = m.getAttribute('style') || '';
const inner = m.innerHTML || '';
// Check for gold border (boss indicator)
// Check for gold border (boss indicator — still reliable)
if (style.includes('BD7400') || style.includes('E6CCA3')) return true;
// Check for SP bar (only bosses have all 3 bars: HP, MP, SP)
if (inner.includes('nbarred.png')) return true;
// Fallback: check name from DOM
const n = m.querySelector('.btm3');
if (!n) return false;
@ -1006,9 +1004,10 @@ function strategyAdept() {
}
}
// 4. Debuffs — only on important fights (rare/boss/ultimate monsters)
// In random mob fights, just attack through them
if (anyRareMonster() || STATE.monsters.length <= 2) {
// 4. Debuffs — only on actual boss fights (gold border style)
// At high levels/difficulties, all monsters have SP bars, so
// we only debuff when a gold-bordered rare/boss is present.
if (anyRareMonster()) {
if (hasSpell('Imperil')) {
const b = findStrongestMonster();
if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))
@ -1142,8 +1141,8 @@ function strategyVeteran() {
}
}
// 4. Debuffs — only on important fights (rare/boss)
if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) {
// 4. Debuffs — only on actual boss fights (gold border)
if (CFG.autoDebuff && STATE.mp > 0.2 && anyRareMonster()) {
if (hasSpell('Imperil')) {
const b = findStrongestMonster();
if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))

View file

@ -708,16 +708,14 @@ function isRareMonster(idx) {
// Boss/rare monsters have distinct visual cues:
// 1. Gold border: style="border-color:#BD7400"
// 2. Gold background on label: style="background:#E6CCA3"
// 3. SP bar present (third btm5 child with nbarred.png)
// NOTE: At high levels/difficulties, normal monsters also get SP bars,
// so we can't use nbarred.png as a boss indicator anymore.
const style = m.getAttribute('style') || '';
const inner = m.innerHTML || '';
// Check for gold border (boss indicator)
// Check for gold border (boss indicator — still reliable)
if (style.includes('BD7400') || style.includes('E6CCA3')) return true;
// Check for SP bar (only bosses have all 3 bars: HP, MP, SP)
if (inner.includes('nbarred.png')) return true;
// Fallback: check name from DOM
const n = m.querySelector('.btm3');
if (!n) return false;
@ -1006,9 +1004,10 @@ function strategyAdept() {
}
}
// 4. Debuffs — only on important fights (rare/boss/ultimate monsters)
// In random mob fights, just attack through them
if (anyRareMonster() || STATE.monsters.length <= 2) {
// 4. Debuffs — only on actual boss fights (gold border style)
// At high levels/difficulties, all monsters have SP bars, so
// we only debuff when a gold-bordered rare/boss is present.
if (anyRareMonster()) {
if (hasSpell('Imperil')) {
const b = findStrongestMonster();
if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))
@ -1142,8 +1141,8 @@ function strategyVeteran() {
}
}
// 4. Debuffs — only on important fights (rare/boss)
if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) {
// 4. Debuffs — only on actual boss fights (gold border)
if (CFG.autoDebuff && STATE.mp > 0.2 && anyRareMonster()) {
if (hasSpell('Imperil')) {
const b = findStrongestMonster();
if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))

View file

@ -63,16 +63,14 @@ function isRareMonster(idx) {
// Boss/rare monsters have distinct visual cues:
// 1. Gold border: style="border-color:#BD7400"
// 2. Gold background on label: style="background:#E6CCA3"
// 3. SP bar present (third btm5 child with nbarred.png)
// NOTE: At high levels/difficulties, normal monsters also get SP bars,
// so we can't use nbarred.png as a boss indicator anymore.
const style = m.getAttribute('style') || '';
const inner = m.innerHTML || '';
// Check for gold border (boss indicator)
// Check for gold border (boss indicator — still reliable)
if (style.includes('BD7400') || style.includes('E6CCA3')) return true;
// Check for SP bar (only bosses have all 3 bars: HP, MP, SP)
if (inner.includes('nbarred.png')) return true;
// Fallback: check name from DOM
const n = m.querySelector('.btm3');
if (!n) return false;
@ -361,9 +359,10 @@ function strategyAdept() {
}
}
// 4. Debuffs — only on important fights (rare/boss/ultimate monsters)
// In random mob fights, just attack through them
if (anyRareMonster() || STATE.monsters.length <= 2) {
// 4. Debuffs — only on actual boss fights (gold border style)
// At high levels/difficulties, all monsters have SP bars, so
// we only debuff when a gold-bordered rare/boss is present.
if (anyRareMonster()) {
if (hasSpell('Imperil')) {
const b = findStrongestMonster();
if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))
@ -497,8 +496,8 @@ function strategyVeteran() {
}
}
// 4. Debuffs — only on important fights (rare/boss)
if (CFG.autoDebuff && STATE.mp > 0.2 && (anyRareMonster() || STATE.monsters.length <= 2)) {
// 4. Debuffs — only on actual boss fights (gold border)
if (CFG.autoDebuff && STATE.mp > 0.2 && anyRareMonster()) {
if (hasSpell('Imperil')) {
const b = findStrongestMonster();
if (b >= 0 && !checkMonsterDebuff(b, 'imperil'))