Skip to content

Commit

Permalink
Merge branch 'oldschoolgg:master' into Farming-Button
Browse files Browse the repository at this point in the history
  • Loading branch information
I-am-TURBO authored Feb 19, 2024
2 parents ed14c84 + 389747f commit dc1b0c9
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 105 deletions.
8 changes: 7 additions & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ export enum BitField {
SelfGamblingLocked = 36,
DisabledFarmingReminders = 37,
DisableClueButtons = 38,
DisableAutoSlayButton = 39
DisableAutoSlayButton = 39,
DisableHighPeakTimeWarning = 40
}

interface BitFieldData {
Expand Down Expand Up @@ -350,6 +351,11 @@ export const BitFieldData: Record<BitField, BitFieldData> = {
name: 'Disable Auto Slay Button',
protected: false,
userConfigurable: true
},
[BitField.DisableHighPeakTimeWarning]: {
name: 'Disable Wilderness High Peak Time Warning',
protected: false,
userConfigurable: true
}
} as const;

Expand Down
4 changes: 2 additions & 2 deletions src/lib/data/Collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function kcProg(mon: Monster): FormatProgressFunction {
}

function mgProg(minigameName: MinigameName): FormatProgressFunction {
return ({ minigames }) => `${minigames[minigameName]} KC`;
return ({ minigames }) => `${minigames[minigameName]} Completions`;
}

