-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathplayer.ts
More file actions
641 lines (445 loc) · 19.9 KB
/
player.ts
File metadata and controls
641 lines (445 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
// Player Hacks ⬛️🟧
// BEGIN IMPORTS
import { Swal, Toast, NumberInput, Input, Confirm } from "../utils/swal"; // Import Swal, Toast, Confirm, Input, and NumberInput from swal
import { category } from "../index"; // Import the Cheat GUI bases.
import Toggler from "../class/Toggler";
import Hack from "../class/Hack";
import { _, getItem, VERY_LARGE_NUMBER, prodigy, saveCharacter, player} from "../utils/util"; // Import Prodigy typings and VERY_LARGE_NUMBER
import { getMemberModule, ids, itemify } from "../utils/hackify"; // Import useful arrays and functions
import openChat from "../utils/chat";
// END IMPORTS
// BEGIN PLAYER HACKS
// Begin open chat
new Hack(category.player, "Open ProdigyPNP Chat", "Opens a chat for ProdigyPNP users").setClick(async () => {
return openChat();
});
// end open chat
// Begin Max Account
new Hack(category.player, "Max Account", "Gives you everything your account could possibly need.").setClick(async () => {
// max account made by gemsvidø
// ============================================
// PRE MAXING PROCESS
if (!(await Confirm.fire("Are you sure that you want to max your account?", "We recommend doing this on an alt.")).value) {
return console.log("Cancelled");
}
// PRE MAXING PROCESS
// ============================================
// ============================================
// PLAYER HACKS
// Set the players gold to 09900000
player.data.gold = 9900000;
console.log("Set player gold to 9900000.")
// Set the players level to 100
const level = 100;
// @ts-expect-error
const h = level.value - 2;
const xpConstant = 1.042;
player.data.stars = Math.round((1 - Math.pow(xpConstant, h)) / (1 - xpConstant) * 20 + 10);
player.data.level = 100;
player.getLevel = () => {
return player.data.level;
};
console.log("Set player level to 100");
// Set the players bounty points to 100 (max)
player.data.bountyScore = 100;
console.log("Set player's bounty points to 100.");
// Set the players conjure cubes to 100 (max)
for (let i = 0; i < Math.min(99, 100); i++) {
prodigy.giftBoxController.receiveGiftBox(null, getItem("giftBox", 1));
}
console.log("Obtained 100 conjure cubes.");
// Get all achievements
for (var i = 0; i < 100; i++) {
player.achievements.data.progress[i] = 10;
}
console.log("Obtained all achievements.");
// Set the players dark tower floor to 100
player.data.tower = 100;
console.log("Set tower floor to 100.");
// PLAYER HACKS
// ============================================
// ============================================
// INVENTORY HACKS
// Get 1 of all items
const num : number = 1;
ids.forEach(id => {
// @ts-expect-error
player.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);
});
// @ts-expect-error
_.gameData.dorm.forEach(x =>
// @ts-expect-error
player.house.data.items[x.ID] = { A: [], N: num.value });
// Remove bounty notes
// @ts-expect-error
const bountyIndex = () => player.backpack.data.item.findIndex(v => v.ID === 84 || v.ID === 85 || v.ID === 86);
while (bountyIndex() > -1) player.backpack.data.item.splice(bountyIndex(), 1);
Toast.fire("Success!", "All items added!", "success");
console.log("All items added!");
// Get all Mounts
player.backpack.data.mount = itemify(_.gameData.mount, 1);
console.log("Added all mounts.");
// INVENTORY HACKS
// ============================================
// ============================================
// GET 6,969,420 OF ALL CURRENCIES
const id : string = "currency";
const amt : number = 6969420;
// @ts-expect-error
player.backpack.data[id] = itemify(_.gameData[id].filter(a => {
return id === 'follow' ? ![125, 126, 127, 128, 129, 134, 135, 136, 137].includes(a.ID) : a
}), amt);
// GET 6,969,420 OF ALL CURRENCIES
// ============================================
// ============================================
// PET HACKS
// Get All Pets
// add pets
// @ts-expect-error
_.gameData.pet.forEach(x => {
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
});
// add encounter info
player.kennel._encounterInfo._data.pets = [];
_.gameData.pet.map((pet: {
ID: number
}) => {
player.kennel._encounterInfo._data.pets.push({
firstSeenDate: Date.now(),
ID: pet.ID,
timesBattled: 1,
timesRescued: 1
});
});
// Fix broken pets
// @ts-expect-error
player.kennel.petTeam.forEach(v => {
if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();
});
console.log("Added all pets.");
// PET HACKS
// ============================================
// ============================================
// EQUIP CELESTIAL GEAR
player.equipment.setHat(200);
player.equipment.setBoots(93);
player.equipment.setOutfit(161);
player.equipment.setWeapon(196);
// EQUIP CELESTIAL GEAR
// ============================================
// ============================================
// POST MAXING PROCESS
// Refresh the players appearance
player.appearanceChanged = true;
console.log("Appearance Refreshed.");
// Save
saveCharacter();
console.log("Character Saved.");
// POST MAXING PROCESS
// ============================================
console.log("Max Account Successful.");
return Toast.fire("Maxed!", `Check your backpack!`, "success");
});
// End Max Account
// Begin Set Gold
new Hack(category.player, "Set Gold").setClick(async () => {
const gold = await NumberInput.fire("Gold Amount", "What number do you want to set your gold to?", "question");
if (gold.value === undefined) return;
if (gold.value > 10000000) return Toast.fire("Error", "Cannot have more than 10,000,000 gold.", "error");
player.data.gold = +gold.value;
return Toast.fire("Success!", `You now have ${gold.value} gold.`, "success");
});
// End Set Gold
// Begin Set Level
new Hack(category.player, "Set Level").setClick(async () => {
const level = await NumberInput.fire("Level", "What number do you want to set your level to?", "question");
if (level.value === undefined) return;
// calculate how many stars the level *should* have
// from 3-16-1.js:8382
if (level.value === 1) return 0;
const i = level.value - 2;
// xpConstant from 3-16-1.js:8528
const xpConstant = 1.042;
player.data.stars = Math.round((1 - Math.pow(xpConstant, i)) / (1 - xpConstant) * 20 + 10);
player.data.level = +level.value;
player.getLevel = () => {
return player.data.level;
};
return Toast.fire("Success!", `You are now level ${level.value}.`, "success");
});
// End Set Level
// Begin Toggle membership
new Toggler(category.player, "Toggle Membership", "Gives you \"Level Up!\" Membership in Prodigy.").setEnabled(async () => {
_.instance.prodigy.gameContainer.get(getMemberModule()).data.membership.active = true;
_.player.appearanceChanged = true;
return Toast.fire("Success!", "You now have Prodigy membership!", "success");
}).setDisabled(() => {
_.instance.prodigy.gameContainer.get(getMemberModule()).data.membership.active = false;
_.player.appearanceChanged = true;
return Toast.fire("Success!", "You no longer have Prodigy membership!", "success");
});
// End Toggle membership
// Begin Ultimate membership
new Toggler(category.player, "Ultimate membership", "Gives you \"Ultimate\" Membership in Prodigy.").setEnabled(async () => {
player.hasLegacyMembership = () => false
player.appearanceChanged = true;
// prodigy.gameContainer.get(getMemberModule())._data.membership.__proto__.active
return Toast.fire("Success!", "You now have Ultimate membership!", "success");
}).setDisabled(() => {
player.hasLegacyMembership = () => true;
player.appearanceChanged = true;
return Toast.fire("Success!", "You no longer have Ultimate membership!", "success");
});
// End Ultimate membership
// Begin Get member stars
new Hack(category.player, "Get member stars").setClick(async () => {
const amount = await NumberInput.fire("Stars", "How many member stars do you want?", "question");
if (amount.value === undefined) return;
player.data.storedMemberStars = amount.value;
return Toast.fire("Success!", `You have set your member stars to ${amount.value}.`, "success");
});
// End Get member stars
// Begin Set bounty points
new Hack(category.player, "Set Bounty Points").setClick(async () => {
const points = await NumberInput.fire(
"Bounty Points",
"What number do you want to set your bounty points to? (Max is 100)",
"question"
);
if (points.value === undefined) return;
player.data.bountyScore = Math.min(+points.value, 100);
return Toast.fire("Success!", `You now have ${player.data.bountyScore} bounty point${player.data.bountyScore != 1 ? "s" : ""}.`, "success");
});
// End Set bounty points
// Begin Obtain Conjure Cubes
new Hack(category.player, "Obtain Conjure Cubes").setClick(async () => {
const cubes = await NumberInput.fire("Conjure Cubes", "How many conjure cubes do you want to get? (Max 99)", "question");
if (cubes.value === undefined) return;
for (let i = 0; i < Math.min(99, +cubes.value); i++) {
prodigy.giftBoxController.receiveGiftBox(null, getItem("giftBox", 1));
}
return Toast.fire("Success!", `You have gained ${cubes.value} conjure cube${cubes.value != 1 ? "s" : ""}.`, "success");
});
// End Obtain Conjure Cubes
// Begin Set Wins
new Hack(category.player, "Set Wins").setClick(async () => {
const amount = await NumberInput.fire("Wins", "What number do you want to set your wins to?", "question");
if (amount.value === undefined) return;
player.data.win = +amount.value;
return Toast.fire("Success!", `You have set your win${amount.value != 1 ? "s" : ""} to ${amount.value}.`, "success");
});
// End Set Wins
// Begin Set Losses
new Hack(category.player, "Set Losses").setClick(async () => {
const amount = await NumberInput.fire("Losses", "What number do you want to set your losses to?", "question");
if (amount.value === undefined) return;
player.data.loss = +amount.value;
return Toast.fire("Success!", `You have set your loss${amount.value != 1 ? "es" : ""} to ${amount.value}.`, "success");
});
// End Set Losses
// Begin Toggle membership
new Toggler(category.player, "Toggle membership").setEnabled(async () => {
_.instance.prodigy.gameContainer.get(getMemberModule()).data.membership.active = true;
player.appearanceChanged = true;
return Toast.fire("Success!", "You now have Prodigy membership!", "success");
}).setDisabled(() => {
_.instance.prodigy.gameContainer.get(getMemberModule()).data.membership.active = false;
player.appearanceChanged = true;
return Toast.fire("Success!", "You no longer have Prodigy membership!", "success");
});
// End Toggle membership
// Begin Set Name (Client Side only)
new Hack(category.player, "Set name (Client side only)").setClick(async () => {
const name = await Input.fire("What would you like to set your name to?");
if (!name.value) return;
player.getName = () => {
return name.value;
};
player.appearanceChanged = true;
return Toast.fire("Changed!", "Your name was changed.");
});
// End Set Name (Client Side only)
// Begin Change Name
new Hack(category.player, "Change Name", "Change the name of your wizard.").setClick(async () => {
const names = _.gameData.name;
const div = document.createElement("div");
const createSelect = (arr: Map < string, string > , equalityFunc: (str: string) => boolean) => {
const select = document.createElement("select");
select.classList.add("selectName");
for (const opt of arr.entries()) {
const optt = document.createElement("option");
[optt.value, optt.innerText] = opt;
if (equalityFunc(optt.value)) optt.selected = true;
select.options.add(optt);
}
return select;
};
const nameSelect = (type: number, equalityFunc: (num: number) => boolean) =>
createSelect(new Map(
// @ts-expect-error
names.filter(x => x.data.type === type).map(x => [x.ID.toString(), x.name])),
val => equalityFunc(+val)
);
div.append(nameSelect(0, x => x === player.name.data.firstName));
div.append(nameSelect(1, x => x === player.name.data.middleName));
div.append(nameSelect(2, x => x === player.name.data.lastName));
div.append(
createSelect(
new Map(
[
["null", "[none]"]
// @ts-expect-error
].concat(_.gameData.nickname.map(x => [x.ID.toString(), x.name])) as[
string,
string
][]
),
x => +x === player.name.data.nickname || String(player.name.data.nickname) === x
)
);
const name = await Swal.fire({
title: "Set Player Name",
focusConfirm: false,
showCancelButton: true,
html: div,
preConfirm: () => {
return Array.prototype.slice
.call(document.querySelectorAll(".selectName"))
.map((x: HTMLSelectElement) => x.options[x.selectedIndex].value);
}
});
if (name.value === undefined) return;
if (name.value[3] === "null") name.value[3] = null;
[
player.name.data.firstName,
player.name.data.middleName,
player.name.data.lastName,
player.name.data.nickname
] = (name.value as string[]).map(x => ((x as unknown) as number) && +x);
player.appearanceChanged = true;
return Toast.fire("Name Changed!", "Your name was successfully changed.", "success");
});
// End Change Name
// Begin Uncap player level
new Hack(category.player, "Uncap player level (client side only)").setClick(async () => {
const level = await NumberInput.fire("Level", "What would you like to set your level to? (Can be >100)", "question");
if (!level.value) return;
localStorage.setItem("level", level.value);
eval(`player.getLevel = () => {return ${level.value}}`);
return Toast.fire("Updated!", "Your level has been successfully updated", "success");
});
// End Uncap player level
// Begin get all achievements
new Hack(category.player, "Get all achievements").setClick(async () => {
for (var i = 0; i < 100; i++) {
player.achievements.data.progress[i] = 10;
}
return Toast.fire("Success!", "Obtained all achievements!", "success");
});
// End get all achievements
// Begin Fix Morph Crash
new Hack(category.player, "Fix Morph Crash").setClick(async () => {
player.getPlayerData().playerTransformation = undefined;
player.appearanceChanged = true;
return Toast.fire("Success!", "Fixed morph crash bug.", "success");
});
// End Fix Morph Crash
// Begin Permanent Morph
new Hack(category.player, "Permanent Morph", "Makes Your Current Morph Last Forever.").setClick(async () => {
if (!player.data.playerTransformation) {
return Swal.fire("No Morph Active", "Please use a Morph Marble and try again.", "error");
}
player.data.playerTransformation.maxTime = Infinity;
player.data.playerTransformation.timeRemaining = Infinity;
return Toast.fire("Success!", "You're morph will last forever!", "success");
});
// End Permanent Morph
// Begin Complete Current Task in Quest
new Hack(category.player, "Complete Current Task In Quest", "Completes current task in quest. (Use this button a lot to complete a quest.)").setClick(async () => {
const zones = {};
Object.keys(_.instance.prodigy.world.zones).forEach(element => {
// @ts-expect-error
zones[element] = _.instance.prodigy.world.zones[element].name;
});
const questName = (await Input.fire({
title: "What Quest Do You Want To Complete?",
input: "select",
inputOptions: zones
})).value;
if (!questName) return;
const questID = _.instance.prodigy.world.zones[questName].getCurrentQuestID();
if (_.instance.prodigy.world.zones[questName].completeQuest(questID)) {
_.instance.prodigy.world.goToZoneHub(questName);
return Toast.fire("Success!", `Completed current task in the ${_.instance.prodigy.world.zones[questName].name} quest successfully!`, "success");
} else {
return Toast.fire("Could Not Complete Current Task In Quest.", "There was an error completing the quest. Did you already complete it?", "error");
}
});
// End Complete Current Task in Quest
// Begin Set Dark Tower Floor
new Hack(category.player, "Set Dark Tower Floor").setClick(async () => {
// @ts-expect-error
const floor = await NumberInput.fire({
title: "What floor do you want to be on, in the dark tower.",
icon: "question",
// @ts-expect-error
inputValidator: (res) => (res > 100 || res < 1) ? `You can only be on floors from 1-100 not ${res}` : false
});
if (!floor.value) return;
player.data.tower = parseInt(floor.value);
return Toast.fire("Success!", `Successfully set dark tower floor to ${floor}!`, "success");
});
// End Set Dark Tower Floor
// Begin Get UserID
new Hack(category.player, "Get UserID").setClick(async () => {
const UserID: number = player.userID;
navigator.clipboard.writeText(UserID.toString()).then(function() {
console.log("Async: Copying to clipboard was successful!");
return Swal.fire({
title: "User ID",
html: `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.`,
icon: "info"
});
}, function(err) {
console.error("Async: Could not copy text: ", err);
return Swal.fire({
title: "User ID",
html: `Here is your User ID: <br> <code> ${UserID} </code> <br> You can use this for copying your account.`,
icon: "info"
});
});
});
// End Get UserID
// Begin Copy Account
new Hack(category.player, "Copy Account", "Copy Account From userID").setClick(async () => {
const userID = (await NumberInput.fire("What is the userID of the account you want to copy?", undefined, "question")).value;
if (!userID) return;
if (!(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;
const 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}`, {
headers: {
Authorization: localStorage.JWT_TOKEN
}
})).json();
await fetch(`https://api.prodigygame.com/game-api/v3/characters/${userID}`, {
headers: {
"Content-Type": "application/json",
Authorization: localStorage.JWT_TOKEN
},
body: JSON.stringify({
data: JSON.stringify(playerData[userID]),
userID: player.userID
}),
method: "POST"
});
return Toast.fire("Success!", "Copied Account Successfully! Please reload.", "success");
});
// End Copy Account
// Begin Set Grade
new Hack(category.player, "Set Grade").setClick(async () => {
const grade = await NumberInput.fire("What number do you want to set your grade to?");
if (!grade.value) return;
player.grade = parseInt(grade.value);
return Toast.fire("Success", `Successfully changed grade to ${grade}!`, "success");
});
// End Set Grade
// END PLAYER HACKS