Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/cheatGUI/src/hacks/player.ts
Views: 723
// Player Hacks ⬛️🟧123// BEGIN IMPORTS4import { Swal, Toast, NumberInput, Input, Confirm } from "../utils/swal"; // Import Swal, Toast, Confirm, Input, and NumberInput from swal5import { category } from "../index"; // Import the Cheat GUI bases.6import Toggler from "../class/Toggler";7import Hack from "../class/Hack";8import { _, getItem, VERY_LARGE_NUMBER, prodigy, saveCharacter, player} from "../utils/util"; // Import Prodigy typings and VERY_LARGE_NUMBER9import { getMemberModule, ids, itemify } from "../utils/hackify"; // Import useful arrays and functions10import openChat from "../utils/chat";1112// END IMPORTS131415161718// BEGIN PLAYER HACKS192021// Begin open chat22new Hack(category.player, "Open ProdigyPNP Chat", "Opens a chat for ProdigyPNP users").setClick(async () => {23return openChat();24});25// end open chat26272829// Begin Max Account30new Hack(category.player, "Max Account").setClick(async () => {31// max account made by gemsvidø3233// ============================================34// PRE MAXING PROCESS35363738if (!(await Confirm.fire("Are you sure that you want to max your account?", "We recommend doing this on an alt.")).value) {39return console.log("Cancelled");40}41424344// PRE MAXING PROCESS45// ============================================46// ============================================47// PLAYER HACKS4849// Set the players gold to 0990000050player.data.gold = 9900000;51console.log("Set player gold to 9900000.")525354// Set the players level to 10055const level = 100;56// @ts-expect-error57const h = level.value - 2;58const xpConstant = 1.042;59player.data.stars = Math.round((1 - Math.pow(xpConstant, h)) / (1 - xpConstant) * 20 + 10);60player.data.level = 100;61player.getLevel = () => {62return player.data.level;63};64console.log("Set player level to 100");656667// Set the players bounty points to 100 (max)68player.data.bountyScore = 100;69console.log("Set player's bounty points to 100.");707172// Set the players conjure cubes to 100 (max)73for (let i = 0; i < Math.min(99, 100); i++) {74prodigy.giftBoxController.receiveGiftBox(null, getItem("giftBox", 1));75}76console.log("Obtained 100 conjure cubes.");7778798081// Get all achievements82for (var i = 0; i < 100; i++) {83player.achievements.data.progress[i] = 10;84}85console.log("Obtained all achievements.");8687// Set the players dark tower floor to 10088player.data.tower = 100;89console.log("Set tower floor to 100.");9091// PLAYER HACKS92// ============================================93// ============================================94// INVENTORY HACKS959697// Get 1 of all items98const num : number = 1;99100ids.forEach(id => {101// @ts-expect-error102player.backpack.data[id] = itemify(_.gameData[id].filter(l => id === "follow" ? ![125, 126, 127, 128, 129, 134, 135, 136, 137].includes(l.ID) : l), num.value);103});104// @ts-expect-error105_.gameData.dorm.forEach(x =>106// @ts-expect-error107player.house.data.items[x.ID] = { A: [], N: num.value });108109// Remove bounty notes110// @ts-expect-error111const bountyIndex = () => player.backpack.data.item.findIndex(v => v.ID === 84 || v.ID === 85 || v.ID === 86);112while (bountyIndex() > -1) player.backpack.data.item.splice(bountyIndex(), 1);113Toast.fire("Success!", "All items added!", "success");114115console.log("All items added!");116117118119// Get all Mounts120player.backpack.data.mount = itemify(_.gameData.mount, 1);121console.log("Added all mounts.");122123124// INVENTORY HACKS125// ============================================126// ============================================127// GET 6,969,420 OF ALL CURRENCIES128129const id : string = "currency";130const amt : number = 6969420;131// @ts-expect-error132player.backpack.data[id] = itemify(_.gameData[id].filter(a => {133return id === 'follow' ? ![125, 126, 127, 128, 129, 134, 135, 136, 137].includes(a.ID) : a134}), amt);135136137138// GET 6,969,420 OF ALL CURRENCIES139// ============================================140// ============================================141// PET HACKS142143144// Get All Pets145146// add pets147// @ts-expect-error148_.gameData.pet.forEach(x => {149player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);150});151152// add encounter info153player.kennel._encounterInfo._data.pets = [];154_.gameData.pet.map((pet: {155ID: number156}) => {157player.kennel._encounterInfo._data.pets.push({158firstSeenDate: Date.now(),159ID: pet.ID,160timesBattled: 1,161timesRescued: 1162});163});164// Fix broken pets165// @ts-expect-error166player.kennel.petTeam.forEach(v => {167if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();168});169console.log("Added all pets.");170171172173174// PET HACKS175// ============================================176// ============================================177// EQUIP CELESTIAL GEAR178179180181player.equipment.setHat(200);182player.equipment.setBoots(93);183player.equipment.setOutfit(161);184player.equipment.setWeapon(196);185186187188189// EQUIP CELESTIAL GEAR190// ============================================191// ============================================192// POST MAXING PROCESS193194195196// Refresh the players appearance197player.appearanceChanged = true;198console.log("Appearance Refreshed.");199200201// Save202saveCharacter();203console.log("Character Saved.");204205206// POST MAXING PROCESS207// ============================================208console.log("Max Account Successful.");209210return Toast.fire("Maxed!", `Check your backpack!`, "success");211});212// End Max Account213214215216217218219// Begin Set Gold220new Hack(category.player, "Set Gold").setClick(async () => {221const gold = await NumberInput.fire("Gold Amount", "What number do you want to set your gold to?", "question");222if (gold.value === undefined) return;223if (gold.value > 10000000) return Toast.fire("Error", "Cannot have more than 10,000,000 gold.", "error");224player.data.gold = +gold.value;225return Toast.fire("Success!", `You now have ${gold.value} gold.`, "success");226});227// End Set Gold228229230231232233234// Begin Set Level235new Hack(category.player, "Set Level").setClick(async () => {236const level = await NumberInput.fire("Level", "What number do you want to set your level to?", "question");237if (level.value === undefined) return;238239// calculate how many stars the level *should* have240// from 3-16-1.js:8382241if (level.value === 1) return 0;242const i = level.value - 2;243// xpConstant from 3-16-1.js:8528244const xpConstant = 1.042;245player.data.stars = Math.round((1 - Math.pow(xpConstant, i)) / (1 - xpConstant) * 20 + 10);246player.data.level = +level.value;247player.getLevel = () => {248return player.data.level;249};250251return Toast.fire("Success!", `You are now level ${level.value}.`, "success");252});253// End Set Level254255256257258259260// Begin Get member stars261new Hack(category.player, "Get member stars").setClick(async () => {262const amount = await NumberInput.fire("Stars", "How many member stars do you want?", "question");263if (amount.value === undefined) return;264player.data.storedMemberStars = amount.value;265return Toast.fire("Success!", `You have set your member stars to ${amount.value}.`, "success");266});267// End Get member stars268269270271272273274275// Begin Set bounty points276new Hack(category.player, "Set Bounty Points").setClick(async () => {277const points = await NumberInput.fire(278"Bounty Points",279"What number do you want to set your bounty points to? (Max is 100)",280"question"281);282if (points.value === undefined) return;283player.data.bountyScore = Math.min(+points.value, 100);284return Toast.fire("Success!", `You now have ${player.data.bountyScore} bounty point${player.data.bountyScore != 1 ? "s" : ""}.`, "success");285});286// End Set bounty points287288289290291292293// Begin Obtain Conjure Cubes294new Hack(category.player, "Obtain Conjure Cubes").setClick(async () => {295const cubes = await NumberInput.fire("Conjure Cubes", "How many conjure cubes do you want to get? (Max 99)", "question");296if (cubes.value === undefined) return;297for (let i = 0; i < Math.min(99, +cubes.value); i++) {298prodigy.giftBoxController.receiveGiftBox(null, getItem("giftBox", 1));299}300return Toast.fire("Success!", `You have gained ${cubes.value} conjure cube${cubes.value != 1 ? "s" : ""}.`, "success");301});302// End Obtain Conjure Cubes303304305306307308309// Begin Set Wins310new Hack(category.player, "Set Wins").setClick(async () => {311const amount = await NumberInput.fire("Wins", "What number do you want to set your wins to?", "question");312if (amount.value === undefined) return;313player.data.win = +amount.value;314return Toast.fire("Success!", `You have set your win${amount.value != 1 ? "s" : ""} to ${amount.value}.`, "success");315});316// End Set Wins317318319320321322323// Begin Set Losses324new Hack(category.player, "Set Losses").setClick(async () => {325const amount = await NumberInput.fire("Losses", "What number do you want to set your losses to?", "question");326if (amount.value === undefined) return;327player.data.loss = +amount.value;328return Toast.fire("Success!", `You have set your loss${amount.value != 1 ? "es" : ""} to ${amount.value}.`, "success");329});330// End Set Losses331332333334335336337// Begin Toggle membership338new Toggler(category.player, "Toggle membership").setEnabled(async () => {339_.instance.prodigy.gameContainer.get(getMemberModule()).data.membership.active = true;340player.appearanceChanged = true;341return Toast.fire("Success!", "You now have Prodigy membership!", "success");342}).setDisabled(() => {343_.instance.prodigy.gameContainer.get(getMemberModule()).data.membership.active = false;344player.appearanceChanged = true;345return Toast.fire("Success!", "You no longer have Prodigy membership!", "success");346});347// End Toggle membership348349350351352353354// Begin Set Name (Client Side only)355new Hack(category.player, "Set name (Client side only)").setClick(async () => {356const name = await Input.fire("What would you like to set your name to?");357if (!name.value) return;358player.getName = () => {359return name.value;360};361player.appearanceChanged = true;362return Toast.fire("Changed!", "Your name was changed.");363});364// End Set Name (Client Side only)365366367368369370371// Begin Change Name372new Hack(category.player, "Change Name", "Change the name of your wizard.").setClick(async () => {373const names = _.gameData.name;374const div = document.createElement("div");375const createSelect = (arr: Map < string, string > , equalityFunc: (str: string) => boolean) => {376const select = document.createElement("select");377select.classList.add("selectName");378for (const opt of arr.entries()) {379const optt = document.createElement("option");380[optt.value, optt.innerText] = opt;381382if (equalityFunc(optt.value)) optt.selected = true;383select.options.add(optt);384}385return select;386};387const nameSelect = (type: number, equalityFunc: (num: number) => boolean) =>388createSelect(new Map(389// @ts-expect-error390names.filter(x => x.data.type === type).map(x => [x.ID.toString(), x.name])),391val => equalityFunc(+val)392);393div.append(nameSelect(0, x => x === player.name.data.firstName));394div.append(nameSelect(1, x => x === player.name.data.middleName));395div.append(nameSelect(2, x => x === player.name.data.lastName));396div.append(397createSelect(398new Map(399400[401["null", "[none]"]402// @ts-expect-error403].concat(_.gameData.nickname.map(x => [x.ID.toString(), x.name])) as[404string,405string406][]407),408x => +x === player.name.data.nickname || String(player.name.data.nickname) === x409)410);411const name = await Swal.fire({412title: "Set Player Name",413focusConfirm: false,414showCancelButton: true,415html: div,416preConfirm: () => {417return Array.prototype.slice418.call(document.querySelectorAll(".selectName"))419.map((x: HTMLSelectElement) => x.options[x.selectedIndex].value);420}421});422if (name.value === undefined) return;423if (name.value[3] === "null") name.value[3] = null;424[425player.name.data.firstName,426player.name.data.middleName,427player.name.data.lastName,428player.name.data.nickname429] = (name.value as string[]).map(x => ((x as unknown) as number) && +x);430player.appearanceChanged = true;431return Toast.fire("Name Changed!", "Your name was successfully changed.", "success");432});433// End Change Name434435436437// Begin Uncap player level438new Hack(category.player, "Uncap player level (client side only)").setClick(async () => {439const level = await NumberInput.fire("Level", "What would you like to set your level to? (Can be >100)", "question");440if (!level.value) return;441localStorage.setItem("level", level.value);442eval(`player.getLevel = () => {return ${level.value}}`);443return Toast.fire("Updated!", "Your level has been successfully updated", "success");444});445// End Uncap player level446447448449450451// Begin get all achievements452new Hack(category.player, "Get all achievements").setClick(async () => {453for (var i = 0; i < 100; i++) {454player.achievements.data.progress[i] = 10;455}456457return Toast.fire("Success!", "Obtained all achievements!", "success");458});459// End get all achievements460461462463464465// Begin Fix Morph Crash466new Hack(category.player, "Fix Morph Crash").setClick(async () => {467player.getPlayerData().playerTransformation = undefined;468player.appearanceChanged = true;469470return Toast.fire("Success!", "Fixed morph crash bug.", "success");471});472// End Fix Morph Crash473474475476477478// Begin Permanent Morph479new Hack(category.player, "Permanent Morph", "Makes Your Current Morph Last Forever.").setClick(async () => {480if (!player.data.playerTransformation) {481return Swal.fire("No Morph Active", "Please use a Morph Marble and try again.", "error");482}483player.data.playerTransformation.maxTime = Infinity;484player.data.playerTransformation.timeRemaining = Infinity;485return Toast.fire("Success!", "You're morph will last forever!", "success");486});487// End Permanent Morph488489490491492493// Begin Complete Current Task in Quest494new Hack(category.player, "Complete Current Task In Quest", "Completes current task in quest. (Use this button a lot to complete a quest.)").setClick(async () => {495const zones = {};496Object.keys(_.instance.prodigy.world.zones).forEach(element => {497// @ts-expect-error498zones[element] = _.instance.prodigy.world.zones[element].name;499});500const questName = (await Input.fire({501title: "What Quest Do You Want To Complete?",502input: "select",503inputOptions: zones504})).value;505if (!questName) return;506const questID = _.instance.prodigy.world.zones[questName].getCurrentQuestID();507if (_.instance.prodigy.world.zones[questName].completeQuest(questID)) {508_.instance.prodigy.world.goToZoneHub(questName);509return Toast.fire("Success!", `Completed current task in the ${_.instance.prodigy.world.zones[questName].name} quest successfully!`, "success");510} else {511return Toast.fire("Could Not Complete Current Task In Quest.", "There was an error completing the quest. Did you already complete it?", "error");512}513});514// End Complete Current Task in Quest515516517518519520// Begin Set Dark Tower Floor521new Hack(category.player, "Set Dark Tower Floor").setClick(async () => {522// @ts-expect-error523const floor = await NumberInput.fire({524title: "What floor do you want to be on, in the dark tower.",525icon: "question",526// @ts-expect-error527inputValidator: (res) => (res > 100 || res < 1) ? `You can only be on floors from 1-100 not ${res}` : false528});529if (!floor.value) return;530player.data.tower = parseInt(floor.value);531return Toast.fire("Success!", `Successfully set dark tower floor to ${floor}!`, "success");532});533// End Set Dark Tower Floor534535536537538539// Begin Get UserID540new Hack(category.player, "Get UserID").setClick(async () => {541542const UserID: number = player.userID;543navigator.clipboard.writeText(UserID.toString()).then(function() {544545546console.log("Async: Copying to clipboard was successful!");547548return Swal.fire({549title: "User ID",550html: `Here is your User ID: <br> <code> ${UserID} </code> <br> You can use this for copying your account. <br> <br> Your UserID is has also been copied to your clipboard.`,551icon: "info"552});553554555}, function(err) {556557console.error("Async: Could not copy text: ", err);558559return Swal.fire({560title: "User ID",561html: `Here is your User ID: <br> <code> ${UserID} </code> <br> You can use this for copying your account.`,562icon: "info"563});564565566});567568});569// End Get UserID570571572573574575// Begin Copy Account576new Hack(category.player, "Copy Account", "Copy Account From userID").setClick(async () => {577const userID = (await NumberInput.fire("What is the userID of the account you want to copy?", undefined, "question")).value;578if (!userID) return;579if (!(await Confirm.fire("Are you sure you want to copy the account?", "This will replace all data on your account with the account your copying."))) return;580const playerData = await (await fetch(`https://api.prodigygame.com/game-api/v2/characters/${userID}?fields=inventory%2Cdata%2CisMember%2Ctutorial%2Cpets%2Cencounters%2Cquests%2Cappearance%2Cequipment%2Chouse%2Cachievements%2Cstate&userID=${userID}`, {581headers: {582Authorization: localStorage.JWT_TOKEN583}584})).json();585await fetch(`https://api.prodigygame.com/game-api/v3/characters/${userID}`, {586headers: {587"Content-Type": "application/json",588Authorization: localStorage.JWT_TOKEN589},590body: JSON.stringify({591data: JSON.stringify(playerData[userID]),592userID: player.userID593}),594method: "POST"595});596return Toast.fire("Success!", "Copied Account Successfully! Please reload.", "success");597});598// End Copy Account599600601602603604// Begin Set Grade605new Hack(category.player, "Set Grade").setClick(async () => {606const grade = await NumberInput.fire("What number do you want to set your grade to?");607if (!grade.value) return;608player.grade = parseInt(grade.value);609return Toast.fire("Success", `Successfully changed grade to ${grade}!`, "success");610});611// End Set Grade612613614615616// END PLAYER HACKS617618619