diff --git a/scripts/hv-unified.user.js b/scripts/hv-unified.user.js index c2128c6..63a85b3 100644 --- a/scripts/hv-unified.user.js +++ b/scripts/hv-unified.user.js @@ -894,13 +894,24 @@ function findBestChannelingTarget() { return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } - // Fallback: cheap damage spell rather than waste the charge on basic attack - const cheap = findDmgSpell(['Fiery Blast', 'Freeze', 'Shockblast', 'Gale']); + // Fallback: ANY damage spell rather than waste the charge on basic attack + // Try elementals first (cheapest), then any spell we know + const cheap = findDmgSpell(['Fiery Blast', 'Freeze', 'Shockblast', 'Gale', + 'Smite', 'Corruption', 'Inferno', 'Blizzard', 'Chained Lightning', 'Downburst', + 'Banishment', 'Disintegrate']); if (cheap) { const t = findWeakestMonster(); if (t >= 0 && STATE.monsters[t] && STATE.monsters[t].hasAttribute('onclick')) return { type: 'spell', name: cheap, target: t }; } + // Last resort: any spell we know that costs MP + for (const sp of STATE.spellsKnown) { + if (sp.mp > 0 && sp.mp < (STATE.mp * 100)) { + const t = findWeakestMonster(); + if (t >= 0 && STATE.monsters[t] && STATE.monsters[t].hasAttribute('onclick')) + return { type: 'spell', name: sp.n, target: t }; + } + } return null; } diff --git a/scripts/latest.user.js b/scripts/latest.user.js index c2128c6..63a85b3 100644 --- a/scripts/latest.user.js +++ b/scripts/latest.user.js @@ -894,13 +894,24 @@ function findBestChannelingTarget() { return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } - // Fallback: cheap damage spell rather than waste the charge on basic attack - const cheap = findDmgSpell(['Fiery Blast', 'Freeze', 'Shockblast', 'Gale']); + // Fallback: ANY damage spell rather than waste the charge on basic attack + // Try elementals first (cheapest), then any spell we know + const cheap = findDmgSpell(['Fiery Blast', 'Freeze', 'Shockblast', 'Gale', + 'Smite', 'Corruption', 'Inferno', 'Blizzard', 'Chained Lightning', 'Downburst', + 'Banishment', 'Disintegrate']); if (cheap) { const t = findWeakestMonster(); if (t >= 0 && STATE.monsters[t] && STATE.monsters[t].hasAttribute('onclick')) return { type: 'spell', name: cheap, target: t }; } + // Last resort: any spell we know that costs MP + for (const sp of STATE.spellsKnown) { + if (sp.mp > 0 && sp.mp < (STATE.mp * 100)) { + const t = findWeakestMonster(); + if (t >= 0 && STATE.monsters[t] && STATE.monsters[t].hasAttribute('onclick')) + return { type: 'spell', name: sp.n, target: t }; + } + } return null; } diff --git a/src/strategy-engine.js b/src/strategy-engine.js index 54890b6..cf4653c 100644 --- a/src/strategy-engine.js +++ b/src/strategy-engine.js @@ -245,13 +245,24 @@ function findBestChannelingTarget() { return { type: 'spell', name: candidates[0].spell, selfTarget: true }; } - // Fallback: cheap damage spell rather than waste the charge on basic attack - const cheap = findDmgSpell(['Fiery Blast', 'Freeze', 'Shockblast', 'Gale']); + // Fallback: ANY damage spell rather than waste the charge on basic attack + // Try elementals first (cheapest), then any spell we know + const cheap = findDmgSpell(['Fiery Blast', 'Freeze', 'Shockblast', 'Gale', + 'Smite', 'Corruption', 'Inferno', 'Blizzard', 'Chained Lightning', 'Downburst', + 'Banishment', 'Disintegrate']); if (cheap) { const t = findWeakestMonster(); if (t >= 0 && STATE.monsters[t] && STATE.monsters[t].hasAttribute('onclick')) return { type: 'spell', name: cheap, target: t }; } + // Last resort: any spell we know that costs MP + for (const sp of STATE.spellsKnown) { + if (sp.mp > 0 && sp.mp < (STATE.mp * 100)) { + const t = findWeakestMonster(); + if (t >= 0 && STATE.monsters[t] && STATE.monsters[t].hasAttribute('onclick')) + return { type: 'spell', name: sp.n, target: t }; + } + } return null; }