function skillProg(skillName: SkillsEnum): FormatProgressFunction {
Expand Down Expand Up @@ -807,7 +807,7 @@ export const allCollectionLogs: ICollection = {
"Shades of Mort'ton": {
items: shadesOfMorttonCL,
isActivity: true,
fmtProg: () => '0 KC'
fmtProg: mgProg('shades_of_morton')
},
'Soul Wars': {
alias: ['soul wars', 'sw'],
Expand Down
20 changes: 18 additions & 2 deletions src/lib/degradeableItems.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { percentChance } from 'e';
import { Bank } from 'oldschooljs';
import { Item } from 'oldschooljs/dist/meta/types';
import Monster from 'oldschooljs/dist/structures/Monster';
Expand Down Expand Up @@ -211,7 +212,7 @@ export const degradeableItems: DegradeableItem[] = [
setup: 'melee',
aliases: ['scythe of vitur'],
chargeInput: {
cost: new Bank().add('Blood rune', 300).add('Vial of blood').freeze(),
cost: new Bank().add('Blood rune', 200).add('Vial of blood').freeze(),
charges: 100
},
unchargedItem: getOSItem('Scythe of vitur (uncharged)'),
Expand Down Expand Up @@ -297,6 +298,17 @@ export async function degradeItem({
const degItem = degradeableItems.find(i => i.item === item);
if (!degItem) throw new Error('Invalid degradeable item');

// 5% chance to not consume a charge when Ghommal's lucky penny is equipped
let pennyReduction = 0;
if (user.hasEquipped("Ghommal's lucky penny")) {
for (let i = 0; i < chargesToDegrade; i++) {
if (percentChance(5)) {
pennyReduction++;
}
}
}
chargesToDegrade -= pennyReduction;

const currentCharges = user.user[degItem.settingsKey];
assert(typeof currentCharges === 'number');
const newCharges = Math.floor(currentCharges - chargesToDegrade);
Expand Down Expand Up @@ -353,7 +365,11 @@ export async function degradeItem({
const chargesAfter = user.user[degItem.settingsKey];
assert(typeof chargesAfter === 'number' && chargesAfter > 0);
return {
userMessage: `Your ${item.name} degraded by ${chargesToDegrade} charges, and now has ${chargesAfter} remaining.`
userMessage: `Your ${
item.name
} degraded by ${chargesToDegrade} charges, and now has ${chargesAfter} remaining.${
pennyReduction > 0 ? ` Your Ghommal's lucky penny saved ${pennyReduction} charges` : ''
}`
};
}

Expand Down
73 changes: 65 additions & 8 deletions src/lib/randomEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,36 @@ export const zombieOutfit = resolveItems([

export const mimeOutfit = resolveItems(['Mime mask', 'Mime top', 'Mime legs', 'Mime gloves', 'Mime boots']);

// Used by Mysterious Old man, Pillory, Rick Turpentine
const randomEventTable = new LootTable()
.add('Uncut sapphire', 1, 32)
.add('Uncut emerald', 1, 16)
.add('Coins', 80, 10)
.add('Coins', 160, 10)
.add('Coins', 320, 10)
.add('Coins', 480, 10)
.add('Coins', 640, 10)
.add('Uncut ruby', 1, 8)
.add('Coins', 240, 6)
.add('Cosmic talisman', 1, 4)
.add('Uncut diamond', 2, 2)
.add('Tooth half of key', 1, 1)
.add('Tooth half of key', 1, 1);

// https://oldschool.runescape.wiki/w/Random_events#List_of_random_events
// Missing: Evil Bob, Jekyll and Hyde, Maze, Prison Pete
export const RandomEvents: RandomEvent[] = [
{
id: 1,
name: 'Bee keeper',
outfit: beekeeperOutfit,
loot: new LootTable().add('Coins', [20, 60]).add('Flax', [1, 27])
loot: new LootTable().add('Coins', [16, 36]).add('Flax', [1, 27])
},
{
id: 2,
name: 'Drill Demon',
outfit: camoOutfit,
loot: new LootTable().every('Coins', 500)
loot: new LootTable().every('Genie lamp')
},
{
id: 3,
Expand All @@ -60,8 +78,8 @@ export const RandomEvents: RandomEvent[] = [
{
id: 4,
name: 'Freaky Forester',
loot: new LootTable().every('Coins', 500),
outfit: lederhosenOutfit
outfit: lederhosenOutfit,
loot: new LootTable().every('Genie lamp')
},
{
id: 5,
Expand All @@ -71,8 +89,8 @@ export const RandomEvents: RandomEvent[] = [
{
id: 6,
name: 'Gravedigger',
loot: new LootTable().every('Coins', 500),
outfit: zombieOutfit
outfit: zombieOutfit,
loot: new LootTable().every('Genie lamp')
},
{
id: 7,
Expand All @@ -82,8 +100,8 @@ export const RandomEvents: RandomEvent[] = [
{
id: 8,
name: 'Mime',
loot: new LootTable().every('Coins', 500),
outfit: mimeOutfit
outfit: mimeOutfit,
loot: new LootTable().every('Genie lamp')
},
{
id: 9,
Expand Down Expand Up @@ -129,6 +147,45 @@ export const RandomEvents: RandomEvent[] = [
.add('Spinach roll')
.add('Tooth half of key')
.add('Loop half of key')
},
{
id: 14,
name: 'Count Check',
loot: new LootTable().every('Genie lamp')
},
{
id: 15,
name: 'Evil twin',
loot: new LootTable()
.add('Uncut sapphire', [2, 4])
.add('Uncut emerald', [2, 4])
.add('Uncut ruby', [2, 4])
.add('Uncut diamond', [2, 4])
},
{
id: 16,
name: 'Mysterious Old Man',
loot: randomEventTable.add('Kebab', 1, 16).add('Spinach roll', 1, 14)
},
{
id: 17,
name: 'Pillory',
loot: randomEventTable
},
{
id: 18,
name: 'Pinball',
loot: new LootTable().add('Sapphire', 5, 3).add('Emerald', 5, 3).add('Ruby', 5, 3).add('Diamond', 2, 1)
},
{
id: 19,
name: 'Rick Turpentine',
loot: randomEventTable.add('Kebab', 1, 16).add('Spinach roll', 1, 14)
},
{
id: 20,
name: 'Strange plant',
loot: new LootTable().every('Strange fruit')
}
];

Expand Down
14 changes: 0 additions & 14 deletions src/lib/slayer/tasks/chaeldarTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,20 +438,6 @@ export const chaeldarTasks: AssignableSlayerTask[] = [
unlocked: true,
dontAssign: true
},
{
monster: Monsters.SpiritualRanger,
amount: [110, 170],

weight: 12,
monsters: [Monsters.SpiritualRanger.id, Monsters.SpiritualWarrior.id, Monsters.SpiritualMage.id],
levelRequirements: {
slayer: 60
},
combatLevel: 60,
slayerLevel: 63,
questPoints: 3,
unlocked: true
},
{
monster: Monsters.MountainTroll,
amount: [110, 170],
Expand Down
17 changes: 1 addition & 16 deletions src/lib/slayer/tasks/duradelTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export const duradelTasks: AssignableSlayerTask[] = [
monster: Monsters.SpiritualMage,
amount: [110, 170],

weight: 12,
weight: 7,
monsters: [Monsters.SpiritualRanger.id, Monsters.SpiritualWarrior.id, Monsters.SpiritualMage.id],
extendedAmount: [180, 250],
extendedUnlockId: SlayerTaskUnlocksEnum.SpiritualFervour,
Expand All @@ -392,21 +392,6 @@ export const duradelTasks: AssignableSlayerTask[] = [
unlocked: true,
dontAssign: true
},
{
monster: Monsters.SpiritualRanger,
amount: [130, 200],
weight: 7,
monsters: [Monsters.SpiritualRanger.id, Monsters.SpiritualWarrior.id, Monsters.SpiritualMage.id],
extendedAmount: [180, 250],
extendedUnlockId: SlayerTaskUnlocksEnum.SpiritualFervour,
levelRequirements: {
slayer: 60
},
combatLevel: 60,
slayerLevel: 63,
questPoints: 3,
unlocked: true
},
{
monster: Monsters.SteelDragon,
amount: [10, 20],
Expand Down
6 changes: 3 additions & 3 deletions src/lib/slayer/tasks/konarTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const konarTasks: AssignableSlayerTask[] = [
{
monster: Monsters.BlueDragon,
amount: [120, 170],
weight: 8,
weight: 4,
monsters: [Monsters.BlueDragon.id, Monsters.BabyBlueDragon.id, Monsters.BrutalBlueDragon.id],
combatLevel: 65,
questPoints: 34,
Expand Down Expand Up @@ -204,7 +204,7 @@ export const konarTasks: AssignableSlayerTask[] = [
monster: Monsters.FossilIslandWyvernSpitting,
amount: [15, 30],

weight: 9,
weight: 5,
monsters: [
Monsters.FossilIslandWyvernAncient.id,
Monsters.FossilIslandWyvernLongTailed.id,
Expand Down Expand Up @@ -381,7 +381,7 @@ export const konarTasks: AssignableSlayerTask[] = [
{
monster: Monsters.SteelDragon,
amount: [30, 50],
weight: 7,
weight: 5,
monsters: [Monsters.SteelDragon.id],
levelRequirements: killableMonsters.find(k => k.id === Monsters.SteelDragon.id)!.levelRequirements,
extendedAmount: [40, 60],
Expand Down
16 changes: 8 additions & 8 deletions src/lib/slayer/tasks/mazchnaTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ export const mazchnaTasks: AssignableSlayerTask[] = [
questPoints: 1,
unlocked: true
},
{
monster: Monsters.Lizard,
amount: [40, 70],
weight: 8,
monsters: [Monsters.Lizard.id, Monsters.SmallLizard.id, Monsters.DesertLizard.id, Monsters.SulphurLizard.id],
slayerLevel: 22,
unlocked: true
},
{
monster: Monsters.GuardDog,
amount: [40, 70],
Expand Down Expand Up @@ -185,6 +177,14 @@ export const mazchnaTasks: AssignableSlayerTask[] = [
questPoints: 4,
unlocked: true
},
{
monster: Monsters.Lizard,
amount: [40, 70],
weight: 8,
monsters: [Monsters.Lizard.id, Monsters.SmallLizard.id, Monsters.DesertLizard.id, Monsters.SulphurLizard.id],
slayerLevel: 22,
unlocked: true
},
{
monster: Monsters.Mogre,
amount: [40, 70],
Expand Down
15 changes: 1 addition & 14 deletions src/lib/slayer/tasks/nieveTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export const nieveTasks: AssignableSlayerTask[] = [
monster: Monsters.SpiritualMage,
amount: [110, 170],

weight: 12,
weight: 6,
monsters: [Monsters.SpiritualRanger.id, Monsters.SpiritualWarrior.id, Monsters.SpiritualMage.id],
levelRequirements: {
slayer: 60
Expand All @@ -369,19 +369,6 @@ export const nieveTasks: AssignableSlayerTask[] = [
unlocked: true,
dontAssign: true
},
{
monster: Monsters.SpiritualRanger,
amount: [120, 185],
weight: 6,
monsters: [Monsters.SpiritualRanger.id, Monsters.SpiritualWarrior.id, Monsters.SpiritualMage.id],
levelRequirements: {
slayer: 60
},
combatLevel: 60,
slayerLevel: 63,
questPoints: 3,
unlocked: true
},
{
monster: Monsters.SteelDragon,
amount: [30, 60],
Expand Down
28 changes: 14 additions & 14 deletions src/lib/slayer/tasks/turaelTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ export const turaelTasks: AssignableSlayerTask[] = [
combatLevel: 5,
unlocked: true
},
{
monster: Monsters.BlackBear,
amount: [15, 50],
weight: 7,
monsters: [
Monsters.BlackBear.id,
Monsters.GrizzlyBearCub.id,
Monsters.BearCub.id,
Monsters.GrizzlyBear.id,
Monsters.Callisto.id
],
combatLevel: 13,
unlocked: true
},
{
monster: Monsters.Bird,
amount: [15, 50],
Expand All @@ -38,20 +52,6 @@ export const turaelTasks: AssignableSlayerTask[] = [
],
unlocked: true
},
{
monster: Monsters.BlackBear,
amount: [15, 50],
weight: 7,
monsters: [
Monsters.BlackBear.id,
Monsters.GrizzlyBearCub.id,
Monsters.BearCub.id,
Monsters.GrizzlyBear.id,
Monsters.Callisto.id
],
combatLevel: 13,
unlocked: true
},
{
monster: Monsters.CaveBug,
amount: [10, 20],
Expand Down
Loading

0 comments on commit dc1b0c9

Please sign in to comment.