Skip to content

Commit

Permalink
fixed issues pointed out in the comments above
Browse files Browse the repository at this point in the history
  • Loading branch information
Arodab committed Aug 20, 2024
1 parent 4da6ae3 commit 52c0865
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 73 deletions.
3 changes: 1 addition & 2 deletions src/lib/data/similarItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ const source: [string, (string | number)[]][] = [
['Forestry kit', ['Forestry basket']],
['Ring of stone', ['Ring of coins', 'Crate ring', 'Ring of nature', 'Snowman ring', 'Ring of 3rd age']],

['Ring of suffering (i)', ['Ring of suffering (ri)']],

['Ring of suffering (i)', ['Ring of suffering (ri)']]
];

const similarItems: Map<number, number[]> = new Map(source.map(entry => [itemID(entry[0]), resolveItems(entry[1])]));
Expand Down
4 changes: 2 additions & 2 deletions src/lib/degradeableItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export const degradeablePvmBoostItems: DegradeableItemPVMBoost[] = [
attackStyle: 'melee',
charges: ({ totalHP }) => totalHP / 25,
boost: 2
},
}
];

export function checkUserCanUseDegradeableItem({
Expand Down Expand Up @@ -470,4 +470,4 @@ export async function refundChargeBank(user: MUser, chargeBank: ChargeBank): Pro
}

return results;
}
}
68 changes: 18 additions & 50 deletions src/lib/minions/data/killableMonsters/bosses/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { SkillsEnum } from '../../../../skilling/types';
import itemID from '../../../../util/itemID';
import type { KillableMonster } from '../../../types';


