Skip to content

Instantly share code, notes, and snippets.

@Corgan
Corgan / data.json
Created August 25, 2023 15:38
Adventuring Extra Data Package Example
{
"$schema": "https://melvoridle.com/assets/schema/gameData.json",
"namespace": "adventuring_extra",
"data": {
"skillData": [{
"skillID": "adventuring:Adventuring",
"data": {
"areas": [
{
"id": "Giants_Lair",
@Corgan
Corgan / adventuring-party.mjs
Last active October 31, 2022 04:02
Melvor Skill
class AdventuringRenderQueue extends SkillRenderQueue {
constructor() {
super();
}
}
export class Adventuring extends Skill {
constructor(namespace, game) {
super(namespace, 'Adventuring', game);
// ==UserScript==
// @name Melvor Tick Multiplier
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Bloop Bleep
// @author NotCorgan#1234
// @match https://melvoridle.com/*
// @match https://www.melvoridle.com/*
// @match https://test.melvoridle.com/*
// @exclude https://melvoridle.com/update/*
@Corgan
Corgan / tick-mult.js
Last active April 8, 2022 23:19
Melvor Tick Multiplier
// ==UserScript==
// @name Melvor Tick Multiplier
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Bloop Bleep
// @author NotCorgan#1234
// @match https://melvoridle.com/*
// @match https://www.melvoridle.com/*
// @match https://test.melvoridle.com/*
// @exclude https://melvoridle.com/update/*
@Corgan
Corgan / swapSets.js
Created June 3, 2021 22:54
Swaps sets to an attack style based on combat triangle
let __attackTable = {}
__attackTable[CONSTANTS.attackType.Melee] = [CONSTANTS.attackStyle.Magic, CONSTANTS.attackStyle.Defensive];
__attackTable[CONSTANTS.attackType.Ranged] = [CONSTANTS.attackStyle.Stab, CONSTANTS.attackStyle.Slash, CONSTANTS.attackStyle.Block];
__attackTable[CONSTANTS.attackType.Magic] = [CONSTANTS.attackStyle.Accurate, CONSTANTS.attackStyle.Rapid, CONSTANTS.attackStyle.Longrange];
window.swapSets = true
let __updateEnemyMaxHit = updateEnemyMaxHit;
updateEnemyMaxHit = function() {
__updateEnemyMaxHit();
if(![CONSTANTS.gamemode.Standard, CONSTANTS.gamemode.Adventure].includes(currentGamemode)) return; // Only run in Standard and Adventure
let hasMods = (i, modList) => Object.entries(randomModifiers.equipment).map(([slot, mods]) => Object.entries(mods).reduce((acc, [mod, val]) => modList.includes(mod) ? true : acc, false))[i];
let hasQty = (i) => equippedItems[i] > 0 && getItemQtyRandomModifier(equippedItems[i])[0] > 1;
let hasGP = (i) => gp >= getRandomModifierCost(i) && equippedItems[i] > 0
let corruptEquipment = () => equippedItems.forEach((item, slot) => { let [speed, qty, cost] = [hasMods(slot, modList), hasQty(slot), hasGP(slot)]; if(!speed && qty && cost) { getEquipmentCorruption(slot) } } );
let modList = ['decreasedPlayerAttackSpeedPercent', 'increasedDamageReduction', 'increasedChanceToDoubleItemsGlobal', 'increasedLifesteal', 'increasedMinHitBasedOnMaxHit', 'increasedMeleeStrengthBonus']
setInterval(corruptEquipment, 250)
@Corgan
Corgan / weaponSwap.js
Last active December 23, 2020 01:14
Swaps between current Melee Weapon/Attack Style and Darksteel Dagger/Stab to maintain 5% hp bleed. Hooks setAttackStyle, equipItem and updateCombat functions.
let __updateCombat = updateCombat;
let __equipItem = equipItem;
let __setAttackStyle = setAttackStyle;
let __lastWeapon = equippedItems[4];
let __attackStyle = attackStyle;
setAttackStyle = function() {
__setAttackStyle.apply(null, arguments);
if(isGolbinRaid) return;
console.log("__attackStyle = " + arguments[0]);
function generateTooltip(item, isPassive=false) {
let itemStat = "";
if (item.description != undefined)
itemStat += '<br><span class="text-info">' + item.description + "</span>";
if (item.hasSpecialAttack)
itemStat += "<br><span class='text-success'>SPECIAL ATTACK<br><span class='text-danger'>" + playerSpecialAttacks[item.specialAttackID].name + " (" + playerSpecialAttacks[item.specialAttackID].chance + "%): </span><span class='text-warning'>" + playerSpecialAttacks[item.specialAttackID].description + "</span></span>";
if (!isPassive) {
if (item.attackBonus[0] > 0)
itemStat += "<br>+" + item.attackBonus[0] + " Melee Stab Bonus";
if (item.attackBonus[0] < 0)
let selectAllButton = document.createElement('button');
selectAllButton.className = 'btn btn-primary m-1';
$(selectAllButton).text("Select All");
selectAllButton.addEventListener('click', (e) => {
bank.filter((e) => e.tab == selectedBankTab && !itemsToMove.includes(e.id)).forEach((e) => selectBankItem(e.id));
});
let deselectAllButton = document.createElement('button');
deselectAllButton.className = 'btn btn-primary m-1';
$(deselectAllButton).text("Deselect All");
for(let id in SKILLS) {
if(SKILLS[id].hasMastery) {
let bar = $(`#mastery-pool-progress-${id}`)[0];
for (let i = 0; i < masteryCheckpoints.length; i++) {
let mark = document.createElement('div');
if (((MASTERY[id].pool / getMasteryPoolTotalXP(id)) * 100) >= masteryCheckpoints[i]) {
mark.className = 'bg-success';
} else {
mark.className = 'bg-danger'
}