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/pets.ts
Views: 723
// Pet Hacks123// BEGIN IMPORTS4import { Swal, Toast, NumberInput, Confirm } from "../utils/swal"; // Import Swal, Toast, Confirm, Input, and NumberInput from swal5import { category } from "../index"; // Import the Cheat GUI bases.6import Hack from "../class/Hack";7import { _, VERY_LARGE_NUMBER, player } from "../utils/util"; // Import Prodigy typings and VERY_LARGE_NUMBER8import { getPet } from "../utils/hackify"; // Import getPet9// END IMPORTS101112// BEGIN PET HACKS131415// Begin Get All Pets16new Hack(category.pets, "Get All Pets").setClick(async () => {171819if (!(await Confirm.fire("Would you like to add all pets to your pets?")).value) {20return console.log("Cancelled");21}222324// add pets25// @ts-expect-error26_.gameData.pet.forEach(x => {27player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);28});293031// add encounter info32player.kennel._encounterInfo._data.pets = [];33_.gameData.pet.map((pet: {34ID: number35}) => {36player.kennel._encounterInfo._data.pets.push({37firstSeenDate: Date.now(),38ID: pet.ID,39timesBattled: 1,40timesRescued: 141});42});43// Fix broken pets44// @ts-expect-error45player.kennel.petTeam.forEach(v => {46if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();47});4849return Toast.fire("Success!", "All pets have been added!", "success");50});51// End Get All Pets5253545556// Begin Get ALl Legacy Epics57new Hack(category.pets, "Get All Legacy Epics").setClick(async () => {585960if (!(await Confirm.fire("This may damage your account.", "Attempting to add legacy epics may damage your account. Would you still like to add all legacy epics to your team?", "warning")).value) {61return console.log("Cancelled");62}6364// @ts-expect-error65const epics = _.gameData.pet.filter(x => [125, 126, 127, 128, 129, 130, 131, 132, 133].includes(x.ID));66// @ts-expect-error67epics.forEach(x => {68player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);69});70// Fix broken pets71// @ts-expect-error72player.kennel.petTeam.forEach(v => {73if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();74});75return Toast.fire("Success!", "All legacy epics have been added!", "success");76});77// End Get ALl Legacy Epics787980818283// Begin Get All Mythical Epics84new Hack(category.pets, "Get All Mythical Epics").setClick(async () => {8586if (!(await Confirm.fire("Would you like to add all mythical epics to your pets?")).value) {87return console.log("Cancelled");88}899091// @ts-expect-error92const epics = _.gameData.pet.filter(x => [93158, // Magmayhem94164, // Blast Star95165, // Vegabloom96166, // Arcturion97167, // Aquadile98168, // Shiver & Scorch99169, // Riptide100170, // Lumanight101171, // Nebula102189, // B.F. Magmayhem103].includes(x.ID));104// @ts-expect-error105epics.forEach(x => {106player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);107});108// Fix broken pets109player.kennel.petTeam.forEach((v: any) => {110if (v && (v as any).assignRandomSpells) (v as any).assignRandomSpells();111});112return Toast.fire("Success!", "All mythical epics have been added!", "success");113}); // btw this hack was made by gemsvidø (afkvido on github)114// End Get ALl Mythical Epics115116117118119120// Begin Clear Pets121new Hack(category.pets, "Clear Pets").setClick(async () => {122123if (!(await Confirm.fire("Would you like to delete all of your pets?")).value) {124return console.log("Cancelled");125}126127128player.kennel.data.length = 0;129130return Toast.fire("Success!", "Your pets have been cleared!", "success");131});132// End Clear Pets133134135136137138// Begin Add Pet139new Hack(category.pets, "Add Pet", "Adds a pet from a list.").setClick(async () => {140// @ts-expect-error141const pet = await Swal.fire({142input: "select",143// @ts-expect-error144inputOptions: new Map(_.gameData.pet.map(x => [x.ID.toString(), `${x.ID}: ${x.data.name}`])),145title: "Choose Pet",146text: "Which pet do you want to obtain?"147});148if (pet.value === undefined) return;149player.kennel.addPet(pet.value);150// add encounter data151player.kennel._encounterInfo._data.pets.push({152firstSeenDate: Date.now(),153ID: pet.value,154timesBattled: 1,155timesRescued: 1156});157158return Toast.fire("Success!", "Your chosen pet has been added to your pets!", "success");159});160// End Add Pet161162163164165166// Begin Uncap pet level167new Hack(category.pets, "Uncap pet level [Client Side]", "Change your pet's level to anything, even over 100. This hack won't save when you reload Prodigy.").setClick(async () => {168const petTeam = player.kennel.petTeam.slice(0);169petTeam.shift();170// @ts-expect-error171const names = petTeam.map(pet => pet.getName());172const pet = await Swal.fire({173title: "Which pet would you like to edit?",174input: "select",175inputOptions: names,176inputPlaceholder: "Select...",177inputValidator: res => res ? "" : "Please select which you'd like to obtain.",178showCancelButton: true179});180const amt = await NumberInput.fire("Level", "What would you like to set your pet's level to? (Can be set over 100)", "question");181if (!amt.value) return;182const num = amt.value;183// sorry in advance184eval(`player.kennel.petTeam[parseInt(${pet.value})+1].getLevel = () => {return ${num}}`);185return Toast.fire("Updated!", "The level of your pet was successfully updated. Note: this hack is client-side.", "success");186});187// End Uncap pet level188189190191192193// Begin Delete Pet194new Hack(category.pets, "Delete Pet", "Delete a pet.").setClick(async () => {195const pet = await getPet("Which pet do you wish to delete?");196if (pet === undefined) return;197player.kennel.data.splice(pet, 1);198return Toast.fire("Successfully deleted!", "The selected pet was deleted successfully.", "success");199});200// End Delete Pet201202203204205// END PET HACKS206207208