const killableBosses: KillableMonster[] = [
{
id: Monsters.GiantMole.id,
Expand Down Expand Up @@ -200,11 +199,9 @@ const killableBosses: KillableMonster[] = [
timeToFinish: Time.Minute * 30,
emoji: '<:Pet_dark_core:324127377347313674>',
wildy: false,
difficultyRating: 6,

itemsRequired: deepResolveItems([
['Zamorakian spear', "Osmumten's fang"]
]),
difficultyRating: 6,
itemsRequired: deepResolveItems([['Zamorakian spear', "Osmumten's fang"]]),
notifyDrops: resolveItems([
'Spectral sigil',
'Arcane sigil',
Expand All @@ -213,70 +210,51 @@ const killableBosses: KillableMonster[] = [
'Jar of spirits'
]),
qpRequired: 0,

itemInBankBoosts: [
{
[itemID("Dragon warhammer")]: 10,
[itemID("Elder maul")]: 12
[itemID('Dragon warhammer')]: 10,
[itemID('Elder maul')]: 12
},
{
[itemID('Bandos godsword')]: 5,
[itemID("Voidwaker")]: 6
[itemID('Voidwaker')]: 6
}
],
equippedItemBoosts: [
{
items: [
{ boostPercent: 10, itemID: itemID("Osmumten's fang") }
],
items: [{ boostPercent: 10, itemID: itemID("Osmumten's fang") }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 8, itemID: itemID("Elysian spirit shield") },
],
items: [{ boostPercent: 8, itemID: itemID('Elysian spirit shield') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 2, itemID: itemID("Torva full helm") },
],
items: [{ boostPercent: 2, itemID: itemID('Torva full helm') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 3, itemID: itemID("Masori body (f)") },
],
items: [{ boostPercent: 3, itemID: itemID('Masori body (f)') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 3, itemID: itemID("Masori chaps (f)") },
],
items: [{ boostPercent: 3, itemID: itemID('Masori chaps (f)') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 2, itemID: itemID("Infernal cape") },
],
items: [{ boostPercent: 2, itemID: itemID('Infernal cape') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 1, itemID: itemID("Ring of suffering (i)") }
],
items: [{ boostPercent: 1, itemID: itemID('Ring of suffering (i)') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 1, itemID: itemID("Barrows gloves") }
],
items: [{ boostPercent: 1, itemID: itemID('Barrows gloves') }],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 1, itemID: itemID("Primordial boots") }
],
items: [{ boostPercent: 1, itemID: itemID('Primordial boots') }],
gearSetup: 'melee'
}
],
Expand All @@ -286,7 +264,7 @@ const killableBosses: KillableMonster[] = [
gearSetup: 'melee',
items: [
{
itemID: itemID("Amulet of blood fury"),
itemID: itemID('Amulet of blood fury'),
boostPercent: 8
}
]
Expand Down Expand Up @@ -536,13 +514,12 @@ const killableBosses: KillableMonster[] = [
table: Monsters.Scurrius,
notifyDrops: resolveItems(['Scurry']),
qpRequired: 0,

equippedItemBoosts: [
{
items: [
{ boostPercent: 15, itemID: itemID('Scythe of vitur') },
{ boostPercent: 12, itemID: itemID('Soulreaper axe') },
{ boostPercent: 5, itemID: itemID('Bone mace') },
{ boostPercent: 5, itemID: itemID('Bone mace') }
],
gearSetup: 'melee'
},
Expand Down Expand Up @@ -573,23 +550,14 @@ const killableBosses: KillableMonster[] = [
{ boostPercent: 2, itemID: itemID('Fire cape') }
],
gearSetup: 'melee'
},
{
items: [
{ boostPercent: 4, itemID: itemID('Infernal cape') },
{ boostPercent: 2, itemID: itemID('Fire cape') }
],
gearSetup: 'melee'
},

}
],

levelRequirements: {
prayer: 43
},
defaultAttackStyles: [SkillsEnum.Attack],
customMonsterHP: 575,
combatXpMultiplier: 1.20,
combatXpMultiplier: 1.2,
healAmountNeeded: 20
}
];
Expand Down
43 changes: 24 additions & 19 deletions src/mahoji/lib/abstracted_commands/minionKill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,9 @@ export async function minionKillCommand(
: user.hasEquippedOrInBank('Salve amulet (ei)');
if (salveBoost) {
salveAmuletBoost = salveEnhanced ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${salveEnhanced ? '(ei)' : '(i)'
} on non-melee task`;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
salveEnhanced ? '(ei)' : '(i)'
} on non-melee task`;
}
} else {
salveBoost = isInWilderness
Expand All @@ -361,8 +362,9 @@ export async function minionKillCommand(
: user.hasEquippedOrInBank('Salve amulet (e)');
if (salveBoost) {
salveAmuletBoost = salveEnhanced ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${salveEnhanced ? ' (e)' : ''
} on melee task`;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
salveEnhanced ? ' (e)' : ''
} on melee task`;
}
}
}
Expand Down Expand Up @@ -569,11 +571,12 @@ export async function minionKillCommand(
for (const set of monster.degradeableItemUsage) {
const equippedInThisSet = set.items.find(item => user.gear[set.gearSetup].hasEquipped(item.itemID));
if (set.required && !equippedInThisSet) {
return `You need one of these items equipped in your ${set.gearSetup} setup to kill ${monster.name
}: ${set.items
.map(i => i.itemID)
.map(itemNameFromID)
.join(', ')}.`;
return `You need one of these items equipped in your ${set.gearSetup} setup to kill ${
monster.name
}: ${set.items
.map(i => i.itemID)
.map(itemNameFromID)
.join(', ')}.`;
}
if (equippedInThisSet) {
const degItem = degradeablePvmBoostItems.find(i => i.item.id === equippedInThisSet.itemID)!;
Expand Down Expand Up @@ -621,9 +624,6 @@ export async function minionKillCommand(
}
}




if (isOnTask) {
let effectiveQtyRemaining = usersTask.currentTask?.quantity_remaining;
if (
Expand Down Expand Up @@ -725,8 +725,9 @@ export async function minionKillCommand(
}
if (pvmCost) {
if (quantity === 0 || !user.owns(lootToRemove)) {
return `You don't have the items needed to kill any amount of ${monster.name
}, you need: ${formatMissingItems(consumableCosts, timeToFinish)} per kill.`;
return `You don't have the items needed to kill any amount of ${
monster.name
}, you need: ${formatMissingItems(consumableCosts, timeToFinish)} per kill.`;
}
}

Expand All @@ -743,8 +744,9 @@ export async function minionKillCommand(
if (projectilesNeeded > rangeCheck.ammo.quantity) {
return `You need ${projectilesNeeded.toLocaleString()}x ${itemNameFromID(
rangeCheck.ammo.item
)} to kill ${quantity}x ${monster.name
}, and you have ${rangeCheck.ammo.quantity.toLocaleString()}x equipped.`;
)} to kill ${quantity}x ${
monster.name
}, and you have ${rangeCheck.ammo.quantity.toLocaleString()}x equipped.`;
}
}

Expand Down Expand Up @@ -1110,7 +1112,8 @@ export async function monsterInfo(user: MUser, name: string): Promise<string | I
const gearReductions = gearStats.replace(/: Reduced from (?:[0-9]+?), /, '\n').replace('), ', ')\n');
if (hpNeededPerKill > 0) {
itemRequirements.push(
`**Healing Required:** ${gearReductions}\nYou require ${hpNeededPerKill * maxCanKill
`**Healing Required:** ${gearReductions}\nYou require ${
hpNeededPerKill * maxCanKill
} hp for a full trip\n`
);
} else {
Expand Down Expand Up @@ -1145,7 +1148,8 @@ export async function monsterInfo(user: MUser, name: string): Promise<string | I
}
if (totalBoost.length > 0) {
str.push(
`**Boosts**\nAvailable Boosts: ${totalBoost.join(', ')}\n${ownedBoostItems.length > 0 ? `Your boosts: ${ownedBoostItems.join(', ')} for ${totalItemBoost}%` : ''
`**Boosts**\nAvailable Boosts: ${totalBoost.join(', ')}\n${
ownedBoostItems.length > 0 ? `Your boosts: ${ownedBoostItems.join(', ')} for ${totalItemBoost}%` : ''
}\n${skillString}`
);
} else {
Expand Down Expand Up @@ -1184,7 +1188,8 @@ export async function monsterInfo(user: MUser, name: string): Promise<string | I
if (monster.degradeableItemUsage) {
for (const item of monster.degradeableItemUsage) {
str.push(
`${item.items.map(i => `${itemNameFromID(i.itemID)} (${i.boostPercent}% boost)`).join(' OR ')} ${item.required ? 'must' : 'can'
`${item.items.map(i => `${itemNameFromID(i.itemID)} (${i.boostPercent}% boost)`).join(' OR ')} ${
item.required ? 'must' : 'can'
} be equipped in your ${item.gearSetup} setup, needs to be charged using /minion charge.`
);
}
Expand Down

0 comments on commit 52c0865

Please sign in to comment.