Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildy Slayer fixes #5940

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions src/lib/minions/data/killableMonsters/krystiliaMonsters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ export const krystiliaMonsters: KillableMonster[] = [

difficultyRating: 5,
qpRequired: 0,
canCannon: true,
pkActivityRating: 1,
pkBaseDeathChance: 1,
revsWeaponBoost: true
revsWeaponBoost: true,
wildyMulti: true
},
{
id: Monsters.ChaosDruid.id,
Expand All @@ -31,7 +33,7 @@ export const krystiliaMonsters: KillableMonster[] = [
difficultyRating: 2,
qpRequired: 0,
canCannon: true,
cannonMulti: true,
cannonMulti: false,
canBarrage: false,
pkActivityRating: 1,
pkBaseDeathChance: 1,
Expand All @@ -53,7 +55,8 @@ export const krystiliaMonsters: KillableMonster[] = [
canBarrage: false,
pkActivityRating: 1,
pkBaseDeathChance: 1,
revsWeaponBoost: true
revsWeaponBoost: true,
wildyMulti: true
},
{
id: Monsters.DeadlyRedSpider.id,
Expand Down Expand Up @@ -87,7 +90,8 @@ export const krystiliaMonsters: KillableMonster[] = [
canBarrage: false,
pkActivityRating: 2,
pkBaseDeathChance: 7,
revsWeaponBoost: true
revsWeaponBoost: true,
wildyMulti: true
},
{
id: Monsters.Ent.id,
Expand Down Expand Up @@ -125,7 +129,8 @@ export const krystiliaMonsters: KillableMonster[] = [
pkActivityRating: 1,
pkBaseDeathChance: 1,
revsWeaponBoost: true,
canBePked: true
canBePked: true,
wildyMulti: true
},
{
id: Monsters.LavaDragon.id,
Expand All @@ -143,7 +148,8 @@ export const krystiliaMonsters: KillableMonster[] = [
pkActivityRating: 3,
pkBaseDeathChance: 4,
revsWeaponBoost: true,
canBePked: true
canBePked: true,
wildyMulti: true
},
{
id: Monsters.MagicAxe.id,
Expand All @@ -162,7 +168,8 @@ export const krystiliaMonsters: KillableMonster[] = [
},
pkActivityRating: 1,
pkBaseDeathChance: 1,
revsWeaponBoost: true
revsWeaponBoost: true,
canCannon: true
},
{
id: Monsters.Mammoth.id,
Expand All @@ -181,7 +188,8 @@ export const krystiliaMonsters: KillableMonster[] = [
pkActivityRating: 1,
pkBaseDeathChance: 1,
revsWeaponBoost: true,
canBePked: true
canBePked: true,
wildyMulti: true
},
{
id: Monsters.Pirate.id,
Expand Down
4 changes: 3 additions & 1 deletion src/lib/minions/data/killableMonsters/vannakaMonsters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,9 @@ export const vannakaMonsters: KillableMonster[] = [
attackStylesUsed: [GearStat.AttackSlash],
canCannon: true,
revsWeaponBoost: true,
wildySlayerCave: true
wildySlayerCave: true,
pkActivityRating: 2,
pkBaseDeathChance: 4
},
{
id: Monsters.HarpieBugSwarm.id,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/slayer/slayerUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface DetermineBoostParams {
monster: KillableMonster;
method?: PvMMethod | null;
isOnTask?: boolean;
wildyJelly?: boolean;
wildyBurst?: boolean;
}
export function determineBoostChoice(params: DetermineBoostParams) {
let boostChoice = 'none';
Expand All @@ -55,12 +55,12 @@ export function determineBoostChoice(params: DetermineBoostParams) {
boostChoice = 'cannon';
} else if (
params.cbOpts.includes(CombatOptionsEnum.AlwaysIceBarrage) &&
(params.monster?.canBarrage || params.wildyJelly)
(params.monster?.canBarrage || params.wildyBurst)
) {
boostChoice = 'barrage';
} else if (
params.cbOpts.includes(CombatOptionsEnum.AlwaysIceBurst) &&
(params.monster?.canBarrage || params.wildyJelly)
(params.monster?.canBarrage || params.wildyBurst)
) {
boostChoice = 'burst';
} else if (params.cbOpts.includes(CombatOptionsEnum.AlwaysCannon)) {
Expand Down
5 changes: 3 additions & 2 deletions src/lib/util/calcWildyPkChance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export async function calcWildyPKChance(
peak: Peak,
monster: KillableMonster,
duration: number,
supplies: boolean
supplies: boolean,
cannonMulti: boolean
): Promise<[number, boolean, string]> {
// Chance per minute, Difficulty from 1 to 10, and factor a million difference, High peak 5x as likley encounter, Medium peak 1x, Low peak 5x as unlikley
const peakInfluence = peakFactor.find(_peaktier => _peaktier.peakTier === peak?.peakTier)?.factor ?? 1;
Expand All @@ -72,7 +73,7 @@ export async function calcWildyPKChance(
deathChance += deathChanceFromLevels;

// Multi does make it riskier, but only if there's actually a team on you
const wildyMultiMultiplier = monster.wildyMulti === true ? 2 : 1;
const wildyMultiMultiplier = monster.wildyMulti || cannonMulti ? 2 : 1;
const hasSupplies = supplies ? 0.5 : 1;
const hasOverheads = user.skillLevel(SkillsEnum.Prayer) >= 43 ? 0.25 : 1;

Expand Down
176 changes: 168 additions & 8 deletions src/mahoji/lib/abstracted_commands/autoSlayCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,164 @@ const AutoSlayMaxEfficiencyTable: AutoslayLink[] = [
}
];

const WildyAutoSlayMaxEfficiencyTable: AutoslayLink[] = [
{
monsterID: Monsters.AbyssalDemon.id,
efficientName: Monsters.AbyssalDemon.name,
efficientMonster: Monsters.AbyssalDemon.id,
efficientMethod: 'barrage'
},
{
monsterID: Monsters.Ankou.id,
efficientName: Monsters.Ankou.name,
efficientMonster: Monsters.Ankou.id,
efficientMethod: 'barrage'
},
{
monsterID: Monsters.BlackDemon.id,
efficientName: Monsters.BlackDemon.name,
efficientMonster: Monsters.BlackDemon.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.BlackKnight.id,
efficientName: Monsters.BlackKnight.name,
efficientMonster: Monsters.BlackKnight.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Bloodveld.id,
efficientName: Monsters.Bloodveld.name,
efficientMonster: Monsters.Bloodveld.id,
efficientMethod: 'barrage'
},
{
monsterID: Monsters.ChaosDruid.id,
efficientName: Monsters.ChaosDruid.name,
efficientMonster: Monsters.ChaosDruid.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.DarkWarrior.id,
efficientName: Monsters.DarkWarrior.name,
efficientMonster: Monsters.DarkWarrior.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.DeadlyRedSpider.id,
efficientName: Monsters.DeadlyRedSpider.name,
efficientMonster: Monsters.DeadlyRedSpider.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.DustDevil.id,
efficientName: Monsters.DustDevil.name,
efficientMonster: Monsters.DustDevil.id,
efficientMethod: 'barrage'
},
{
monsterID: Monsters.ElderChaosDruid.id,
efficientName: Monsters.ElderChaosDruid.name,
efficientMonster: Monsters.ElderChaosDruid.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Ent.id,
efficientName: Monsters.Ent.name,
efficientMonster: Monsters.Ent.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.GreaterDemon.id,
efficientName: Monsters.GreaterDemon.name,
efficientMonster: Monsters.GreaterDemon.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.GreenDragon.id,
efficientName: Monsters.GreenDragon.name,
efficientMonster: Monsters.GreenDragon.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.GuardBandit.id,
efficientName: Monsters.GuardBandit.name,
efficientMonster: Monsters.GuardBandit.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Hellhound.id,
efficientName: Monsters.Hellhound.name,
efficientMonster: Monsters.Hellhound.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.IceGiant.id,
efficientName: Monsters.IceGiant.name,
efficientMonster: Monsters.IceGiant.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.IceWarrior.id,
efficientName: Monsters.IceWarrior.name,
efficientMonster: Monsters.IceWarrior.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Jelly.id,
efficientName: Monsters.Jelly.name,
efficientMonster: Monsters.Jelly.id,
efficientMethod: 'barrage'
},
{
monsterID: Monsters.LesserDemon.id,
efficientName: Monsters.LesserDemon.name,
efficientMonster: Monsters.LesserDemon.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.MagicAxe.id,
efficientName: Monsters.MagicAxe.name,
efficientMonster: Monsters.MagicAxe.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Mammoth.id,
efficientName: Monsters.Mammoth.name,
efficientMonster: Monsters.Mammoth.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.MossGiant.id,
efficientName: Monsters.MossGiant.name,
efficientMonster: Monsters.MossGiant.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Nechryael.id,
efficientName: Monsters.Nechryael.name,
efficientMonster: Monsters.Nechryael.id,
efficientMethod: 'barrage'
},
{
monsterID: Monsters.RevenantImp.id,
efficientName: Monsters.RevenantDemon.name,
efficientMonster: Monsters.RevenantDemon.id,
efficientMethod: 'none'
},
{
monsterID: Monsters.Scorpion.id,
efficientName: Monsters.Scorpion.name,
efficientMonster: Monsters.Scorpion.id,
efficientMethod: 'cannon'
},
{
monsterID: Monsters.Spider.id,
efficientName: Monsters.Spider.name,
efficientMonster: Monsters.Spider.id,
efficientMethod: 'cannon'
}
];
function determineAutoslayMethod(autoslayOptions: AutoslayOptionsEnum[]) {
let method = 'default';
if (autoslayOptions.includes(AutoslayOptionsEnum.MaxEfficiency)) {
Expand Down Expand Up @@ -294,21 +452,23 @@ export async function autoSlayCommand({
return;
}
if (method === 'ehp') {
const ehpMonster = AutoSlayMaxEfficiencyTable.find(e => {
let ehpMonster = AutoSlayMaxEfficiencyTable.find(e => {
const masterMatch = !e.slayerMasters || e.slayerMasters.includes(usersTask.currentTask?.slayer_master_id);
return masterMatch && e.monsterID === usersTask.assignedTask?.monster.id;
});

if (usersTask.currentTask.slayer_master_id === 8) {
ehpMonster = WildyAutoSlayMaxEfficiencyTable.find(e => {
const masterMatch =
!e.slayerMasters || e.slayerMasters.includes(usersTask.currentTask!.slayer_master_id);
return masterMatch && e.monsterID === usersTask.assignedTask!.monster.id;
});
}

const ehpKillable = killableMonsters.find(m => m.id === ehpMonster?.efficientMonster);

// If we don't have the requirements for the efficient monster, revert to default monster
if (
(ehpKillable?.levelRequirements !== undefined && !hasSkillReqs(user, ehpKillable.levelRequirements)[0]) ||
(usersTask.currentTask?.slayer_master_id === 8 &&
[Monsters.Jelly.id, Monsters.Bloodveld.id, Monsters.BlackDragon.id].includes(
usersTask.assignedTask?.monster.id
))
) {
if (ehpKillable?.levelRequirements !== undefined && !hasSkillReqs(user, ehpKillable.levelRequirements)[0]) {
runCommand({
commandName: 'k',
args: {
Expand Down
Loading
Loading