Skip to content

Commit

Permalink
BSO Wildy Changes (#5926)
Browse files Browse the repository at this point in the history
  • Loading branch information
TastyPumPum authored Jul 2, 2024
1 parent 0fa9b33 commit c2f4723
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 45 deletions.
6 changes: 4 additions & 2 deletions src/lib/minions/data/killableMonsters/custom/demiBosses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ const Malygos: CustomMonster = {
uniques: resolveItems(['Abyssal thread', 'Abyssal cape', 'Ori', 'Dragon hunter lance']),
notifyDrops: resolveItems(['Abyssal cape', 'Ori']),
baseMonster: Monsters.Vorkath,
customMonsterData: { attributes: [MonsterAttribute.Dragon, MonsterAttribute.Fiery] }
customMonsterData: { attributes: [MonsterAttribute.Dragon, MonsterAttribute.Fiery] },
canBePked: true
};

const Treebeard: CustomMonster = {
Expand Down Expand Up @@ -139,7 +140,8 @@ const Treebeard: CustomMonster = {
resolveNameBank({
'Axe of the high sungod': 10
})
]
],
canBePked: true
};

export const QueenBlackDragon: CustomMonster = {
Expand Down
1 change: 1 addition & 0 deletions src/lib/minions/data/killableMonsters/krystiliaMonsters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const krystiliaMonsters: KillableMonster[] = [

difficultyRating: 5,
qpRequired: 0,
canCannon: true,
pkActivityRating: 1,
pkBaseDeathChance: 1,
revsWeaponBoost: true,
Expand Down
55 changes: 14 additions & 41 deletions src/mahoji/lib/abstracted_commands/minionKill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export async function minionKillCommand(
}
}

for (const [itemID, boostAmount] of Object.entries(resolveAvailableItemBoosts(user, monster, isInWilderness))) {
for (const [itemID, boostAmount] of Object.entries(resolveAvailableItemBoosts(user, monster))) {

Check warning on line 341 in src/mahoji/lib/abstracted_commands/minionKill.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'itemID' is already declared in the upper scope on line 18 column 10

Check warning on line 341 in src/mahoji/lib/abstracted_commands/minionKill.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'itemID' is already declared in the upper scope on line 18 column 10
timeToFinish *= (100 - boostAmount) / 100;
boosts.push(`${boostAmount}% for ${itemNameFromID(parseInt(itemID))}`);
}
Expand Down Expand Up @@ -394,13 +394,8 @@ export async function minionKillCommand(
}

function applyDragonBoost() {
const hasDragonLance = isInWilderness
? wildyGear.hasEquipped('Dragon hunter lance')
: user.hasEquippedOrInBank('Dragon hunter lance');
const hasDragonCrossbow = isInWilderness
? wildyGear.hasEquipped('Dragon hunter crossbow')
: user.hasEquippedOrInBank('Dragon hunter crossbow');

const hasDragonLance = user.hasEquippedOrInBank('Dragon hunter lance');
const hasDragonCrossbow = user.hasEquippedOrInBank('Dragon hunter crossbow');
if (
(hasDragonLance && !attackStyles.includes(SkillsEnum.Ranged) && !attackStyles.includes(SkillsEnum.Magic)) ||
(hasDragonCrossbow && attackStyles.includes(SkillsEnum.Ranged))
Expand All @@ -414,18 +409,10 @@ export async function minionKillCommand(
}

function applyBlackMaskBoost() {
const hasInfernalSlayerHelmI = isInWilderness
? wildyGear.hasEquipped('Infernal slayer helmet(i)')
: user.hasEquippedOrInBank('Infernal slayer helmet(i)');
const hasInfernalSlayerHelm = isInWilderness
? wildyGear.hasEquipped('Infernal slayer helmet')
: user.hasEquippedOrInBank('Infernal slayer helmet');
const hasBlackMask = isInWilderness
? wildyGear.hasEquipped('Black mask')
: user.hasEquippedOrInBank('Black mask');
const hasBlackMaskI = isInWilderness
? wildyGear.hasEquipped('Black mask (i)')
: user.hasEquippedOrInBank('Black mask (i)');
const hasInfernalSlayerHelmI = user.hasEquippedOrInBank('Infernal slayer helmet(i)');
const hasInfernalSlayerHelm = user.hasEquippedOrInBank('Infernal slayer helmet');
const hasBlackMask = user.hasEquippedOrInBank('Black mask');
const hasBlackMaskI = user.hasEquippedOrInBank('Black mask (i)');

if (attackStyles.includes(SkillsEnum.Ranged) || attackStyles.includes(SkillsEnum.Magic)) {
if (hasBlackMaskI) {
Expand All @@ -451,25 +438,17 @@ export async function minionKillCommand(
let salveEnhanced = false;
const style = attackStyles[0];

Check warning on line 439 in src/mahoji/lib/abstracted_commands/minionKill.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

'style' is already declared in the upper scope on line 180 column 8

Check warning on line 439 in src/mahoji/lib/abstracted_commands/minionKill.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

'style' is already declared in the upper scope on line 180 column 8
if (style === 'ranged' || style === 'magic') {
salveBoost = isInWilderness
? wildyGear.hasEquipped('Salve amulet(i)')
: user.hasEquippedOrInBank('Salve amulet (i)');
salveEnhanced = isInWilderness
? wildyGear.hasEquipped('Salve amulet(ei)')
: user.hasEquippedOrInBank('Salve amulet (ei)');
salveBoost = user.hasEquippedOrInBank('Salve amulet (i)');
salveEnhanced = user.hasEquippedOrInBank('Salve amulet (ei)');
if (salveBoost) {
salveAmuletBoost = salveEnhanced ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
salveEnhanced ? '(ei)' : '(i)'
} on non-melee task`;
}
} else {
salveBoost = isInWilderness
? wildyGear.hasEquipped('Salve amulet')
: user.hasEquippedOrInBank('Salve amulet');
salveEnhanced = isInWilderness
? wildyGear.hasEquipped('Salve amulet (e)')
: user.hasEquippedOrInBank('Salve amulet (e)');
salveBoost = user.hasEquippedOrInBank('Salve amulet');
salveEnhanced = user.hasEquippedOrInBank('Salve amulet (e)');
if (salveBoost) {
salveAmuletBoost = salveEnhanced ? 20 : oneSixthBoost;
salveAmuletBoostMsg = `${salveAmuletBoost}% for Salve amulet${
Expand All @@ -487,11 +466,7 @@ export async function minionKillCommand(
let virtusPiecesEquipped = 0;

for (const item of resolveItems(['Virtus mask', 'Virtus robe top', 'Virtus robe legs'])) {
if (isInWilderness) {
if (wildyGear.hasEquipped(item)) {
virtusPiecesEquipped += blackMaskBoost !== 0 && itemNameFromID(item) === 'Virtus mask' ? 0 : 1;
}
} else if (user.gear.mage.hasEquipped(item)) {
if (user.gear.mage.hasEquipped(item)) {
virtusPiecesEquipped += blackMaskBoost !== 0 && itemNameFromID(item) === 'Virtus mask' ? 0 : 1;
}
}
Expand Down Expand Up @@ -763,9 +738,7 @@ export async function minionKillCommand(
convertPvmStylesToGearSetup(attackStyles).includes(degItem.attackStyle) &&
(monster.setupsUsed ? monster.setupsUsed.includes(degItem.attackStyle) : true);

const gearCheck = isInWilderness
? user.gear.wildy.hasEquipped(degItem.item.id)
: user.gear[degItem.attackStyle].hasEquipped(degItem.item.id);
const gearCheck = user.gear[degItem.attackStyle].hasEquipped(degItem.item.id);

if (isUsing && gearCheck) {
// We assume they have enough charges, add the boost, and degrade at the end to avoid doing it twice.
Expand Down Expand Up @@ -1070,7 +1043,7 @@ export async function minionKillCommand(
let hasDied: boolean | undefined = undefined;
let hasWildySupplies = undefined;

if (isInWilderness) {
if (isInWilderness && ![BSOMonsters.Malygos.id, BSOMonsters.Treebeard.id].includes(monster.id)) {
await increaseWildEvasionXp(user, duration);
thePkCount = 0;
hasDied = false;
Expand Down
4 changes: 2 additions & 2 deletions src/mahoji/mahojiSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export function hasMonsterRequirements(user: MUser, monster: KillableMonster) {
return [true];
}

export function resolveAvailableItemBoosts(user: MUser, monster: KillableMonster, isInWilderness: boolean = false) {
export function resolveAvailableItemBoosts(user: MUser, monster: KillableMonster) {
const boosts = new Bank();
if (monster.itemInBankBoosts) {
for (const boostSet of monster.itemInBankBoosts) {
Expand All @@ -320,7 +320,7 @@ export function resolveAvailableItemBoosts(user: MUser, monster: KillableMonster
// find the highest boost that the player has
for (const [itemID, boostAmount] of Object.entries(boostSet)) {
const parsedId = parseInt(itemID);
if (isInWilderness ? !user.hasEquipped(parsedId) : !user.hasEquippedOrInBank(parsedId)) {
if (!user.hasEquippedOrInBank(parsedId)) {
continue;
}
if (boostAmount > highestBoostAmount) {
Expand Down

0 comments on commit c2f4723

Please sign in to comment.