Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /****************************************************************************************************
  2. Setting the initial stage of the cheating tool and some quick definitions.
  3. */
  4. const cheats = {};
  5. const cheatState = {
  6. damageMultiplier: 1,
  7. cloudz: false,
  8. runescape: false,
  9. godlikes: false,
  10. godlike: {
  11. crit: false,
  12. reach: false,
  13. hp: false,
  14. mp: false,
  15. ability: false,
  16. bosshp: false,
  17. food: false,
  18. hitchance: false,
  19. dmg: false,
  20. buff: false,
  21. },
  22. unlocks: false,
  23. unlock: {
  24. teleports: false,
  25. quickref: false,
  26. tickets: false,
  27. silvpen: false,
  28. goldpen: false,
  29. obolfrag: false,
  30. revive: false,
  31. },
  32. wides: false,
  33. wide: {
  34. mtx: false,
  35. post: false,
  36. guild: false,
  37. task: false,
  38. quest: false,
  39. star: false,
  40. crystal: false,
  41. giant: false,
  42. obol: false,
  43. },
  44. W1s: false,
  45. W1: {
  46. stampcost: false,
  47. anvil: false,
  48. forge: false,
  49. smith: false,
  50. statue: false,
  51. },
  52. cauldrons: false,
  53. cauldron: {
  54. vialrng: false,
  55. vialattempt: false,
  56. bubblecost: false,
  57. vialcost: false,
  58. lvlreq: false,
  59. newbubble: false,
  60. re_speed: false,
  61. liq_rate: false,
  62. },
  63. W3s: false,
  64. W3: {
  65. mobdeath: false,
  66. flagreq: false,
  67. saltcost: false,
  68. matcost: false,
  69. instabuild: false,
  70. booktime: false,
  71. totalflags: false,
  72. buildspd: false,
  73. saltlick: false,
  74. refinery: false,
  75. trapping: false,
  76. book: false,
  77. prayer: false,
  78. shrinehr: false,
  79. worshipspeed: false,
  80. },
  81. W4s: false,
  82. W4: {
  83. eggcap: false,
  84. fenceyard: false,
  85. battleslots: false,
  86. petchance: false,
  87. genes: false,
  88. fasteggs: false,
  89. labpx: false,
  90. instameals: false,
  91. instarecipes: false,
  92. luckychef: false,
  93. freekitchens: false,
  94. },
  95. minigames: false,
  96. minigame: {
  97. mining: false,
  98. catching: false,
  99. fishing: false,
  100. choppin: false,
  101. }
  102. };
  103. // Used to store things like item and card definitions
  104. let dictVals = {};
  105. let setupDone = false;
  106. let fixobj; // An object used to store stuff, for example an un-broken piece of GameAttribute from one character to another
  107. function registerCheat(command, fn) { cheats[command] = fn; }
  108. function isGameReady() {
  109. let result = true; // Check for engine
  110. result = !!this["com.stencyl.Engine"];
  111. return result;
  112. }
  113. // The main function that executes all cheats
  114. function cheat(action) {
  115. try {
  116. if (!isGameReady.call(this)) return 'Game is not ready.';
  117. if (!setupDone) setup.call(this);
  118. const [command, ...params] = action.split(' ');
  119. const foundCheat = cheats[command];
  120. if (foundCheat) {
  121. const result = foundCheat.call(this, params);
  122. return result ?? 'Done.';
  123. } else return `${command} is not a valid option.`;
  124. } catch (error) { return `Error: ${error}`; }
  125. }
  126. /****************************************************************************************************
  127. A proxy setup and all Proxy definitions
  128. */
  129. function setup() {
  130. setupDone = true;
  131. // setup proxies
  132. setupCurrenciesOwnedProxy.call(this);
  133. setupArbitraryProxy.call(this);
  134. setupAnvilProxy.call(this);
  135. setupStampCostProxy.call(this);
  136. setupAlchProxy.call(this);
  137. setupW3StuffProxy.call(this);
  138. setupW4StuffProxy.call(this);
  139. setupOptionsListAccountProxy.call(this);
  140. setupCListProxy.call(this);
  141. setupGameAttrProxy.call(this);
  142. setupQuestProxy.call(this);
  143. setupSmithProxy.call(this);
  144. setupAbilityProxy.call(this);
  145. setupValuesMapProxy.call(this);
  146. setupCloudSaveProxy.call(this);
  147. //setupBuffsActiveProxy.call(this);
  148. }
  149. // Unlock quick references
  150. function setupOptionsListAccountProxy() {
  151. const bEngine = this["com.stencyl.Engine"].engine;
  152. const optionsListAccount = bEngine.getGameAttribute("OptionsListAccount");
  153. const handler = {
  154. get: function(obj, prop) {
  155. if ((cheatState.unlocks || cheatState.unlock.quickref) && Number(prop) === 34) return 0;
  156. if (cheatState.minigames && Number(prop) === 33) return obj[33] || 1;
  157. return Reflect.get(...arguments);
  158. },
  159. set: function(obj, prop, value) {
  160. if (cheatState.minigames && Number(prop) === 33) {
  161. if (obj[33] < value) obj[33] = value;
  162. return true;
  163. } return Reflect.set(...arguments);
  164. }
  165. };
  166. const proxy = new Proxy(optionsListAccount, handler);
  167. bEngine.setGameAttribute("OptionsListAccount", proxy);
  168. }
  169. // Free revival cheat
  170. function setupValuesMapProxy() {
  171. const bEngine = this["com.stencyl.Engine"].engine;
  172. const CurrenciesOwned = bEngine.getGameAttribute("PersonalValuesMap").h;
  173. const handler = {
  174. get: function(obj, prop) {
  175. if ((cheatState.unlocks || cheatState.unlock.revive) && prop === "InstaRevives") return obj.InstaRevives || 1;
  176. return Reflect.get(...arguments);
  177. },
  178. set: function(obj, prop, value) {
  179. if ((cheatState.unlocks || cheatState.unlock.revive) && prop === "InstaRevives"){
  180. if (obj["InstaRevives"] < value) obj["InstaRevives"] = value;
  181. return true;
  182. } return Reflect.set(...arguments);
  183. }
  184. };
  185. const proxy = new Proxy(CurrenciesOwned, handler);
  186. bEngine.getGameAttribute("PersonalValuesMap").h = proxy;
  187. }
  188. // Buffs never run out
  189. function setupBuffsActiveProxy() {
  190. const bEngine = this["com.stencyl.Engine"].engine;
  191. const BuffsActive = bEngine.getGameAttribute("BuffsActive");
  192. const handler = {
  193. get: function(obj, prop) {
  194. if ((cheatState.godlikes || cheatState.godlike.buff) && typeof obj[prop][1] != "undefined") obj[prop][1] = 5; // Trap at 5 seconds left
  195. return Reflect.get(...arguments);
  196. },
  197. set: function(obj, prop, value) {
  198. if ((cheatState.godlikes || cheatState.godlike.buff) && typeof obj[prop][1] != "undefined"){
  199. obj[prop][1] = 5;
  200. return true;
  201. } return Reflect.set(...arguments);
  202. }
  203. };
  204. const proxy = new Proxy(BuffsActive, handler);
  205. bEngine.setGameAttribute("BuffsActive", proxy);
  206. }
  207. // Stop cloud saving, once re-enabled it'll proc a save in 2 seconds.
  208. function setupCloudSaveProxy() {
  209. const bEngine = this["com.stencyl.Engine"].engine;
  210. const CloudSave = bEngine.getGameAttribute("CloudSaveCD");
  211. const handler = {
  212. get: function(obj, prop) {
  213. if (cheatState.cloudz && Number(prop) === 0) return 235;
  214. return Reflect.get(...arguments);
  215. },
  216. set: function(obj, prop, value) {
  217. if (cheatState.cloudz && Number(prop) === 0){
  218. obj[0] = 235;
  219. return true;
  220. } return Reflect.set(...arguments);
  221. }
  222. };
  223. const proxy = new Proxy(CloudSave, handler);
  224. bEngine.setGameAttribute("CloudSaveCD", proxy);
  225.  
  226. }
  227. // Some godlike cheats
  228. function setupGameAttrProxy() {
  229. const bEngine = this["com.stencyl.Engine"].engine;
  230. const gameAttr = bEngine.gameAttributes.h;
  231. const handler = {
  232. get: function(obj, prop) {
  233. if((cheatState.godlikes || cheatState.godlike.hp) && prop === "PlayerHP") return obj.PlayerHP || 1;
  234. if((cheatState.godlikes || cheatState.godlike.mp) && prop === "PlayerMP") return obj.PlayerMP || 1;
  235. if((cheatState.godlikes || cheatState.godlike.bosshp) && prop === "BossHP") return 0;
  236. return Reflect.get(...arguments);
  237. },
  238. set: function(obj, prop, value) {
  239. if((cheatState.godlikes || cheatState.godlike.hp) && prop === "PlayerHP"){ if (obj.PlayerHP < value) obj.PlayerHP = value; return true; }
  240. if((cheatState.godlikes || cheatState.godlike.mp) && prop === "PlayerMP"){ if (obj.PlayerMP < value) obj.PlayerMP = value; return true; }
  241. if((cheatState.godlikes || cheatState.godlike.bosshp) && prop === "BossHP"){ if (obj.BossHP < 0) obj.BossHP = 0; return true; }
  242. return Reflect.set(...arguments);
  243. }
  244. };
  245. const proxy = new Proxy(gameAttr, handler);
  246. bEngine.gameAttributes.h = proxy;
  247. }
  248. // Some more stats, as well as a forge upgrade within this one
  249. function setupArbitraryProxy(){
  250. const ActorEvents12 = this["scripts.ActorEvents_12"];
  251. // 100% crit chance
  252. const CritChance = ActorEvents12._customBlock_CritChance;
  253. const handlerCrit = {
  254. apply: function(originalFn, context, argumentsList) {
  255. if (cheatState.godlike.dmg) return 0; // Disable crits on dmg cap, as it's already capped
  256. if (cheatState.godlikes || cheatState.godlike.crit) return 100;
  257. return Reflect.apply(originalFn, context, argumentsList);
  258. }
  259. };
  260. const proxyCrit = new Proxy(CritChance, handlerCrit);
  261. ActorEvents12._customBlock_CritChance = proxyCrit;
  262. // Reach to 230
  263. const atkReach = ActorEvents12._customBlock_PlayerReach;
  264. const handlerReach = {
  265. apply: function(originalFn, context, argumentsList) {
  266. if (cheatState.godlikes || cheatState.godlike.reach) return 666;
  267. return Reflect.apply(originalFn, context, argumentsList);
  268. }
  269. };
  270. const proxyReach = new Proxy(atkReach, handlerReach);
  271. ActorEvents12._customBlock_PlayerReach = proxyReach;
  272. // Free forge upgrades
  273. const forgeupgr = ActorEvents12._customBlock_ForgeUpdateCosts;
  274. const handlerForge = {
  275. apply: function(originalFn, context, argumentsList) {
  276. if (cheatState.W1s || cheatState.W1.forge) return 0;
  277. return Reflect.apply(originalFn, context, argumentsList);
  278. }
  279. };
  280. const proxyForge = new Proxy(forgeupgr, handlerForge);
  281. ActorEvents12._customBlock_ForgeUpdateCosts = proxyForge;
  282. // Imperfect damage cap on too-OP broken players with overflowing damage
  283. const DamageDealt = ActorEvents12._customBlock_DamageDealed;
  284. const handlerDamage = {
  285. apply: function(originalFn, context, argumentsList) {
  286. const t = argumentsList[0];
  287. if (cheatState.godlike.dmg && t == "Min") return Number.MAX_SAFE_INTEGER;
  288. if (cheatState.godlike.dmg && t == "Max") return Number.MAX_SAFE_INTEGER;
  289. if (cheatState.godlike.dmg && t == "RNG") return Number.MAX_SAFE_INTEGER;
  290. return Reflect.apply(originalFn, context, argumentsList) * (argumentsList[0] == "Max" ? cheatState.damageMultiplier : 1);
  291. }
  292. };
  293. const proxyDamage = new Proxy(DamageDealt, handlerDamage);
  294. ActorEvents12._customBlock_DamageDealed = proxyDamage;
  295.  
  296. // Skill stats
  297. const SkillStats = ActorEvents12._customBlock_SkillStats;
  298. const handlerSkillStats = {
  299. apply: function(originalFn, context, argumentsList) {
  300. const t = argumentsList[0];
  301. if ((cheatState.W3s || cheatState.W3.worshipspeed) && t == "WorshipSpeed") return 5000; // 1000 worship%/h
  302. return Reflect.apply(originalFn, context, argumentsList);
  303. }
  304. };
  305. const proxySkillStats = new Proxy(SkillStats, handlerSkillStats);
  306. ActorEvents12._customBlock_SkillStats = proxySkillStats;
  307.  
  308. // Some arbitrary stuff
  309. const Arbitrary = ActorEvents12._customBlock_ArbitraryCode;
  310. const handlerArbitrary = {
  311. apply: function(originalFn, context, argumentsList) {
  312. const t = argumentsList[0];
  313. // if (cheatState.W1.statue && t.substring(0, 12) == "StatueExpReq") return 1; // This cheat works, but absolutely destroys your account
  314. if ((cheatState.wides || cheatState.wide.crystal) && t == "CrystalSpawn") return 1; // Crystal mob spawn rate 1
  315. if ((cheatState.wides || cheatState.wide.giant) && t == "GiantMob") return 1; // Giant mob spawn rate 1
  316. if ((cheatState.godlikes || cheatState.godlike.food) && t == "FoodNOTconsume") return 100; // Food never consumed
  317. if ((cheatState.godlikes || cheatState.godlike.hitchance) && t == "HitChancePCT") return 100; // 100% hit chance
  318.  
  319. return Reflect.apply(originalFn, context, argumentsList);
  320. }
  321. };
  322. const proxyArbitrary = new Proxy(Arbitrary, handlerArbitrary);
  323. ActorEvents12._customBlock_ArbitraryCode = proxyArbitrary;
  324.  
  325. const XforThingY = ActorEvents12._customBlock_RunCodeOfTypeXforThingY;
  326. const handlerXforThingY = {
  327. apply: function(originalFn, context, argumentsList) {
  328. const t = argumentsList[0];
  329. if ((cheatState.wides || cheatState.wide.obol) && t == "ObolRerollCostMoney") return 0;
  330. if ((cheatState.wides || cheatState.wide.obol) && t == "ObolRerollCostFrag") return 0;
  331. return Reflect.apply(originalFn, context, argumentsList);
  332. }
  333. };
  334. const proxyXforThingY = new Proxy(XforThingY, handlerXforThingY);
  335. ActorEvents12._customBlock_RunCodeOfTypeXforThingY = proxyXforThingY;
  336. }
  337. // A bunch of currency related cheats
  338. function setupCurrenciesOwnedProxy() {
  339. const bEngine = this["com.stencyl.Engine"].engine;
  340. const currencies = bEngine.getGameAttribute("CurrenciesOwned").h;
  341. const handler = {
  342. get: function(obj, prop) {
  343. if ((cheatState.unlocks || cheatState.unlock.teleports) && prop === 'WorldTeleports') return obj.WorldTeleports || 1;
  344. if ((cheatState.unlocks || cheatState.unlock.tickets) && prop === 'ColosseumTickets') return obj.ColosseumTickets || 1;
  345. if ((cheatState.unlocks || cheatState.unlock.obolfrag) && prop === 'ObolFragments') return obj.ObolFragments || 9001; // It's over nine thousand
  346. if ((cheatState.unlocks || cheatState.unlock.silvpen) && prop === 'SilverPens') return obj.SilverPens || 1;
  347. // Not a safe cheat as golden pens aren't released yet,
  348. // Only for people that use the manual cheat: chng bEngine.getGameAttribute("CurrenciesOwned").h["GoldPens"]=100
  349. //if ((cheatState.unlocks || cheatState.unlock.goldpen) && prop === 'GoldPens') return obj.GoldPens || 1;
  350. return Reflect.get(...arguments);
  351. },
  352. set: function(obj, prop, value) {
  353. if ((cheatState.unlocks || cheatState.unlock.teleports) && prop === 'WorldTeleports') return true; // Do nothing
  354. if ((cheatState.unlocks || cheatState.unlock.tickets) && prop === 'ColosseumTickets') {
  355. if (obj.ColosseumTickets < value) obj.ColosseumTickets = value;
  356. return true;
  357. } if ((cheatState.unlocks || cheatState.unlock.silvpen) && prop === 'SilverPens') {
  358. if(obj.SilverPens < value) obj.SilverPens = value;
  359. return true;
  360. } if ((cheatState.unlocks || cheatState.unlock.GoldPens) && prop === 'GoldPens') {
  361. if(obj.GoldPens < value) obj.GoldPens = value;
  362. return true;
  363. } if ((cheatState.unlocks || cheatState.unlock.obolfrag) && prop === 'ObolFragments') {
  364. if(obj.ObolFragments < value) obj.ObolFragments = value;
  365. return true;
  366. } return Reflect.set(...arguments);
  367. }
  368. };
  369. const proxy = new Proxy(currencies, handler);
  370. bEngine.getGameAttribute("CurrenciesOwned").h = proxy;
  371. }
  372. // Nullify stamp upgrade cost
  373. function setupStampCostProxy() {
  374. const bEngine = this["com.stencyl.Engine"].engine;
  375. const actorEvents124 = this["scripts.ActorEvents_124"];
  376. const stampCostFn = actorEvents124._customBlock_StampCostss;
  377. const handler = {
  378. apply: function(originalFn, context, argumentsList) {
  379. if (cheatState.W1s || cheatState.W1.stampcost) {
  380. const tab = argumentsList[0];
  381. const index = argumentsList[1];
  382. const currentStampLevel = bEngine.getGameAttribute("StampLevel")[tab][index];
  383. const maxStampLevel = bEngine.getGameAttribute("StampLevelMAX")[tab][index];
  384. if (currentStampLevel < maxStampLevel) return ['Money', 0];
  385. return ['PremiumGem', 0];
  386. } return Reflect.apply(originalFn, context, argumentsList);
  387. }
  388. };
  389. const proxy = new Proxy(stampCostFn, handler);
  390. actorEvents124._customBlock_StampCostss = proxy;
  391. }
  392. // Nullify anvil upgrade cost and duration
  393. function setupAnvilProxy() {
  394. const ActorEvents189 = this["scripts.ActorEvents_189"];
  395. const _AnvilProduceStats = ActorEvents189._customBlock_AnvilProduceStats;
  396. const handler = {
  397. apply: function(originalFn, context, argumentsList) {
  398. if (cheatState.W1s || cheatState.W1.anvil) {
  399. const t = argumentsList[0];
  400. if (t == "Costs1") return 0;
  401. if (t == "Costs2") return 0;
  402. if (t == "ProductionSpeed") return 1000000;
  403. else return Reflect.apply(originalFn, context, argumentsList);
  404. } return Reflect.apply(originalFn, context, argumentsList);
  405. }
  406. };
  407. const proxy = new Proxy(_AnvilProduceStats, handler);
  408. ActorEvents189._customBlock_AnvilProduceStats = proxy;
  409. }
  410. // Ability tweaking cheat
  411. function setupAbilityProxy() {
  412. const CustomMaps = this["scripts.CustomMaps"];
  413. const atkMoveMap = JSON.parse(JSON.stringify(this["scripts.CustomMaps"].atkMoveMap.h));
  414. for(const [key, value] of Object.entries(atkMoveMap)){
  415. value.h["cooldown"] = 0;
  416. value.h["castTime"] = .1;
  417. value.h["manaCost"] = 0;
  418. atkMoveMap[key] = value;
  419. }
  420. const handler = {
  421. get: function(obj, prop) {
  422. if(cheatState.godlikes || cheatState.godlike.ability) return atkMoveMap[prop];
  423. return Reflect.get(...arguments);
  424. }
  425. };
  426. const proxy = new Proxy(CustomMaps.atkMoveMap.h, handler);
  427. CustomMaps.atkMoveMap.h = proxy;
  428. }
  429. // Nullify smithing cost
  430. function setupSmithProxy() {
  431. const bEngine = this["com.stencyl.Engine"].engine;
  432. const sizeref = bEngine.getGameAttribute("CustomLists").h["ItemToCraftEXP"];
  433. const tCustomList = this["scripts.CustomLists"];
  434.  
  435. const NewReqs = []; // This'll be the new Array where we write our stuff to
  436. const size = []; // Time to obtain the Array lengths (e.g. amount of items per smithing tab)
  437. for(const [index, element] of Object.entries(sizeref)) size.push(element.length);
  438. // Yup we're using double square brackets, cause each item could require multiple materials to craft, while we only need to fill in one
  439. for(i=0; i < size.length; i++) NewReqs.push(new Array(size[i]).fill([["Copper", "0"]]));
  440. const handler = {
  441. apply: function(originalFn, context, argumentsList) {
  442. if (cheatState.W1s || cheatState.W1.smith) return NewReqs;
  443. return Reflect.apply(originalFn, context, argumentsList);
  444. }
  445. };
  446. const proxy = new Proxy(tCustomList["ItemToCraftCostTYPE"], handler);
  447. tCustomList["ItemToCraftCostTYPE"] = proxy;
  448. }
  449. // Modification of many functions that return static N-dimensional Arrays
  450. function setupCListProxy() {
  451. const bEngine = this["com.stencyl.Engine"].engine;
  452. const CList = bEngine.getGameAttribute("CustomLists").h;
  453.  
  454. const FuncDict = {
  455. AlchemyVialItemsPCT: new Array(CList.AlchemyVialItemsPCT.length).fill(99), // Vials unlock at rollin 1+
  456. SaltLicks: ChangeND(bEngine,2,"SaltLicks","0",[2]), // Nullify Saltlick upgrade cost
  457. RefineryInfo: ChangeND(bEngine,2,"RefineryInfo","0",[6,7,8,9,10,11]), // Nullify refinery cost
  458. TrapBoxInfo: ChangeND(bEngine,3,"TrapBoxInfo","0", [0]), // Nullify trapping time
  459. PrayerInfo: ChangeND(bEngine,2, // Nullify Prayer Curses and upgrade cost
  460. ChangeND(bEngine,2,"PrayerInfo","0",[4,6]),
  461. "None._Even_curses_need_time_off_every_now_and_then.",[2]),
  462. MTXinfo: ChangeND(bEngine,4,"MTXinfo",0,[3,7]), // Nullify MTX cost
  463. PostOfficePossibleOrders: ChangeND(bEngine,4,"PostOfficePossibleOrders","0",[1]), // Nullify post office order cost
  464. GuildGPtasks: ChangeND(bEngine,2,"GuildGPtasks","0",[1]), // Nullify guild task requirements
  465. TaskDescriptions: ChangeND(bEngine,3,"TaskDescriptions","0",[5,6,7,8,9,10,11,12,13,14]), // Nullify task requirements
  466. SSignInfoUI: ChangeND(bEngine,2,"SSignInfoUI","0",[4]) // Nullify star sign unlock req
  467. };
  468. const handler = {
  469. get: function(obj, prop) {
  470. if ((cheatState.cauldrons || cheatState.cauldron.vialrng) && prop === "AlchemyVialItemsPCT") return FuncDict[prop];
  471. if ((cheatState.W3s || cheatState.W3.saltlick) && prop === "SaltLicks") return FuncDict[prop];
  472. if ((cheatState.W3s || cheatState.W3.refinery) && prop === "RefineryInfo") return FuncDict[prop];
  473. if ((cheatState.W3s || cheatState.W3.trapping) && prop === "TrapBoxInfo") return FuncDict[prop];
  474. if ((cheatState.W3s || cheatState.W3.prayer) && prop === "PrayerInfo") return FuncDict[prop];
  475. if ((cheatState.wides || cheatState.wide.mtx) && prop === "MTXinfo") return FuncDict[prop];
  476. if ((cheatState.wides || cheatState.wide.post) && prop === "PostOfficePossibleOrders") return FuncDict[prop];
  477. if ((cheatState.wides || cheatState.wide.guild) && prop === "GuildGPtasks") return FuncDict[prop];
  478. if ((cheatState.wides || cheatState.wide.task) && prop === "TaskDescriptions") return FuncDict[prop];
  479. if ((cheatState.wides || cheatState.wide.star) && prop === "SSignInfoUI") return FuncDict[prop];
  480. return Reflect.get(...arguments);
  481. }
  482. };
  483. const proxy = new Proxy(CList, handler);
  484. bEngine.getGameAttribute("CustomLists").h = proxy;
  485. }
  486. // The proxy that allows us to enable/disable quest item requirement nullifications whenever we like
  487. function setupQuestProxy() {
  488. const dialogueDefs = this["scripts.DialogueDefinitions"];
  489. const dialogueDefsC = JSON.parse(JSON.stringify( this["scripts.DialogueDefinitions"].dialogueDefs.h ));
  490. for(const [key, value] of Object.entries(dialogueDefsC)) // Go over all the quest-giving NPCs
  491. for(i=0; i < value[1].length; i++) // Go over all the addLine elements of that NPC
  492. // Notice that inside each value (e.g. NPC object), the 1st element is where all numeric stuff reside.
  493. // The 0th element holds the textual dialogue, which is not what we're looking for
  494. if(value[1][i].length == 9){ // Both addLine_ItemsAndSpaceRequired and addLine_Custom have nine elements within
  495. // Iterate over an unknown amount of req. values/Arrays
  496. if(value[1][i][2] === value[1][i][8]) // This is addLine_Custom
  497. for(j=0; j < value[1][i][3].length; j++){
  498. dialogueDefsC[key][1][i][3][j][1] = 0;
  499. dialogueDefsC[key][1][i][3][j][3] = 0;
  500. }
  501. else for(j=0; j < value[1][i][3].length; j++) // This is addLine_ItemsAndSpaceRequired
  502. dialogueDefsC[key][1][i][3][j] = 0;
  503. }
  504. const handler = {
  505. get: function(obj, prop) {
  506. if (cheatState.wides || cheatState.wide.quest) return dialogueDefsC[prop];
  507. return Reflect.get(...arguments);
  508. }
  509. };
  510. const proxy = new Proxy(dialogueDefs.dialogueDefs.h, handler);
  511. dialogueDefs.dialogueDefs.h = proxy;
  512. }
  513. // Alchemy cheats
  514. function setupAlchProxy() {
  515. const bEngine = this["com.stencyl.Engine"].engine;
  516. const ActorEvents189 = this["scripts.ActorEvents_189"];
  517. // No vial attempt reduction
  518. const CauldronP2W = bEngine.getGameAttribute("CauldronP2W");
  519. const handlerP2W = {
  520. get: function(obj, prop) {
  521. if ((cheatState.cauldron.vialattempt || cheatState.cauldrons) && obj[5][0] < obj[5][1]) {
  522. obj[5][0] = obj[5][1];
  523. return obj;
  524. } return Reflect.get(...arguments);
  525. }
  526. };
  527. const proxyP2W = new Proxy(CauldronP2W, handlerP2W);
  528. bEngine.setGameAttribute("CauldronP2W", proxyP2W);
  529. // Nullify all cauldron costs and durations (except P2W)
  530. const CauldronStats = ActorEvents189._customBlock_CauldronStats;
  531. const handlerStats = {
  532. apply: function(originalFn, context, argumentsList) {
  533. const t = argumentsList[0];
  534. if ((cheatState.cauldrons || cheatState.cauldron.bubblecost) && t == "CauldronCosts") return 0; // Nullified cauldron cost
  535. if ((cheatState.cauldrons || cheatState.cauldron.vialcost) && t == "VialCosts") return 0; // Nullified vial cost
  536. if ((cheatState.cauldrons || cheatState.cauldron.lvlreq) && t == "CauldronLvsBrewREQ") return 0; // Nullified brew reqs
  537. if ((cheatState.cauldrons || cheatState.cauldron.newbubble) && t == "PctChanceNewBubble") return 1000000; // Big enough new bubble chance
  538. if ((cheatState.cauldrons || cheatState.cauldron.re_speed) && t == "ResearchSpeed") return 10000; // Instant research speed
  539. if ((cheatState.cauldrons || cheatState.cauldron.liq_rate) && t == "LiquidHRrate") return 10000; // Quick liquid
  540. return Reflect.apply(originalFn, context, argumentsList);
  541. }
  542. };
  543. const proxyStats = new Proxy(CauldronStats, handlerStats);
  544. ActorEvents189._customBlock_CauldronStats = proxyStats;
  545. }
  546. // W3 cheats
  547. function setupW3StuffProxy() {
  548. const actorEvents345 = this["scripts.ActorEvents_345"];
  549. // Nullification of all costs inside the workbench
  550. const WorkbenchStuff = actorEvents345._customBlock_WorkbenchStuff;
  551. const handlerWb = {
  552. apply: function(originalFn, context, argumentsList) {
  553. const t = argumentsList[0];
  554. if ((cheatState.W3s || cheatState.W3.flagreq) && t == "FlagReq") return 0; // Nullified flag unlock time
  555. if ((cheatState.W3s || cheatState.W3.saltcost) && t == "TowerSaltCost") return 0; // Partial Tower cost nullification
  556. if ((cheatState.W3s || cheatState.W3.matcost) && t == "TowerMatCost") return 0; // Partial Tower cost nullification
  557. if ((cheatState.W3s || cheatState.W3.instabuild) && t == "TowerBuildReq") return 0; // Instant build/upgrade
  558. if ((cheatState.W3s || cheatState.W3.booktime) && t == "BookReqTime") return 1; // Book/second, holds shadow ban danger and could one day be replaced
  559. if ((cheatState.W3s || cheatState.W3.totalflags) && t == "TotalFlags") return 10; // Total amnt of placeable flags
  560. if ((cheatState.W3s || cheatState.W3.buildspd) && t == "PlayerBuildSpd") return 1000000; // Buildrate on cogs
  561. if (cheatState.W3.shrinehr && t == "ShrineHrREQ") return 0.5; // Shrine lvl up time reduced to 0.5 hour
  562. // The minimum level talent book from the library is equivalent to the max level
  563. if ((cheatState.W3s || cheatState.W3.book) && t == "minBookLv"){ argumentsList[0] = "maxBookLv"; return Reflect.apply(originalFn, context, argumentsList); }
  564. return Reflect.apply(originalFn, context, argumentsList);
  565. }
  566. };
  567. const proxyWb = new Proxy(WorkbenchStuff, handlerWb);
  568. actorEvents345._customBlock_WorkbenchStuff = proxyWb;
  569. // Worship mobs die on spawn
  570. const _customBlock_2inputsFn = actorEvents345._customBlock_2inputs;
  571. const handlerWs = {
  572. apply: function(originalFn, context, argumentsList) {
  573. if (cheatState.W3.mobdeath || cheatState.W3s)
  574. return "Worshipmobdeathi" == true ? 0 : 0;
  575. return Reflect.apply(originalFn, context, argumentsList);
  576. }
  577. };
  578. const proxyWorship = new Proxy(_customBlock_2inputsFn, handlerWs);
  579. actorEvents345._customBlock_2inputs = proxyWorship;
  580. }
  581.  
  582. // W4 cheats
  583. function setupW4StuffProxy() {
  584. const actorEvents345 = this["scripts.ActorEvents_345"];
  585. // Nullification of all costs inside the workbench
  586. const breeding = actorEvents345._customBlock_Breeding;
  587. const handlerBreeding = {
  588. apply: function(originalFn, context, argumentsList) {
  589. const t = argumentsList[0];
  590. if ((cheatState.W4s || cheatState.W4.eggcap) && t == "TotalEggCapacity") return 13; // 13 eggs
  591. if ((cheatState.W4s || cheatState.W4.fenceyard) && t == "FenceYardSlots") return 27; // 27 fenceyard slots
  592. if ((cheatState.W4s || cheatState.W4.battleslots) && t == "PetBattleSlots") return 6; // 6 battle slots
  593. if ((cheatState.W4s || cheatState.W4.petchance) && t == "TotalBreedChance") return 1; // 100% new pet chance
  594. if ((cheatState.W4s || cheatState.W4.genes) && t == "GeneticCost") return 0; // 0 gene upgrades
  595. if ((cheatState.W4s || cheatState.W4.fasteggs) && t == "TotalTimeForEgg") return 5; // 0 gene upgrades
  596. return Reflect.apply(originalFn, context, argumentsList);
  597. }
  598. };
  599. const proxyBreeding = new Proxy(breeding, handlerBreeding);
  600. actorEvents345._customBlock_Breeding = proxyBreeding;
  601.  
  602. const lab = actorEvents345._customBlock_Labb;
  603. const handlerLab = {
  604. apply: function(originalFn, context, argumentsList) {
  605. const t = argumentsList[0];
  606. if ((cheatState.W4s || cheatState.W4.labpx) && (t == "Dist" || t == "BonusLineWidth")) return 1000; // long lab connections
  607. return Reflect.apply(originalFn, context, argumentsList);
  608. }
  609. };
  610. const proxyLab = new Proxy(lab, handlerLab);
  611. actorEvents345._customBlock_Labb = proxyLab;
  612.  
  613. const cooking = actorEvents345._customBlock_CookingR;
  614. const handlerCooking = {
  615. apply: function(originalFn, context, argumentsList) {
  616. const t = argumentsList[0];
  617. if ((cheatState.W4s || cheatState.W4.instameals) && t == "CookingReqToCook") return 5; // super fast food
  618. if ((cheatState.W4s || cheatState.W4.instarecipes) && t == "CookingFireREQ") return 100; // super fast recipes
  619. if ((cheatState.W4s || cheatState.W4.luckychef) && t == "CookingNewRecipeOdds") return 1; // always cook a new recipe
  620. if ((cheatState.W4s || cheatState.W4.freekitchens) && t == "CookingNewKitchenCoinCost") return 0; // free kitchens
  621. return Reflect.apply(originalFn, context, argumentsList);
  622. }
  623. }
  624. const proxyCooking = new Proxy(cooking, handlerCooking);
  625.  
  626. actorEvents345._customBlock_CookingR = proxyCooking;
  627. }
  628.  
  629. // Minigame cheats
  630. function setupMinigameProxy() {
  631. const bEngine = this["com.stencyl.Engine"].engine;
  632.  
  633. const miningGameOver = bEngine.getGameAttribute("PixelHelperActor")[4].getValue('ActorEvents_229', '_customEvent_MiningGameOver');
  634. const handlerMining = {
  635. apply: function(originalFn, context, argumentsList) {
  636. if (cheatState.minigame.mining) return; // Do nothing when game over
  637. return Reflect.apply(originalFn, context, argumentsList);
  638. }
  639. };
  640. const proxyMining = new Proxy(miningGameOver, handlerMining);
  641. bEngine.getGameAttribute("PixelHelperActor")[4].setValue('ActorEvents_229', '_customEvent_MiningGameOver', proxyMining);
  642.  
  643. const fishingGameOver = bEngine.getGameAttribute("PixelHelperActor")[4].getValue('ActorEvents_229', '_customEvent_FishingGameOver');
  644. const handlerFishing = {
  645. apply: function(originalFn, context, argumentsList) {
  646. if (cheatState.minigame.fishing) return; // Do nothing when game over
  647. return Reflect.apply(originalFn, context, argumentsList);
  648. }
  649. };
  650. const proxyFishing = new Proxy(fishingGameOver, handlerFishing);
  651. bEngine.getGameAttribute("PixelHelperActor")[4].setValue('ActorEvents_229', '_customEvent_FishingGameOver', proxyFishing);
  652. }
  653. // Static fly and hoop positions
  654. function setupCatchingMinigameProxy() {
  655. const bEngine = this["com.stencyl.Engine"].engine;
  656.  
  657. const catchingGameGenInfo = bEngine.getGameAttribute("PixelHelperActor")[4].getValue('ActorEvents_229', '_GenInfo');
  658. const handler = {
  659. get: function(originalObject, property) {
  660. if (cheatState.minigame.catching) {
  661. if (Number(property) === 31) return 70;
  662. if (Number(property) === 33) return [95, 95, 95, 95, 95];
  663. } return Reflect.get(...arguments);
  664. }
  665. };
  666. const proxyCatching = new Proxy(catchingGameGenInfo, handler);
  667. bEngine.getGameAttribute("PixelHelperActor")[4].setValue('ActorEvents_229', '_GenInfo', proxyCatching);
  668. }
  669. // Chopping minigame: Whole bar filled with gold zone
  670. function setupGeneralInfoProxy() {
  671. const bEngine = this["com.stencyl.Engine"].engine;
  672. const generalInfo = bEngine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO");
  673. const handler = {
  674. get: function(orignalObject, property) {
  675. if (cheatState.minigame.choppin && Number(property) === 7)
  676. return [100, -1, 0, 2, 0, 220, -1, 0, -1, 0, -1, 0, 0, 220, 0, 0, 1];
  677. return Reflect.get(...arguments);
  678. }
  679. };
  680. const proxyChopping = new Proxy(generalInfo, handler);
  681. bEngine.getGameAttribute("PixelHelperActor")[1].setValue("ActorEvents_116", "_GeneralINFO", proxyChopping);
  682. }
  683. /****************************************************************************************************
  684. The following few commands are related functions for Creater0822's fork of the injection tool.
  685. */
  686. registerCheat('exit', function () { return "exit"; }); // Terminates the game process quicker
  687. /****************************************************************************************************
  688. Runescape homage cheats: Now we're finally God Gaming xD
  689. */
  690. registerCheat('runescape', function() { // Activate ability bar switching when switching weapons
  691. cheatState.runescape = !cheatState.runescape;
  692. return `${cheatState.runescape ? 'Activated' : 'Deactived'} ability bar switching.`;
  693. });
  694. // Preset BiS weapon + upgrade binding
  695. registerCheat('bind', function () {
  696. const bEngine = this["com.stencyl.Engine"].engine;
  697. const itemDefs = this["scripts.ItemDefinitions"].itemDefs;
  698. const AttackLoadout = bEngine.getGameAttribute("AttackLoadout");
  699. bEngine.whenAnyKeyPressedListeners.push((function(e, t) {
  700. if ( (e.keyCode === 65 || e.keyCode === 83 || e.keyCode === 68 || e.keyCode === 70) && bEngine.getGameAttribute("MenuType") === 6 ) {
  701. const BiS = {
  702. 65:["STR", "EquipmentSword3"], // Key A
  703. 83:["AGI", "EquipmentBows8"], // Key S
  704. 68:["WIS", "EquipmentWands7"], // Key D
  705. 70:["LUK", "EquipmentPunching5"] // Key F
  706. };
  707. // BiS = Warped Weapon Upgrade Stone: All random stats goes to the style's DPS stat
  708. const upgrstats = { Weapon_Power:3, Defence:0, Random_Stat:4 } // Edit this line to whatever you like
  709. const EquipOrd = bEngine.getGameAttribute("EquipmentOrder")[0];
  710. const EquipMap = bEngine.getGameAttribute("EquipmentMap")[0];
  711. const upgrslots = itemDefs.h[BiS[e.keyCode][1]].h["Upgrade_Slots_Left"];
  712. if(BiS[e.keyCode]){ // Only procs if whatever keycode is defined in the dictionary
  713. EquipOrd[1] = BiS[e.keyCode][1]; // Change equipped weapon
  714. EquipMap[1].h["Upgrade_Slots_Left"] = upgrslots*-1; // Deduct the amount of slots left
  715. EquipMap[1].h["Weapon_Power"] = upgrslots*upgrstats["Weapon_Power"];
  716. EquipMap[1].h["Defence"] = upgrslots*upgrstats["Defence"];
  717. EquipMap[1].h[BiS[e.keyCode][0]] = upgrslots*upgrstats["Random_Stat"];
  718. }
  719. if(cheatState.runescape){ // Let's play Runescape xD
  720. switch(e.keyCode) {
  721. case 65: // Melee
  722. AttackLoadout[0] = [90,91,105,120,106,121];
  723. AttackLoadout[1] = [94,108,122,107,639,635];
  724. break;
  725. case 83: // Ranged
  726. AttackLoadout[0] = [270,271,285,300,286,301];
  727. AttackLoadout[1] = [273,288,303,302,639,635];
  728. break;
  729. case 68: // Mage
  730. AttackLoadout[0] = [453,450,451,482,465,467];
  731. AttackLoadout[1] = [481,480,466,469,639,635];
  732. break;
  733. case 70: // Buffbar
  734. AttackLoadout[0] = [15,30,94,108,288,481];
  735. AttackLoadout[1] = [302,303,466,469,122,273];
  736. break;
  737. default: break;
  738. }
  739. }
  740. }
  741. })); return `The custom keybinds have been activated! (Has to be re-applied when changing maps)`;
  742. });
  743. /****************************************************************************************************
  744. We'll start things off with the relatively safe cheats.
  745. Though the drop function itself is safe, dropping unreleased items obviously isn't!
  746. */
  747. // Show all available cheats, this one's as safe as it can get xD
  748. registerCheat('cheats', function () { return Object.keys(cheats).join('\n'); });
  749. // Restore non-Proxy changed values
  750. registerCheat('restore', function(params) {
  751. if(params[0] === 'save'){
  752. dictVals.itemDefs = JSON.parse(JSON.stringify(this["scripts.ItemDefinitions"].itemDefs.h));
  753. dictVals.CardStuff = JSON.parse(JSON.stringify(this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["CardStuff"]));
  754. return `Saved the current values.`;
  755. }
  756. if(params[0] === 'item'){
  757. this["scripts.ItemDefinitions"].itemDefs.h = dictVals.itemDefs;
  758. return `Restored original item values.`;
  759. }
  760. if(params[0] === 'card'){
  761. this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["CardStuff"] = dictVals.CardStuff;
  762. return `Restored original card values`;
  763. }
  764. });
  765.  
  766. registerCheat('common', function() {
  767. cheatState.unlock.quickref = !cheatState.unlock.quickref;
  768. cheatState.unlock.teleports = !cheatState.unlock.teleports;
  769. cheatState.unlock.tickets = !cheatState.unlock.tickets;
  770. cheatState.unlock.silvpen = !cheatState.unlock.silvpen;
  771. cheatState.unlock.revive = !cheatState.unlock.revive;
  772. cheatState.wide.mtx = !cheatState.wide.mtx;
  773. cheatState.W3.book = !cheatState.W3.book;
  774. cheatState.minigames = !cheatState.minigames;
  775. cheatState.wide.star = !cheatState.wide.star;
  776. cheatState.wide.obol = !cheatState.wide.obol;
  777. cheatState.minigame.mining = !cheatState.minigame.mining;
  778. cheatState.minigame.fishing = !cheatState.minigame.fishing;
  779. cheatState.minigame.catching = !cheatState.minigame.catching;
  780. cheatState.minigame.choppin = !cheatState.minigame.choppin;
  781. cheatState.W3.prayer = !cheatState.W3.prayer;
  782. for( const [index, element] of Object.entries(this["scripts.ItemDefinitions"].itemDefs.h))
  783. if(element.h["typeGen"] === "dStone") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Amount"] = 100;
  784. });
  785.  
  786. // Damage multiplier
  787. registerCheat('damagemultiplier', function (params) {
  788. cheatState.damageMultiplier = params[0] || 1;
  789. });
  790.  
  791. // The OG-drop function that we all love
  792. registerCheat('drop', function (params) {
  793. const bEngine = this["com.stencyl.Engine"].engine;
  794. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  795. const actorEvents189 = this["scripts.ActorEvents_189"];
  796. const character = bEngine.getGameAttribute("OtherPlayers").h[bEngine.getGameAttribute("UserInfo")[0]];
  797.  
  798. const item = params[0];
  799. const amount = params[1] || 1;
  800. try {
  801. const itemDefinition = itemDefs[item];
  802. if (itemDefinition) {
  803. let x = character.getXCenter()
  804. let y = character.getValue("ActorEvents_20", "_PlayerNode");
  805. if(item.includes("SmithingRecipes")) actorEvents189._customBlock_DropSomething(item, 0, amount, 0, 2, y, 0, x, y);
  806. else actorEvents189._customBlock_DropSomething(item, amount, 0, 0, 2, y, 0, x, y);
  807. return `Dropped ${itemDefinition.h.displayName.replace(/_/g, ' ')}. (x${amount})`;
  808. } else return `No item found for '${item}'`;
  809. } catch (err) { return `Error: ${err}`; }
  810. });
  811. // Spawn any monster you like: Be careful with what you spawn!
  812. registerCheat('spawn', function(params) {
  813. const bEngine = this["com.stencyl.Engine"].engine;
  814. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  815. const ActorEvents124 = this["scripts.ActorEvents_124"];
  816. const character = bEngine.getGameAttribute("OtherPlayers").h[bEngine.getGameAttribute("UserInfo")[0]];
  817. const monster = params[0];
  818. const spawnAmnt = params[1] || 1;
  819. try{
  820. const monsterDefinition = monsterDefs[monster];
  821. if(monsterDefinition){
  822. let x = character.getXCenter();
  823. let y = character.getValue("ActorEvents_20", "_PlayerNode");
  824. for(let i=0; i<spawnAmnt; i++) ActorEvents124._customBlock_CreateMonster(monster, y, x);
  825. return `Spawned ${monsterDefinition.h["Name"].replace(/_/g, ' ')} ${spawnAmnt} time(s)`
  826. } else return `No monster found for '${monster}'`;
  827. } catch (err) { return `Error: ${err}`; }
  828. });
  829. // The OG portal unlock command
  830. registerCheat('unlock', function(params) {
  831. const bEngine = this["com.stencyl.Engine"].engine;
  832. if(params[0]){ // Execute sub-commands individually
  833. if (params && params[0] === 'portals') {
  834. bEngine.getGameAttribute("KillsLeft2Advance").map(entry => {
  835. for(i=0; i < entry.length; i++) entry[i] = 0;
  836. return entry; });
  837. return `The portals have been unlocked!`;
  838. }
  839. if (params && params[0] === 'quickref') {
  840. cheatState.unlock.quickref = !cheatState.unlock.quickref;
  841. return `${cheatState.unlock.quickref ? 'Activated' : 'Deactived'} quickref.`
  842. }
  843. if (params && params[0] === 'teleports') {
  844. cheatState.unlock.teleports = !cheatState.unlock.teleports;
  845. return `${cheatState.unlock.teleports ? 'Activated' : 'Deactived'} free teleports.`
  846. }
  847. if (params && params[0] === 'tickets') {
  848. cheatState.unlock.tickets = !cheatState.unlock.tickets;
  849. return `${cheatState.unlock.tickets ? 'Activated' : 'Deactived'} free colosseum tickets.`
  850. }
  851. if (params && params[0] === 'silvpen') {
  852. cheatState.unlock.silvpen = !cheatState.unlock.silvpen;
  853. return `${cheatState.unlock.silvpen ? 'Activated' : 'Deactived'} free silver pens.`
  854. }
  855. if (params && params[0] === 'goldpen') {
  856. cheatState.unlock.goldpen = !cheatState.unlock.goldpen;
  857. return `${cheatState.unlock.goldpen ? 'Activated' : 'Deactived'} free golden pens (if you have at least one xD).`
  858. }
  859. if (params && params[0] === 'obolfrag') {
  860. cheatState.unlock.obolfrag = !cheatState.unlock.obolfrag;
  861. return `${cheatState.unlock.obolfrag ? 'Activated' : 'Deactived'} free obol fragments.`
  862. }
  863. if (params && params[0] === 'revive') {
  864. cheatState.unlock.revive = !cheatState.unlock.revive;
  865. return `${cheatState.unlock.revive ? 'Activated' : 'Deactived'} unlimited revival attempts.`
  866. }
  867. return `Wrong sub-command, use one of these:\nportals, ${Object.keys(cheatState.unlock).join(", ")}`;
  868. } else{ // All Proxy cheats, so everything except portals
  869. if(cheatState.unlocks){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  870. cheatState.unlock.quickref = false;
  871. cheatState.unlock.teleports = false;
  872. cheatState.unlock.teleports = false;
  873. cheatState.unlock.silvpen = false;
  874. cheatState.unlock.goldpen = false;
  875. cheatState.unlock.obolfrag = false;
  876. cheatState.unlock.revive = false;
  877. } cheatState.unlocks = !cheatState.unlocks;
  878. return `${cheatState.unlocks ? 'Activated' : 'Deactived'} quickref & free teleports, colosseum tickets, silver/gold pens.`;
  879. }
  880. });
  881. // The bulk item function with dictionary item collections
  882. registerCheat('bulk', function(params) {
  883. const bEngine = this["com.stencyl.Engine"].engine;
  884. const itemDefs = this['scripts.ItemDefinitions'].itemDefs.h;
  885. const actorEvents189 = this["scripts.ActorEvents_189"];
  886. const character = bEngine.getGameAttribute("OtherPlayers").h[bEngine.getGameAttribute("UserInfo")[0]];
  887.  
  888. // Obtaining clusters of items at once (Doesn't return a drop log in the console)
  889. const items = params[0] || "default";
  890. const amnt = params[1] || 1;
  891. try {
  892. let x = character.getXCenter();
  893. let y = character.getValue("ActorEvents_20", "_PlayerNode");
  894. const drop_log = [];
  895. // Here we'll use the pre-defined function to work out the magic
  896. if(DictDrops[items]){
  897. if(items === 'startalents') DictDrops[items].forEach(item => {
  898. actorEvents189._customBlock_DropSomething("TalentBook1", item, 0, 0, 2, y, 0, x, y);
  899. drop_log.push(`Dropped talent book with id ${item}`);
  900. });
  901. if(items === 'smith'){
  902. DictDrops[items].forEach(item => { // Drop the regular items
  903. if(itemDefs[item]){
  904. actorEvents189._customBlock_DropSomething(item, 1, 0, 0, 2, y, 0, x, y);
  905. drop_log.push(`Dropped ${itemDefs[item].h.displayName.replace(/_/g, ' ')}. (x${1})`);
  906. } else drop_log.push(`No item found for '${item}'`);
  907. });
  908. //Not really too efficient, must be a better way to deal with this... Since this one's kinda lackluster I'll postphone it for now
  909. const notreleased = [[23,59,63,70],[24,44,48,65,66,67,79],[20,21,46,59]]; // Array of smithing recipes that aren't out yet
  910. if(amnt==1) [...Array(84).keys()].forEach(item => { if(notreleased[0].indexOf(item) == -1) actorEvents189._customBlock_DropSomething(`SmithingRecipes1`, 0, item, 0, 2, y, 0, x, y); });
  911. if(amnt==2) [...Array(80).keys()].forEach(item => { if(notreleased[1].indexOf(item) == -1) actorEvents189._customBlock_DropSomething(`SmithingRecipes2`, 0, item, 0, 2, y, 0, x, y); });
  912. if(amnt==3) [...Array(60).keys()].forEach(item => { if(notreleased[2].indexOf(item) == -1) actorEvents189._customBlock_DropSomething(`SmithingRecipes3`, 0, item, 0, 2, y, 0, x, y); });
  913. } else DictDrops[items].forEach(item => {
  914. if(itemDefs[item]){
  915. actorEvents189._customBlock_DropSomething(item, amnt, 0, 0, 2, y, 0, x, y);
  916. drop_log.push(`Dropped ${itemDefs[item].h.displayName.replace(/_/g, ' ')}. (x${amnt})`);
  917. } else drop_log.push(`No item found for '${item}'`);
  918. });
  919. } else drop_log.push(` The sub-command didn't yield any item collection. Existing sub-commands are: \n ${Object.keys(DictDrops).join(", ")}`);
  920. return drop_log.join("\n");
  921. } catch (err) { return `Error: ${err}`; }
  922. });
  923. // Minigame cheats
  924. registerCheat('minigame', function (params) {
  925. // setup needs to be repeated, because currently swapping players would break the setup.
  926. setupMinigameProxy.call(this);
  927. setupCatchingMinigameProxy.call(this);
  928. setupGeneralInfoProxy.call(this);
  929. if (!params || params.length === 0) {
  930. cheatState.minigames = !cheatState.minigames;
  931. return `${cheatState.minigames ? 'Activated' : 'Deactived'} unlimited minigames.`;
  932. }
  933. if (params && params[0] === 'mining') {
  934. cheatState.minigame.mining = !cheatState.minigame.mining;
  935. return `${cheatState.minigame.mining ? 'Activated' : 'Deactived'} minigame mining.`;
  936. }
  937. if (params && params[0] === 'fishing') {
  938. cheatState.minigame.fishing = !cheatState.minigame.fishing;
  939. return `${cheatState.minigame.fishing ? 'Activated' : 'Deactived'} minigame fishing.`;
  940. }
  941. if (params && params[0] === 'catching') {
  942. cheatState.minigame.catching = !cheatState.minigame.catching;
  943. return `${cheatState.minigame.catching ? 'Activated' : 'Deactived'} minigame catching.`;
  944. }
  945. if (params && params[0] === 'choppin') {
  946. cheatState.minigame.choppin = !cheatState.minigame.choppin;
  947. return `${cheatState.minigame.choppin ? 'Activated' : 'Deactived'} minigame choppin.`;
  948. }
  949. return `${params ? params[0] : ''} not supported.`;
  950. });
  951. /****************************************************************************************************
  952. The following commands have not been tested properly and/or are definitely dangerous to use
  953. Use these only if you don't care about shadow ban and/or have the confidence in some...
  954. Functions such as spawn, godlike and nullify don't directly modify the account info...
  955. ...and may be safe to use to some degree. (No guarantees!!)
  956. */
  957. // All W1 related Proxy cheats
  958. registerCheat('w1', function(params) {
  959. if(params[0]){
  960. if (params && params[0] === 'anvil') {
  961. cheatState.W1.anvil = !cheatState.W1.anvil;
  962. return `${cheatState.W1.anvil ? 'Activated' : 'Deactived'} anvil cost and duration nullification.`;
  963. }
  964. if (params && params[0] === 'forge') {
  965. cheatState.W1.forge = !cheatState.W1.forge;
  966. return `${cheatState.W1.forge ? 'Activated' : 'Deactived'} forge upgrade cost nullification.`;
  967. }
  968. if (params && params[0] === 'stampcost') {
  969. cheatState.W1.stampcost = !cheatState.W1.stampcost;
  970. return `${cheatState.W1.stampcost ? 'Activated' : 'Deactived'} stamp cost nullification.`;
  971. }
  972. if (params && params[0] === 'smith') {
  973. cheatState.W1.smith = !cheatState.W1.smith;
  974. return `${cheatState.W1.smith ? 'Activated' : 'Deactived'} smithing cost nullification (change maps to have the effect apply).`;
  975. }
  976. if (params && params[0] === 'statue') {
  977. cheatState.W1.smith = !cheatState.W1.smith;
  978. return `${cheatState.W1.smith ? 'Activated' : 'Deactived'} statue upgrade cost to 1. \n(This cheat has been commented out due to account breaking issues)`;
  979. }
  980. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.W1).join(", ")}`;
  981. } else{
  982. if(cheatState.W1s){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  983. cheatState.W1.anvil = false;
  984. cheatState.W1.forge = false;
  985. cheatState.W1.stampcost = false;
  986. cheatState.W1.smith = false;
  987. } cheatState.W1s = !cheatState.W1s;
  988. return `${cheatState.W1s ? 'Activated' : 'Deactived'} stamps, forge and anvil upgrade cost nullification.`;
  989. }
  990. });
  991. // Account-wide cheats
  992. registerCheat('wide', function(params) {
  993. if(params[0]){
  994. if (params && params[0] === 'mtx') {
  995. cheatState.wide.mtx = !cheatState.wide.mtx;
  996. return `${cheatState.wide.mtx ? 'Activated' : 'Deactived'} mtx shop cost nullification.`;
  997. }
  998. if (params && params[0] === 'post') {
  999. cheatState.wide.post = !cheatState.wide.post;
  1000. return `${cheatState.wide.post ? 'Activated' : 'Deactived'} post office cost nullification.`;
  1001. }
  1002. if (params && params[0] === 'guild') {
  1003. cheatState.wide.guild = !cheatState.wide.guild;
  1004. return `${cheatState.wide.guild ? 'Activated' : 'Deactived'} guild task cost nullification.`;
  1005. }
  1006. if (params && params[0] === 'task') {
  1007. cheatState.wide.task = !cheatState.wide.task;
  1008. return `${cheatState.wide.task ? 'Activated' : 'Deactived'} task cost nullification.`;
  1009. }
  1010. if (params && params[0] === 'quest') {
  1011. cheatState.wide.quest = !cheatState.wide.quest; // Nullifies quest item requirements (doesn't nullify level requirements)
  1012. return `${cheatState.wide.quest ? 'Activated' : 'Deactived'} quest item requirement nullification.`;
  1013. }
  1014. if (params && params[0] === 'star') {
  1015. cheatState.wide.star = !cheatState.wide.star;
  1016. return `${cheatState.wide.star ? 'Activated' : 'Deactived'} star point req. to unlock signs.`;
  1017. }
  1018. if (params && params[0] === 'crystal') {
  1019. cheatState.wide.crystal = !cheatState.wide.crystal;
  1020. return `${cheatState.wide.crystal ? 'Activated' : 'Deactived'} 100% Crystal mob spawn rate.`;
  1021. }
  1022. if (params && params[0] === 'giant') {
  1023. cheatState.wide.giant = !cheatState.wide.giant;
  1024. return `${cheatState.wide.giant ? 'Activated' : 'Deactived'} 100% giant mob spawn rate.`;
  1025. }
  1026. if (params && params[0] === 'obol') {
  1027. cheatState.wide.obol = !cheatState.wide.obol;
  1028. return `${cheatState.wide.obol ? 'Activated' : 'Deactived'} obol reroll cost nullification.`;
  1029. }
  1030. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.wide).join(", ")}`;
  1031. } else{
  1032. if(cheatState.wides){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1033. cheatState.wide.guild = false;
  1034. cheatState.wide.mtx = false;
  1035. cheatState.wide.post = false;
  1036. cheatState.wide.task = false;
  1037. cheatState.wide.quest = false;
  1038. cheatState.wide.star = false;
  1039. cheatState.wide.crystal = false;
  1040. cheatState.wide.giant = false;
  1041. cheatState.wide.obol = false;
  1042. } cheatState.wides = !cheatState.wides;
  1043. return `${cheatState.wides ? 'Activated' : 'Deactived'} account-wide nullifications e.g. mtx, post office, tasks and guild tasks cost.`;
  1044. }
  1045. });
  1046. // All cauldron related cheats
  1047. registerCheat('cauldron', function(params) {
  1048. if(params[0]){
  1049. if (params && params[0] === 'vialrng') {
  1050. cheatState.cauldron.vialrng = !cheatState.cauldron.vialrng;
  1051. return `${cheatState.cauldron.vialrng ? 'Activated' : 'Deactived'} vial unlock upon rolling 1+.`;
  1052. }
  1053. if (params && params[0] === 'vialattempt') {
  1054. cheatState.cauldron.vialattempt = !cheatState.cauldron.vialattempt;
  1055. return `${cheatState.cauldron.vialattempt ? 'Activated' : 'Deactived'} unlimited vial attempts.`;
  1056. }
  1057. if (params && params[0] === 'bubblecost') {
  1058. cheatState.cauldron.bubblecost = !cheatState.cauldron.bubblecost;
  1059. return `${cheatState.cauldron.bubblecost ? 'Activated' : 'Deactived'} bubble cost nullification.`;
  1060. }
  1061. if (params && params[0] === 'vialcost') {
  1062. cheatState.cauldron.vialcost = !cheatState.cauldron.vialcost;
  1063. return `${cheatState.cauldron.vialcost ? 'Activated' : 'Deactived'} vial cost nullification.`;
  1064. }
  1065. if (params && params[0] === 'lvlreq') {
  1066. cheatState.cauldron.lvlreq = !cheatState.cauldron.lvlreq;
  1067. return `${cheatState.cauldron.lvlreq ? 'Activated' : 'Deactived'} lvl requirement nullification.`;
  1068. }
  1069. if (params && params[0] === 'newbubble') {
  1070. cheatState.cauldron.newbubble = !cheatState.cauldron.newbubble;
  1071. return `${cheatState.cauldron.newbubble ? 'Activated' : 'Deactived'} new bubble chance 100%.`;
  1072. }
  1073. if (params && params[0] === 're_speed') {
  1074. cheatState.cauldron.re_speed = !cheatState.cauldron.re_speed;
  1075. return `${cheatState.cauldron.re_speed ? 'Activated' : 'Deactived'} super research speed.`;
  1076. }
  1077. if (params && params[0] === 'liq_rate') {
  1078. cheatState.cauldron.liq_rate = !cheatState.cauldron.liq_rate;
  1079. return `${cheatState.cauldron.liq_rate ? 'Activated' : 'Deactived'} super liquid speed.`;
  1080. }
  1081. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.cauldron).join(", ")}`;
  1082. } else{ // The full cauldron command that does everything
  1083. if(cheatState.cauldrons){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1084. cheatState.cauldron.vialrng = false,
  1085. cheatState.cauldron.vialattempt = false,
  1086. cheatState.cauldron.bubblecost = false;
  1087. cheatState.cauldron.vialcost = false;
  1088. cheatState.cauldron.lvlreq = false;
  1089. cheatState.cauldron.newbubble = false;
  1090. cheatState.cauldron.re_speed = false;
  1091. cheatState.cauldron.liq_rate = false;
  1092. } cheatState.cauldrons = !cheatState.cauldrons;
  1093. return `${cheatState.cauldrons ? 'Activated' : 'Deactived'} all cauldron costs and duration nullifications (except P2W).`;
  1094. }
  1095. });
  1096. // All W3 related Proxy cheats
  1097. registerCheat('w3', function(params) {
  1098. if(params[0]){
  1099. if (params && params[0] === 'mobdeath') {
  1100. cheatState.W3.mobdeath = !cheatState.W3.mobdeath;
  1101. return `${cheatState.W3.mobdeath ? 'Activated' : 'Deactived'} worship mobs insta-death.`;
  1102. }
  1103. if (params && params[0] === 'flagreq') {
  1104. cheatState.W3.flagreq = !cheatState.W3.flagreq;
  1105. return `${cheatState.W3.flagreq ? 'Activated' : 'Deactived'} flag unlock time nullification.`;
  1106. }
  1107. if (params && params[0] === 'saltcost') {
  1108. cheatState.W3.altcost = !cheatState.W3.altcost;
  1109. return `${cheatState.W3.altcost ? 'Activated' : 'Deactived'} salt cost nullification.`;
  1110. }
  1111. if (params && params[0] === 'matcost') {
  1112. cheatState.W3.flagreq = !cheatState.W3.flagreq;
  1113. return `${cheatState.W3.flagreq ? 'Activated' : 'Deactived'} flag unlock time nullification.`;
  1114. }
  1115. if (params && params[0] === 'instabuild') {
  1116. cheatState.W3.instabuild = !cheatState.W3.instabuild;
  1117. return `${cheatState.W3.instabuild ? 'Activated' : 'Deactived'} insta-build of buildings.`;
  1118. }
  1119. if (params && params[0] === 'booktime') {
  1120. cheatState.W3.booktime = !cheatState.W3.booktime;
  1121. return `${cheatState.W3.booktime ? 'Activated' : 'Deactived'} book per second.`;
  1122. }
  1123. if (params && params[0] === 'totalflags') {
  1124. cheatState.W3.totalflags = !cheatState.W3.totalflags;
  1125. return `${cheatState.W3.totalflags ? 'Activated' : 'Deactived'} 10 total flags.`;
  1126. }
  1127. if (params && params[0] === 'buildcogs') {
  1128. cheatState.W3.buildspd = !cheatState.W3.buildspd;
  1129. return `${cheatState.W3.buildspd ? 'Activated' : 'Deactived'} super build speed on cogs.`;
  1130. }
  1131. if (params && params[0] === 'saltlick') {
  1132. cheatState.W3.saltlick = !cheatState.W3.saltlick;
  1133. return `${cheatState.W3.saltlick ? 'Activated' : 'Deactived'} Salt Lick upgrade cost nullification.`;
  1134. }
  1135. if (params && params[0] === 'refinery') {
  1136. cheatState.W3.refinery = !cheatState.W3.refinery;
  1137. return `${cheatState.W3.refinery ? 'Activated' : 'Deactived'} refinery cost nullification.`;
  1138. }
  1139. if (params && params[0] === 'trapping') {
  1140. cheatState.W3.trapping = !cheatState.W3.trapping;
  1141. return `${cheatState.W3.trapping ? 'Activated' : 'Deactived'} trapping duration nullification.`;
  1142. }
  1143. if (params && params[0] === 'book') {
  1144. cheatState.W3.book = !cheatState.W3.book;
  1145. return `${cheatState.W3.book ? 'Activated' : 'Deactived'} always max lvl talent book.`;
  1146. }
  1147. if (params && params[0] === 'prayer') {
  1148. cheatState.W3.prayer = !cheatState.W3.prayer;
  1149. return `${cheatState.W3.prayer ? 'Activated' : 'Deactived'} Prayer curse nullification.`;
  1150. }
  1151. if (params && params[0] === 'shrinehr') {
  1152. cheatState.W3.shrinehr = !cheatState.W3.shrinehr;
  1153. return `${cheatState.W3.shrinehr ? 'Activated' : 'Deactived'} shrine lvl time reduction to 0.5h.`;
  1154. }
  1155. if (params && params[0] === 'worshipspeed') {
  1156. cheatState.W3.worshipspeed = !cheatState.W3.worshipspeed;
  1157. return `${cheatState.W3.worshipspeed ? 'Activated' : 'Deactived'} worship charge superspeed`;
  1158. }
  1159. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.W3).join(", ")}`;
  1160. } else{ // The full workbench command that does everything
  1161. if(cheatState.W3s){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1162. cheatState.W3.mobdeath = false;
  1163. cheatState.W3.flagreq = false;
  1164. cheatState.W3.saltcost = false;
  1165. cheatState.W3.matcost = false;
  1166. cheatState.W3.instabuild = false;
  1167. cheatState.W3.booktime = false;
  1168. cheatState.W3.totalflags = false;
  1169. cheatState.W3.buildspd = false;
  1170. cheatState.W3.saltlick = false;
  1171. cheatState.W3.refinery = false;
  1172. cheatState.W3.trapping = false;
  1173. cheatState.W3.book = false;
  1174. cheatState.W3.prayer = false;
  1175. cheatState.W3.worshipspeed = false;
  1176. } cheatState.W3s = !cheatState.W3s;
  1177. return `${cheatState.W3s ? 'Activated' : 'Deactived'} all workbench nullifications and worship mob insta-death.`;
  1178. }
  1179. });
  1180. // All W4 related Proxy cheats
  1181. registerCheat('w4', function(params) {
  1182. if(params[0]){
  1183. if (params && params[0] === 'battleslots') {
  1184. cheatState.W4.battleslots = !cheatState.W4.battleslots;
  1185. return `${cheatState.W4.battleslots ? 'Activated' : 'Deactived'} all 6 battle slots`;
  1186. }
  1187. if (params && params[0] === 'eggcap') {
  1188. cheatState.W4.eggcap = !cheatState.W4.eggcap;
  1189. return `${cheatState.W4.eggcap ? 'Activated' : 'Deactived'} all egg slots`;
  1190. }
  1191. if (params && params[0] === 'fenceyard') {
  1192. cheatState.W4.fenceyard = !cheatState.W4.fenceyard;
  1193. return `${cheatState.W4.fenceyard ? 'Activated' : 'Deactived'} big garden`;
  1194. }
  1195. if (params && params[0] === 'petchance') {
  1196. cheatState.W4.petchance = !cheatState.W4.petchance;
  1197. return `${cheatState.W4.petchance ? 'Activated' : 'Deactived'} 100% new pet chance`;
  1198. }
  1199. if (params && params[0] === 'genes') {
  1200. cheatState.W4.genes = !cheatState.W4.genes;
  1201. return `${cheatState.W4.genes ? 'Activated' : 'Deactived'} 0 gene upgrades`;
  1202. }
  1203. if (params && params[0] === 'fasteggs') {
  1204. cheatState.W4.fasteggs = !cheatState.W4.fasteggs;
  1205. return `${cheatState.W4.fasteggs ? 'Activated' : 'Deactived'} fast incubation`;
  1206. }
  1207. if (params && params[0] === 'labpx') {
  1208. cheatState.W4.labpx = !cheatState.W4.labpx;
  1209. return `${cheatState.W4.labpx ? 'Activated' : 'Deactived'} long lab connections`;
  1210. }
  1211. if (params && params[0] === 'instameals') {
  1212. cheatState.W4.instameals = !cheatState.W4.instameals;
  1213. return `${cheatState.W4.instameals ? 'Activated' : 'Deactived'} instant meals`;
  1214. }
  1215. if (params && params[0] === 'instarecipes') {
  1216. cheatState.W4.instarecipes = !cheatState.W4.instarecipes;
  1217. return `${cheatState.W4.instarecipes ? 'Activated' : 'Deactived'} instant recipes`;
  1218. }
  1219. if (params && params[0] === 'luckychef') {
  1220. cheatState.W4.luckychef = !cheatState.W4.luckychef;
  1221. return `${cheatState.W4.luckychef ? 'Activated' : 'Deactived'} new recipe guarantee`;
  1222. }
  1223. if (params && params[0] === 'freekitchens') {
  1224. cheatState.W4.freekitchens = !cheatState.W4.freekitchens;
  1225. return `${cheatState.W4.freekitchens ? 'Activated' : 'Deactived'} free kitchens`;
  1226. }
  1227. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.W4).join(", ")}`;
  1228. } else{ // The full workbench command that does everything
  1229. if(cheatState.W4s){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1230. cheatState.W4.battleslots = false;
  1231. cheatState.W4.eggcap = false;
  1232. cheatState.W4.fenceyard = false;
  1233. cheatState.W4.petchance = false;
  1234. cheatState.W4.genes = false;
  1235. cheatState.W4.fasteggs = false;
  1236. cheatState.W4.labpx = false;
  1237. cheatState.W4.instameals = false;
  1238. cheatState.W4.instarecipes = false;
  1239. cheatState.W4.luckychef = false;
  1240. cheatState.W4.freekitchens = false;
  1241. } cheatState.W4s = !cheatState.W4s;
  1242. return `${cheatState.W4s ? 'Activated' : 'Deactived'} all W4 cheats`;
  1243. }
  1244. });
  1245.  
  1246. // Godlike powers
  1247. registerCheat('godlike', function(params) {
  1248. if(params[0]){
  1249. if (params && params[0] === 'hp') {
  1250. cheatState.godlike.hp = !cheatState.godlike.hp;
  1251. return `${cheatState.godlike.hp ? 'Activated' : 'Deactived'} hp deduction nullification.`;
  1252. }
  1253. if (params && params[0] === 'mp') {
  1254. cheatState.godlike.mp = !cheatState.godlike.mp;
  1255. return `${cheatState.godlike.mp ? 'Activated' : 'Deactived'} mp deduction nullification.`;
  1256. }
  1257. if (params && params[0] === 'reach') {
  1258. cheatState.godlike.reach = !cheatState.godlike.reach;
  1259. return `${cheatState.godlike.reach ? 'Activated' : 'Deactived'} reach set to 666.`;
  1260. }
  1261. if (params && params[0] === 'crit') {
  1262. cheatState.godlike.crit = !cheatState.godlike.crit;
  1263. return `${cheatState.godlike.crit ? 'Activated' : 'Deactived'} crit set to 100.`;
  1264. }
  1265. if (params && params[0] === 'ability') {
  1266. cheatState.godlike.ability = !cheatState.godlike.ability;
  1267. return `${cheatState.godlike.ability ? 'Activated' : 'Deactived'} zero ability cooldown, mana cost nullification and cast time 0.1s.`;
  1268. }
  1269. if (params && params[0] === 'bosshp') {
  1270. cheatState.godlike.bosshp = !cheatState.godlike.bosshp;
  1271. return `${cheatState.godlike.bosshp ? 'Activated' : 'Deactived'} Boss HP nullification.`;
  1272. }
  1273. if (params && params[0] === 'food') {
  1274. cheatState.godlike.food = !cheatState.godlike.food;
  1275. return `${cheatState.godlike.food ? 'Activated' : 'Deactived'} food deduction nullification.`;
  1276. }
  1277. if (params && params[0] === 'hitchance') {
  1278. cheatState.godlike.hitchance = !cheatState.godlike.hitchance;
  1279. return `${cheatState.godlike.hitchance ? 'Activated' : 'Deactived'} 100% hit chance.`;
  1280. }
  1281. if (params && params[0] === 'buff') {
  1282. cheatState.godlike.buff = !cheatState.godlike.buff;
  1283. return `${cheatState.godlike.buff ? 'Activated' : 'Deactived'} unlimited buff time: Once disabled it'll run out in 5 seconds. \n(This cheat has been commented out due to crashing upon activating new buffs)`;
  1284. }
  1285. if (params && params[0] === 'dmg') {
  1286. cheatState.godlike.dmg = !cheatState.godlike.dmg;
  1287. return `${cheatState.godlike.dmg ? 'Activated' : 'Deactived'} auto attack capping: Crits are disabled and combat abilities will overflow.`;
  1288. }
  1289. if (params && params[0] === 'speed') { // Not a Proxy cheat, will have to activate individually
  1290. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1291. for( const [index, element] of Object.entries(itemDefs))
  1292. if(element.h["typeGen"] === "aWeapon") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Speed"] = params[1] || 9;
  1293. return `All weapon speed are up to Turbo. \nThe max speed parameter you can set is 14: Higher will cause a non-attacking bug.`;
  1294. }
  1295. if (params && params[0] === 'card') {
  1296. const bEngine = this["com.stencyl.Engine"].engine;
  1297. const CardStuff = bEngine.getGameAttribute("CustomLists").h["CardStuff"];
  1298. const TargetCards = ["Boss2A", "Boss2B", "poopBig", "OakTree", "Copper"];
  1299. for(const [key1, value1] of Object.entries(CardStuff))
  1300. for(const [key2, value2] of Object.entries(value1))
  1301. if(TargetCards.includes(value2[0])) CardStuff[key1][key2][4] = "10000";
  1302. return `The cards Efaunt, Chaotic Efaunt, Dr Defecaus, Oak Tree and Copper have been altered with insane stats.`;
  1303. }
  1304. return `Wrong sub-command, use one of these:\nfood, speed, card, ${Object.keys(cheatState.godlike).join(", ")}`;
  1305. } else{
  1306. if(cheatState.godlikes){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1307. cheatState.godlike.hp = false;
  1308. cheatState.godlike.mp = false;
  1309. cheatState.godlike.reach = false;
  1310. cheatState.godlike.crit = false;
  1311. cheatState.godlike.ability = false;
  1312. cheatState.godlike.bosshp = false;
  1313. cheatState.godlike.food = false;
  1314. cheatState.godlike.hitchance = false;
  1315. cheatState.godlike.buff = false;
  1316. } cheatState.godlikes = !cheatState.godlikes;
  1317. return `${cheatState.godlikes ? 'Activated' : 'Deactived'}: \nNo HP/MP deduction, \n100% crit chance, 666 reach, \nZero ability cooldown, mana usage and 0.1s cast time, \nBoss HP set to zero.`;
  1318. }
  1319. });
  1320. // Quick daily shop and post office reset
  1321. registerCheat('daily', function(params) {
  1322. this["com.stencyl.Engine"].engine.getGameAttribute("TimeAway").h["ShopRestock"]=1
  1323. return `The daily shop restock has been triggered, which somehow also triggers the daily post office reset.`;
  1324. });
  1325. // This function doesn't kill other players (luckily) but yourself :)
  1326. registerCheat('noob', function(params) {
  1327. const hpval = parseInt(params[0]) || 0;
  1328. this["com.stencyl.Engine"].engine.gameAttributes.h.PlayerHP = hpval;
  1329. return `The amount of health is set to ${params[0]}`;
  1330. });
  1331. // This function definitely looks dangerous as it changes your class, but doesn't reset distributed talents!
  1332. registerCheat('class', function(params) {
  1333. let ClassId = parseInt(params[0]) || -1;
  1334. if(ClassId == -1) return `Class Id has to be a numeric value!`;
  1335. if(ClassId > 50 || ClassId < 0) ClassId = 1; // A small fail-safe
  1336. this["com.stencyl.Engine"].engine.setGameAttribute("CharacterClass", ClassId);
  1337. return `Class id has been changed to ${ClassId}`;
  1338. });
  1339. // Not sure if this function's safe, probably is to most items but I have not personally tested.
  1340. registerCheat('qnty', function(params) {
  1341. const bEngine = this["com.stencyl.Engine"].engine;
  1342. const setqnty = params[1] || 1;
  1343. if(params[0] === "inv"){
  1344. bEngine.getGameAttribute("ItemQuantity")[0] = setqnty;
  1345. return `The item quantity in the first inventory slot has been changed to ${setqnty}`;
  1346. } else if(params[0] === "chest"){
  1347. bEngine.getGameAttribute("ChestQuantity")[0] = setqnty;
  1348. return `The item quantity in the first chest slot has been changed to ${setqnty}`;
  1349. } else return "Unknown sub-command!\nKnown sub-commands are 'inv' and 'chest'.";
  1350. });
  1351. // This function is extremely dangerous, as you're changing the lvl value your exp isn't changing accordingly
  1352. registerCheat('lvl', function(params) {
  1353. const bEngine = this["com.stencyl.Engine"].engine;
  1354. const lvltype = params[0];
  1355. const setlvl = parseInt(params[1]) || -1;
  1356. if(setlvl == -1) return `The lvl value has to be numeric!`; // Yup this is a dummy-proof measurement to prevent account bricking
  1357. // The class and skill lvl code is easily done through dictionary.
  1358. const dictype = {'class':0,'mining':1,'smithing':2,'chopping':3,'fishing':4,'alchemy':5,'catching':6,'trapping':7,'construction':8,'worship':9};
  1359. if(Object.keys(dictype).includes(lvltype)) bEngine.getGameAttribute('Lv0')[dictype[lvltype]] = setlvl;
  1360. else if(lvltype === 'furnace') bEngine.setGameAttribute("FurnaceLevels", [16,setlvl,setlvl,setlvl,setlvl,setlvl]);
  1361. else if(lvltype === 'statue') bEngine.getGameAttribute("StatueLevels").forEach(item => item[0] = setlvl);
  1362. else if(lvltype === 'anvil'){
  1363. const Levels = bEngine.getGameAttribute("AnvilPAstats");
  1364. const lvllist = { exp: 3, spd: 4, cap: 5 };
  1365. for (const i in lvllist) Levels[lvllist[i]] = setlvl;
  1366. bEngine.setGameAttribute("AnvilPAstats", Levels);
  1367. } else if(lvltype === 'talent'){
  1368. const Levels0 = bEngine.getGameAttribute("SkillLevelsMAX");
  1369. const Levels1 = bEngine.getGameAttribute("SkillLevels");
  1370. for(const [index,element] of Object.entries(Levels0)) Levels0[index] = Levels1[index] = setlvl;
  1371. } else if(lvltype === 'stamp'){
  1372. const Levels0 = bEngine.getGameAttribute("StampLevelMAX");
  1373. const Levels1 = bEngine.getGameAttribute("StampLevel");
  1374. for(const [index1,element1] of Object.entries(Levels0)) // A double for loop to nail the job
  1375. for(const [index2,element2] of Object.entries(element1))
  1376. Levels0[index1][index2] = Levels1[index1][index2] = setlvl;
  1377. return `Both current and max of all stamp levels have been set to ${setlvl}`;
  1378. } else if(lvltype === 'shrine'){
  1379. const Levels = bEngine.getGameAttribute("ShrineInfo");
  1380. Levels.forEach(item => { item[3] = setlvl; item[4] = 0; }); // Shrine lvl set and accumulated xp to 0
  1381. } else if(lvltype === 'guild'){
  1382. const Levels = bEngine.getGameAttribute("GuildTasks");
  1383. for(const [index,element] of Object.entries(Levels[0])) Levels[0][index] = setlvl;
  1384. return "This is only for show and does not truly work server-sided. Might even be dangerous, but so is the entire lvl-command.";
  1385. } else return "This lvl type isn't supported.";
  1386. return `${lvltype} has been changed to ${setlvl}.`;
  1387. });
  1388. // Raw changes to cauldron variables
  1389. registerCheat('setalch', function(params) {
  1390. const bEngine = this["com.stencyl.Engine"].engine;
  1391. const alchdict = {"orange":0, "green":1, "purple":2, "yellow":3, "vial":4, "color":5, "liquid":6, "upgrade":8};
  1392. const setlvl = params[1] || 1000;
  1393. if(Object.keys(alchdict).includes(params[0])) {
  1394. const tochange = bEngine.getGameAttribute("CauldronInfo")[alchdict[params[0]]];
  1395. if(params[0] === "upgrade"){
  1396. for(const [index1,element1] of Object.entries(tochange))
  1397. for(const [index2,element2] of Object.entries(element1))
  1398. tochange[index1][index2][1] = setlvl;
  1399. return `All cauldron upgrades set to lvl ${setlvl}`;
  1400. } // No need to else, as there's a return
  1401. for(const [index,element] of Object.entries(tochange)) tochange[index] = setlvl;
  1402. return `All ${params[0]} levels have changed to ${setlvl}.`;
  1403. } else return `Wrong sub-command, use one of these:\n${Object.keys(alchdict).join(", ")}`;
  1404. });
  1405. // A highly dangerous function, only use it on shadow banned test accounts!!
  1406. registerCheat('abilitybar', function(params) {
  1407. const bEngine = this["com.stencyl.Engine"].engine;
  1408. const talentDefs = bEngine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1409. const AttackLoadout = bEngine.getGameAttribute("AttackLoadout");
  1410. // First parameter is the ability bar that ranges from 0 to 9.
  1411. const abilitybar = params[0];
  1412. const abilities = params.slice(1); //
  1413. const Abilities = [];
  1414. if(abilitybar < 10 && abilitybar >= 0){
  1415. for(const [index,element] of Object.entries(abilities)){
  1416. if(index >= 6) return "An ability bar can only hold 6 elements!";
  1417. if(element < talentDefs.length && element >= 0){
  1418. Abilities.push(`Bar ${abilitybar} ability ${index} set to: ${talentDefs[element].replace(/_/g, ' ').toLowerCase()}`)
  1419. AttackLoadout[abilitybar][index] = element;
  1420. } else Abilities.push("Ability falls out of the known id range!");
  1421. }
  1422. bEngine.setGameAttribute("AttackLoadout", AttackLoadout);
  1423. return Abilities.join("\n");
  1424. } else return "The ability bar index ranges from 0 to 9!";
  1425. });
  1426. // All item can by worn by any class
  1427. registerCheat('equipall', function(params) {
  1428. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1429. for( const [index, element] of Object.entries(itemDefs)){ // Any item with Class attribute is set to ALL, and any with lvlReqToEquip set to 1
  1430. if(element.h["Class"]) this["scripts.ItemDefinitions"].itemDefs.h[index].h["Class"] = "ALL";
  1431. if(element.h["lvReqToEquip"]) this["scripts.ItemDefinitions"].itemDefs.h[index].h["lvReqToEquip"] = 1;
  1432. } return `All items can be worn by any class at any level.`;
  1433. });
  1434. // All item can by worn by any class
  1435. registerCheat('upstones', function(params) {
  1436. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1437. if(params[0] === 'rng'){ // Should be 100% safe
  1438. for( const [index, element] of Object.entries(itemDefs))
  1439. if(element.h["typeGen"] === "dStone") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Amount"] = 100;
  1440. return `All upgrade stones have 100% success chance.`;
  1441. } else if(params[0] === 'use'){ // Probably risky
  1442. for( const [index, element] of Object.entries(itemDefs))
  1443. if(element.h["typeGen"] === "dStone") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Trigger"] = 0;
  1444. return `Using an upgrade stone doesn't deduct remaining upgrade amount on an item.`;
  1445. } return `Wrong sub-command, correct ones are:\nrng: Upgrade stones have 100% success chance, \nuse: Upgrade stones doesn't deduct remaining upgrade amount on an item.`;
  1446. });
  1447. // I still aim to add even more costs to nullify
  1448. registerCheat('nullify', function(params) {
  1449. const changedstuff = []; // Used to concatenate strings about what has been nullified by this command xD
  1450.  
  1451. cheatState.wides = !cheatState.wides;
  1452. changedstuff.push(`${cheatState.wides ? 'Activated' : 'Deactived'} account-wide nullifications e.g. mtx, post office, tasks and guild tasks cost.`);
  1453.  
  1454. cheatState.W1s = !cheatState.W1s;
  1455. changedstuff.push(`${cheatState.W1s ? 'Activated' : 'Deactived'} stamps, forge and anvil upgrade cost nullification.`);
  1456.  
  1457. cheatState.cauldrons = !cheatState.cauldrons;
  1458. changedstuff.push(`${cheatState.cauldrons ? 'Activated' : 'Deactived'} all cauldron costs and durations (except P2W).`);
  1459.  
  1460. cheatState.W3s = !cheatState.W3s;
  1461. changedstuff.push(`${cheatState.W3s ? 'Activated' : 'Deactived'} all workbench nullifications and worship mob insta-death.`);
  1462.  
  1463. return changedstuff.join("\n"); // Tell the user how many things have happened through this singular command xD
  1464. });
  1465. /****************************************************************************************************
  1466. The following functions only aggregate information from the game's data structures.
  1467. As such, these functions are perfectly safe.
  1468. */
  1469. // Search by item, monster or talent name: All in lowercase!
  1470. registerCheat('search', function (params) {
  1471. const queryX = params.slice(1) && params.slice(1).length ? params.slice(1).join(' ').toLowerCase() : undefined;
  1472. const bEngine = this["com.stencyl.Engine"].engine;
  1473. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1474. const ItemVals = [[],[]]
  1475. const searchVals = [];
  1476. if(queryX){
  1477. if(params[0] === "item"){
  1478. searchVals.push("Id, Item");
  1479. for(const [key, value] of Object.entries(itemDefs)){
  1480. const valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
  1481. if (valName.includes(queryX)) searchVals.push(`${key} - ${valName}`);
  1482. }
  1483. } else if(params[0] === "monster"){
  1484. searchVals.push("Id, Monster");
  1485. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  1486. for (const [key, value] of Object.entries(monsterDefs)) {
  1487. const valName = value.h["Name"].replace(/_/g, ' ').toLowerCase();
  1488. if (valName.includes(queryX)) searchVals.push(`${key} - ${valName}`);
  1489. }
  1490. } else if(params[0] === "talent"){
  1491. searchVals.push("Order, Id, Talent");
  1492. const talentDefs = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1493. const Order = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["TalentOrder"];
  1494. for(let i=0; i < Order.length; i++){
  1495. const valName = talentDefs[Order[i]].replace(/_/g, ' ').toLowerCase();
  1496. if (valName.includes(queryX)) searchVals.push(`${i} - ${Order[i]} - ${valName}`);
  1497. }
  1498. } else if(params[0] === "smith"){
  1499. searchVals.push("Tab, Id, ItemId, ItemName");
  1500. const ItemToCraftNAME = bEngine.getGameAttribute("CustomLists").h["ItemToCraftNAME"];
  1501. for(const [key, value] of Object.entries(itemDefs)){
  1502. const valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
  1503. if (valName.includes(queryX)) ItemVals.push([key,valName]);
  1504. }
  1505. for(h=0; h < ItemVals.length; h++) for(i=0; i < ItemToCraftNAME.length; i++) for(j=0; j < ItemToCraftNAME[i].length; j++)
  1506. if (ItemVals[h][0] == ItemToCraftNAME[i][j]) searchVals.push(`${i+i}, ${j}, ${ItemVals[h][0]}, ${ItemVals[h][1]}`);
  1507. } else return "Invalid sub-command! Valid ones are:\n item\n monster\n talent\n smith";
  1508. if (searchVals.length > 0) return searchVals.join('\n');
  1509. else return `No info found for '${queryX}'`;
  1510. }
  1511. });
  1512. // Get Game Attributes: Uses a for loop to iterate over the object's key/index and element.
  1513. registerCheat('gga', function(params) {
  1514. const bEngine = this["com.stencyl.Engine"].engine;
  1515. return gg_func(params, 0, bEngine); // Yup the function's down at the bottom
  1516. });
  1517. // Get Game Key
  1518. registerCheat('ggk', function(params) {
  1519. const bEngine = this["com.stencyl.Engine"].engine;
  1520. return gg_func(params, 1, bEngine); // Yup the function's down at the bottom
  1521. });
  1522. /* Evaluate Get Game Attributes: fill in the variable you'd like to see
  1523. > egga this["com.stencyl.Engine"].engine.getGameAttribute("Lv0");
  1524. Under the hood it does:
  1525. > let gga = this["com.stencyl.Engine"].engine.getGameAttribute("Lv0");
  1526. Yeah this function is therefore pretty buggy, don't expect too much out of it xD
  1527. */
  1528. registerCheat('egga', function(params) {
  1529. const foundVals = [];
  1530. const bEngine = this["com.stencyl.Engine"].engine;
  1531. const CList = this["scripts.CustomLists"];
  1532. const Clist = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1533. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1534. const atkMoveMap = this["scripts.CustomMaps"].atkMoveMap.h;
  1535. const abilities = this["com.stencyl.Engine"].engine.getGameAttribute("AttackLoadout");
  1536. try{
  1537. let gga = eval(params[0]);
  1538. let obj_gga = Object.entries(gga);
  1539. if(typeof obj_gga == "string" || obj_gga.length == 0) foundVals.push(`${gga}`);
  1540. else for(const [index,element] of obj_gga) foundVals.push(`${index}, ${element}`);
  1541. return foundVals.join("\n");
  1542. } catch(error){
  1543. // If the gga isn't an Array nor Dictionary.
  1544. if(error instanceof TypeError) return `This TypeError should appear if you gave a non-existing object`;
  1545. return `Error: ${err}`;
  1546. }
  1547. });
  1548. // Evaluate Get Game Key: The code is indeed quite redundant, but yeah... it works
  1549. registerCheat('eggk', function(params) {
  1550. const foundVals = [];
  1551. const bEngine = this["com.stencyl.Engine"].engine;
  1552. const CList = this["scripts.CustomLists"];
  1553. const Clist = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1554. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1555. const atkMoveMap = this["scripts.CustomMaps"].atkMoveMap.h;
  1556. const abilities = this["com.stencyl.Engine"].engine.getGameAttribute("AttackLoadout");
  1557. try{
  1558. let gga = eval(params[0]);
  1559. let obj_gga = Object.entries(gga);
  1560. if(typeof obj_gga == "string" || obj_gga.length == 0) foundVals.push(`Non iterable value: ${gga}`);
  1561. else for(const [index,element] of obj_gga) foundVals.push(`${index}`);
  1562. return foundVals.join("\n");
  1563. } catch(error){
  1564. // If the gga isn't an Array nor Dictionary.
  1565. if(error instanceof TypeError) return `This TypeError should appear if you gave a non-existing object`;
  1566. return `Error: ${err}`;
  1567. }
  1568. });
  1569. // A list creator
  1570. registerCheat('list', function (params) {
  1571. const bEngine = this["com.stencyl.Engine"].engine;
  1572. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1573. const CList = this["scripts.CustomLists"];
  1574. const Clist = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1575. const foundVals = [];
  1576.  
  1577. if(params[0] == "item"){
  1578. foundVals.push("Id, ingameName");
  1579. for(const [key, value] of Object.entries(itemDefs)){
  1580. let valName;
  1581. if(key.startsWith("Cards")) valName = (value.h.desc_line1.replace(/_/g, ' ').toLowerCase() + value.h.desc_line2.replace(/_/g, ' ').toLowerCase()).replace("filler", '');
  1582. else valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
  1583. foundVals.push(`${key}, ${valName}`);
  1584. }
  1585. } else if(params[0] == "monster"){
  1586. foundVals.push("Id, ingameName, HP, Defence, Damage, EXP");
  1587. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  1588. for(const [key, value] of Object.entries(monsterDefs)){
  1589. const valName = value.h["Name"].replace(/_/g, ' ').toLowerCase();
  1590. foundVals.push(`${key}, ${valName}, ${value.h["MonsterHPTotal"]}, ${value.h["Defence"]}, ${value.h["Damages"][0]}, ${value.h["ExpGiven"]}`);
  1591. }
  1592. } else if(params[0] == "card"){
  1593. foundVals.push("Id, Entity, Value, Effect");
  1594. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  1595. const CardStuff = bEngine.getGameAttribute("CustomLists").h["CardStuff"];
  1596. for(const [key1, value1] of Object.entries(CardStuff))
  1597. for(const [key2, value2] of Object.entries(value1)){
  1598. if(monsterDefs[value2[0]]) foundVals.push(`${value2[0]}, ${monsterDefs[value2[0]].h["Name"]}, ${value2[4]}, ${value2[3]}`);
  1599. else foundVals.push(`${value2[0]}, Unknown, ${value2[4]}, ${value2[3]}`);
  1600. }
  1601. } else if(params[0] == "class"){
  1602. foundVals.push("Id, ClassName, PromotesTo");
  1603. for(const [index, element] of CList.ClassNames().entries())
  1604. foundVals.push(`${index}, ${element}, [${CList.ClassPromotionChoices()[index]}]`);
  1605. } else if(params[0] == "quest"){
  1606. foundVals.push("Id, QuestName, NPC, QuestlineNo, paramX1");
  1607. for(const [index, element] of CList.SceneNPCquestOrder().entries())
  1608. foundVals.push(`${element}, ${CList.SceneNPCquestInfo()[index].join(", ")}`);
  1609. } else if(params[0] == "map"){
  1610. foundVals.push("Num_Id, Str_Id, MapName, AFK1, AFK2, Transition");
  1611. for(const [index, element] of CList.MapName().entries())
  1612. foundVals.push(`${index}, ${element}, ${CList.MapDispName()[index]}, ${CList.MapAFKtarget()[index]}, ${CList.MapAFKtargetSide()[index]}, [${CList.SceneTransitions()[index]}]`);
  1613. } else if(params[0] == "talent"){
  1614. foundVals.push("Order, Id, Name");
  1615. const Order = bEngine.getGameAttribute("CustomLists").h["TalentOrder"];
  1616. const talentDefs = bEngine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1617. for(i=0; i < Order.length; i++) if(talentDefs[Order[i]] !== "_")
  1618. foundVals.push(`${i}, ${Order[i]}, ${talentDefs[Order[i]]}`);
  1619. } else if(params[0] == "ability"){
  1620. foundVals.push("Order, Id, Name");
  1621. const Order = bEngine.getGameAttribute("CustomLists").h["TalentOrder"];
  1622. const talentDefs = bEngine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1623. const atkMoveMap = this["scripts.CustomMaps"].atkMoveMap.h;
  1624. for(i=0; i < Order.length; i++) if(talentDefs[Order[i]] !== "_")
  1625. if(atkMoveMap[talentDefs[Order[i]]]) // Filter out all non-ability talents
  1626. foundVals.push(`${i}, ${Order[i]}, ${talentDefs[Order[i]]}`);
  1627. } else if(params[0] == "smith"){
  1628. foundVals.push("CraftId, Tab, ItemId, ItemName");
  1629. const ItemToCraftNAME = bEngine.getGameAttribute("CustomLists").h["ItemToCraftNAME"];
  1630. for(i=0; i < ItemToCraftNAME.length; i++) for(j=0; j < ItemToCraftNAME[i].length; j++){
  1631. let itemName = itemDefs[ItemToCraftNAME[i][j]].h.displayName.replace(/_/g, ' ').toLowerCase();
  1632. foundVals.push(`${i+1}, ${j}, ${ItemToCraftNAME[i][j]}, ${itemName}`);
  1633. }
  1634. }
  1635. else if(params[0] = "gga") for(const [key, val] of Object.entries(bEngine.gameAttributes.h)) foundVals.push(key);
  1636. else return "Valid sub-commands are:\n item\n monster\n class\n quest\n map\n talent\n smith";
  1637. if(params[1]) return foundVals.filter(foundVals => foundVals.includes(params[1])).join("\n");
  1638. return foundVals.join("\n"); // Concatenate all lines into one string with new lines
  1639. });
  1640. /****************************************************************************************************
  1641. These following functions enable you to perform extremely risky value manipulations...
  1642. ...and have insanely high chance of destroying your account.
  1643.  
  1644. Only use these when you know what you're doing!!
  1645. */
  1646. // Stop/restart cloud saving
  1647. registerCheat('cloudz', function() {
  1648. cheatState.cloudz = !cheatState.cloudz;
  1649. return `${cheatState.cloudz ? 'Activated' : 'Deactived'} the cloudsave jammer: Your game will not be saved while it's active! \nOnce disabled, your game will proc a cloudsave in 5 seconds. \nProbably doesn't work.`;
  1650. });
  1651. // Wipe stuff
  1652. registerCheat('wipe', function(params) {
  1653. const bEngine = this["com.stencyl.Engine"].engine;
  1654. if(params[0] === "inv"){
  1655. const wipedef = bEngine.getGameAttribute("InventoryOrder");
  1656. for(const [index,element] of Object.entries(wipedef)) wipedef[index] = "Blank";
  1657. return "The inventory has been wiped.";
  1658. } else if(params[0] == "chest"){
  1659. const wipedef = bEngine.getGameAttribute("ChestOrder");
  1660. for(const [index,element] of Object.entries(wipedef)) wipedef[index] = "Blank";
  1661. return "Wipe chest could result in a crash: Should be fine after restart.";
  1662. } else if(params[0] === "forge"){
  1663. for(const [index,element] of Object.entries(bEngine.getGameAttribute("ForgeItemOrder"))){
  1664. bEngine.getGameAttribute("ForgeItemOrder")[index] = "Blank";
  1665. bEngine.getGameAttribute("ForgeItemQuantity")[index] = 0;
  1666. } return "The forge has been wiped. \nIf the game crashes, it should be fine after restart.";
  1667. } else if(params[0] === "ban"){
  1668. bEngine.getGameAttribute("OptionsListAccount")[26] = 0;
  1669. return "The shadowing has been cleared, but it doesn't clear the true flag on your account. \n(note that this is not a true unban)";
  1670. } else return "Unknown sub-command given\nKnown sub-commands are 'inv', 'chest', 'forge' and 'ban'.";
  1671. });
  1672. // Don't use unless needed: This function exists to wipe certain stuff from your already broken account!
  1673. registerCheat('fix_save', function(params) {
  1674. fixobj = this["com.stencyl.Engine"].engine.getGameAttribute(params[0]);
  1675. return "Saved";
  1676. });
  1677. registerCheat('fix_write', function(params) {
  1678. this["com.stencyl.Engine"].engine.setGameAttribute(params[0], fixobj);
  1679. return "Writen";
  1680. });
  1681. // A highly dangerous function that lets you manually change in-game variables, like:
  1682. // > chng bEngine.getGameAttribute("QuestComplete").h["Secretkeeper1"]=1
  1683. registerCheat('chng', function(params) {
  1684. const bEngine = this["com.stencyl.Engine"].engine;
  1685. const CList = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1686. try{
  1687. eval(params[0]);
  1688. return `${params[0]}`;
  1689. } catch(error){ return `Error: ${err}`; }
  1690. });
  1691.  
  1692. /****************************************************************************************************
  1693. A huge dictionary made for the bulk function:
  1694. Since we'd hardly access this part of the code, it's fine being all the way down here.
  1695. */
  1696. const DictDrops = {
  1697. // 0) Handy cheat items
  1698. default:["Timecandy6","ExpBalloon3","ResetCompleted","ResetCompletedS","ClassSwap"],
  1699. // 1) All bag boosters
  1700. invbag:["InvBag1","InvBag2","InvBag3","InvBag4","InvBag5","InvBag6","InvBag7","InvBag8",//"InvBag9",
  1701. "InvBag21","InvBag22","InvBag23","InvBag24","InvBag25","InvBag26","InvBag100",
  1702. "InvBag101","InvBag102","InvBag103","InvBag104","InvBag105","InvBag106","InvBag107",//"InvBag101",
  1703. "InvBag109","InvBag110"],
  1704. // 2) All storage chest boosters
  1705. invstorage:["InvStorage1","InvStorage2","InvStorage3","InvStorage4","InvStorage5","InvStorage6","InvStorage7",
  1706. "InvStorage8","InvStorage9","InvStorage10","InvStorage11","InvStorage12","InvStorage13",//"InvStorage14",
  1707. "InvStorage15","InvStorage16","InvStorage17","InvStorage18","InvStorage19","InvStorage20","InvStorage21",
  1708. "InvStorage31","InvStorage32","InvStorage33","InvStorage34","InvStorage35","InvStorage36","InvStorage37",
  1709. "InvStorage38","InvStorage39","InvStorage40","InvStorage41","InvStorage42","InvStorageF"],
  1710. // 3) All item bag capacity boosters
  1711. capbag:["MaxCapBagT2","MaxCapBag1","MaxCapBag2","MaxCapBag3","MaxCapBag4","MaxCapBag5",
  1712. "MaxCapBagMi6","MaxCapBagT1","MaxCapBag7","MaxCapBag9","MaxCapBagT3","MaxCapBagT4",
  1713. "MaxCapBagT5","MaxCapBagT6","MaxCapBag6","MaxCapBag8","MaxCapBag10","MaxCapBagF3",
  1714. "MaxCapBagF4","MaxCapBagF5","MaxCapBagF6","MaxCapBagM1","MaxCapBagM2","MaxCapBagM3",
  1715. "MaxCapBagM4","MaxCapBagM5","MaxCapBagM6","MaxCapBagM7","MaxCapBagFi0","MaxCapBagFi1",
  1716. "MaxCapBagFi2","MaxCapBagFi3","MaxCapBagFi4","MaxCapBagFi5","MaxCapBagFi6","MaxCapBagB0",
  1717. "MaxCapBagB1","MaxCapBagB2","MaxCapBagB3","MaxCapBagB4","MaxCapBagB5","MaxCapBagB6",
  1718. "MaxCapBagTr0","MaxCapBagTr1","MaxCapBagTr2","MaxCapBagTr3","MaxCapBagTr4","MaxCapBagTr5",
  1719. "MaxCapBagS0","MaxCapBagS1","MaxCapBagS2","MaxCapBagS3","MaxCapBagS4","MaxCapBagS5"],
  1720. // 4) All Yugioh cards
  1721. yugioh:["CardsA0","CardsA1","CardsA2","CardsA3","CardsA4","CardsA5","CardsA6","CardsA7","CardsA8",
  1722. "CardsA9","CardsA10","CardsA11","CardsA12","CardsA13","CardsA14","CardsA15","CardsA16",
  1723. "CardsB1","CardsB2","CardsB3","CardsB4","CardsB5","CardsB6","CardsB7","CardsB8",
  1724. "CardsB9","CardsB10","CardsB11","CardsB12","CardsB13","CardsB14",
  1725. "CardsC1","CardsC2","CardsC3","CardsC4","CardsC5","CardsC6","CardsC7","CardsC8",
  1726. "CardsC9","CardsC10","CardsC11","CardsC12","CardsC13","CardsC14","CardsC15","CardsC16",
  1727. "CardsD1","CardsD2","CardsD3","CardsD4","CardsD5","CardsD6","CardsD7","CardsD8","CardsD9","CardsD10",
  1728. "CardsD11","CardsD12","CardsD13","CardsD16","CardsD17","CardsD18","CardsD19","CardsD20","CardsD21",
  1729. "CardsE0","CardsE1","CardsE2","CardsE3","CardsE4","CardsE5","CardsE6","CardsE7","CardsE8",
  1730. "CardsE9","CardsE10","CardsE11","CardsE12","CardsE13","CardsE14","CardsE15",
  1731. "CardsF1","CardsF2","CardsF3","CardsF4","CardsF5","CardsF6","CardsF7","CardsF8","CardsF9","CardsF10","CardsF11",
  1732. "CardsY0","CardsY1","CardsY2","CardsY3","CardsY4","CardsY5","CardsY5","CardsY6",
  1733. "CardsY7","CardsY8","CardsY9","CardsY10","CardsY11","CardsY12","CardsY13",
  1734. "CardsZ0","CardsZ1","CardsZ2","CardsZ3","CardsZ4","CardsZ5","CardsZ6","CardsZ7","CardsZ8","CardsZ9"],
  1735. // 5) All statues
  1736. statues:["EquipmentStatues1","EquipmentStatues2","EquipmentStatues3","EquipmentStatues4","EquipmentStatues5",
  1737. "EquipmentStatues6","EquipmentStatues7","EquipmentStatues8","EquipmentStatues9","EquipmentStatues10",
  1738. "EquipmentStatues11","EquipmentStatues12","EquipmentStatues13","EquipmentStatues14","EquipmentStatues15",
  1739. "EquipmentStatues16","EquipmentStatues17","EquipmentStatues18","EquipmentStatues19"],
  1740. // 6) All stamps (Many stamps aren't released yet)
  1741. stamps:["StampA1","StampA2","StampA3","StampA4","StampA5","StampA6","StampA7","StampA8","StampA9","StampA10",
  1742. "StampA11","StampA12","StampA13","StampA14","StampA15","StampA16","StampA17","StampA18","StampA19",
  1743. "StampA20","StampA21"/*,"StampA22"*/,"StampA23","StampA24"/*,"StampA25"*/,"StampA26","StampA27","StampA28",
  1744. //"StampA29","StampA30","StampA31","StampA32","StampA33","StampA34","StampA35",
  1745. "StampB1","StampB2","StampB3","StampB4","StampB5","StampB6","StampB7","StampB8","StampB9","StampB10",
  1746. "StampB11","StampB12","StampB13","StampB14","StampB15","StampB16","StampB17","StampB18","StampB19",
  1747. "StampB20","StampB21","StampB22","StampB23","StampB24","StampB25","StampB26","StampB27",//"StampB28","StampB29",
  1748. "StampB30","StampB31"/*,"StampB32","StampB33"*/,"StampB34"/*,"StampB35"*/,"StampB36",
  1749. "StampC1","StampC2","StampC3"/*,"StampC4","StampC5"*/,"StampC6","StampC7"/*,"StampC8"*/,"StampC9",//"StampC10","StampC11","StampC12","StampC13",
  1750. "StampC14","StampC15"/*,"StampC16","StampC17","StampC18"*/,"StampC19","StampC20"],
  1751. // 7) All fishing tools
  1752. fishtools:["Line1","Line2","Line3","Line4","Line5","Line6","Line7",
  1753. "Line8","Line9","Line10","Line11","Line12","Line13","Line14",
  1754. "Weight1","Weight2","Weight3","Weight4","Weight5","Weight6","Weight7",
  1755. "Weight8","Weight9","Weight10","Weight11","Weight12","Weight13","Weight14"],
  1756. // 8) All released Star Talent books
  1757. startalents:[
  1758. //"3615100", //Bored To Death (Lvl 100)
  1759. "361650", //Beginner Best Class (Lvl 50)
  1760. //"3617100", //Studious Quester (Lvl 100)
  1761. "3618100", //Quest Chungus (Lvl 100)
  1762. "3619100", //Crystals 4 Dayys (Lvl 100)
  1763. "362050", //Will Of The Eldest (Lvl 50)
  1764. "3621104", //TICK TOCK (Lvl 104)
  1765. "3622100", //STONKS! (Lvl 100)
  1766. "3623100", //Roll Da Dice (Lvl 100)
  1767. "362450", //Attacks on simmer (Lvl 50)
  1768. "3625120", //Toilet Paper Postage (Lvl 120)
  1769. "362640", //Exp Converter (Lvl 40)
  1770. "362750", //Goblet Of Hemoglobin (Lvl 50)
  1771. "3628100", //JUST EXP (Lvl 100)
  1772. "3629100", //Frothy Malk (Lvl 100)
  1773. "363050", //Convert Better Darnit (Lvl 50)
  1774. "3631100", //PULSATION (Lvl 100)
  1775. "3632100", //CARDIOVASCULAR! (Lvl 100)
  1776. //"3633100", //Nothing
  1777. "363450", //Telekinetic Storage (Lvl 50)
  1778. "3635100", //Printer Sampling (Lvl 100)
  1779. "3639100", //Shrine Architect (Lvl 100)
  1780. ],
  1781. // 9) Blacksmith recipes and tabs
  1782. smith:["EquipmentSmithingTabs3","SmithingHammerChisel","SmithingHammerChisel2"],
  1783. // 10) All skilling resources
  1784. skill:["Copper","Iron","Gold","Plat","Dementia","Void","Lustre","Starfire","Dreadlo","Godshard",
  1785. "CopperBar","IronBar","GoldBar","PlatBar","DementiaBar","VoidBar","LustreBar","StarfireBar","DreadloBar","GodshardBar",
  1786. "OakTree","BirchTree","JungleTree","ForestTree","ToiletTree","PalmTree","StumpTree","SaharanFoal","Tree7",
  1787. "Leaf1","Leaf2","Leaf3",
  1788. "Fish1","Fish2","Fish3","Fish4",
  1789. "Bug1","Bug2","Bug3","Bug4","Bug5","Bug6","PureWater",
  1790. "Critter1","Critter2","Critter3","Critter4","Critter5","Critter6","Critter7","Critter8","Critter9",
  1791. "Critter1A","Critter2A","Critter3A","Critter4A","Critter5A","Critter6A","Critter7A","Critter8A","Critter9A",
  1792. "Soul1","Soul2","Soul3","Soul4","Soul5",
  1793. "Soul6","Refinery1","Refinery2","Refinery3","Refinery4","Refinery5","Refinery6",
  1794. "CraftMat1","CraftMat2","CraftMat3"/*,"CraftMat4"*/,"CraftMat5","CraftMat6","CraftMat7","CraftMat8","CraftMat9","CraftMat10"],
  1795. // 11) All monster resources
  1796. monster:["Grasslands1","Grasslands2","Grasslands3","Grasslands4","Jungle1","Jungle2","Jungle3","Forest1","Forest2","Forest3",
  1797. "Sewers1","Sewers1b","Sewers2","Sewers3","TreeInterior1","TreeInterior1b","TreeInterior2","BabaYagaETC",
  1798. "DesertA1","DesertA1b","DesertA2","DesertA3","DesertA3b","DesertB1","DesertB2","DesertB3","DesertB4",
  1799. "DesertC1","DesertC2","DesertC2b","DesertC3","DesertC4","SnowA1","SnowA2","SnowA2a","SnowA3","SnowA4",
  1800. "SnowB1","SnowB2","SnowB2a","SnowB5","SnowB3","SnowB4","SnowC1","SnowC2","SnowC3","SnowC4","SnowC4a",
  1801. "IceMountains2","Hgg","EfauntDrop1","EfauntDrop2"],
  1802. // 12) Most (not all) currencies and gift items
  1803. currency:["Key1","Key2","Key3","SilverPen","PremiumGem",//"DeliveryBox",
  1804. "Quest30","Quest35","Quest36","Quest38","Quest40","Quest42","Quest44","Quest45","Quest49","Quest50"],
  1805. // 13) Best food
  1806. food:["PeanutG","FoodG1","FoodG2","FoodG3","FoodG4","FoodG5","FoodG6","Meatloaf","MidnightCookie",
  1807. "FoodPotOr3","FoodPotRe3","FoodPotGr3","FoodPotMana3","FoodPotYe3"],
  1808. // 14) All trophies
  1809. trophy:["Trophy1","Trophy2","Trophy3"/*,"Trophy4"*/,
  1810. "Trophy5","Trophy6","Trophy7","Trophy8","Trophy9","Trophy10",
  1811. "Trophy11","Trophy12","Trophy13","Trophy14"],
  1812. // 15) All upgrade stones (except lvl 1 and 2 cause 3 exists)
  1813. upstone:["StoneWe","StoneWeb","StoneW3","StoneW6",
  1814. "StoneA1b","StoneA2b","StoneA3b","StoneA3","StoneAe","StoneAeB",
  1815. "StoneHelm1","StoneHelm6","StoneHelm1b",
  1816. "StoneTe","StoneT1e","StoneT1eb","StoneT3",
  1817. "StoneZ2",
  1818. "StonePremSTR","StonePremAGI","StonePremWIS","StonePremLUK"],
  1819. // 16) All premium hats
  1820. phats:["EquipmentHats31","EquipmentHats32","EquipmentHats33","EquipmentHats34","EquipmentHats35",
  1821. "EquipmentHats36","EquipmentHats40","EquipmentHats37","EquipmentHats38","EquipmentHats46",
  1822. "EquipmentHats47","EquipmentHats48","EquipmentHats49","EquipmentHats50","EquipmentHats43",
  1823. "EquipmentHats45","EquipmentHats57","EquipmentHats62"],
  1824. // 17) High level Gear
  1825. gear:["EquipmentHats60","EquipmentShirts28","EquipmentShirts29","EquipmentShirts30","EquipmentPants21",
  1826. "EquipmentShoes22","EquipmentPendant14","EquipmentPendant17","EquipmentRings16","EquipmentRings16",
  1827. "EquipmentRings6","EquipmentRings6","EquipmentTools11","EquipmentTools7","EquipmentToolsHatchet5",
  1828. "EquipmentToolsHatchet7","CatchingNet7","CatchingNet6","FishingRod6","FishingRod7",
  1829. "EquipmentSword3","EquipmentBows8","EquipmentWands7","EquipmentPunching5",
  1830. "EquipmentHats58","EquipmentHats59","TrapBoxSet5","WorshipSkull5"],
  1831. // 18) Cheat equipments (Some unreleased items which will definitely shadow ban you)
  1832. cheat:["EquipmentWeapons2","TestObj16","EquipmentRings8","EquipmentPendant8","EquipmentShoes12","EquipmentPants13","EquipmentShirts8"]
  1833. };
  1834. /****************************************************************************************************
  1835. This function is made to simplify some code, basically a bit of elementary programming.
  1836. The arguments are as followed:
  1837. bEng = Engine input: Not very elegant, but it works for until I have more JavaScript experience.
  1838. dim = Amount of dimensions, can take values 2 to 4 (at 1D there's no reason for such complexity)
  1839. KeyName = The respecitve key inside GameAttribute Customlist that we want to iterate
  1840. repl = The replacement value
  1841. elem = List of Array indices, which elements we want replaced
  1842. */
  1843. function ChangeND(bEng, dim, KeyName, repl, elem){
  1844. let NDArr;
  1845. if(typeof KeyName === "string") // Creates a deep-copy
  1846. NDArr = JSON.parse(JSON.stringify(bEng.getGameAttribute("CustomLists").h[KeyName]));
  1847. else NDArr = KeyName; // Else this KeyName parameter is an object
  1848. if(dim === 4){
  1849. for(const [index1, element1] of Object.entries(NDArr)){
  1850. for(const [index2, element2] of Object.entries(element1)){
  1851. for(const [index3, element3] of Object.entries(element2)){
  1852. for(i in elem) element3[elem[i]] = repl; // Fill every
  1853. NDArr[index1][index2][index3] = element3; // Write back to the 4D Array
  1854. }
  1855. }
  1856. }
  1857. } else if(dim === 3){
  1858. for(const [index1, element1] of Object.entries(NDArr)){
  1859. for(const [index2, element2] of Object.entries(element1)){
  1860. for(i in elem) element2[elem[i]] = repl;
  1861. NDArr[index1][index2] = element2; // Write back to the 3D Array
  1862. }
  1863. }
  1864. } else if(dim === 2){
  1865. for(const [index1, element1] of Object.entries(NDArr)){
  1866. for(i in elem) element1[elem[i]] = repl;
  1867. NDArr[index1] = element1; // Write back to the 2D Array
  1868. }
  1869. } else return NDArr; // Else return the original without modifications
  1870. return NDArr;
  1871. } // This function's even less likely to ever be revisited, so it's nice here
  1872. /****************************************************************************************************
  1873. The help function for gga/ggk
  1874. */
  1875. function gg_func(Params, which, bEngine){
  1876. const foundVals = [];
  1877. try{
  1878. let gga = bEngine.gameAttributes.h;
  1879. let eva_gga; let obj_gga;
  1880. if(Params.length > 0){
  1881. gga = bEngine.getGameAttribute(Params[0]);
  1882. if("h" in gga) gga = bEngine.getGameAttribute(Params[0]).h; // Some attributes may not have a .h
  1883. }
  1884. switch(Params.length) {
  1885. case 2:
  1886. eva_gga = gga[Params[1]];
  1887. break;
  1888. case 3:
  1889. eva_gga = gga[Params[1]][Params[2]];
  1890. break;
  1891. case 4:
  1892. eva_gga = gga[Params[1]][Params[2]][Params[3]];
  1893. break;
  1894. case 5:
  1895. eva_gga = gga[Params[1]][Params[2]][Params[3]][Params[4]];
  1896. break;
  1897. default: // For every other length goes this
  1898. eva_gga = gga;
  1899. break;
  1900. }
  1901. obj_gga = Object.entries(eva_gga);
  1902. if(typeof obj_gga == "string" || obj_gga.length == 0){
  1903. if(which == 0) foundVals.push(`${eva_gga}`);
  1904. else foundVals.push(`Non iterable value: ${eva_gga}`);
  1905. } else for(const [index,element] of obj_gga){
  1906. if(which == 0) foundVals.push(`${index}, ${element}`); // This one's for gga
  1907. else foundVals.push(`${index}`); // This one's for ggk
  1908. }
  1909. return foundVals.join("\n");
  1910. } catch(error){
  1911. if(error instanceof TypeError) return `This TypeError should appear if you gave a non-existing key.`;
  1912. return `Error: ${err}`;
  1913. }
  1914. }
  1915. /* Credit section:
  1916.  
  1917. iBelg
  1918. User profile: https://fearlessrevolution.com/memberlist.php?mode=viewprofile&u=45315
  1919. Tool release: https://fearlessrevolution.com/viewtopic.php?p=199352#p199352
  1920. > The creator of the console injection, designer of the cheats syntax as well as many cheats
  1921.  
  1922. salmon85
  1923. User profile: https://fearlessrevolution.com/memberlist.php?mode=viewprofile&u=80266
  1924. > Wipe inv, wipe forge and class lvl command
  1925.  
  1926. Creater0822
  1927. User profile: https://fearlessrevolution.com/memberlist.php?mode=viewprofile&u=10529
  1928. Google Drive: https://drive.google.com/drive/folders/1MyEkO0uNEpGx1VctMEKZ5sQiNzuSZv36?usp=sharing
  1929. > For the remaining commands
  1930. */
  1931.  
  1932. /* Help & troubleshoot section:
  1933.  
  1934. How to use:
  1935. > Place iBelg's injecting tool and this script inside the game's root folder and execute the tool (not the game)
  1936. > To close the game, you have to close the NodeJS console.
  1937.  
  1938. The tool closes itself instantly after execution?!?!
  1939. The error shows things like: UnhandledPromiseRejectionWarning: Error: No inspectable targets
  1940. > You probably forgot to have the Steam client launched in the background.
  1941.  
  1942. The game is has been loaded, but the console doesn't load.
  1943. > There could be multiple sessions running.
  1944. > If you rapidly re-start the injected game after closing it, the previous process may not be killed yet.
  1945. */
  1946.  
  1947. /* Depreciated unique cheats:
  1948. // A non-proxy cheat that nullifies boost food consumption and health food cooldown.
  1949. if (params && params[0] === 'food') {
  1950. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1951. for( const [index, element] of Object.entries(itemDefs))
  1952. if(element.h["typeGen"] === "cFood") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Cooldown"] = 0;
  1953. return `Boost food is never consumed and consumption cooldown on health food is nullified.`;
  1954. }
  1955. */