From 74d2c6e0a3a43812b78edcc05b1029f29a6a27a7 Mon Sep 17 00:00:00 2001 From: Felris Date: Sat, 19 Oct 2024 18:51:13 -0500 Subject: [PATCH] add teleport scrolls and bugfix --- .../data/killableMonsters/bosses/misc.ts | 20 +- .../data/killableMonsters/chaeldarMonsters.ts | 10 +- src/lib/minions/data/killableMonsters/revs.ts | 236 ++++++++++++------ .../minionKill/handleConsumables.ts | 6 +- 4 files changed, 194 insertions(+), 78 deletions(-) diff --git a/src/lib/minions/data/killableMonsters/bosses/misc.ts b/src/lib/minions/data/killableMonsters/bosses/misc.ts index a96b950b83..3d5d3e3d13 100644 --- a/src/lib/minions/data/killableMonsters/bosses/misc.ts +++ b/src/lib/minions/data/killableMonsters/bosses/misc.ts @@ -140,7 +140,15 @@ const killableBosses: KillableMonster[] = [ } }, defaultAttackStyles: [SkillsEnum.Ranged, SkillsEnum.Magic], - disallowedAttackStyles: [SkillsEnum.Attack, SkillsEnum.Strength] + disallowedAttackStyles: [SkillsEnum.Attack, SkillsEnum.Strength], + itemCost: [ + { + itemCost: new Bank().add('Zul-andra teleport'), + qtyPerKill: 0.25, + boostPercent: 10, + optional: true + } + ] }, { id: Monsters.KalphiteQueen.id, @@ -347,7 +355,15 @@ const killableBosses: KillableMonster[] = [ combatXpMultiplier: 1.15, healAmountNeeded: 20 * 15, attackStyleToUse: GearStat.AttackCrush, - attackStylesUsed: [GearStat.AttackCrush] + attackStylesUsed: [GearStat.AttackCrush], + itemCost: [ + { + itemCost: new Bank().add('Key master teleport'), + qtyPerKill: 0.1, + boostPercent: 10, + optional: true + } + ] }, { id: Monsters.KingBlackDragon.id, diff --git a/src/lib/minions/data/killableMonsters/chaeldarMonsters.ts b/src/lib/minions/data/killableMonsters/chaeldarMonsters.ts index ed9ea1a5fd..eb50fd3f4e 100644 --- a/src/lib/minions/data/killableMonsters/chaeldarMonsters.ts +++ b/src/lib/minions/data/killableMonsters/chaeldarMonsters.ts @@ -518,6 +518,14 @@ export const chaeldarMonsters: KillableMonster[] = [ healAmountNeeded: 250, attackStyleToUse: GearStat.AttackStab, attackStylesUsed: [GearStat.AttackSlash, GearStat.AttackRanged, GearStat.AttackMagic], - requiredQuests: [QuestID.WhileGuthixSleeps] + requiredQuests: [QuestID.WhileGuthixSleeps], + itemCost: [ + { + itemCost: new Bank().add('Guthixian temple teleport'), + qtyPerKill: 0.05, + boostPercent: 10, + optional: true + } + ] } ]; diff --git a/src/lib/minions/data/killableMonsters/revs.ts b/src/lib/minions/data/killableMonsters/revs.ts index f0beada3a0..dab3196946 100644 --- a/src/lib/minions/data/killableMonsters/revs.ts +++ b/src/lib/minions/data/killableMonsters/revs.ts @@ -15,14 +15,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -36,14 +44,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -57,14 +73,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -78,14 +102,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -99,7 +131,15 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 8, pkBaseDeathChance: 8, - canBePked: true + canBePked: true, + itemCost: [ + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ] }, { id: Monsters.RevenantHellhound.id, @@ -112,14 +152,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -133,14 +181,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -154,7 +210,15 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 8, pkBaseDeathChance: 8, - canBePked: true + canBePked: true, + itemCost: [ + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ] }, { id: Monsters.RevenantKnight.id, @@ -167,14 +231,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -188,14 +260,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true }, { @@ -209,14 +289,22 @@ export const revenantMonsters: KillableMonster[] = [ qpRequired: 0, pkActivityRating: 9, pkBaseDeathChance: 8, - itemCost: { - itemCost: new Bank().add('Blighted super restore (4)', 1), - qtyPerMinute: 0.17, - alternativeConsumables: [ - { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, - { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } - ] - }, + itemCost: [ + { + itemCost: new Bank().add('Blighted super restore (4)', 1), + qtyPerMinute: 0.17, + alternativeConsumables: [ + { itemCost: new Bank().add('Super restore (4)', 1), qtyPerMinute: 0.17 }, + { itemCost: new Bank().add('Prayer potion (4)', 1), qtyPerMinute: 0.17 } + ] + }, + { + itemCost: new Bank().add('Revenant cave teleport'), + qtyPerKill: 0.05, + boostPercent: 5, + optional: true + } + ], canBePked: true } ]; diff --git a/src/mahoji/lib/abstracted_commands/minionKill/handleConsumables.ts b/src/mahoji/lib/abstracted_commands/minionKill/handleConsumables.ts index fdba2ad443..3218c326ab 100644 --- a/src/mahoji/lib/abstracted_commands/minionKill/handleConsumables.ts +++ b/src/mahoji/lib/abstracted_commands/minionKill/handleConsumables.ts @@ -86,7 +86,11 @@ export function getItemCostFromConsumables({ const maxBasedOnTime = Math.floor(maxTripLength / timeToFinish); const maxCanKillWithItemCost = - consumableCosts.length === 0 ? Number.POSITIVE_INFINITY : Math.floor(floatCostsPerKill.fits(gearBank.bank)); + consumableCosts.length === 0 + ? Number.POSITIVE_INFINITY + : floatCostsPerKill.length() === 0 + ? Number.POSITIVE_INFINITY + : Math.floor(floatCostsPerKill.fits(gearBank.bank)); const maxAllowed = Math.min(maxBasedOnTime, maxCanKillWithItemCost); let finalQuantity = Math.max(1, inputQuantity ? Math.min(inputQuantity, maxAllowed) : maxAllowed) ?? maxAllowed; if (slayerKillsRemaining && finalQuantity > slayerKillsRemaining) {