From ce5f0fc1075ee67d89d68492aee6b2f46c4467ef Mon Sep 17 00:00:00 2001 From: TastyPumPum <79149170+TastyPumPum@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:54:49 +0100 Subject: [PATCH] Wildy Slayer changes (#349) --- src/meta/types.ts | 1 - .../monsters/low/n-s/RevenantCyclops.ts | 14 +++++----- .../monsters/low/n-s/RevenantDarkBeast.ts | 14 +++++----- .../monsters/low/n-s/RevenantDemon.ts | 14 +++++----- .../monsters/low/n-s/RevenantDragon.ts | 14 +++++----- .../monsters/low/n-s/RevenantGoblin.ts | 14 +++++----- .../monsters/low/n-s/RevenantHellhound.ts | 14 +++++----- .../monsters/low/n-s/RevenantHobgoblin.ts | 14 +++++----- .../monsters/low/n-s/RevenantImp.ts | 14 +++++----- .../monsters/low/n-s/RevenantKnight.ts | 14 +++++----- .../monsters/low/n-s/RevenantOrk.ts | 14 +++++----- .../monsters/low/n-s/RevenantPyrefiend.ts | 14 +++++----- src/structures/SimpleMonster.ts | 27 ++++++++++++++++--- src/util/util.ts | 24 ++++++++++++++++- 14 files changed, 123 insertions(+), 83 deletions(-) diff --git a/src/meta/types.ts b/src/meta/types.ts index 95132834e..cf89cd7c4 100644 --- a/src/meta/types.ts +++ b/src/meta/types.ts @@ -440,7 +440,6 @@ export interface MonsterKillOptions { */ hasSuperiors?: SimpleMonster; farmingLevel?: number; - skulled?: boolean; isAwakened?: boolean; lootTableOptions?: LootTableRollOptions; } diff --git a/src/simulation/monsters/low/n-s/RevenantCyclops.ts b/src/simulation/monsters/low/n-s/RevenantCyclops.ts index b15bc6f99..9c0a117a2 100644 --- a/src/simulation/monsters/low/n-s/RevenantCyclops.ts +++ b/src/simulation/monsters/low/n-s/RevenantCyclops.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantCyclopsTable, aliases: ['revenant cyclops'], customKillLogic: makeRevTable({ - seeds: [2440, 1342], - uniqueTable: [6507, 3579], - ancientEmblem: [1626, 5368], - ancientTotem: [2440, 1342], - ancientCrystal: [3253, 1789], - ancientStatuette: [4880, 2684], - topThree: [9760, 5368] + seeds: [1342, 1342], + uniqueTable: [3579, 716], + ancientEmblem: [5368, 5368], + ancientTotem: [1342, 1342], + ancientCrystal: [1789, 1789], + ancientStatuette: [2684, 2684], + topThree: [5368, 5368] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantDarkBeast.ts b/src/simulation/monsters/low/n-s/RevenantDarkBeast.ts index a00324177..7e74de150 100644 --- a/src/simulation/monsters/low/n-s/RevenantDarkBeast.ts +++ b/src/simulation/monsters/low/n-s/RevenantDarkBeast.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantDarkBeastTable, aliases: ['revenant dark beast'], customKillLogic: makeRevTable({ - seeds: [2220, 1210], - uniqueTable: [5867, 3227], - ancientEmblem: [1466, 4840], - ancientTotem: [2200, 1210], - ancientCrystal: [2933, 1613], - ancientStatuette: [4400, 2420], - topThree: [8800, 4840] + seeds: [1210, 1210], + uniqueTable: [3227, 645], + ancientEmblem: [4840, 4840], + ancientTotem: [1210, 1210], + ancientCrystal: [1613, 1613], + ancientStatuette: [2420, 2420], + topThree: [4840, 4840] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantDemon.ts b/src/simulation/monsters/low/n-s/RevenantDemon.ts index d6261018e..d0b4e3371 100644 --- a/src/simulation/monsters/low/n-s/RevenantDemon.ts +++ b/src/simulation/monsters/low/n-s/RevenantDemon.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantDemonTable, aliases: ['revenant demon'], customKillLogic: makeRevTable({ - seeds: [2440, 1342], - uniqueTable: [6507, 3579], - ancientEmblem: [1626, 5368], - ancientTotem: [2440, 1342], - ancientCrystal: [3253, 1789], - ancientStatuette: [4880, 2684], - topThree: [9760, 4840] + seeds: [1342, 1342], + uniqueTable: [3579, 716], + ancientEmblem: [5368, 5368], + ancientTotem: [1342, 1342], + ancientCrystal: [1789, 1789], + ancientStatuette: [2684, 2684], + topThree: [5368, 5368] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantDragon.ts b/src/simulation/monsters/low/n-s/RevenantDragon.ts index 83f90c14a..bf6c8ce3d 100644 --- a/src/simulation/monsters/low/n-s/RevenantDragon.ts +++ b/src/simulation/monsters/low/n-s/RevenantDragon.ts @@ -46,12 +46,12 @@ export default new SimpleMonster({ table: RevenantDragonTable, aliases: ['revenant dragon'], customKillLogic: makeRevTable({ - seeds: [2000, 1100], - uniqueTable: [5333, 2933], - ancientEmblem: [1333, 4400], - ancientTotem: [2000, 1100], - ancientCrystal: [2666, 1466], - ancientStatuette: [4000, 2000], - topThree: [8000, 4400] + seeds: [1100, 1100], + uniqueTable: [2933, 587], + ancientEmblem: [4400, 4400], + ancientTotem: [1100, 1100], + ancientCrystal: [1467, 1467], + ancientStatuette: [2000, 2000], + topThree: [4400, 4400] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantGoblin.ts b/src/simulation/monsters/low/n-s/RevenantGoblin.ts index d966c8d47..a1562d12e 100644 --- a/src/simulation/monsters/low/n-s/RevenantGoblin.ts +++ b/src/simulation/monsters/low/n-s/RevenantGoblin.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantGoblinTable, aliases: ['revenant goblin'], customKillLogic: makeRevTable({ - seeds: [7330, 1342], - uniqueTable: [19_467, 10_751], - ancientEmblem: [1626, 5368], - ancientTotem: [2440, 1342], - ancientCrystal: [3253, 1789], - ancientStatuette: [4880, 2684], - topThree: [9760, 5368] + seeds: [4032, 4032], + uniqueTable: [10_751, 2150], + ancientEmblem: [16_126, 16_126], + ancientTotem: [4032, 4032], + ancientCrystal: [5375, 5375], + ancientStatuette: [8063, 8063], + topThree: [16_126, 16_126] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantHellhound.ts b/src/simulation/monsters/low/n-s/RevenantHellhound.ts index 2979969f7..be917c5db 100644 --- a/src/simulation/monsters/low/n-s/RevenantHellhound.ts +++ b/src/simulation/monsters/low/n-s/RevenantHellhound.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantHellhoundTable, aliases: ['revenant hellhound'], customKillLogic: makeRevTable({ - seeds: [2440, 1342], - uniqueTable: [6507, 3579], - ancientEmblem: [1626, 5368], - ancientTotem: [2440, 1342], - ancientCrystal: [3253, 1789], - ancientStatuette: [4880, 2684], - topThree: [9760, 5368] + seeds: [1342, 1342], + uniqueTable: [3579, 716], + ancientEmblem: [5368, 5368], + ancientTotem: [1342, 1342], + ancientCrystal: [1789, 1789], + ancientStatuette: [2684, 2684], + topThree: [5368, 5368] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantHobgoblin.ts b/src/simulation/monsters/low/n-s/RevenantHobgoblin.ts index 37eda2176..7b803adbf 100644 --- a/src/simulation/monsters/low/n-s/RevenantHobgoblin.ts +++ b/src/simulation/monsters/low/n-s/RevenantHobgoblin.ts @@ -48,12 +48,12 @@ export default new SimpleMonster({ table: RevenantHobgoblinTable, aliases: ['revenant hobgoblin'], customKillLogic: makeRevTable({ - seeds: [3140, 1727], - uniqueTable: [8373, 4605], - ancientEmblem: [2093, 6908], - ancientTotem: [3140, 1727], - ancientCrystal: [4186, 2302], - ancientStatuette: [6280, 3454], - topThree: [12_560, 6908] + seeds: [1727, 1727], + uniqueTable: [4605, 921], + ancientEmblem: [6908, 6908], + ancientTotem: [1727, 1727], + ancientCrystal: [2302, 2302], + ancientStatuette: [3454, 3454], + topThree: [6908, 6908] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantImp.ts b/src/simulation/monsters/low/n-s/RevenantImp.ts index 7cbd010fb..c71b3947c 100644 --- a/src/simulation/monsters/low/n-s/RevenantImp.ts +++ b/src/simulation/monsters/low/n-s/RevenantImp.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantImpTable, aliases: ['revenant imp'], customKillLogic: makeRevTable({ - seeds: [11_000, 6050], - uniqueTable: [29_333, 16_133], - ancientEmblem: [7333, 24_200], - ancientTotem: [11_000, 6050], - ancientCrystal: [14_666, 8066], - ancientStatuette: [22_000, 12_000], - topThree: [44_000, 24_200] + seeds: [6050, 6050], + uniqueTable: [161_334, 3226], + ancientEmblem: [24_200, 24_200], + ancientTotem: [6050, 6050], + ancientCrystal: [8067, 8067], + ancientStatuette: [12_100, 12_000], + topThree: [24_200, 24_200] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantKnight.ts b/src/simulation/monsters/low/n-s/RevenantKnight.ts index c23df5476..92b21df62 100644 --- a/src/simulation/monsters/low/n-s/RevenantKnight.ts +++ b/src/simulation/monsters/low/n-s/RevenantKnight.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantKnightTable, aliases: ['revenant knight'], customKillLogic: makeRevTable({ - seeds: [2000, 1100], - uniqueTable: [5333, 2933], - ancientEmblem: [1333, 4400], - ancientTotem: [2000, 1100], - ancientCrystal: [2666, 1466], - ancientStatuette: [4000, 2200], - topThree: [8000, 4400] + seeds: [1100, 1100], + uniqueTable: [2933, 587], + ancientEmblem: [4400, 4400], + ancientTotem: [1100, 1100], + ancientCrystal: [1467, 1467], + ancientStatuette: [2200, 2200], + topThree: [4400, 4400] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantOrk.ts b/src/simulation/monsters/low/n-s/RevenantOrk.ts index 971308a0a..4e8012ad6 100644 --- a/src/simulation/monsters/low/n-s/RevenantOrk.ts +++ b/src/simulation/monsters/low/n-s/RevenantOrk.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantOrkTable, aliases: ['revenant ork'], customKillLogic: makeRevTable({ - seeds: [2200, 1210], - uniqueTable: [5867, 3227], - ancientEmblem: [1466, 1210], - ancientTotem: [2200, 1210], - ancientCrystal: [2933, 1613], - ancientStatuette: [4400, 2420], - topThree: [8800, 4840] + seeds: [1210, 1210], + uniqueTable: [3227, 645], + ancientEmblem: [4840, 4840], + ancientTotem: [1210, 1210], + ancientCrystal: [1613, 1613], + ancientStatuette: [2420, 2420], + topThree: [4840, 4840] }) }); diff --git a/src/simulation/monsters/low/n-s/RevenantPyrefiend.ts b/src/simulation/monsters/low/n-s/RevenantPyrefiend.ts index 5ea57e604..01657d305 100644 --- a/src/simulation/monsters/low/n-s/RevenantPyrefiend.ts +++ b/src/simulation/monsters/low/n-s/RevenantPyrefiend.ts @@ -47,12 +47,12 @@ export default new SimpleMonster({ table: RevenantPyrefiendTable, aliases: ['revenant pyrefiend'], customKillLogic: makeRevTable({ - seeds: [3140, 1727], - uniqueTable: [8373, 4605], - ancientEmblem: [2093, 6908], - ancientTotem: [3140, 1727], - ancientCrystal: [4186, 2302], - ancientStatuette: [6280, 3454], - topThree: [12_560, 6908] + seeds: [1727, 1727], + uniqueTable: [4605, 921], + ancientEmblem: [6908, 6908], + ancientTotem: [1727, 1727], + ancientCrystal: [2303, 2303], + ancientStatuette: [3454, 3454], + topThree: [6908, 6908] }) }); diff --git a/src/structures/SimpleMonster.ts b/src/structures/SimpleMonster.ts index 90839ba14..277ae6cb0 100644 --- a/src/structures/SimpleMonster.ts +++ b/src/structures/SimpleMonster.ts @@ -2,7 +2,13 @@ import { roll } from 'e'; import { MonsterSlayerMaster } from '../meta/monsterData'; import { CustomKillLogic, MonsterKillOptions, MonsterOptions } from '../meta/types'; -import { getAncientShardChanceFromHP, getBrimKeyChanceFromCBLevel, getTotemChanceFromHP } from '../util/util'; +import { + getAncientShardChanceFromHP, + getBrimKeyChanceFromCBLevel, + getLarranKeyChanceFromCBLevel, + getSlayersEnchantmentChanceFromHP, + getTotemChanceFromHP +} from '../util/util'; import Bank from './Bank'; import LootTable from './LootTable'; import Monster from './Monster'; @@ -37,15 +43,28 @@ export default class SimpleMonster extends Monster { public kill(quantity = 1, options: MonsterKillOptions = {}): Bank { const loot = new Bank(); - const canGetKey = options.onSlayerTask && options.slayerMaster === MonsterSlayerMaster.Konar; + const canGetBrimKey = options.onSlayerTask && options.slayerMaster === MonsterSlayerMaster.Konar; + const canGetSlayersEnchantment = options.onSlayerTask && options.slayerMaster === MonsterSlayerMaster.Krystilia; + const canGetLarranKey = options.onSlayerTask && options.slayerMaster === MonsterSlayerMaster.Krystilia; + const slayerMonster: boolean = Boolean(options.onSlayerTask && this.data.slayerLevelRequired > 1); for (let i = 0; i < quantity; i++) { - if (canGetKey) { + if (canGetBrimKey) { if (roll(getBrimKeyChanceFromCBLevel(this.data.combatLevel))) { loot.add('Brimstone key'); } } - if (options.inCatacombs && this.data.hitpoints) { + if (canGetSlayersEnchantment && this.data.hitpoints) { + if (roll(getSlayersEnchantmentChanceFromHP(this.data.hitpoints))) { + loot.add("Slayer's enchantment"); + } + } + if (canGetLarranKey) { + if (roll(getLarranKeyChanceFromCBLevel(this.data.combatLevel, slayerMonster))) { + loot.add("Larran's key"); + } + } + if (options.inCatacombs && this.data.hitpoints && !canGetLarranKey) { if (roll(getAncientShardChanceFromHP(this.data.hitpoints))) { loot.add('Ancient shard'); } diff --git a/src/util/util.ts b/src/util/util.ts index e45adda86..a06047406 100644 --- a/src/util/util.ts +++ b/src/util/util.ts @@ -161,6 +161,23 @@ export function getBrimKeyChanceFromCBLevel(combatLevel: number): number { return Math.max(Math.round((-1 / 5) * combatLevel + 120), 50); } +export function getLarranKeyChanceFromCBLevel(combatLevel: number, slayerMonster: boolean): number { + let baseChance = 0; + + if (combatLevel <= 80) { + baseChance = (3 / 10) * Math.pow(80 - combatLevel, 2) + 100; + } else if (combatLevel <= 350) { + baseChance = (-5 / 27) * combatLevel + 115; + } else { + baseChance = 50; + } + + // Reduce the base chance by 20% if slayerMonster is true + const adjustedChance = slayerMonster ? baseChance * 0.8 : baseChance; + + return adjustedChance; +} + export function JSONClone(object: O): O { return JSON.parse(JSON.stringify(object)); } @@ -182,6 +199,11 @@ export function getTotemChanceFromHP(hitpoints: number): number { return 500 - hitpoints; } +export function getSlayersEnchantmentChanceFromHP(hitpoints: number): number { + let chanceHitpoints = Math.min(hitpoints, 300); + return Math.round(320 - (chanceHitpoints * 8) / 10); +} + export interface RevTable { uniqueTable: RevTableItem; ancientEmblem: RevTableItem; @@ -202,7 +224,7 @@ export const revsUniqueTable = new LootTable() export function makeRevTable(table: RevTable): CustomKillLogic { return (options: MonsterKillOptions, currentLoot: Bank) => { - const index = options.skulled ? 1 : 0; + const index = options.onSlayerTask ? 1 : 0; if (roll(table.uniqueTable[index])) { currentLoot.add(revsUniqueTable.roll()); return;