├── .gitignore ├── LICENSE ├── README.md ├── Ryujinx ├── BDSP_RNG (v1.1.1)_Ryujinx.lua ├── BDSP_RNG (v1.1.2)_Ryujinx.lua ├── BDSP_RNG (v1.1.3)_Ryujinx.lua ├── BDSP_RNG (v1.2.0)_Ryujinx.lua └── BDSP_RNG (v1.3.0)_Ryujinx.lua └── yuzu ├── BDSP_RNG (v1.1.1)_yuzu.lua ├── BDSP_RNG (v1.1.2)_yuzu.lua ├── BDSP_RNG (v1.1.3)_yuzu.lua ├── BDSP_RNG (v1.2.0)_yuzu.lua └── BDSP_RNG (v1.3.0)_yuzu.lua /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Lua sources 2 | luac.out 3 | 4 | # luarocks build files 5 | *.src.rock 6 | *.zip 7 | *.tar.gz 8 | 9 | # Object files 10 | *.o 11 | *.os 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | *.def 26 | *.exp 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BDSP-CheatEngine-Lua 2 | Lua script for RNG abusing in Pokémon Brilliant Diamond and Shining Pearl on Yuzu/Ryujinx emulator via Cheat Engine! 3 | 4 | ![Cleffa](https://user-images.githubusercontent.com/20956021/145038320-37ae9125-aa91-4ebe-9d3a-687d8043e589.png) 5 | 6 | ## Features 7 | * Rng info checking 8 | * Trainer info checking 9 | * Wild Pokemon info checking 10 | * Breeding info checking 11 | * Roamer Pokemon info checking 12 | * Party Pokemon info checking 13 | * Box Pokemon info checking 14 | 15 | ## Requirements 16 | * [Cheat Engine](https://www.cheatengine.org/downloads.php) 17 | * [Yuzu](https://yuzu-emu.org/downloads/)/[Ryujinx](https://ryujinx.org/download) 18 | * Updated game to version 1.1.1+ 19 | 20 | ## Usage 21 | 1) Open Yuzu/Ryujinx, run the game and pause it at the title screen 22 | 2) Open Cheat Engine, click on `Edit > Settings`, select `Scan Settings` and check `MEM_MAPPED` option 23 | 3) Click on `File > Open Process` and select Yuzu/Ryujinx process (Yuzu will look like `xxxx-yuzu xxx | game name`, Ryujinx will look like `xxxx-Ryujinx x.x.xxxx - game name`) 24 | 4) Click on `Table > Show Cheat Table Lua Script`. A new window called `Lua Script: Cheat Table` will appear 25 | 5) Open `BDSP_RNG (v1.x.x).lua` with a text editor, copy all its content and paste it in the window opened before 26 | 6) Click `Execute Script`. It will freeze for some seconds, just wait until all the rng info will be printed in a new window 27 | 28 | ## Notes 29 | * To change the info view tab mode, press the keys shown in the script output 30 | * If you want to stop the script, press keyboard key 0 or keyboard key NumPad 0. It won't stop otherwhise 31 | * If you want to restart the game, do what's written above and then restart the game and the script. It won't work otherwhise 32 | * To avoid text flickering, be sure to enlarge enough the `Lua Engine` window 33 | 34 | ## Credits: 35 | * [Cheat Engine](https://github.com/cheat-engine/cheat-engine) devs 36 | * [Yuzu](https://github.com/yuzu-emu/yuzu)/[Ryujinx](https://github.com/Ryujinx/Ryujinx) devs 37 | * [zaksabeast](https://github.com/zaksabeast) for the research and for his great Rng Switch tool [CaptureSight](https://github.com/zaksabeast/CaptureSight/) (part of the code is taken from there) 38 | * [Admiral-Fish](https://github.com/Admiral-Fish) for the research and for his great app [PokeFinder](https://github.com/Admiral-Fish/PokeFinder) always up to date 39 | * [SteveCookTU](https://github.com/SteveCookTU) for the research and for dumping Items, Moves and Abilities tables 40 | * [SciresM](https://github.com/SciresM), [Kaphotics](https://github.com/kwsch) and all the other Pokemon researchers! 41 | -------------------------------------------------------------------------------- /yuzu/BDSP_RNG (v1.1.2)_yuzu.lua: -------------------------------------------------------------------------------- 1 | -- Various variables 2 | local stateSizeMode = {"u32", "u64"} 3 | local stateSizeModeIndex = 1 4 | local viewMode = {"Wild", "Breeding", "Roamer", "Party", "Box"} 5 | local viewModeIndex = 1 6 | local prevKeyPressed = false 7 | local slotIndex = 0 8 | local boxNumberIndex = 0 9 | 10 | 11 | 12 | -- Find game Base address and Main address 13 | local mainAddr 14 | local baseAddr 15 | 16 | do 17 | local seedAddressScan = createMemScan() 18 | local foundList = createFoundList(seedAddressScan) 19 | seedAddressScan.firstScan(soExactValue, vtQword, 0, "04B2A61830444F4D", "", 0, 0x7FFFFFFFFFFF, 20 | "", fsmNotAligned, nil, true, false, false, false) 21 | seedAddressScan.waitTillDone() 22 | foundList.initialize() 23 | 24 | mainAddr = tonumber(foundList.Address[1], 16) - 0x8 25 | baseAddr = mainAddr - 0x80004000 26 | 27 | foundList.destroy() 28 | seedAddressScan.destroy() 29 | end 30 | 31 | 32 | 33 | -- Set addresses 34 | local function getPlayerPrefsProviderAddr() 35 | local playerPrefsProviderInstanceAddr = readQword(mainAddr + 0x4E60170) 36 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0x18) 37 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0xC0) 38 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0x28) 39 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0xB8) 40 | 41 | return readQword(playerPrefsProviderInstanceAddr + baseAddr) 42 | end 43 | 44 | local stateAddr = readQword(mainAddr + 0x4F8CCD0) + baseAddr 45 | local playerPrefsProviderAddr = getPlayerPrefsProviderAddr() 46 | local IDsAddr = playerPrefsProviderAddr + baseAddr + 0xE8 47 | local isEggReadyFlagAddr = playerPrefsProviderAddr + baseAddr + 0x458 48 | local eggSeedAddr = isEggReadyFlagAddr + 0x8 49 | local eggStepsCounterAddr = eggSeedAddr + 0x8 50 | 51 | 52 | 53 | -- Set trainer info 54 | local TID = bAnd(readInteger(IDsAddr), 0xFFFF) 55 | local SID = bShr(readInteger(IDsAddr), 16) 56 | local G8TID = bAnd(bShl(SID, 16) | TID, 0xFFFFFFFF) % 1000000 57 | local TSV = bShr((TID ~ SID), 4) 58 | 59 | 60 | 61 | -- XorShift class 62 | XorShift = {} 63 | XorShift.__index = XorShift 64 | 65 | function XorShift.new(s0, s1, s2, s3) 66 | local o = setmetatable({}, XorShift) 67 | o.initS0 = s0 68 | o.initS1 = s1 69 | o.initS2 = s2 70 | o.initS3 = s3 71 | 72 | o.currS0 = s0 73 | o.currS1 = s1 74 | o.currS2 = s2 75 | o.currS3 = s3 76 | 77 | o.advances = 0 78 | 79 | return o 80 | end 81 | 82 | function XorShift:next() 83 | local t = self.currS0 84 | local s = self.currS3 85 | 86 | t = t ~ bAnd(bShl(t, 11), 0xFFFFFFFF) 87 | t = t ~ bShr(t, 8) 88 | t = t ~ (s ~ bShr(s, 19)) 89 | 90 | self.currS0 = self.currS1 91 | self.currS1 = self.currS2 92 | self.currS2 = self.currS3 93 | self.currS3 = t 94 | self.advances = self.advances + 1 95 | 96 | return bAnd(((t % 0xFFFFFFFF) + 0x80000000), 0xFFFFFFFF) 97 | end 98 | 99 | function XorShift:print() 100 | print(string.format("State size: %s\t(Change state size pressing keyboard key 3 or 6)\n", stateSizeMode[stateSizeModeIndex])) 101 | 102 | if stateSizeMode[stateSizeModeIndex] == "u32" then 103 | print(string.format("Initial Seed:\nS[0]: %08X S[1]: %08X\nS[2]: %08X S[3]: %08X\n", self.initS0, self.initS1, self.initS2, self.initS3)) 104 | print(string.format("Current Seed:\nS[0]: %08X S[1]: %08X\nS[2]: %08X S[3]: %08X\n", self.currS0, self.currS1, self.currS2, self.currS3)) 105 | else 106 | print(string.format("Initial Seed:\nS[0]: %08X%08X S[1]: %08X%08X\n", self.initS0, self.initS1, self.initS2, self.initS3)) 107 | print(string.format("Current Seed:\nS[0]: %08X%08X S[1]: %08X%08X\n", self.currS0, self.currS1, self.currS2, self.currS3)) 108 | end 109 | 110 | print(string.format("Advances: %d\n\n", self.advances)) 111 | end 112 | 113 | local initRNG = XorShift.new(readInteger(stateAddr), readInteger(stateAddr + 0x4), readInteger(stateAddr + 0x8), readInteger(stateAddr + 0xC)) 114 | 115 | 116 | 117 | -- XoroShiro128Plus class 118 | local ulongMask = 0xFFFFFFFFFFFFFFFF 119 | 120 | XoroShiro128Plus = {} 121 | XoroShiro128Plus.__index = XoroShiro128Plus 122 | 123 | function XoroShiro128Plus.new(seed) 124 | local o = setmetatable({}, XoroShiro128Plus) 125 | 126 | local _seed1 = bAnd((seed - 0x61C8864680B583EB), ulongMask) 127 | local _seed2 = bAnd((seed + 0x3C6EF372FE94F82A), ulongMask) 128 | _seed1 = bAnd((0xBF58476D1CE4E5B9 * (_seed1 ~ bShr(_seed1, 30))), ulongMask) 129 | _seed2 = bAnd((0xBF58476D1CE4E5B9 * (_seed2 ~ bShr(_seed2, 30))), ulongMask) 130 | _seed1 = bAnd((0x94D049BB133111EB * (_seed1 ~ bShr(_seed1, 27))), ulongMask) 131 | _seed2 = bAnd((0x94D049BB133111EB * (_seed2 ~ bShr(_seed2, 27))), ulongMask) 132 | 133 | o.seed1 = _seed1 ~ bShr(_seed1, 31) 134 | o.seed2 = _seed2 ~ bShr(_seed2, 31) 135 | 136 | return o 137 | end 138 | 139 | function XoroShiro128Plus:rotl(x, k) 140 | return bAnd(bOr(bShl(x, k), bShr(x, (64 - k))), ulongMask) 141 | end 142 | 143 | function XoroShiro128Plus:next() 144 | local s0 = self.seed1 145 | local s1 = self.seed2 146 | local result = bAnd((s0 + s1), ulongMask) 147 | s1 = s1 ~ s0 148 | self.seed1 = self:rotl(s0, 24) ~ s1 ~ bAnd(bShl(s1, 16), ulongMask) 149 | self.seed2 = self:rotl(s1, 37) 150 | 151 | return bShr(result, 32) 152 | end 153 | 154 | function XoroShiro128Plus:quickrand1(mask) 155 | return self:next() % mask 156 | end 157 | 158 | function XoroShiro128Plus:quickrand2(mask) 159 | return bAnd(self:next(), mask) 160 | end 161 | 162 | 163 | 164 | -- PK8 class 165 | local natureNamesList = { 166 | "Hardy", "Lonely", "Brave", "Adamant", "Naughty", 167 | "Bold", "Docile", "Relaxed", "Impish", "Lax", 168 | "Timid", "Hasty", "Serious", "Jolly", "Naive", 169 | "Modest", "Mild", "Quiet", "Bashful", "Rash", 170 | "Calm", "Gentle", "Sassy", "Careful", "Quirky"} 171 | 172 | local speciesNamesList = { 173 | "None", 174 | -- Gen 1 175 | "Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", 176 | "Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata", 177 | "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran♀", 178 | "Nidorina", "Nidoqueen", "Nidoran♂", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales", 179 | "Jigglypuff", "Wigglytuff", "Zubat", "Golbat", "Oddish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", 180 | "Venomoth", "Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", 181 | "Arcanine", "Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", 182 | "Bellsprout", "Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", 183 | "Rapidash", "Slowpoke", "Slowbro", "Magnemite", "Magneton", "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", 184 | "Grimer", "Muk", "Shellder", "Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", 185 | "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", 186 | "Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", 187 | "Goldeen", "Seaking", "Staryu", "Starmie", "Mr. Mime", "Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", 188 | "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", 189 | "Kabuto", "Kabutops", "Aerodactyl", "Snorlax", "Articuno", "Zapdos", "Moltres", "Dratini", "Dragonair", "Dragonite", 190 | "Mewtwo", "Mew", 191 | -- Gen 2 192 | "Chikorita", "Bayleef", "Meganium", "Cyndaquil", "Quilava", "Typhlosion", "Totodile", "Croconaw", "Feraligatr", 193 | "Sentret", "Furret", "Hoothoot", "Noctowl", "Ledyba", "Ledian", "Spinarak", "Ariados", "Crobat", "Chinchou", "Lanturn", 194 | "Pichu", "Cleffa", "Igglybuff", "Togepi", "Togetic", "Natu", "Xatu", "Mareep", "Flaaffy", "Ampharos", "Bellossom", 195 | "Marill", "Azumarill", "Sudowoodo", "Politoed", "Hoppip", "Skiploom", "Jumpluff", "Aipom", "Sunkern", "Sunflora", 196 | "Yanma", "Wooper", "Quagsire", "Espeon", "Umbreon", "Murkrow", "Slowking", "Misdreavus", "Unown", "Wobbuffet", 197 | "Girafarig", "Pineco", "Forretress", "Dunsparce", "Gligar", "Steelix", "Snubbull", "Granbull", "Qwilfish", "Scizor", 198 | "Shuckle", "Heracross", "Sneasel", "Teddiursa", "Ursaring", "Slugma", "Magcargo", "Swinub", "Piloswine", "Corsola", 199 | "Remoraid", "Octillery", "Delibird", "Mantine", "Skarmory", "Houndour", "Houndoom", "Kingdra", "Phanpy", "Donphan", 200 | "Porygon2", "Stantler", "Smeargle", "Tyrogue", "Hitmontop", "Smoochum", "Elekid", "Magby", "Miltank", "Blissey", 201 | "Raikou", "Entei", "Suicune", "Larvitar", "Pupitar", "Tyranitar", "Lugia", "Ho-Oh", "Celebi", 202 | -- Gen 3 203 | "Treecko", "Grovyle", "Sceptile", "Torchic", "Combusken", "Blaziken", "Mudkip", "Marshtomp", "Swampert", "Poochyena", 204 | "Mightyena", "Zigzagoon", "Linoone", "Wurmple", "Silcoon", "Beautifly", "Cascoon", "Dustox", "Lotad", "Lombre", "Ludicolo", 205 | "Seedot", "Nuzleaf", "Shiftry", "Taillow", "Swellow", "Wingull", "Pelipper", "Ralts", "Kirlia", "Gardevoir", "Surskit", 206 | "Masquerain", "Shroomish", "Breloom", "Slakoth", "Vigoroth", "Slaking", "Nincada", "Ninjask", "Shedinja", "Whismur", 207 | "Loudred", "Exploud", "Makuhita", "Hariyama", "Azurill", "Nosepass", "Skitty", "Delcatty", "Sableye", "Mawile", "Aron", 208 | "Lairon", "Aggron", "Meditite", "Medicham", "Electrike", "Manectric", "Plusle", "Minun", "Volbeat", "Illumise", "Roselia", 209 | "Gulpin", "Swalot", "Carvanha", "Sharpedo", "Wailmer", "Wailord", "Numel", "Camerupt", "Torkoal", "Spoink", "Grumpig", 210 | "Spinda", "Trapinch", "Vibrava", "Flygon", "Cacnea", "Cacturne", "Swablu", "Altaria", "Zangoose", "Seviper", "Lunatone", 211 | "Solrock", "Barboach", "Whiscash", "Corphish", "Crawdaunt", "Baltoy", "Claydol", "Lileep", "Cradily", "Anorith", "Armaldo", 212 | "Feebas", "Milotic", "Castform", "Kecleon", "Shuppet", "Banette", "Duskull", "Dusclops", "Tropius", "Chimecho", "Absol", 213 | "Wynaut", "Snorunt", "Glalie", "Spheal", "Sealeo", "Walrein", "Clamperl", "Huntail", "Gorebyss", "Relicanth", "Luvdisc", 214 | "Bagon", "Shelgon", "Salamence", "Beldum", "Metang", "Metagross", "Regirock", "Regice", "Registeel", "Latias", "Latios", 215 | "Kyogre", "Groudon", "Rayquaza", "Jirachi", "Deoxys", 216 | -- Gen 4 217 | "Turtwig", "Grotle", "Torterra", "Chimchar", "Monferno", "Infernape", "Piplup", "Prinplup", "Empoleon", "Starly", 218 | "Staravia", "Staraptor", "Bidoof", "Bibarel", "Kricketot", "Kricketune", "Shinx", "Luxio", "Luxray", "Budew", "Roserade", 219 | "Cranidos", "Rampardos", "Shieldon", "Bastiodon", "Burmy", "Wormadam", "Mothim", "Combee", "Vespiquen", "Pachirisu", 220 | "Buizel", "Floatzel", "Cherubi", "Cherrim", "Shellos", "Gastrodon", "Ambipom", "Drifloon", "Drifblim", "Buneary", 221 | "Lopunny", "Mismagius", "Honchkrow", "Glameow", "Purugly", "Chingling", "Stunky", "Skuntank", "Bronzor", "Bronzong", 222 | "Bonsly", "Mime Jr.", "Happiny", "Chatot", "Spiritomb", "Gible", "Gabite", "Garchomp", "Munchlax", "Riolu", "Lucario", 223 | "Hippopotas", "Hippowdon", "Skorupi", "Drapion", "Croagunk", "Toxicroak", "Carnivine", "Finneon", "Lumineon", "Mantyke", 224 | "Snover", "Abomasnow", "Weavile", "Magnezone", "Lickilicky", "Rhyperior", "Tangrowth", "Electivire", "Magmortar", 225 | "Togekiss", "Yanmega", "Leafeon", "Glaceon", "Gliscor", "Mamoswine", "Porygon-Z", "Gallade", "Probopass", "Dusknoir", 226 | "Froslass", "Rotom", "Uxie", "Mesprit", "Azelf", "Dialga", "Palkia", "Heatran", "Regigigas", "Giratina", "Cresselia", 227 | "Phione", "Manaphy", "Darkrai", "Shaymin", "Arceus"} 228 | 229 | local abilityNamesList = { 230 | "--", 231 | -- Gen 3 232 | "Stench", "Drizzle", "Speed Boost", "Battle Armor", "Sturdy", "Damp", "Limber", "Sand Veil", "Static", "Volt Absorb", 233 | "Water Absorb", "Oblivious", "Cloud Nine", "Compound Eyes", "Insomnia", "Color Change", "Immunity", "Flash Fire", "Shield Dust", 234 | "Own Tempo", "Suction Cups", "Intimidate", "Shadow Tag", "Rough Skin", "Wonder Guard", "Levitate", "Effect Spore", "Synchronize", 235 | "Clear Body", "Natural Cure", "Lightning Rod", "Serene Grace", "Swift Swim", "Chlorophyll", "Illuminate", "Trace", "Huge Power", 236 | "Poison Point", "Inner Focus", "Magma Armor", "Water Veil", "Magnet Pull", "Soundproof", "Rain Dish", "Sand Stream", "Pressure", 237 | "Thick Fat", "Early Bird", "Flame Body", "Run Away", "Keen Eye", "Hyper Cutter", "Pickup", "Truant", "Hustle", "Cute Charm", 238 | "Plus", "Minus", "Forecast", "Sticky Hold", "Shed Skin", "Guts", "Marvel Scale", "Liquid Ooze", "Overgrow", "Blaze", "Torrent", 239 | "Swarm", "Rock Head", "Drought", "Arena Trap", "Vital Spirit", "White Smoke", "Pure Power", "Shell Armor", "Air Lock", 240 | -- Gen 4 241 | "Tangled Feet", "Motor Drive", "Rivalry", "Steadfast", "Snow Cloak", 242 | "Gluttony", "Anger Point", "Unburden", "Heatproof", "Simple", "Dry Skin", "Download", "Iron Fist", "Poison Heal", "Adaptability", 243 | "Skill Link", "Hydration", "Solar Power", "Quick Feet", "Normalize", "Sniper", "Magic Guard", "No Guard", "Stall", "Technician", 244 | "Leaf Guard", "Klutz", "Mold Breaker", "Super Luck", "Aftermath", "Anticipation", "Forewarn", "Unaware", "Tinted Lens", "Filter", 245 | "Slow Start", "Scrappy", "Storm Drain", "Ice Body", "Solid Rock", "Snow Warning", "Honey Gather", "Frisk", "Reckless", "Multitype", 246 | "Flower Gift", "Bad Dreams", 247 | -- Gen 5 248 | "Pickpocket", "Sheer Force", "Contrary", "Unnerve", "Defiant", "Defeatist", "Cursed Body", "Healer", "Friend Guard", "Weak Armor", 249 | "Heavy Metal", "Light Metal", "Multiscale", "Toxic Boost", "Flare Boost", "Harvest", "Telepathy", "Moody", "Overcoat", "Poison Touch", 250 | "Regenerator", "Big Pecks", "Sand Rush", "Wonder Skin", "Analytic", "Illusion", "Imposter", "Infiltrator", "Mummy", "Moxie", 251 | "Justified", "Rattled", "Magic Bounce", "Sap Sipper", "Prankster", "Sand Force", "Iron Barbs", "Zen Mode", "Victory Star", 252 | "Turboblaze", "Teravolt", 253 | -- Gen 6 254 | "Aroma Veil", "Flower Veil", "Cheek Pouch", "Protean", "Fur Coat", "Magician", "Bulletproof", "Competitive", "Strong Jaw", 255 | "Refrigerate", "Sweet Veil", "Stance Change", "Gale Wings", "Mega Launcher", "Grass Pelt", "Symbiosis", "Tough Claws", "Pixilate", 256 | "Gooey", "Aerilate", "Parental Bond", "Dark Aura", "Fairy Aura", "Aura Break", "Primordial Sea", "Desolate Land", "Delta Stream", 257 | -- Gen 7 258 | "Stamina", "Wimp Out", "Emergency Exit", "Water Compaction", "Merciless", "Shields Down", "Stakeout", "Water Bubble", 259 | "Steelworker", "Berserk", "Slush Rush", "Long Reach", "Liquid Voice", "Triage", "Galvanize", "Surge Surfer", 260 | "Schooling", "Disguise", "Battle Bond", "Power Construct", "Corrosion", "Comatose", "Queenly Majesty", "Innards Out", 261 | "Dancer", "Battery", "Fluffy", "Dazzling", "Soul-Heart", "Tangling Hair", "Receiver", "Power of Alchemy", 262 | "Beast Boost", "RKS System", "Electric Surge", "Psychic Surge", "Misty Surge", "Grassy Surge", "Full Metal Body", "Shadow Shield", 263 | "Prism Armor", "Neuroforce", 264 | -- Gen 8 265 | "Intrepid Sword", "Dauntless Shield", "Libero", "Ball Fetch", "Cotton Down", "Propeller Tail", "Mirror Armor", "Gulp Missile", 266 | "Stalwart", "Steam Engine", "Punk Rock", "Sand Spit", "Ice Scales", "Ripen", "Ice Face", "Power Spot", "Mimicry", "Screen Cleaner", 267 | "Steely Spirit", "Perish Body", "Wandering Spirit", "Gorilla Tactics", "Neutralizing Gas", "Pastel Veil", "Hunger Switch", 268 | "Quick Draw", "Unseen Fist", "Curious Medicine", "Transistor", "Dragon’s Maw", "Chilling Neigh", "Grim Neigh", "As One", "As One"} 269 | 270 | local moveNamesList = { 271 | -- Gen 1 272 | "--", "Pound", "Karate Chop", "Double Slap", "Comet Punch", "Mega Punch", "Pay Day", "Fire Punch", "Ice Punch", "Thunder Punch", 273 | "Scratch", "Vice Grip", "Guillotine", "Razor Wind", "Swords Dance", "Cut", "Gust", "Wing Attack", "Whirlwind", "Fly", 274 | "Bind", "Slam", "Vine Whip", "Stomp", "Double Kick", "Mega Kick", "Jump Kick", "Rolling Kick", "Sand Attack", "Headbutt", 275 | "Horn Attack", "Fury Attack", "Horn Drill", "Tackle", "Body Slam", "Wrap", "Take Down", "Thrash", "Double-Edge", 276 | "Tail Whip", "Poison Sting", "Twineedle", "Pin Missile", "Leer", "Bite", "Growl", "Roar", "Sing", "Supersonic", "Sonic Boom", 277 | "Disable", "Acid", "Ember", "Flamethrower", "Mist", "Water Gun", "Hydro Pump", "Surf", "Ice Beam", "Blizzard", "Psybeam", 278 | "Bubble Beam", "Aurora Beam", "Hyper Beam", "Peck", "Drill Peck", "Submission", "Low Kick", "Counter", "Seismic Toss", 279 | "Strength", "Absorb", "Mega Drain", "Leech Seed", "Growth", "Razor Leaf", "Solar Beam", "Poison Powder", "Stun Spore", 280 | "Sleep Powder", "Petal Dance", "String Shot", "Dragon Rage", "Fire Spin", "Thunder Shock", "Thunderbolt", "Thunder Wave", 281 | "Thunder", "Rock Throw", "Earthquake", "Fissure", "Dig", "Toxic", "Confusion", "Psychic", "Hypnosis", "Meditate", 282 | "Agility", "Quick Attack", "Rage", "Teleport", "Night Shade", "Mimic", "Screech", "Double Team", "Recover", "Harden", 283 | "Minimize", "Smokescreen", "Confuse Ray", "Withdraw", "Defense Curl", "Barrier", "Light Screen", "Haze", "Reflect", 284 | "Focus Energy", "Bide", "Metronome", "Mirror Move", "Self-Destruct", "Egg Bomb", "Lick", "Smog", "Sludge", "Bone Club", 285 | "Fire Blast", "Waterfall", "Clamp", "Swift", "Skull Bash", "Spike Cannon", "Constrict", "Amnesia", "Kinesis", "Soft-Boiled", 286 | "High Jump Kick", "Glare", "Dream Eater", "Poison Gas", "Barrage", "Leech Life", "Lovely Kiss", "Sky Attack", "Transform", 287 | "Bubble", "Dizzy Punch", "Spore", "Flash", "Psywave", "Splash", "Acid Armor", "Crabhammer", "Explosion", "Fury Swipes", 288 | "Bonemerang", "Rest", "Rock Slide", "Hyper Fang", "Sharpen", "Conversion", "Tri Attack", "Super Fang", "Slash", 289 | "Substitute", "Struggle", 290 | -- Gen 2 291 | "Sketch", "Triple Kick", "Thief", "Spider Web", "Mind Reader", "Nightmare", "Flame Wheel", 292 | "Snore", "Curse", "Flail", "Conversion 2", "Aeroblast", "Cotton Spore", "Reversal", "Spite", "Powder Snow", "Protect", 293 | "Mach Punch", "Scary Face", "Feint Attack", "Sweet Kiss", "Belly Drum", "Sludge Bomb", "Mud-Slap", "Octazooka", "Spikes", 294 | "Zap Cannon", "Foresight", "Destiny Bond", "Perish Song", "Icy Wind", "Detect", "Bone Rush", "Lock-On", "Outrage", 295 | "Sandstorm", "Giga Drain", "Endure", "Charm", "Rollout", "False Swipe", "Swagger", "Milk Drink", "Spark", "Fury Cutter", 296 | "Steel Wing", "Mean Look", "Attract", "Sleep Talk", "Heal Bell", "Return", "Present", "Frustration", "Safeguard", 297 | "Pain Split", "Sacred Fire", "Magnitude", "Dynamic Punch", "Megahorn", "Dragon Breath", "Baton Pass", "Encore", "Pursuit", 298 | "Rapid Spin", "Sweet Scent", "Iron Tail", "Metal Claw", "Vital Throw", "Morning Sun", "Synthesis", "Moonlight", "Hidden Power", 299 | "Cross Chop", "Twister", "Rain Dance", "Sunny Day", "Crunch", "Mirror Coat", "Psych Up", "Extreme Speed", "Ancient Power", 300 | "Shadow Ball", "Future Sight", "Rock Smash", "Whirlpool", "Beat Up", 301 | -- Gen 3 302 | "Fake Out", "Uproar", "Stockpile", "Spit Up", "Swallow", "Heat Wave", "Hail", "Torment", "Flatter", "Will-O-Wisp", "Memento", 303 | "Facade", "Focus Punch", "Smelling Salts", "Follow Me", "Nature Power", "Charge", "Taunt", "Helping Hand", "Trick", "Role Play", 304 | "Wish", "Assist", "Ingrain", "Superpower", "Magic Coat", "Recycle", "Revenge", "Brick Break", "Yawn", "Knock Off", "Endeavor", 305 | "Eruption", "Skill Swap", "Imprison", "Refresh", "Grudge", "Snatch", "Secret Power", "Dive", "Arm Thrust", "Camouflage", 306 | "Tail Glow", "Luster Purge", "Mist Ball", "Feather Dance", "Teeter Dance", "Blaze Kick", "Mud Sport", "Ice Ball", "Needle Arm", 307 | "Slack Off", "Hyper Voice", "Poison Fang", "Crush Claw", "Blast Burn", "Hydro Cannon", "Meteor Mash", "Astonish", "Weather Ball", 308 | "Aromatherapy", "Fake Tears", "Air Cutter", "Overheat", "Odor Sleuth", "Rock Tomb", "Silver Wind", "Metal Sound", 309 | "Grass Whistle", "Tickle", "Cosmic Power", "Water Spout", "Signal Beam", "Shadow Punch", "Extrasensory", "Sky Uppercut", 310 | "Sand Tomb", "Sheer Cold", "Muddy Water", "Bullet Seed", "Aerial Ace", "Icicle Spear", "Iron Defense", "Block", "Howl", 311 | "Dragon Claw", "Frenzy Plant", "Bulk Up", "Bounce", "Mud Shot", "Poison Tail", "Covet", "Volt Tackle", "Magical Leaf", 312 | "Water Sport", "Calm Mind", "Leaf Blade", "Dragon Dance", "Rock Blast", "Shock Wave", "Water Pulse", "Doom Desire", 313 | "Psycho Boost", 314 | -- Gen 4 315 | "Roost", "Gravity", "Miracle Eye", "Wake-Up Slap", "Hammer Arm", "Gyro Ball", "Healing Wish", "Brine", 316 | "Natural Gift", "Feint", "Pluck", "Tailwind", "Acupressure", "Metal Burst", "U-turn", "Close Combat", "Payback", "Assurance", 317 | "Embargo", "Fling", "Psycho Shift", "Trump Card", "Heal Block", "Wring Out", "Power Trick", "Gastro Acid", "Lucky Chant", 318 | "Me First", "Copycat", "Power Swap", "Guard Swap", "Punishment", "Last Resort", "Worry Seed", "Sucker Punch", "Toxic Spikes", 319 | "Heart Swap", "Aqua Ring", "Magnet Rise", "Flare Blitz", "Force Palm", "Aura Sphere", "Rock Polish", "Poison Jab", 320 | "Dark Pulse", "Night Slash", "Aqua Tail", "Seed Bomb", "Air Slash", "X-Scissor", "Bug Buzz", "Dragon Pulse", "Dragon Rush", 321 | "Power Gem", "Drain Punch", "Vacuum Wave", "Focus Blast", "Energy Ball", "Brave Bird", "Earth Power", "Switcheroo", 322 | "Giga Impact", "Nasty Plot", "Bullet Punch", "Avalanche", "Ice Shard", "Shadow Claw", "Thunder Fang", "Ice Fang", "Fire Fang", 323 | "Shadow Sneak", "Mud Bomb", "Psycho Cut", "Zen Headbutt", "Mirror Shot", "Flash Cannon", "Rock Climb", "Defog", 324 | "Trick Room", "Draco Meteor", "Discharge", "Lava Plume", "Leaf Storm", "Power Whip", "Rock Wrecker", "Cross Poison", "Gunk Shot", 325 | "Iron Head", "Magnet Bomb", "Stone Edge", "Captivate", "Stealth Rock", "Grass Knot", "Chatter", "Judgment", "Bug Bite", 326 | "Charge Beam", "Wood Hammer", "Aqua Jet", "Attack Order", "Defend Order", "Heal Order", "Head Smash", "Double Hit", 327 | "Roar of Time", "Spacial Rend", "Lunar Dance", "Crush Grip", "Magma Storm", "Dark Void", "Seed Flare", "Ominous Wind", 328 | "Shadow Force", 329 | -- Gen 5 330 | "Hone Claws", "Wide Guard", "Guard Split", "Power Split", "Wonder Room", "Psyshock", "Venoshock", "Autotomize", "Rage Powder", 331 | "Telekinesis", "Magic Room", "Smack Down", "Storm Throw", "Flame Burst", "Sludge Wave", "Quiver Dance", "Heavy Slam", "Synchronoise", 332 | "Electro Ball", "Soak", "Flame Charge", "Coil", "Low Sweep", "Acid Spray", "Foul Play", "Simple Beam", "Entrainment", "After You", 333 | "Round", "Echoed Voice", "Chip Away", "Clear Smog", "Stored Power", "Quick Guard", "Ally Switch", "Scald", 334 | "Shell Smash", "Heal Pulse", "Hex", "Sky Drop", "Shift Gear", "Circle Throw", "Incinerate", "Quash", 335 | "Acrobatics", "Reflect Type", "Retaliate", "Final Gambit", "Bestow", "Inferno", "Water Pledge", "Fire Pledge", 336 | "Grass Pledge", "Volt Switch", "Struggle Bug", "Bulldoze", "Frost Breath", "Dragon Tail", "Work Up", "Electroweb", 337 | "Wild Charge", "Drill Run", "Dual Chop", "Heart Stamp", "Horn Leech", "Sacred Sword", "Razor Shell", "Heat Crash", 338 | "Leaf Tornado", "Steamroller", "Cotton Guard", "Night Daze", "Psystrike", "Tail Slap", "Hurricane", "Head Charge", 339 | "Gear Grind", "Searing Shot", "Techno Blast", "Relic Song", "Secret Sword", "Glaciate", "Bolt Strike", "Blue Flare", 340 | "Fiery Dance", "Freeze Shock", "Ice Burn", "Snarl", "Icicle Crash", "V-create", "Fusion Flare", "Fusion Bolt", 341 | -- Gen 6 342 | "Flying Press", "Mat Block", "Belch", "Rototiller", "Sticky Web", "Fell Stinger", "Phantom Force", "Trick-or-Treat", 343 | "Noble Roar", "Ion Deluge", "Parabolic Charge", "Forest’s Curse", "Petal Blizzard", "Freeze-Dry", "Disarming Voice", "Parting Shot", 344 | "Topsy-Turvy", "Draining Kiss", "Crafty Shield", "Flower Shield", "Grassy Terrain", "Misty Terrain", "Electrify", "Play Rough", 345 | "Fairy Wind", "Moonblast", "Boomburst", "Fairy Lock", "King’s Shield", "Play Nice", "Confide", "Diamond Storm", 346 | "Steam Eruption", "Hyperspace Hole", "Water Shuriken", "Mystical Fire", "Spiky Shield", "Aromatic Mist", "Eerie Impulse", "Venom Drench", 347 | "Powder", "Geomancy", "Magnetic Flux", "Happy Hour", "Electric Terrain", "Dazzling Gleam", "Celebrate", "Hold Hands", 348 | "Baby-Doll Eyes", "Nuzzle", "Hold Back", "Infestation", "Power-Up Punch", "Oblivion Wing", "Thousand Arrows", "Thousand Waves", 349 | "Land’s Wrath", "Light of Ruin", "Origin Pulse", "Precipice Blades", "Dragon Ascent", "Hyperspace Fury", 350 | -- Gen 7 351 | "Breakneck Blitz", "Breakneck Blitz", "All-Out Pummeling", "All-Out Pummeling", "Supersonic Skystrike", "Supersonic Skystrike", 352 | "Acid Downpour", "Acid Downpour", "Tectonic Rage", "Tectonic Rage", "Continental Crush", "Continental Crush", "Savage Spin-Out", 353 | "Savage Spin-Out", "Never-Ending Nightmare", "Never-Ending Nightmare", "Corkscrew Crash", "Corkscrew Crash", "Inferno Overdrive", 354 | "Inferno Overdrive", "Hydro Vortex", "Hydro Vortex", "Bloom Doom", "Bloom Doom", "Gigavolt Havoc", "Gigavolt Havoc", "Shattered Psyche", 355 | "Shattered Psyche", "Subzero Slammer", "Subzero Slammer", "Devastating Drake", "Devastating Drake", "Black Hole Eclipse", 356 | "Black Hole Eclipse", "Twinkle Tackle", "Twinkle Tackle", "Catastropika", "Shore Up", "First Impression", "Baneful Bunker", 357 | "Spirit Shackle", "Darkest Lariat", "Sparkling Aria", "Ice Hammer", "Floral Healing", "High Horsepower", "Strength Sap", "Solar Blade", 358 | "Leafage", "Spotlight", "Toxic Thread", "Laser Focus", "Gear Up", "Throat Chop", "Pollen Puff", "Anchor Shot", "Psychic Terrain", "Lunge", 359 | "Fire Lash", "Power Trip", "Burn Up", "Speed Swap", "Smart Strike", "Purify", "Revelation Dance", "Core Enforcer", 360 | "Trop Kick", "Instruct", "Beak Blast", "Clanging Scales", "Dragon Hammer", "Brutal Swing", "Aurora Veil", "Sinister Arrow Raid", 361 | "Malicious Moonsault", "Oceanic Operetta", "Guardian of Alola", "Soul-Stealing 7-Star Strike", "Stoked Sparksurfer", "Pulverizing Pancake", 362 | "Extreme Evoboost", "Genesis Supernova", "Shell Trap", "Fleur Cannon", "Psychic Fangs", "Stomping Tantrum", "Shadow Bone", "Accelerock", 363 | "Liquidation", "Prismatic Laser", "Spectral Thief", "Sunsteel Strike", "Moongeist Beam", "Tearful Look", "Zing Zap", "Nature’s Madness", 364 | "Multi-Attack", "10,000,000 Volt Thunderbolt", "Mind Blown", "Plasma Fists", "Photon Geyser", "Light That Burns the Sky", 365 | "Searing Sunraze Smash", "Menacing Moonraze Maelstrom", "Let’s Snuggle Forever", "Splintered Stormshards", "Clangorous Soulblaze", 366 | "Zippy Zap", "Splishy Splash", "Floaty Fall", "Pika Papow", "Bouncy Bubble", "Buzzy Buzz", "Sizzly Slide", "Glitzy Glow", "Baddy Bad", 367 | "Sappy Seed", "Freezy Frost", "Sparkly Swirl", "Veevee Volley", "Double Iron Bash", 368 | -- Gen 8 369 | "Max Guard", "Dynamax Cannon", "Snipe Shot", "Jaw Lock", "Stuff Cheeks", "No Retreat", "Tar Shot", "Magic Powder", "Dragon Darts", 370 | "Teatime", "Octolock", "Bolt Beak", "Fishious Rend", "Court Change", "Max Flare", "Max Flutterby", "Max Lightning", 371 | "Max Strike", "Max Knuckle", "Max Phantasm", "Max Hailstorm", "Max Ooze", "Max Geyser", "Max Airstream", "Max Starfall", 372 | "Max Wyrmwind", "Max Mindstorm", "Max Rockfall", "Max Quake", "Max Darkness", "Max Overgrowth", "Max Steelspike", "Clangorous Soul", 373 | "Body Press", "Decorate", "Drum Beating", "Snap Trap", "Pyro Ball", "Behemoth Blade", "Behemoth Bash", "Aura Wheel", 374 | "Breaking Swipe", "Branch Poke", "Overdrive", "Apple Acid", "Grav Apple", "Spirit Break", "Strange Steam", "Life Dew", 375 | "Obstruct", "False Surrender", "Meteor Assault", "Eternabeam", "Steel Beam", "Expanding Force", "Steel Roller", "Scale Shot", 376 | "Meteor Beam", "Shell Side Arm", "Misty Explosion", "Grassy Glide", "Rising Voltage", "Terrain Pulse", "Skitter Smack", "Burning Jealousy", 377 | "Lash Out", "Poltergeist", "Corrosive Gas", "Coaching", "Flip Turn", "Triple Axel", "Dual Wingbeat", "Scorching Sands", 378 | "Jungle Healing", "Wicked Blow", "Surging Strikes", "Thunder Cage", "Dragon Energy", "Freezing Glare", "Fiery Wrath", "Thunderous Kick", 379 | "Glacial Lance", "Astral Barrage", "Eerie Spell"} 380 | 381 | local itemNamesList = { 382 | "None", "Master Ball", "Ultra Ball", "Great Ball", "Poké Ball", "Safari Ball", "Net Ball", "Dive Ball", 383 | "Nest Ball", "Repeat Ball", "Timer Ball", "Luxury Ball", "Premier Ball", "Dusk Ball", "Heal Ball", "Quick Ball", 384 | "Cherish Ball", "Potion", "Antidote", "Burn Heal", "Ice Heal", "Awakening", "Paralyze Heal", "Full Restore", 385 | "Max Potion", "Hyper Potion", "Super Potion", "Full Heal", "Revive", "Max Revive", "Fresh Water", "Soda Pop", 386 | "Lemonade", "Moomoo Milk", "Energy Powder", "Energy Root", "Heal Powder", "Revival Herb", "Ether", "Max Ether", 387 | "Elixir", "Max Elixir", "Lava Cookie", "Berry Juice", "Sacred Ash", "HP Up", "Protein", "Iron", 388 | "Carbos", "Calcium", "Rare Candy", "PP Up", "Zinc", "PP Max", "Old Gateau", "Guard Spec.", 389 | "Dire Hit", "X Attack", "X Defense", "X Speed", "X Accuracy", "X Sp. Atk", "X Sp. Def", "Poké Doll", 390 | "Fluffy Tail", "Blue Flute", "Yellow Flute", "Red Flute", "Black Flute", "White Flute", "Shoal Salt", "Shoal Shell", 391 | "Red Shard", "Blue Shard", "Yellow Shard", "Green Shard", "Super Repel", "Max Repel", "Escape Rope", "Repel", 392 | "Sun Stone", "Moon Stone", "Fire Stone", "Thunder Stone", "Water Stone", "Leaf Stone", "Tiny Mushroom", "Big Mushroom", 393 | "Pearl", "Big Pearl", "Stardust", "Star Piece", "Nugget", "Heart Scale", "Honey", "Growth Mulch", 394 | "Damp Mulch", "Stable Mulch", "Gooey Mulch", "Root Fossil", "Claw Fossil", "Helix Fossil", "Dome Fossil", "Old Amber", 395 | "Armor Fossil", "Skull Fossil", "Rare Bone", "Shiny Stone", "Dusk Stone", "Dawn Stone", "Oval Stone", "Odd Keystone", 396 | "Griseous Orb", "Tea", "unknown", "Autograph", "Douse Drive", "Shock Drive", "Burn Drive", "Chill Drive", 397 | "unknown", "Pokémon Box Link", "Medicine Pocket", "TM Case", "Candy Jar", "Power-Up Pocket", "Clothing Trunk", "Catching Pocket", 398 | "Battle Pocket", "unknown", "unknown", "unknown", "unknown", "unknown", "Sweet Heart", "Adamant Orb", 399 | "Lustrous Orb", "Greet Mail", "Favored Mail", "RSVP Mail", "Thanks Mail", "Inquiry Mail", "Like Mail", "Reply Mail", 400 | "Bridge Mail S", "Bridge Mail D", "Bridge Mail T", "Bridge Mail V", "Bridge Mail M", "Cheri Berry", "Chesto Berry", "Pecha Berry", 401 | "Rawst Berry", "Aspear Berry", "Leppa Berry", "Oran Berry", "Persim Berry", "Lum Berry", "Sitrus Berry", "Figy Berry", 402 | "Wiki Berry", "Mago Berry", "Aguav Berry", "Iapapa Berry", "Razz Berry", "Bluk Berry", "Nanab Berry", "Wepear Berry", 403 | "Pinap Berry", "Pomeg Berry", "Kelpsy Berry", "Qualot Berry", "Hondew Berry", "Grepa Berry", "Tamato Berry", "Cornn Berry", 404 | "Magost Berry", "Rabuta Berry", "Nomel Berry", "Spelon Berry", "Pamtre Berry", "Watmel Berry", "Durin Berry", "Belue Berry", 405 | "Occa Berry", "Passho Berry", "Wacan Berry", "Rindo Berry", "Yache Berry", "Chople Berry", "Kebia Berry", "Shuca Berry", 406 | "Coba Berry", "Payapa Berry", "Tanga Berry", "Charti Berry", "Kasib Berry", "Haban Berry", "Colbur Berry", "Babiri Berry", 407 | "Chilan Berry", "Liechi Berry", "Ganlon Berry", "Salac Berry", "Petaya Berry", "Apicot Berry", "Lansat Berry", "Starf Berry", 408 | "Enigma Berry", "Micle Berry", "Custap Berry", "Jaboca Berry", "Rowap Berry", "Bright Powder", "White Herb", "Macho Brace", 409 | "Exp. Share", "Quick Claw", "Soothe Bell", "Mental Herb", "Choice Band", "King’s Rock", "Silver Powder", "Amulet Coin", 410 | "Cleanse Tag", "Soul Dew", "Deep Sea Tooth", "Deep Sea Scale", "Smoke Ball", "Everstone", "Focus Band", "Lucky Egg", 411 | "Scope Lens", "Metal Coat", "Leftovers", "Dragon Scale", "Light Ball", "Soft Sand", "Hard Stone", "Miracle Seed", 412 | "Black Glasses", "Black Belt", "Magnet", "Mystic Water", "Sharp Beak", "Poison Barb", "Never-Melt Ice", "Spell Tag", 413 | "Twisted Spoon", "Charcoal", "Dragon Fang", "Silk Scarf", "Upgrade", "Shell Bell", "Sea Incense", "Lax Incense", 414 | "Lucky Punch", "Metal Powder", "Thick Club", "Leek", "Red Scarf", "Blue Scarf", "Pink Scarf", "Green Scarf", 415 | "Yellow Scarf", "Wide Lens", "Muscle Band", "Wise Glasses", "Expert Belt", "Light Clay", "Life Orb", "Power Herb", 416 | "Toxic Orb", "Flame Orb", "Quick Powder", "Focus Sash", "Zoom Lens", "Metronome", "Iron Ball", "Lagging Tail", 417 | "Destiny Knot", "Black Sludge", "Icy Rock", "Smooth Rock", "Heat Rock", "Damp Rock", "Grip Claw", "Choice Scarf", 418 | "Sticky Barb", "Power Bracer", "Power Belt", "Power Lens", "Power Band", "Power Anklet", "Power Weight", "Shed Shell", 419 | "Big Root", "Choice Specs", "Flame Plate", "Splash Plate", "Zap Plate", "Meadow Plate", "Icicle Plate", "Fist Plate", 420 | "Toxic Plate", "Earth Plate", "Sky Plate", "Mind Plate", "Insect Plate", "Stone Plate", "Spooky Plate", "Draco Plate", 421 | "Dread Plate", "Iron Plate", "Odd Incense", "Rock Incense", "Full Incense", "Wave Incense", "Rose Incense", "Luck Incense", 422 | "Pure Incense", "Protector", "Electirizer", "Magmarizer", "Dubious Disc", "Reaper Cloth", "Razor Claw", "Razor Fang", 423 | "TM01", "TM02", "TM03", "TM04", "TM05", "TM06", "TM07", "TM08", 424 | "TM09", "TM10", "TM11", "TM12", "TM13", "TM14", "TM15", "TM16", 425 | "TM17", "TM18", "TM19", "TM20", "TM21", "TM22", "TM23", "TM24", 426 | "TM25", "TM26", "TM27", "TM28", "TM29", "TM30", "TM31", "TM32", 427 | "TM33", "TM34", "TM35", "TM36", "TM37", "TM38", "TM39", "TM40", 428 | "TM41", "TM42", "TM43", "TM44", "TM45", "TM46", "TM47", "TM48", 429 | "TM49", "TM50", "TM51", "TM52", "TM53", "TM54", "TM55", "TM56", 430 | "TM57", "TM58", "TM59", "TM60", "TM61", "TM62", "TM63", "TM64", 431 | "TM65", "TM66", "TM67", "TM68", "TM69", "TM70", "TM71", "TM72", 432 | "TM73", "TM74", "TM75", "TM76", "TM77", "TM78", "TM79", "TM80", 433 | "TM81", "TM82", "TM83", "TM84", "TM85", "TM86", "TM87", "TM88", 434 | "TM89", "TM90", "TM91", "TM92", "TM93", "TM94", "TM95", "TM96", 435 | "TM97", "TM98", "TM99", "TM100", "Explorer Kit", "Loot Sack", "Rule Book", "Poké Radar", 436 | "Point Card", "Guidebook", "Sticker Case", "Fashion Case", "Sticker Bag", "Pal Pad", "Works Key", "Old Charm", 437 | "Galactic Key", "Red Chain", "Town Map", "Vs. Seeker", "Coin Case", "Old Rod", "Good Rod", "Super Rod", 438 | "Sprayduck", "Poffin Case", "Bike", "Suite Key", "Oak’s Letter", "Lunar Feather", "Member Card", "unknown", 439 | "S.S. Ticket", "Contest Pass", "Magma Stone", "Parcel", "Coupon 1", "Coupon 2", "Coupon 3", "Storage Key", 440 | "Secret Medicine", "Vs. Recorder", "Gracidea", "Secret Key", "Apricorn Box", "Unown Report", "Berry Pots", "Dowsing Machine", 441 | "Blue Card", "Slowpoke Tail", "Clear Bell", "Card Key", "Basement Key", "Squirt Bottle", "Red Scale", "Lost Item", 442 | "Pass", "Machine Part", "Silver Wing", "Rainbow Wing", "Mystery Egg", "Red Apricorn", "Blue Apricorn", "Yellow Apricorn", 443 | "Green Apricorn", "Pink Apricorn", "White Apricorn", "Black Apricorn", "Fast Ball", "Level Ball", "Lure Ball", "Heavy Ball", 444 | "Love Ball", "Friend Ball", "Moon Ball", "Sport Ball", "Park Ball", "Photo Album", "GB Sounds", "Tidal Bell", 445 | "Rage Candy Bar", "Data Card 01", "Data Card 02", "Data Card 03", "Data Card 04", "Data Card 05", "Data Card 06", "Data Card 07", 446 | "Data Card 08", "Data Card 09", "Data Card 10", "Data Card 11", "Data Card 12", "Data Card 13", "Data Card 14", "Data Card 15", 447 | "Data Card 16", "Data Card 17", "Data Card 18", "Data Card 19", "Data Card 20", "Data Card 21", "Data Card 22", "Data Card 23", 448 | "Data Card 24", "Data Card 25", "Data Card 26", "Data Card 27", "Jade Orb", "Lock Capsule", "Red Orb", "Blue Orb", 449 | "Enigma Stone", "Prism Scale", "Eviolite", "Float Stone", "Rocky Helmet", "Air Balloon", "Red Card", "Ring Target", 450 | "Binding Band", "Absorb Bulb", "Cell Battery", "Eject Button", "Fire Gem", "Water Gem", "Electric Gem", "Grass Gem", 451 | "Ice Gem", "Fighting Gem", "Poison Gem", "Ground Gem", "Flying Gem", "Psychic Gem", "Bug Gem", "Rock Gem", 452 | "Ghost Gem", "Dragon Gem", "Dark Gem", "Steel Gem", "Normal Gem", "Health Feather", "Muscle Feather", "Resist Feather", 453 | "Genius Feather", "Clever Feather", "Swift Feather", "Pretty Feather", "Cover Fossil", "Plume Fossil", "Liberty Pass", "Pass Orb", 454 | "Dream Ball", "Poké Toy", "Prop Case", "Dragon Skull", "Balm Mushroom", "Big Nugget", "Pearl String", "Comet Shard", 455 | "Relic Copper", "Relic Silver", "Relic Gold", "Relic Vase", "Relic Band", "Relic Statue", "Relic Crown", "Casteliacone", 456 | "Dire Hit 2", "X Speed 2", "X Sp. Atk 2", "X Sp. Def 2", "X Defense 2", "X Attack 2", "X Accuracy 2", "X Speed 3", 457 | "X Sp. Atk 3", "X Sp. Def 3", "X Defense 3", "X Attack 3", "X Accuracy 3", "X Speed 6", "X Sp. Atk 6", "X Sp. Def 6", 458 | "X Defense 6", "X Attack 6", "X Accuracy 6", "Ability Urge", "Item Drop", "Item Urge", "Reset Urge", "Dire Hit 3", 459 | "Light Stone", "Dark Stone", "TM93", "TM94", "TM95", "Xtransceiver", "unknown", "Gram 1", 460 | "Gram 2", "Gram 3", "Xtransceiver", "Medal Box", "DNA Splicers", "DNA Splicers", "Permit", "Oval Charm", 461 | "Shiny Charm", "Plasma Card", "Grubby Hanky", "Colress Machine", "Dropped Item", "Dropped Item", "Reveal Glass", "Weakness Policy", 462 | "Assault Vest", "Holo Caster", "Prof’s Letter", "Roller Skates", "Pixie Plate", "Ability Capsule", "Whipped Dream", "Sachet", 463 | "Luminous Moss", "Snowball", "Safety Goggles", "Poké Flute", "Rich Mulch", "Surprise Mulch", "Boost Mulch", "Amaze Mulch", 464 | "Gengarite", "Gardevoirite", "Ampharosite", "Venusaurite", "Charizardite X", "Blastoisinite", "Mewtwonite X", "Mewtwonite Y", 465 | "Blazikenite", "Medichamite", "Houndoominite", "Aggronite", "Banettite", "Tyranitarite", "Scizorite", "Pinsirite", 466 | "Aerodactylite", "Lucarionite", "Abomasite", "Kangaskhanite", "Gyaradosite", "Absolite", "Charizardite Y", "Alakazite", 467 | "Heracronite", "Mawilite", "Manectite", "Garchompite", "Latiasite", "Latiosite", "Roseli Berry", "Kee Berry", 468 | "Maranga Berry", "Sprinklotad", "TM96", "TM97", "TM98", "TM99", "TM100", "Power Plant Pass", 469 | "Mega Ring", "Intriguing Stone", "Common Stone", "Discount Coupon", "Elevator Key", "TMV Pass", "Honor of Kalos", "Adventure Guide", 470 | "Strange Souvenir", "Lens Case", "Makeup Bag", "Travel Trunk", "Lumiose Galette", "Shalour Sable", "Jaw Fossil", "Sail Fossil", 471 | "Looker Ticket", "Bike", "Holo Caster", "Fairy Gem", "Mega Charm", "Mega Glove", "Mach Bike", "Acro Bike", 472 | "Wailmer Pail", "Devon Parts", "Soot Sack", "Basement Key", "Pokéblock Kit", "Letter", "Eon Ticket", "Scanner", 473 | "Go-Goggles", "Meteorite", "Key to Room 1", "Key to Room 2", "Key to Room 4", "Key to Room 6", "Storage Key", "Devon Scope", 474 | "S.S. Ticket", "HM07", "Devon Scuba Gear", "Contest Costume", "Contest Costume", "Magma Suit", "Aqua Suit", "Pair of Tickets", 475 | "Mega Bracelet", "Mega Pendant", "Mega Glasses", "Mega Anchor", "Mega Stickpin", "Mega Tiara", "Mega Anklet", "Meteorite", 476 | "Swampertite", "Sceptilite", "Sablenite", "Altarianite", "Galladite", "Audinite", "Metagrossite", "Sharpedonite", 477 | "Slowbronite", "Steelixite", "Pidgeotite", "Glalitite", "Diancite", "Prison Bottle", "Mega Cuff", "Cameruptite", 478 | "Lopunnite", "Salamencite", "Beedrillite", "Meteorite", "Meteorite", "Key Stone", "Meteorite Shard", "Eon Flute", 479 | "Normalium Z", "Firium Z", "Waterium Z", "Electrium Z", "Grassium Z", "Icium Z", "Fightinium Z", "Poisonium Z", 480 | "Groundium Z", "Flyinium Z", "Psychium Z", "Buginium Z", "Rockium Z", "Ghostium Z", "Dragonium Z", "Darkinium Z", 481 | "Steelium Z", "Fairium Z", "Pikanium Z", "Bottle Cap", "Gold Bottle Cap", "Z-Ring", "Decidium Z", "Incinium Z", 482 | "Primarium Z", "Tapunium Z", "Marshadium Z", "Aloraichium Z", "Snorlium Z", "Eevium Z", "Mewnium Z", "Normalium Z", 483 | "Firium Z", "Waterium Z", "Electrium Z", "Grassium Z", "Icium Z", "Fightinium Z", "Poisonium Z", "Groundium Z", 484 | "Flyinium Z", "Psychium Z", "Buginium Z", "Rockium Z", "Ghostium Z", "Dragonium Z", "Darkinium Z", "Steelium Z", 485 | "Fairium Z", "Pikanium Z", "Decidium Z", "Incinium Z", "Primarium Z", "Tapunium Z", "Marshadium Z", "Aloraichium Z", 486 | "Snorlium Z", "Eevium Z", "Mewnium Z", "Pikashunium Z", "Pikashunium Z", "unknown", "unknown", "unknown", 487 | "unknown", "Forage Bag", "Fishing Rod", "Professor’s Mask", "Festival Ticket", "Sparkling Stone", "Adrenaline Orb", "Zygarde Cube", 488 | "unknown", "Ice Stone", "Ride Pager", "Beast Ball", "Big Malasada", "Red Nectar", "Yellow Nectar", "Pink Nectar", 489 | "Purple Nectar", "Sun Flute", "Moon Flute", "unknown", "Enigmatic Card", "Silver Razz Berry", "Golden Razz Berry", "Silver Nanab Berry", 490 | "Golden Nanab Berry", "Silver Pinap Berry", "Golden Pinap Berry", "unknown", "unknown", "unknown", "unknown", "unknown", 491 | "Secret Key", "S.S. Ticket", "Silph Scope", "Parcel", "Card Key", "Gold Teeth", "Lift Key", "Terrain Extender", 492 | "Protective Pads", "Electric Seed", "Psychic Seed", "Misty Seed", "Grassy Seed", "Stretchy Spring", "Chalky Stone", "Marble", 493 | "Lone Earring", "Beach Glass", "Gold Leaf", "Silver Leaf", "Polished Mud Ball", "Tropical Shell", "Leaf Letter", "Leaf Letter", 494 | "Small Bouquet", "unknown", "unknown", "unknown", "Lure", "Super Lure", "Max Lure", "Pewter Crunchies", 495 | "Fighting Memory", "Flying Memory", "Poison Memory", "Ground Memory", "Rock Memory", "Bug Memory", "Ghost Memory", "Steel Memory", 496 | "Fire Memory", "Water Memory", "Grass Memory", "Electric Memory", "Psychic Memory", "Ice Memory", "Dragon Memory", "Dark Memory", 497 | "Fairy Memory", "Solganium Z", "Lunalium Z", "Ultranecrozium Z", "Mimikium Z", "Lycanium Z", "Kommonium Z", "Solganium Z", 498 | "Lunalium Z", "Ultranecrozium Z", "Mimikium Z", "Lycanium Z", "Kommonium Z", "Z-Power Ring", "Pink Petal", "Orange Petal", 499 | "Blue Petal", "Red Petal", "Green Petal", "Yellow Petal", "Purple Petal", "Rainbow Flower", "Surge Badge", "N-Solarizer", 500 | "N-Lunarizer", "N-Solarizer", "N-Lunarizer", "Ilima Normalium Z", "Left Poké Ball", "Roto Hatch", "Roto Bargain", "Roto Prize Money", 501 | "Roto Exp. Points", "Roto Friendship", "Roto Encounter", "Roto Stealth", "Roto HP Restore", "Roto PP Restore", "Roto Boost", "Roto Catch", 502 | "Health Candy", "Mighty Candy", "Tough Candy", "Smart Candy", "Courage Candy", "Quick Candy", "Health Candy L", "Mighty Candy L", 503 | "Tough Candy L", "Smart Candy L", "Courage Candy L", "Quick Candy L", "Health Candy XL", "Mighty Candy XL", "Tough Candy XL", 504 | "Smart Candy XL", "Courage Candy XL", "Quick Candy XL", "Bulbasaur Candy", "Charmander Candy", "Squirtle Candy", "Caterpie Candy", 505 | "Weedle Candy", "Pidgey Candy", "Rattata Candy", "Spearow Candy", "Ekans Candy", "Pikachu Candy", "Sandshrew Candy", "Nidoran♀ Candy", 506 | "Nidoran♂ Candy", "Clefairy Candy", "Vulpix Candy", "Jigglypuff Candy", "Zubat Candy", "Oddish Candy", "Paras Candy", "Venonat Candy", 507 | "Diglett Candy", "Meowth Candy", "Psyduck Candy", "Mankey Candy", "Growlithe Candy", "Poliwag Candy", "Abra Candy", "Machop Candy", 508 | "Bellsprout Candy", "Tentacool Candy", "Geodude Candy", "Ponyta Candy", "Slowpoke Candy", "Magnemite Candy", "Farfetch’d Candy", 509 | "Doduo Candy", "Seel Candy", "Grimer Candy", "Shellder Candy", "Gastly Candy", "Onix Candy", "Drowzee Candy", "Krabby Candy", 510 | "Voltorb Candy", "Exeggcute Candy", "Cubone Candy", "Hitmonlee Candy", "Hitmonchan Candy", "Lickitung Candy", "Koffing Candy", 511 | "Rhyhorn Candy", "Chansey Candy", "Tangela Candy", "Kangaskhan Candy", "Horsea Candy", "Goldeen Candy", "Staryu Candy", "Mr. Mime Candy", 512 | "Scyther Candy", "Jynx Candy", "Electabuzz Candy", "Pinsir Candy", "Tauros Candy", "Magikarp Candy", "Lapras Candy", "Ditto Candy", 513 | "Eevee Candy", "Porygon Candy", "Omanyte Candy", "Kabuto Candy", "Aerodactyl Candy", "Snorlax Candy", "Articuno Candy", "Zapdos Candy", 514 | "Moltres Candy", "Dratini Candy", "Mewtwo Candy", "Mew Candy", "Meltan Candy", "Magmar Candy", "unknown", "unknown", "unknown", "unknown", 515 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 516 | "unknown", "unknown", "Endorsement", "Pokémon Box Link", "Wishing Star", "Dynamax Band", "unknown", "unknown", 517 | "Fishing Rod", "Rotom Bike", "unknown", "unknown", "Sausages", "Bob’s Food Tin", "Bach’s Food Tin", "Tin of Beans", 518 | "Bread", "Pasta", "Mixed Mushrooms", "Smoke-Poke Tail", "Large Leek", "Fancy Apple", "Brittle Bones", "Pack of Potatoes", 519 | "Pungent Root", "Salad Mix", "Fried Food", "Boiled Egg", "Camping Gear", "unknown", "unknown", "Rusted Sword", 520 | "Rusted Shield", "Fossilized Bird", "Fossilized Fish", "Fossilized Drake", "Fossilized Dino", "Strawberry Sweet", "Love Sweet", 521 | "Berry Sweet", "Clover Sweet", "Flower Sweet", "Star Sweet", "Ribbon Sweet", "Sweet Apple", "Tart Apple", "Throat Spray", "Eject Pack", 522 | "Heavy-Duty Boots", "Blunder Policy", "Room Service", "Utility Umbrella", "Exp. Candy XS", "Exp. Candy S", "Exp. Candy M", "Exp. Candy L", 523 | "Exp. Candy XL", "Dynamax Candy", "TR00", "TR01", "TR02", "TR03", "TR04", "TR05", 524 | "TR06", "TR07", "TR08", "TR09", "TR10", "TR11", "TR12", "TR13", 525 | "TR14", "TR15", "TR16", "TR17", "TR18", "TR19", "TR20", "TR21", 526 | "TR22", "TR23", "TR24", "TR25", "TR26", "TR27", "TR28", "TR29", 527 | "TR30", "TR31", "TR32", "TR33", "TR34", "TR35", "TR36", "TR37", 528 | "TR38", "TR39", "TR40", "TR41", "TR42", "TR43", "TR44", "TR45", 529 | "TR46", "TR47", "TR48", "TR49", "TR50", "TR51", "TR52", "TR53", 530 | "TR54", "TR55", "TR56", "TR57", "TR58", "TR59", "TR60", "TR61", 531 | "TR62", "TR63", "TR64", "TR65", "TR66", "TR67", "TR68", "TR69", 532 | "TR70", "TR71", "TR72", "TR73", "TR74", "TR75", "TR76", "TR77", 533 | "TR78", "TR79", "TR80", "TR81", "TR82", "TR83", "TR84", "TR85", 534 | "TR86", "TR87", "TR88", "TR89", "TR90", "TR91", "TR92", "TR93", 535 | "TR94", "TR95", "TR96", "TR97", "TR98", "TR99", "TM00", "Lonely Mint", 536 | "Adamant Mint", "Naughty Mint", "Brave Mint", "Bold Mint", "Impish Mint", "Lax Mint", "Relaxed Mint", "Modest Mint", 537 | "Mild Mint", "Rash Mint", "Quiet Mint", "Calm Mint", "Gentle Mint", "Careful Mint", "Sassy Mint", "Timid Mint", 538 | "Hasty Mint", "Jolly Mint", "Naive Mint", "Serious Mint", "Wishing Piece", "Cracked Pot", "Chipped Pot", "Hi-tech Earbuds", 539 | "Fruit Bunch", "Moomoo Cheese", "Spice Mix", "Fresh Cream", "Packaged Curry", "Coconut Milk", "Instant Noodles", "Precooked Burger", 540 | "Gigantamix", "Wishing Chip", "Rotom Bike", "Catching Charm", "unknown", "Old Letter", "Band Autograph", "Sonia’s Book", 541 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "Rotom Catalog", "★And458", 542 | "★And15", "★And337", "★And603", "★And390", "★Sgr6879", "★Sgr6859", "★Sgr6913", "★Sgr7348", 543 | "★Sgr7121", "★Sgr6746", "★Sgr7194", "★Sgr7337", "★Sgr7343", "★Sgr6812", "★Sgr7116", "★Sgr7264", 544 | "★Sgr7597", "★Del7882", "★Del7906", "★Del7852", "★Psc596", "★Psc361", "★Psc510", "★Psc437", 545 | "★Psc8773", "★Lep1865", "★Lep1829", "★Boo5340", "★Boo5506", "★Boo5435", "★Boo5602", "★Boo5733", 546 | "★Boo5235", "★Boo5351", "★Hya3748", "★Hya3903", "★Hya3418", "★Hya3482", "★Hya3845", "★Eri1084", 547 | "★Eri472", "★Eri1666", "★Eri897", "★Eri1231", "★Eri874", "★Eri1298", "★Eri1325", "★Eri984", 548 | "★Eri1464", "★Eri1393", "★Eri850", "★Tau1409", "★Tau1457", "★Tau1165", "★Tau1791", "★Tau1910", 549 | "★Tau1346", "★Tau1373", "★Tau1412", "★CMa2491", "★CMa2693", "★CMa2294", "★CMa2827", "★CMa2282", 550 | "★CMa2618", "★CMa2657", "★CMa2646", "★UMa4905", "★UMa4301", "★UMa5191", "★UMa5054", "★UMa4295", 551 | "★UMa4660", "★UMa4554", "★UMa4069", "★UMa3569", "★UMa3323", "★UMa4033", "★UMa4377", "★UMa4375", 552 | "★UMa4518", "★UMa3594", "★Vir5056", "★Vir4825", "★Vir4932", "★Vir4540", "★Vir4689", "★Vir5338", 553 | "★Vir4910", "★Vir5315", "★Vir5359", "★Vir5409", "★Vir5107", "★Ari617", "★Ari553", "★Ari546", 554 | "★Ari951", "★Ori1713", "★Ori2061", "★Ori1790", "★Ori1903", "★Ori1948", "★Ori2004", "★Ori1852", 555 | "★Ori1879", "★Ori1899", "★Ori1543", "★Cas21", "★Cas168", "★Cas403", "★Cas153", "★Cas542", 556 | "★Cas219", "★Cas265", "★Cnc3572", "★Cnc3208", "★Cnc3461", "★Cnc3449", "★Cnc3429", "★Cnc3627", 557 | "★Cnc3268", "★Cnc3249", "★Com4968", "★Crv4757", "★Crv4623", "★Crv4662", "★Crv4786", "★Aur1708", 558 | "★Aur2088", "★Aur1605", "★Aur2095", "★Aur1577", "★Aur1641", "★Aur1612", "★Pav7790", "★Cet911", 559 | "★Cet681", "★Cet188", "★Cet539", "★Cet804", "★Cep8974", "★Cep8162", "★Cep8238", "★Cep8417", 560 | "★Cen5267", "★Cen5288", "★Cen551", "★Cen5459", "★Cen5460", "★CMi2943", "★CMi2845", "★Equ8131", 561 | "★Vul7405", "★UMi424", "★UMi5563", "★UMi5735", "★UMi6789", "★Crt4287", "★Lyr7001", "★Lyr7178", 562 | "★Lyr7106", "★Lyr7298", "★Ara6585", "★Sco6134", "★Sco6527", "★Sco6553", "★Sco5953", "★Sco5984", 563 | "★Sco6508", "★Sco6084", "★Sco5944", "★Sco6630", "★Sco6027", "★Sco6247", "★Sco6252", "★Sco5928", 564 | "★Sco6241", "★Sco6165", "★Tri544", "★Leo3982", "★Leo4534", "★Leo4357", "★Leo4057", "★Leo4359", 565 | "★Leo4031", "★Leo3852", "★Leo3905", "★Leo3773", "★Gru8425", "★Gru8636", "★Gru8353", "★Lib5685", 566 | "★Lib5531", "★Lib5787", "★Lib5603", "★Pup3165", "★Pup3185", "★Pup3045", "★Cyg7924", "★Cyg7417", 567 | "★Cyg7796", "★Cyg8301", "★Cyg7949", "★Cyg7528", "★Oct7228", "★Col1956", "★Col2040", "★Col2177", 568 | "★Gem2990", "★Gem2891", "★Gem2421", "★Gem2473", "★Gem2216", "★Gem2777", "★Gem2650", "★Gem2286", 569 | "★Gem2484", "★Gem2930", "★Peg8775", "★Peg8781", "★Peg39", "★Peg8308", "★Peg8650", "★Peg8634", 570 | "★Peg8684", "★Peg8450", "★Peg8880", "★Peg8905", "★Oph6556", "★Oph6378", "★Oph6603", "★Oph6149", 571 | "★Oph6056", "★Oph6075", "★Ser5854", "★Ser7141", "★Ser5879", "★Her6406", "★Her6148", "★Her6410", 572 | "★Her6526", "★Her6117", "★Her6008", "★Per936", "★Per1017", "★Per1131", "★Per1228", "★Per834", 573 | "★Per941", "★Phe99", "★Phe338", "★Vel3634", "★Vel3485", "★Vel3734", "★Aqr8232", "★Aqr8414", 574 | "★Aqr8709", "★Aqr8518", "★Aqr7950", "★Aqr8499", "★Aqr8610", "★Aqr8264", "★Cru4853", "★Cru4730", 575 | "★Cru4763", "★Cru4700", "★Cru4656", "★PsA8728", "★TrA6217", "★Cap7776", "★Cap7754", "★Cap8278", 576 | "★Cap8322", "★Cap7773", "★Sge7479", "★Car2326", "★Car3685", "★Car3307", "★Car3699", "★Dra5744", 577 | "★Dra5291", "★Dra6705", "★Dra6536", "★Dra7310", "★Dra6688", "★Dra4434", "★Dra6370", "★Dra7462", 578 | "★Dra6396", "★Dra6132", "★Dra6636", "★CVn4915", "★CVn4785", "★CVn4846", "★Aql7595", "★Aql7557", 579 | "★Aql7525", "★Aql7602", "★Aql7235", "Max Honey", "Max Mushrooms", "Galarica Twig", "Galarica Cuff", "Style Card", 580 | "Armor Pass", "Rotom Bike", "Rotom Bike", "Exp. Charm", "Armorite Ore", "Mark Charm", "Reins of Unity", "Reins of Unity", 581 | "Galarica Wreath", "Legendary Clue 1", "Legendary Clue 2", "Legendary Clue 3", "Legendary Clue?", "Crown Pass", "Wooden Crown", 582 | "Radiant Petal", "White Mane Hair", "Black Mane Hair", "Iceroot Carrot", "Shaderoot Carrot", "Dynite Ore", "Carrot Seeds", 583 | "Ability Patch", "Reins of Unity", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 584 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 585 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 586 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 587 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 588 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 589 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 590 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 591 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 592 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 593 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 594 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 595 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 596 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 597 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 598 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 599 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 600 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 601 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 602 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 603 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 604 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 605 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 606 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 607 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 608 | "Mysterious Shard S", "Mysterious Shard L", "Digger Drill", "Kanto Slate", "Johto Slate", "Soul Slate", "Rainbow Slate", "Squall Slate", 609 | "Oceanic Slate", "Tectonic Slate", "Stratospheric Slate", "Genome Slate", "Discovery Slate", "Distortion Slate", "DS Sounds"} 610 | 611 | local STOREDSIZE = 328 612 | local BLOCKSIZE = 80 613 | 614 | local BLOCKPOSITION = { 615 | 0, 1, 2, 3, 616 | 0, 1, 3, 2, 617 | 0, 2, 1, 3, 618 | 0, 3, 1, 2, 619 | 0, 2, 3, 1, 620 | 0, 3, 2, 1, 621 | 1, 0, 2, 3, 622 | 1, 0, 3, 2, 623 | 2, 0, 1, 3, 624 | 3, 0, 1, 2, 625 | 2, 0, 3, 1, 626 | 3, 0, 2, 1, 627 | 1, 2, 0, 3, 628 | 1, 3, 0, 2, 629 | 2, 1, 0, 3, 630 | 3, 1, 0, 2, 631 | 2, 3, 0, 1, 632 | 3, 2, 0, 1, 633 | 1, 2, 3, 0, 634 | 1, 3, 2, 0, 635 | 2, 1, 3, 0, 636 | 3, 1, 2, 0, 637 | 2, 3, 1, 0, 638 | 3, 2, 1, 0, 639 | 640 | --duplicates of 0-7 to eliminate modulus 641 | 0, 1, 2, 3, 642 | 0, 1, 3, 2, 643 | 0, 2, 1, 3, 644 | 0, 3, 1, 2, 645 | 0, 2, 3, 1, 646 | 0, 3, 2, 1, 647 | 1, 0, 2, 3, 648 | 1, 0, 3, 2} 649 | 650 | local function leValue(str) 651 | local noSpaceStr = str:gsub("%s+", "") 652 | local i = #noSpaceStr 653 | local leStr = "" 654 | 655 | while i > 1 do 656 | leStr = leStr..noSpaceStr:sub(i - 1, i) 657 | i = i - 2 658 | end 659 | 660 | return tonumber(leStr, 16) 661 | end 662 | 663 | local function LCRNG(s) 664 | local a = 0x41C6 * (s % 0x10000) + bShr(s, 16) * 0x4E6D 665 | local b = 0x4E6D * (s % 0x10000) + (a % 0x10000) * 0x10000 + 0x6073 666 | local c = b % 4294967296 667 | 668 | return c 669 | end 670 | 671 | PK8 = {} 672 | PK8.__index = PK8 673 | 674 | function PK8.new(cryptedPKString) 675 | local o = setmetatable({}, PK8) 676 | o.buff = cryptedPKString 677 | 678 | return o 679 | end 680 | 681 | function PK8:getEC() 682 | local ec = self.buff:sub(1, (0x4 * 3) - 1) 683 | 684 | return leValue(ec) 685 | end 686 | 687 | function PK8:getSpecies() 688 | local species = self.buff:sub((0x8 * 3) + 1, (0x8 * 3) + ((0x2 * 3) - 1)) 689 | 690 | return leValue(species) 691 | end 692 | 693 | function PK8:getHeldItem() 694 | local heldItem = self.buff:sub((0xA * 3) + 1, (0xA * 3) + ((0x2 * 3) - 1)) 695 | 696 | return leValue(heldItem) 697 | end 698 | 699 | function PK8:getSIDTID() 700 | local sidtid = self.buff:sub((0x0C * 3) + 1, (0x0C * 3) + ((0x4 * 3) - 1)) 701 | 702 | return leValue(sidtid) 703 | end 704 | 705 | function PK8:getAbility() 706 | local ability = self.buff:sub((0x14 * 3) + 1, (0x14 * 3) + ((0x2 * 3) - 1)) 707 | 708 | return leValue(ability) 709 | end 710 | 711 | function PK8:getAbilityNum() 712 | local abilityNum = self.buff:sub((0x16 * 3) + 1, (0x16 * 3) + 2) 713 | 714 | return bAnd(leValue(abilityNum), 0x7) 715 | end 716 | 717 | function PK8:getPID() 718 | local pid = self.buff:sub((0x1C * 3) + 1, (0x1C * 3) + ((0x4 * 3) - 1)) 719 | 720 | return leValue(pid) 721 | end 722 | 723 | function PK8:getNature() 724 | local nature = self.buff:sub((0x20 * 3) + 1, (0x20 * 3) + 2) 725 | 726 | return leValue(nature) 727 | end 728 | 729 | function PK8:getMove1() 730 | local move1 = self.buff:sub((0x72 * 3) + 1, (0x72 * 3) + ((0x2 * 3) - 1)) 731 | 732 | return leValue(move1) 733 | end 734 | 735 | function PK8:getMove2() 736 | local move2 = self.buff:sub((0x74 * 3) + 1, (0x74 * 3) + ((0x2 * 3) - 1)) 737 | 738 | return leValue(move2) 739 | end 740 | 741 | function PK8:getMove3() 742 | local move3 = self.buff:sub((0x76 * 3) + 1, (0x76 * 3) + ((0x2 * 3) - 1)) 743 | 744 | return leValue(move3) 745 | end 746 | 747 | function PK8:getMove4() 748 | local move4 = self.buff:sub((0x78 * 3) + 1, (0x78 * 3) + ((0x2 * 3) - 1)) 749 | 750 | return leValue(move4) 751 | end 752 | 753 | function PK8:getIV32() 754 | local iv32 = self.buff:sub((0x8C * 3) + 1, (0x8C * 3) + ((0x4 * 3) - 1)) 755 | 756 | return leValue(iv32) 757 | end 758 | 759 | function PK8:getIVs() 760 | local iv32 = self:getIV32() 761 | local ivHp = bAnd(iv32, 0x1F) 762 | local ivAtk = bAnd(bShr(iv32, 5), 0x1F) 763 | local ivDef = bAnd(bShr(iv32, 10), 0x1F) 764 | local ivSpAtk = bAnd(bShr(iv32, 20), 0x1F) 765 | local ivSpDef = bAnd(bShr(iv32, 25), 0x1F) 766 | local ivSpd = bAnd(bShr(iv32, 15), 0x1F) 767 | 768 | return string.format("%d/%d/%d/%d/%d/%d", ivHp, ivAtk, ivDef, ivSpAtk, ivSpDef, ivSpd) 769 | end 770 | 771 | function PK8:getFakeXor() 772 | local SIDTID = self:getSIDTID() 773 | local PID = self:getPID() 774 | return bShr(SIDTID, 16) ~ (bAnd(SIDTID, 0xFFFF) ~ bShr(PID, 16) ~ bAnd(PID, 0xFFFF)) 775 | end 776 | 777 | function PK8:getShinyType() 778 | local PID = self:getPID() 779 | local fakeXor = self:getFakeXor() 780 | 781 | if fakeXor > 15 then 782 | return 0 783 | else 784 | if fakeXor == 0 then 785 | return 2 786 | else 787 | return 1 788 | end 789 | end 790 | end 791 | 792 | function PK8:shinyString() 793 | local shinyType = self:getShinyType() 794 | 795 | if shinyType == 0 then 796 | return "" 797 | elseif shinyType == 1 then 798 | return " (★)" 799 | else 800 | return " (◆)" 801 | end 802 | end 803 | 804 | function PK8:getFinalPID() 805 | local PID = self:getPID() 806 | local fakeXor = self:getFakeXor() 807 | local PSV = bShr(bShr(PID, 16) ~ bAnd(PID, 0xFFFF), 4) 808 | local realXor = bShr(PID, 16) ~ bAnd(PID, 0xFFFF) ~ TID ~ SID 809 | 810 | if fakeXor < 16 then -- Force shiny 811 | local shinyType = self:getShinyType() 812 | 813 | if fakeXor ~= realXor then 814 | local high = bAnd(PID, 0xFFFF) ~ TID ~ SID ~ (2 - shinyType) 815 | PID = bOr(bShl(high, 16), bAnd(PID, 0xFFFF)) 816 | end 817 | else -- Force non shiny 818 | if PSV == TSV then 819 | PID = PID ~ 0x10000000 820 | end 821 | end 822 | 823 | return PID 824 | end 825 | 826 | function PK8:getAbilityString() 827 | if self:getAbilityNum() < 1 then 828 | return "0" 829 | elseif self:getAbilityNum() < 4 then 830 | return tostring(self:getAbilityNum() - 1) 831 | else 832 | return "H" 833 | end 834 | end 835 | 836 | function PK8:getIsEgg() 837 | return bAnd(bShr(self:getIV32(), 30), 1) == 1 838 | end 839 | 840 | function PK8:cryptPKM(seed, start, ending) 841 | local i = (start * 3) + 1 842 | 843 | while i <= (ending * 3) - 5 do 844 | seed = LCRNG(seed) 845 | self.buff = self.buff:sub(1, i - 1)..string.format("%02X", tonumber(self.buff:sub(i, i + 1), 16) ~ bAnd(bShr(seed, 16), 0xFF))..self.buff:sub(i + 2) 846 | i = i + 3 847 | self.buff = self.buff:sub(1, i - 1)..string.format("%02X", tonumber(self.buff:sub(i, i + 1), 16) ~ bAnd(bShr(seed, 24), 0xFF))..self.buff:sub(i + 2) 848 | i = i + 3 849 | end 850 | end 851 | 852 | function PK8:shuffle(sv) 853 | local idx = 4 * sv 854 | local sdata = self.buff 855 | 856 | for block = 0, 3 do 857 | local ofs = BLOCKPOSITION[idx + block + 1] 858 | self.buff = self.buff:sub(1, (8 + BLOCKSIZE * block) * 3)..sdata:sub(((8 + BLOCKSIZE * ofs) * 3) + 1, ((8 + BLOCKSIZE * (ofs + 1)) * 3) - 3)..self.buff:sub(((8 + BLOCKSIZE * (block + 1)) * 3) - 2) 859 | end 860 | end 861 | 862 | function PK8:decrypt() 863 | local seed = self:getEC() 864 | local sv = bAnd(bShr(seed, 13), 0x1F) 865 | 866 | self:cryptPKM(seed, 8, STOREDSIZE) 867 | self:shuffle(sv) 868 | end 869 | 870 | function PK8:print() 871 | print(string.format("Species: %s", speciesNamesList[self:getSpecies() + 1])) 872 | print(string.format("PID: %08X%s", self:getFinalPID(), self:shinyString())) 873 | print(string.format("Nature: %s", natureNamesList[self:getNature() + 1])) 874 | print(string.format("Ability: %s (%s)", abilityNamesList[self:getAbility() + 1], self:getAbilityString())) 875 | print(string.format("IVs: %s", self:getIVs())) 876 | print(string.format("Held Item: %s\n", itemNamesList[self:getHeldItem() + 1])) 877 | print(string.format("Move: %s", moveNamesList[self:getMove1() + 1])) 878 | print(string.format("Move: %s", moveNamesList[self:getMove2() + 1])) 879 | print(string.format("Move: %s", moveNamesList[self:getMove3() + 1])) 880 | print(string.format("Move: %s", moveNamesList[self:getMove4() + 1])) 881 | end 882 | 883 | 884 | 885 | -- Roamer8 class 886 | Roamer8 = {} 887 | Roamer8.__index = Roamer8 888 | 889 | function Roamer8.new(roamerListAddr) 890 | local o = setmetatable({}, Roamer8) 891 | 892 | local roamerAddr = roamerListAddr + baseAddr + 0x20 + (slotIndex * 0x20) 893 | o.EC = readInteger(roamerAddr + 0x4) 894 | o.species = readSmallInteger(roamerAddr + 0xC) 895 | 896 | local r = XoroShiro128Plus.new(o.EC) 897 | local OTID = r:next() 898 | o.PID = r:next() 899 | 900 | local fakeXor = bShr(OTID, 16) ~ bAnd(OTID, 0xFFFF) ~ bShr(o.PID, 16) ~ bAnd(o.PID, 0xFFFF) 901 | local PSV = bShr(bShr(o.PID, 16) ~ bAnd(o.PID, 0xFFFF), 4) 902 | local realXor = bShr(o.PID, 16) ~ bAnd(o.PID, 0xFFFF) ~ TID ~ SID 903 | local TSV = bShr((TID ~ SID), 4) 904 | 905 | if fakeXor < 16 then -- Force shiny 906 | if fakeXor == 0 then 907 | o.shinyType = 2 908 | else 909 | o.shinyType = 1 910 | end 911 | 912 | if fakeXor ~= realXor then 913 | local high = bAnd(o.PID, 0xFFFF) ~ TID ~ SID ~ (2 - o.shinyType) 914 | o.PID = bOr(bShl(high, 16), bAnd(o.PID, 0xFFFF)) 915 | end 916 | 917 | if fakeXor == 0 then 918 | o.shinyType = " (◆)" 919 | else 920 | o.shinyType = " (★)" 921 | end 922 | else -- Force non shiny 923 | o.shinyType = "" 924 | 925 | if PSV == TSV then 926 | o.PID = o.PID ~ 0x10000000 927 | end 928 | end 929 | 930 | o.IVs = {} 931 | local i = 0 932 | while i < 3 do 933 | local stat = r:quickrand1(0x6) 934 | 935 | if o.IVs[stat + 1] == nil then 936 | o.IVs[stat + 1] = 31 937 | i = i + 1 938 | end 939 | end 940 | 941 | for i = 1, 6 do 942 | if o.IVs[i] == nil then 943 | o.IVs[i] = r:quickrand2(0x1F) 944 | end 945 | end 946 | 947 | o.ability = r:quickrand2(0x1) 948 | o.nature = r:quickrand1(25) 949 | 950 | return o 951 | end 952 | 953 | function Roamer8:print() 954 | print(string.format("Species: %s", speciesNamesList[self.species + 1])) 955 | print(string.format("PID: %08X%s", self.PID, self.shinyType)) 956 | print(string.format("Nature: %s", natureNamesList[self.nature + 1])) 957 | print(string.format("Ability: Levitate (%s)", self.ability)) 958 | print(string.format("IVs: %d/%d/%d/%d/%d/%d", self.IVs[1], self.IVs[2], self.IVs[3], self.IVs[4], self.IVs[5], self.IVs[6])) 959 | end 960 | 961 | 962 | 963 | -- Pokemon addresses functions 964 | local function getWildPokemonAddr() 965 | local wildPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x7E8) 966 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x58) 967 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x28) 968 | 969 | if wildPokemonAddr ~= 0 then 970 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x10) 971 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x20) 972 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x20) 973 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x18) 974 | wildPokemonAddr = wildPokemonAddr + baseAddr + 0x20 975 | end 976 | 977 | return wildPokemonAddr 978 | end 979 | 980 | local function getPartyPokemonAddr() 981 | local partySlotIndex = slotIndex 982 | 983 | if viewMode[viewModeIndex] == "Breeding" then 984 | local partyMemberCountAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x7F0) 985 | partySlotIndex = readBytes(partyMemberCountAddr + baseAddr + 0x18) - 1 986 | end 987 | 988 | local partyPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x7F0) 989 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x10) 990 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x20 + (8 * partySlotIndex)) 991 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x20) 992 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x18) 993 | partyPokemonAddr = partyPokemonAddr + baseAddr + 0x20 994 | 995 | return partyPokemonAddr 996 | end 997 | 998 | local function getBoxPokemonAddr() 999 | local boxPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0xA0) 1000 | boxPokemonAddr = readQword(boxPokemonAddr + baseAddr + 0x20 + (8 * boxNumberIndex)) 1001 | boxPokemonAddr = readQword(boxPokemonAddr + baseAddr + 0x20 + (8 * slotIndex)) 1002 | boxPokemonAddr = boxPokemonAddr + baseAddr + 0x20 1003 | 1004 | return boxPokemonAddr 1005 | end 1006 | 1007 | local function getRoamerListAddr() 1008 | local roamerPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x2A0) 1009 | 1010 | return roamerPokemonAddr 1011 | end 1012 | 1013 | 1014 | 1015 | -- Input functions 1016 | local function getStateSizeModeIndexInput() 1017 | if isKeyPressed(VK_3) or isKeyPressed(VK_NUMPAD3) then 1018 | stateSizeModeIndex = 1 1019 | elseif isKeyPressed(VK_6) or isKeyPressed(VK_NUMPAD6) then 1020 | stateSizeModeIndex = 2 1021 | end 1022 | end 1023 | 1024 | local function getViewModeIndexInput() 1025 | if (isKeyPressed(VK_2) or isKeyPressed(VK_NUMPAD2)) and viewModeIndex < 5 and not prevKeyPressed then 1026 | slotIndex = 0 1027 | boxNumberIndex = 0 1028 | viewModeIndex = viewModeIndex + 1 1029 | prevKeyPressed = true 1030 | elseif (isKeyPressed(VK_1) or isKeyPressed(VK_NUMPAD1)) and viewModeIndex > 1 and not prevKeyPressed then 1031 | slotIndex = 0 1032 | boxNumberIndex = 0 1033 | viewModeIndex = viewModeIndex - 1 1034 | prevKeyPressed = true 1035 | else 1036 | prevKeyPressed = false 1037 | end 1038 | end 1039 | 1040 | local function getPartySlotIndexInput() 1041 | if (isKeyPressed(VK_5) or isKeyPressed(VK_NUMPAD5)) and slotIndex < 5 and not prevKeyPressed then 1042 | slotIndex = slotIndex + 1 1043 | prevKeyPressed = true 1044 | elseif (isKeyPressed(VK_4) or isKeyPressed(VK_NUMPAD4)) and slotIndex > 0 and not prevKeyPressed then 1045 | slotIndex = slotIndex - 1 1046 | prevKeyPressed = true 1047 | else 1048 | prevKeyPressed = false 1049 | end 1050 | end 1051 | 1052 | local function getBoxNumberIndexInput() 1053 | if (isKeyPressed(VK_8) or isKeyPressed(VK_NUMPAD8)) and boxNumberIndex < 39 and not prevKeyPressed then 1054 | slotIndex = 0 1055 | boxNumberIndex = boxNumberIndex + 1 1056 | prevKeyPressed = true 1057 | elseif (isKeyPressed(VK_7) or isKeyPressed(VK_NUMPAD7)) and boxNumberIndex > 0 and not prevKeyPressed then 1058 | slotIndex = 0 1059 | boxNumberIndex = boxNumberIndex - 1 1060 | prevKeyPressed = true 1061 | else 1062 | prevKeyPressed = false 1063 | end 1064 | end 1065 | 1066 | local function getBoxSlotIndexInput() 1067 | if (isKeyPressed(VK_5) or isKeyPressed(VK_NUMPAD5)) and slotIndex < 29 and not prevKeyPressed then 1068 | slotIndex = slotIndex + 1 1069 | prevKeyPressed = true 1070 | elseif (isKeyPressed(VK_4) or isKeyPressed(VK_NUMPAD4)) and slotIndex > 0 and not prevKeyPressed then 1071 | slotIndex = slotIndex - 1 1072 | prevKeyPressed = true 1073 | else 1074 | prevKeyPressed = false 1075 | end 1076 | end 1077 | 1078 | local function getRoamerSlotIndexInput() 1079 | if (isKeyPressed(VK_5) or isKeyPressed(VK_NUMPAD5)) and slotIndex < 1 and not prevKeyPressed then 1080 | slotIndex = slotIndex + 1 1081 | prevKeyPressed = true 1082 | elseif (isKeyPressed(VK_4) or isKeyPressed(VK_NUMPAD4)) and slotIndex > 0 and not prevKeyPressed then 1083 | slotIndex = slotIndex - 1 1084 | prevKeyPressed = true 1085 | else 1086 | prevKeyPressed = false 1087 | end 1088 | end 1089 | 1090 | local function getPokemonIndexInput() 1091 | if viewMode[viewModeIndex] == "Party" then 1092 | getPartySlotIndexInput() 1093 | elseif viewMode[viewModeIndex] == "Box" then 1094 | getBoxNumberIndexInput() 1095 | getBoxSlotIndexInput() 1096 | elseif viewMode[viewModeIndex] == "Roamer" then 1097 | getRoamerSlotIndexInput() 1098 | end 1099 | end 1100 | 1101 | 1102 | 1103 | -- Printing functions 1104 | local function printTrainerInfo() 1105 | print("Trainer Info:") 1106 | print(string.format("G8TID: %d", G8TID)) 1107 | print(string.format("TID: %d", TID)) 1108 | print(string.format("SID: %d", SID)) 1109 | print(string.format("TSV: %d", TSV)) 1110 | print("\n") 1111 | end 1112 | 1113 | local function getCurrentViewModePokemonAddr() 1114 | if viewMode[viewModeIndex] == "Wild" then 1115 | return getWildPokemonAddr() 1116 | elseif viewMode[viewModeIndex] == "Breeding" or viewMode[viewModeIndex] == "Party" then 1117 | return getPartyPokemonAddr() 1118 | elseif viewMode[viewModeIndex] == "Box" then 1119 | return getBoxPokemonAddr() 1120 | elseif viewMode[viewModeIndex] == "Roamer" then 1121 | return getRoamerListAddr() 1122 | end 1123 | end 1124 | 1125 | local function printEggInfo() 1126 | local isEggReady = readQword(isEggReadyFlagAddr) == 0x01 1127 | local eggStepsCounter = 180 - readBytes(eggStepsCounterAddr) 1128 | 1129 | if not isEggReady then 1130 | print("Egg Steps Counter: "..eggStepsCounter) 1131 | print("Egg is not ready") 1132 | end 1133 | 1134 | if isEggReady then 1135 | local eggSeed = readInteger(eggSeedAddr) 1136 | print("Egg generated, go get it!") 1137 | print(string.format("Egg Seed: %08X\n", eggSeed)) 1138 | elseif eggStepsCounter == 1 then 1139 | print("Next step might generate an egg!\n") 1140 | elseif eggStepsCounter == 180 then 1141 | print("180th step taken\n") 1142 | else 1143 | print("Keep on steppin'\n") 1144 | end 1145 | end 1146 | 1147 | local function getPK8(buffAddr) 1148 | local decStringBuff = table.concat(readBytes(buffAddr, STOREDSIZE, true), " ") 1149 | local hexStringBuff = decStringBuff:gsub("%S+", function (c) return string.format("%02X", c) end) 1150 | 1151 | return PK8.new(hexStringBuff) 1152 | end 1153 | 1154 | local function printPokemonInfo() 1155 | print(string.format("Mode: %s\t(Change mode pressing keyboard key 1 or 2)\n", viewMode[viewModeIndex])) 1156 | 1157 | if viewMode[viewModeIndex] == "Party" then 1158 | print(string.format("Slot: %d\t\t(Change slot pressing keyboard key 4 or 5)\n", slotIndex + 1)) 1159 | elseif viewMode[viewModeIndex] == "Box" then 1160 | print(string.format("Number: %d\t(Change box number pressing keyboard key 7 or 8)", boxNumberIndex + 1)) 1161 | print(string.format("Slot: %d\t\t(Change slot pressing keyboard key 4 or 5)\n", slotIndex + 1)) 1162 | elseif viewMode[viewModeIndex] == "Breeding" then 1163 | printEggInfo() 1164 | elseif viewMode[viewModeIndex] == "Roamer" then 1165 | print(string.format("Slot: %d\t\t(Change slot pressing keyboard key 4 or 5)\n", slotIndex + 1)) 1166 | end 1167 | 1168 | print("Pokemon Info:") 1169 | 1170 | local pokemonBlockAddr = getCurrentViewModePokemonAddr() 1171 | local pk = nil 1172 | 1173 | if pokemonBlockAddr ~= 0 then 1174 | if viewMode[viewModeIndex] == "Roamer" then 1175 | pk = Roamer8.new(pokemonBlockAddr) 1176 | else 1177 | pk = getPK8(pokemonBlockAddr) 1178 | pk:decrypt() 1179 | end 1180 | end 1181 | 1182 | if pk ~= nil and (viewMode[viewModeIndex] ~= "Breeding" or pk:getIsEgg()) then 1183 | pk:print() 1184 | elseif viewMode[viewModeIndex] == "Breeding" then 1185 | print("No egg in last party slot") 1186 | else 1187 | print("No Pokemon") 1188 | end 1189 | end 1190 | 1191 | local function printRngInfo() 1192 | local currRamS0 = readInteger(stateAddr) 1193 | local currRamS1 = readInteger(stateAddr + 0x4) 1194 | local currRamS2 = readInteger(stateAddr + 0x8) 1195 | local currRamS3 = readInteger(stateAddr + 0xC) 1196 | local skips = 0 1197 | 1198 | while (currRamS0 ~= initRNG.currS0 or currRamS1 ~= initRNG.currS1 or currRamS2 ~= initRNG.currS2 or currRamS3 ~= initRNG.currS3) and skips < 99999 do 1199 | initRNG:next() 1200 | skips = skips + 1 1201 | 1202 | if currRamS0 == initRNG.currS0 and currRamS1 == initRNG.currS1 and currRamS2 == initRNG.currS2 and currRamS3 == initRNG.currS3 then 1203 | GetLuaEngine().MenuItem5.doClick() 1204 | initRNG:print() 1205 | printTrainerInfo() 1206 | printPokemonInfo() 1207 | end 1208 | end 1209 | end 1210 | 1211 | 1212 | 1213 | -- Timer function 1214 | local function aTimerTick(timer) 1215 | if isKeyPressed(VK_0) or isKeyPressed(VK_NUMPAD0) then 1216 | timer.destroy() 1217 | end 1218 | 1219 | getStateSizeModeIndexInput() 1220 | getViewModeIndexInput() 1221 | getPokemonIndexInput() 1222 | printRngInfo() 1223 | end 1224 | 1225 | 1226 | 1227 | -- Main 1228 | initRNG:print() 1229 | printTrainerInfo() 1230 | printPokemonInfo() 1231 | 1232 | local aTimer = nil 1233 | local timerInterval = 50 1234 | 1235 | aTimer = createTimer(getMainForm()) 1236 | aTimer.Interval = timerInterval 1237 | aTimer.OnTimer = aTimerTick 1238 | aTimer.Enabled = true -------------------------------------------------------------------------------- /yuzu/BDSP_RNG (v1.1.3)_yuzu.lua: -------------------------------------------------------------------------------- 1 | -- Various variables 2 | local stateSizeMode = {"u32", "u64"} 3 | local stateSizeModeIndex = 1 4 | local viewMode = {"Wild", "Breeding", "Roamer", "Party", "Box"} 5 | local viewModeIndex = 1 6 | local prevKeyPressed = false 7 | local slotIndex = 0 8 | local boxNumberIndex = 0 9 | 10 | 11 | 12 | -- Find game Base address and Main address 13 | local mainAddr 14 | local baseAddr 15 | 16 | do 17 | local seedAddressScan = createMemScan() 18 | local foundList = createFoundList(seedAddressScan) 19 | seedAddressScan.firstScan(soExactValue, vtQword, 0, "04B4E97830444F4D", "", 0, 0x7FFFFFFFFFFF, 20 | "", fsmNotAligned, nil, true, false, false, false) 21 | seedAddressScan.waitTillDone() 22 | foundList.initialize() 23 | 24 | mainAddr = tonumber(foundList.Address[1], 16) - 0x8 25 | baseAddr = mainAddr - 0x80004000 26 | 27 | foundList.destroy() 28 | seedAddressScan.destroy() 29 | end 30 | 31 | 32 | 33 | -- Set addresses 34 | local function getPlayerPrefsProviderAddr() 35 | local playerPrefsProviderInstanceAddr = readQword(mainAddr + 0x4E853F0) 36 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0x18) 37 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0xC0) 38 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0x28) 39 | playerPrefsProviderInstanceAddr = readQword(playerPrefsProviderInstanceAddr + baseAddr + 0xB8) 40 | 41 | return readQword(playerPrefsProviderInstanceAddr + baseAddr) 42 | end 43 | 44 | local stateAddr = readQword(mainAddr + 0x4FB2050) + baseAddr 45 | local playerPrefsProviderAddr = getPlayerPrefsProviderAddr() 46 | local IDsAddr = playerPrefsProviderAddr + baseAddr + 0xE8 47 | local isEggReadyFlagAddr = playerPrefsProviderAddr + baseAddr + 0x458 48 | local eggSeedAddr = isEggReadyFlagAddr + 0x8 49 | local eggStepsCounterAddr = eggSeedAddr + 0x8 50 | 51 | 52 | 53 | -- Set trainer info 54 | local TID = bAnd(readInteger(IDsAddr), 0xFFFF) 55 | local SID = bShr(readInteger(IDsAddr), 16) 56 | local G8TID = bAnd(bShl(SID, 16) | TID, 0xFFFFFFFF) % 1000000 57 | local TSV = bShr((TID ~ SID), 4) 58 | 59 | 60 | 61 | -- XorShift class 62 | XorShift = {} 63 | XorShift.__index = XorShift 64 | 65 | function XorShift.new(s0, s1, s2, s3) 66 | local o = setmetatable({}, XorShift) 67 | o.initS0 = s0 68 | o.initS1 = s1 69 | o.initS2 = s2 70 | o.initS3 = s3 71 | 72 | o.currS0 = s0 73 | o.currS1 = s1 74 | o.currS2 = s2 75 | o.currS3 = s3 76 | 77 | o.advances = 0 78 | 79 | return o 80 | end 81 | 82 | function XorShift:next() 83 | local t = self.currS0 84 | local s = self.currS3 85 | 86 | t = t ~ bAnd(bShl(t, 11), 0xFFFFFFFF) 87 | t = t ~ bShr(t, 8) 88 | t = t ~ (s ~ bShr(s, 19)) 89 | 90 | self.currS0 = self.currS1 91 | self.currS1 = self.currS2 92 | self.currS2 = self.currS3 93 | self.currS3 = t 94 | self.advances = self.advances + 1 95 | 96 | return bAnd(((t % 0xFFFFFFFF) + 0x80000000), 0xFFFFFFFF) 97 | end 98 | 99 | function XorShift:print() 100 | print(string.format("State size: %s\t(Change state size pressing keyboard key 3 or 6)\n", stateSizeMode[stateSizeModeIndex])) 101 | 102 | if stateSizeMode[stateSizeModeIndex] == "u32" then 103 | print(string.format("Initial Seed:\nS[0]: %08X S[1]: %08X\nS[2]: %08X S[3]: %08X\n", self.initS0, self.initS1, self.initS2, self.initS3)) 104 | print(string.format("Current Seed:\nS[0]: %08X S[1]: %08X\nS[2]: %08X S[3]: %08X\n", self.currS0, self.currS1, self.currS2, self.currS3)) 105 | else 106 | print(string.format("Initial Seed:\nS[0]: %08X%08X S[1]: %08X%08X\n", self.initS0, self.initS1, self.initS2, self.initS3)) 107 | print(string.format("Current Seed:\nS[0]: %08X%08X S[1]: %08X%08X\n", self.currS0, self.currS1, self.currS2, self.currS3)) 108 | end 109 | 110 | print(string.format("Advances: %d\n\n", self.advances)) 111 | end 112 | 113 | local initRNG = XorShift.new(readInteger(stateAddr), readInteger(stateAddr + 0x4), readInteger(stateAddr + 0x8), readInteger(stateAddr + 0xC)) 114 | 115 | 116 | 117 | -- XoroShiro128Plus class 118 | local ulongMask = 0xFFFFFFFFFFFFFFFF 119 | 120 | XoroShiro128Plus = {} 121 | XoroShiro128Plus.__index = XoroShiro128Plus 122 | 123 | function XoroShiro128Plus.new(seed) 124 | local o = setmetatable({}, XoroShiro128Plus) 125 | 126 | local _seed1 = bAnd((seed - 0x61C8864680B583EB), ulongMask) 127 | local _seed2 = bAnd((seed + 0x3C6EF372FE94F82A), ulongMask) 128 | _seed1 = bAnd((0xBF58476D1CE4E5B9 * (_seed1 ~ bShr(_seed1, 30))), ulongMask) 129 | _seed2 = bAnd((0xBF58476D1CE4E5B9 * (_seed2 ~ bShr(_seed2, 30))), ulongMask) 130 | _seed1 = bAnd((0x94D049BB133111EB * (_seed1 ~ bShr(_seed1, 27))), ulongMask) 131 | _seed2 = bAnd((0x94D049BB133111EB * (_seed2 ~ bShr(_seed2, 27))), ulongMask) 132 | 133 | o.seed1 = _seed1 ~ bShr(_seed1, 31) 134 | o.seed2 = _seed2 ~ bShr(_seed2, 31) 135 | 136 | return o 137 | end 138 | 139 | function XoroShiro128Plus:rotl(x, k) 140 | return bAnd(bOr(bShl(x, k), bShr(x, (64 - k))), ulongMask) 141 | end 142 | 143 | function XoroShiro128Plus:next() 144 | local s0 = self.seed1 145 | local s1 = self.seed2 146 | local result = bAnd((s0 + s1), ulongMask) 147 | s1 = s1 ~ s0 148 | self.seed1 = self:rotl(s0, 24) ~ s1 ~ bAnd(bShl(s1, 16), ulongMask) 149 | self.seed2 = self:rotl(s1, 37) 150 | 151 | return bShr(result, 32) 152 | end 153 | 154 | function XoroShiro128Plus:quickrand1(mask) 155 | return self:next() % mask 156 | end 157 | 158 | function XoroShiro128Plus:quickrand2(mask) 159 | return bAnd(self:next(), mask) 160 | end 161 | 162 | 163 | 164 | -- PK8 class 165 | local natureNamesList = { 166 | "Hardy", "Lonely", "Brave", "Adamant", "Naughty", 167 | "Bold", "Docile", "Relaxed", "Impish", "Lax", 168 | "Timid", "Hasty", "Serious", "Jolly", "Naive", 169 | "Modest", "Mild", "Quiet", "Bashful", "Rash", 170 | "Calm", "Gentle", "Sassy", "Careful", "Quirky"} 171 | 172 | local speciesNamesList = { 173 | "None", 174 | -- Gen 1 175 | "Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", 176 | "Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata", 177 | "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran♀", 178 | "Nidorina", "Nidoqueen", "Nidoran♂", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales", 179 | "Jigglypuff", "Wigglytuff", "Zubat", "Golbat", "Oddish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", 180 | "Venomoth", "Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", 181 | "Arcanine", "Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", 182 | "Bellsprout", "Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", 183 | "Rapidash", "Slowpoke", "Slowbro", "Magnemite", "Magneton", "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", 184 | "Grimer", "Muk", "Shellder", "Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", 185 | "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", 186 | "Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", 187 | "Goldeen", "Seaking", "Staryu", "Starmie", "Mr. Mime", "Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", 188 | "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", 189 | "Kabuto", "Kabutops", "Aerodactyl", "Snorlax", "Articuno", "Zapdos", "Moltres", "Dratini", "Dragonair", "Dragonite", 190 | "Mewtwo", "Mew", 191 | -- Gen 2 192 | "Chikorita", "Bayleef", "Meganium", "Cyndaquil", "Quilava", "Typhlosion", "Totodile", "Croconaw", "Feraligatr", 193 | "Sentret", "Furret", "Hoothoot", "Noctowl", "Ledyba", "Ledian", "Spinarak", "Ariados", "Crobat", "Chinchou", "Lanturn", 194 | "Pichu", "Cleffa", "Igglybuff", "Togepi", "Togetic", "Natu", "Xatu", "Mareep", "Flaaffy", "Ampharos", "Bellossom", 195 | "Marill", "Azumarill", "Sudowoodo", "Politoed", "Hoppip", "Skiploom", "Jumpluff", "Aipom", "Sunkern", "Sunflora", 196 | "Yanma", "Wooper", "Quagsire", "Espeon", "Umbreon", "Murkrow", "Slowking", "Misdreavus", "Unown", "Wobbuffet", 197 | "Girafarig", "Pineco", "Forretress", "Dunsparce", "Gligar", "Steelix", "Snubbull", "Granbull", "Qwilfish", "Scizor", 198 | "Shuckle", "Heracross", "Sneasel", "Teddiursa", "Ursaring", "Slugma", "Magcargo", "Swinub", "Piloswine", "Corsola", 199 | "Remoraid", "Octillery", "Delibird", "Mantine", "Skarmory", "Houndour", "Houndoom", "Kingdra", "Phanpy", "Donphan", 200 | "Porygon2", "Stantler", "Smeargle", "Tyrogue", "Hitmontop", "Smoochum", "Elekid", "Magby", "Miltank", "Blissey", 201 | "Raikou", "Entei", "Suicune", "Larvitar", "Pupitar", "Tyranitar", "Lugia", "Ho-Oh", "Celebi", 202 | -- Gen 3 203 | "Treecko", "Grovyle", "Sceptile", "Torchic", "Combusken", "Blaziken", "Mudkip", "Marshtomp", "Swampert", "Poochyena", 204 | "Mightyena", "Zigzagoon", "Linoone", "Wurmple", "Silcoon", "Beautifly", "Cascoon", "Dustox", "Lotad", "Lombre", "Ludicolo", 205 | "Seedot", "Nuzleaf", "Shiftry", "Taillow", "Swellow", "Wingull", "Pelipper", "Ralts", "Kirlia", "Gardevoir", "Surskit", 206 | "Masquerain", "Shroomish", "Breloom", "Slakoth", "Vigoroth", "Slaking", "Nincada", "Ninjask", "Shedinja", "Whismur", 207 | "Loudred", "Exploud", "Makuhita", "Hariyama", "Azurill", "Nosepass", "Skitty", "Delcatty", "Sableye", "Mawile", "Aron", 208 | "Lairon", "Aggron", "Meditite", "Medicham", "Electrike", "Manectric", "Plusle", "Minun", "Volbeat", "Illumise", "Roselia", 209 | "Gulpin", "Swalot", "Carvanha", "Sharpedo", "Wailmer", "Wailord", "Numel", "Camerupt", "Torkoal", "Spoink", "Grumpig", 210 | "Spinda", "Trapinch", "Vibrava", "Flygon", "Cacnea", "Cacturne", "Swablu", "Altaria", "Zangoose", "Seviper", "Lunatone", 211 | "Solrock", "Barboach", "Whiscash", "Corphish", "Crawdaunt", "Baltoy", "Claydol", "Lileep", "Cradily", "Anorith", "Armaldo", 212 | "Feebas", "Milotic", "Castform", "Kecleon", "Shuppet", "Banette", "Duskull", "Dusclops", "Tropius", "Chimecho", "Absol", 213 | "Wynaut", "Snorunt", "Glalie", "Spheal", "Sealeo", "Walrein", "Clamperl", "Huntail", "Gorebyss", "Relicanth", "Luvdisc", 214 | "Bagon", "Shelgon", "Salamence", "Beldum", "Metang", "Metagross", "Regirock", "Regice", "Registeel", "Latias", "Latios", 215 | "Kyogre", "Groudon", "Rayquaza", "Jirachi", "Deoxys", 216 | -- Gen 4 217 | "Turtwig", "Grotle", "Torterra", "Chimchar", "Monferno", "Infernape", "Piplup", "Prinplup", "Empoleon", "Starly", 218 | "Staravia", "Staraptor", "Bidoof", "Bibarel", "Kricketot", "Kricketune", "Shinx", "Luxio", "Luxray", "Budew", "Roserade", 219 | "Cranidos", "Rampardos", "Shieldon", "Bastiodon", "Burmy", "Wormadam", "Mothim", "Combee", "Vespiquen", "Pachirisu", 220 | "Buizel", "Floatzel", "Cherubi", "Cherrim", "Shellos", "Gastrodon", "Ambipom", "Drifloon", "Drifblim", "Buneary", 221 | "Lopunny", "Mismagius", "Honchkrow", "Glameow", "Purugly", "Chingling", "Stunky", "Skuntank", "Bronzor", "Bronzong", 222 | "Bonsly", "Mime Jr.", "Happiny", "Chatot", "Spiritomb", "Gible", "Gabite", "Garchomp", "Munchlax", "Riolu", "Lucario", 223 | "Hippopotas", "Hippowdon", "Skorupi", "Drapion", "Croagunk", "Toxicroak", "Carnivine", "Finneon", "Lumineon", "Mantyke", 224 | "Snover", "Abomasnow", "Weavile", "Magnezone", "Lickilicky", "Rhyperior", "Tangrowth", "Electivire", "Magmortar", 225 | "Togekiss", "Yanmega", "Leafeon", "Glaceon", "Gliscor", "Mamoswine", "Porygon-Z", "Gallade", "Probopass", "Dusknoir", 226 | "Froslass", "Rotom", "Uxie", "Mesprit", "Azelf", "Dialga", "Palkia", "Heatran", "Regigigas", "Giratina", "Cresselia", 227 | "Phione", "Manaphy", "Darkrai", "Shaymin", "Arceus"} 228 | 229 | local abilityNamesList = { 230 | "--", 231 | -- Gen 3 232 | "Stench", "Drizzle", "Speed Boost", "Battle Armor", "Sturdy", "Damp", "Limber", "Sand Veil", "Static", "Volt Absorb", 233 | "Water Absorb", "Oblivious", "Cloud Nine", "Compound Eyes", "Insomnia", "Color Change", "Immunity", "Flash Fire", "Shield Dust", 234 | "Own Tempo", "Suction Cups", "Intimidate", "Shadow Tag", "Rough Skin", "Wonder Guard", "Levitate", "Effect Spore", "Synchronize", 235 | "Clear Body", "Natural Cure", "Lightning Rod", "Serene Grace", "Swift Swim", "Chlorophyll", "Illuminate", "Trace", "Huge Power", 236 | "Poison Point", "Inner Focus", "Magma Armor", "Water Veil", "Magnet Pull", "Soundproof", "Rain Dish", "Sand Stream", "Pressure", 237 | "Thick Fat", "Early Bird", "Flame Body", "Run Away", "Keen Eye", "Hyper Cutter", "Pickup", "Truant", "Hustle", "Cute Charm", 238 | "Plus", "Minus", "Forecast", "Sticky Hold", "Shed Skin", "Guts", "Marvel Scale", "Liquid Ooze", "Overgrow", "Blaze", "Torrent", 239 | "Swarm", "Rock Head", "Drought", "Arena Trap", "Vital Spirit", "White Smoke", "Pure Power", "Shell Armor", "Air Lock", 240 | -- Gen 4 241 | "Tangled Feet", "Motor Drive", "Rivalry", "Steadfast", "Snow Cloak", 242 | "Gluttony", "Anger Point", "Unburden", "Heatproof", "Simple", "Dry Skin", "Download", "Iron Fist", "Poison Heal", "Adaptability", 243 | "Skill Link", "Hydration", "Solar Power", "Quick Feet", "Normalize", "Sniper", "Magic Guard", "No Guard", "Stall", "Technician", 244 | "Leaf Guard", "Klutz", "Mold Breaker", "Super Luck", "Aftermath", "Anticipation", "Forewarn", "Unaware", "Tinted Lens", "Filter", 245 | "Slow Start", "Scrappy", "Storm Drain", "Ice Body", "Solid Rock", "Snow Warning", "Honey Gather", "Frisk", "Reckless", "Multitype", 246 | "Flower Gift", "Bad Dreams", 247 | -- Gen 5 248 | "Pickpocket", "Sheer Force", "Contrary", "Unnerve", "Defiant", "Defeatist", "Cursed Body", "Healer", "Friend Guard", "Weak Armor", 249 | "Heavy Metal", "Light Metal", "Multiscale", "Toxic Boost", "Flare Boost", "Harvest", "Telepathy", "Moody", "Overcoat", "Poison Touch", 250 | "Regenerator", "Big Pecks", "Sand Rush", "Wonder Skin", "Analytic", "Illusion", "Imposter", "Infiltrator", "Mummy", "Moxie", 251 | "Justified", "Rattled", "Magic Bounce", "Sap Sipper", "Prankster", "Sand Force", "Iron Barbs", "Zen Mode", "Victory Star", 252 | "Turboblaze", "Teravolt", 253 | -- Gen 6 254 | "Aroma Veil", "Flower Veil", "Cheek Pouch", "Protean", "Fur Coat", "Magician", "Bulletproof", "Competitive", "Strong Jaw", 255 | "Refrigerate", "Sweet Veil", "Stance Change", "Gale Wings", "Mega Launcher", "Grass Pelt", "Symbiosis", "Tough Claws", "Pixilate", 256 | "Gooey", "Aerilate", "Parental Bond", "Dark Aura", "Fairy Aura", "Aura Break", "Primordial Sea", "Desolate Land", "Delta Stream", 257 | -- Gen 7 258 | "Stamina", "Wimp Out", "Emergency Exit", "Water Compaction", "Merciless", "Shields Down", "Stakeout", "Water Bubble", 259 | "Steelworker", "Berserk", "Slush Rush", "Long Reach", "Liquid Voice", "Triage", "Galvanize", "Surge Surfer", 260 | "Schooling", "Disguise", "Battle Bond", "Power Construct", "Corrosion", "Comatose", "Queenly Majesty", "Innards Out", 261 | "Dancer", "Battery", "Fluffy", "Dazzling", "Soul-Heart", "Tangling Hair", "Receiver", "Power of Alchemy", 262 | "Beast Boost", "RKS System", "Electric Surge", "Psychic Surge", "Misty Surge", "Grassy Surge", "Full Metal Body", "Shadow Shield", 263 | "Prism Armor", "Neuroforce", 264 | -- Gen 8 265 | "Intrepid Sword", "Dauntless Shield", "Libero", "Ball Fetch", "Cotton Down", "Propeller Tail", "Mirror Armor", "Gulp Missile", 266 | "Stalwart", "Steam Engine", "Punk Rock", "Sand Spit", "Ice Scales", "Ripen", "Ice Face", "Power Spot", "Mimicry", "Screen Cleaner", 267 | "Steely Spirit", "Perish Body", "Wandering Spirit", "Gorilla Tactics", "Neutralizing Gas", "Pastel Veil", "Hunger Switch", 268 | "Quick Draw", "Unseen Fist", "Curious Medicine", "Transistor", "Dragon’s Maw", "Chilling Neigh", "Grim Neigh", "As One", "As One"} 269 | 270 | local moveNamesList = { 271 | -- Gen 1 272 | "--", "Pound", "Karate Chop", "Double Slap", "Comet Punch", "Mega Punch", "Pay Day", "Fire Punch", "Ice Punch", "Thunder Punch", 273 | "Scratch", "Vice Grip", "Guillotine", "Razor Wind", "Swords Dance", "Cut", "Gust", "Wing Attack", "Whirlwind", "Fly", 274 | "Bind", "Slam", "Vine Whip", "Stomp", "Double Kick", "Mega Kick", "Jump Kick", "Rolling Kick", "Sand Attack", "Headbutt", 275 | "Horn Attack", "Fury Attack", "Horn Drill", "Tackle", "Body Slam", "Wrap", "Take Down", "Thrash", "Double-Edge", 276 | "Tail Whip", "Poison Sting", "Twineedle", "Pin Missile", "Leer", "Bite", "Growl", "Roar", "Sing", "Supersonic", "Sonic Boom", 277 | "Disable", "Acid", "Ember", "Flamethrower", "Mist", "Water Gun", "Hydro Pump", "Surf", "Ice Beam", "Blizzard", "Psybeam", 278 | "Bubble Beam", "Aurora Beam", "Hyper Beam", "Peck", "Drill Peck", "Submission", "Low Kick", "Counter", "Seismic Toss", 279 | "Strength", "Absorb", "Mega Drain", "Leech Seed", "Growth", "Razor Leaf", "Solar Beam", "Poison Powder", "Stun Spore", 280 | "Sleep Powder", "Petal Dance", "String Shot", "Dragon Rage", "Fire Spin", "Thunder Shock", "Thunderbolt", "Thunder Wave", 281 | "Thunder", "Rock Throw", "Earthquake", "Fissure", "Dig", "Toxic", "Confusion", "Psychic", "Hypnosis", "Meditate", 282 | "Agility", "Quick Attack", "Rage", "Teleport", "Night Shade", "Mimic", "Screech", "Double Team", "Recover", "Harden", 283 | "Minimize", "Smokescreen", "Confuse Ray", "Withdraw", "Defense Curl", "Barrier", "Light Screen", "Haze", "Reflect", 284 | "Focus Energy", "Bide", "Metronome", "Mirror Move", "Self-Destruct", "Egg Bomb", "Lick", "Smog", "Sludge", "Bone Club", 285 | "Fire Blast", "Waterfall", "Clamp", "Swift", "Skull Bash", "Spike Cannon", "Constrict", "Amnesia", "Kinesis", "Soft-Boiled", 286 | "High Jump Kick", "Glare", "Dream Eater", "Poison Gas", "Barrage", "Leech Life", "Lovely Kiss", "Sky Attack", "Transform", 287 | "Bubble", "Dizzy Punch", "Spore", "Flash", "Psywave", "Splash", "Acid Armor", "Crabhammer", "Explosion", "Fury Swipes", 288 | "Bonemerang", "Rest", "Rock Slide", "Hyper Fang", "Sharpen", "Conversion", "Tri Attack", "Super Fang", "Slash", 289 | "Substitute", "Struggle", 290 | -- Gen 2 291 | "Sketch", "Triple Kick", "Thief", "Spider Web", "Mind Reader", "Nightmare", "Flame Wheel", 292 | "Snore", "Curse", "Flail", "Conversion 2", "Aeroblast", "Cotton Spore", "Reversal", "Spite", "Powder Snow", "Protect", 293 | "Mach Punch", "Scary Face", "Feint Attack", "Sweet Kiss", "Belly Drum", "Sludge Bomb", "Mud-Slap", "Octazooka", "Spikes", 294 | "Zap Cannon", "Foresight", "Destiny Bond", "Perish Song", "Icy Wind", "Detect", "Bone Rush", "Lock-On", "Outrage", 295 | "Sandstorm", "Giga Drain", "Endure", "Charm", "Rollout", "False Swipe", "Swagger", "Milk Drink", "Spark", "Fury Cutter", 296 | "Steel Wing", "Mean Look", "Attract", "Sleep Talk", "Heal Bell", "Return", "Present", "Frustration", "Safeguard", 297 | "Pain Split", "Sacred Fire", "Magnitude", "Dynamic Punch", "Megahorn", "Dragon Breath", "Baton Pass", "Encore", "Pursuit", 298 | "Rapid Spin", "Sweet Scent", "Iron Tail", "Metal Claw", "Vital Throw", "Morning Sun", "Synthesis", "Moonlight", "Hidden Power", 299 | "Cross Chop", "Twister", "Rain Dance", "Sunny Day", "Crunch", "Mirror Coat", "Psych Up", "Extreme Speed", "Ancient Power", 300 | "Shadow Ball", "Future Sight", "Rock Smash", "Whirlpool", "Beat Up", 301 | -- Gen 3 302 | "Fake Out", "Uproar", "Stockpile", "Spit Up", "Swallow", "Heat Wave", "Hail", "Torment", "Flatter", "Will-O-Wisp", "Memento", 303 | "Facade", "Focus Punch", "Smelling Salts", "Follow Me", "Nature Power", "Charge", "Taunt", "Helping Hand", "Trick", "Role Play", 304 | "Wish", "Assist", "Ingrain", "Superpower", "Magic Coat", "Recycle", "Revenge", "Brick Break", "Yawn", "Knock Off", "Endeavor", 305 | "Eruption", "Skill Swap", "Imprison", "Refresh", "Grudge", "Snatch", "Secret Power", "Dive", "Arm Thrust", "Camouflage", 306 | "Tail Glow", "Luster Purge", "Mist Ball", "Feather Dance", "Teeter Dance", "Blaze Kick", "Mud Sport", "Ice Ball", "Needle Arm", 307 | "Slack Off", "Hyper Voice", "Poison Fang", "Crush Claw", "Blast Burn", "Hydro Cannon", "Meteor Mash", "Astonish", "Weather Ball", 308 | "Aromatherapy", "Fake Tears", "Air Cutter", "Overheat", "Odor Sleuth", "Rock Tomb", "Silver Wind", "Metal Sound", 309 | "Grass Whistle", "Tickle", "Cosmic Power", "Water Spout", "Signal Beam", "Shadow Punch", "Extrasensory", "Sky Uppercut", 310 | "Sand Tomb", "Sheer Cold", "Muddy Water", "Bullet Seed", "Aerial Ace", "Icicle Spear", "Iron Defense", "Block", "Howl", 311 | "Dragon Claw", "Frenzy Plant", "Bulk Up", "Bounce", "Mud Shot", "Poison Tail", "Covet", "Volt Tackle", "Magical Leaf", 312 | "Water Sport", "Calm Mind", "Leaf Blade", "Dragon Dance", "Rock Blast", "Shock Wave", "Water Pulse", "Doom Desire", 313 | "Psycho Boost", 314 | -- Gen 4 315 | "Roost", "Gravity", "Miracle Eye", "Wake-Up Slap", "Hammer Arm", "Gyro Ball", "Healing Wish", "Brine", 316 | "Natural Gift", "Feint", "Pluck", "Tailwind", "Acupressure", "Metal Burst", "U-turn", "Close Combat", "Payback", "Assurance", 317 | "Embargo", "Fling", "Psycho Shift", "Trump Card", "Heal Block", "Wring Out", "Power Trick", "Gastro Acid", "Lucky Chant", 318 | "Me First", "Copycat", "Power Swap", "Guard Swap", "Punishment", "Last Resort", "Worry Seed", "Sucker Punch", "Toxic Spikes", 319 | "Heart Swap", "Aqua Ring", "Magnet Rise", "Flare Blitz", "Force Palm", "Aura Sphere", "Rock Polish", "Poison Jab", 320 | "Dark Pulse", "Night Slash", "Aqua Tail", "Seed Bomb", "Air Slash", "X-Scissor", "Bug Buzz", "Dragon Pulse", "Dragon Rush", 321 | "Power Gem", "Drain Punch", "Vacuum Wave", "Focus Blast", "Energy Ball", "Brave Bird", "Earth Power", "Switcheroo", 322 | "Giga Impact", "Nasty Plot", "Bullet Punch", "Avalanche", "Ice Shard", "Shadow Claw", "Thunder Fang", "Ice Fang", "Fire Fang", 323 | "Shadow Sneak", "Mud Bomb", "Psycho Cut", "Zen Headbutt", "Mirror Shot", "Flash Cannon", "Rock Climb", "Defog", 324 | "Trick Room", "Draco Meteor", "Discharge", "Lava Plume", "Leaf Storm", "Power Whip", "Rock Wrecker", "Cross Poison", "Gunk Shot", 325 | "Iron Head", "Magnet Bomb", "Stone Edge", "Captivate", "Stealth Rock", "Grass Knot", "Chatter", "Judgment", "Bug Bite", 326 | "Charge Beam", "Wood Hammer", "Aqua Jet", "Attack Order", "Defend Order", "Heal Order", "Head Smash", "Double Hit", 327 | "Roar of Time", "Spacial Rend", "Lunar Dance", "Crush Grip", "Magma Storm", "Dark Void", "Seed Flare", "Ominous Wind", 328 | "Shadow Force", 329 | -- Gen 5 330 | "Hone Claws", "Wide Guard", "Guard Split", "Power Split", "Wonder Room", "Psyshock", "Venoshock", "Autotomize", "Rage Powder", 331 | "Telekinesis", "Magic Room", "Smack Down", "Storm Throw", "Flame Burst", "Sludge Wave", "Quiver Dance", "Heavy Slam", "Synchronoise", 332 | "Electro Ball", "Soak", "Flame Charge", "Coil", "Low Sweep", "Acid Spray", "Foul Play", "Simple Beam", "Entrainment", "After You", 333 | "Round", "Echoed Voice", "Chip Away", "Clear Smog", "Stored Power", "Quick Guard", "Ally Switch", "Scald", 334 | "Shell Smash", "Heal Pulse", "Hex", "Sky Drop", "Shift Gear", "Circle Throw", "Incinerate", "Quash", 335 | "Acrobatics", "Reflect Type", "Retaliate", "Final Gambit", "Bestow", "Inferno", "Water Pledge", "Fire Pledge", 336 | "Grass Pledge", "Volt Switch", "Struggle Bug", "Bulldoze", "Frost Breath", "Dragon Tail", "Work Up", "Electroweb", 337 | "Wild Charge", "Drill Run", "Dual Chop", "Heart Stamp", "Horn Leech", "Sacred Sword", "Razor Shell", "Heat Crash", 338 | "Leaf Tornado", "Steamroller", "Cotton Guard", "Night Daze", "Psystrike", "Tail Slap", "Hurricane", "Head Charge", 339 | "Gear Grind", "Searing Shot", "Techno Blast", "Relic Song", "Secret Sword", "Glaciate", "Bolt Strike", "Blue Flare", 340 | "Fiery Dance", "Freeze Shock", "Ice Burn", "Snarl", "Icicle Crash", "V-create", "Fusion Flare", "Fusion Bolt", 341 | -- Gen 6 342 | "Flying Press", "Mat Block", "Belch", "Rototiller", "Sticky Web", "Fell Stinger", "Phantom Force", "Trick-or-Treat", 343 | "Noble Roar", "Ion Deluge", "Parabolic Charge", "Forest’s Curse", "Petal Blizzard", "Freeze-Dry", "Disarming Voice", "Parting Shot", 344 | "Topsy-Turvy", "Draining Kiss", "Crafty Shield", "Flower Shield", "Grassy Terrain", "Misty Terrain", "Electrify", "Play Rough", 345 | "Fairy Wind", "Moonblast", "Boomburst", "Fairy Lock", "King’s Shield", "Play Nice", "Confide", "Diamond Storm", 346 | "Steam Eruption", "Hyperspace Hole", "Water Shuriken", "Mystical Fire", "Spiky Shield", "Aromatic Mist", "Eerie Impulse", "Venom Drench", 347 | "Powder", "Geomancy", "Magnetic Flux", "Happy Hour", "Electric Terrain", "Dazzling Gleam", "Celebrate", "Hold Hands", 348 | "Baby-Doll Eyes", "Nuzzle", "Hold Back", "Infestation", "Power-Up Punch", "Oblivion Wing", "Thousand Arrows", "Thousand Waves", 349 | "Land’s Wrath", "Light of Ruin", "Origin Pulse", "Precipice Blades", "Dragon Ascent", "Hyperspace Fury", 350 | -- Gen 7 351 | "Breakneck Blitz", "Breakneck Blitz", "All-Out Pummeling", "All-Out Pummeling", "Supersonic Skystrike", "Supersonic Skystrike", 352 | "Acid Downpour", "Acid Downpour", "Tectonic Rage", "Tectonic Rage", "Continental Crush", "Continental Crush", "Savage Spin-Out", 353 | "Savage Spin-Out", "Never-Ending Nightmare", "Never-Ending Nightmare", "Corkscrew Crash", "Corkscrew Crash", "Inferno Overdrive", 354 | "Inferno Overdrive", "Hydro Vortex", "Hydro Vortex", "Bloom Doom", "Bloom Doom", "Gigavolt Havoc", "Gigavolt Havoc", "Shattered Psyche", 355 | "Shattered Psyche", "Subzero Slammer", "Subzero Slammer", "Devastating Drake", "Devastating Drake", "Black Hole Eclipse", 356 | "Black Hole Eclipse", "Twinkle Tackle", "Twinkle Tackle", "Catastropika", "Shore Up", "First Impression", "Baneful Bunker", 357 | "Spirit Shackle", "Darkest Lariat", "Sparkling Aria", "Ice Hammer", "Floral Healing", "High Horsepower", "Strength Sap", "Solar Blade", 358 | "Leafage", "Spotlight", "Toxic Thread", "Laser Focus", "Gear Up", "Throat Chop", "Pollen Puff", "Anchor Shot", "Psychic Terrain", "Lunge", 359 | "Fire Lash", "Power Trip", "Burn Up", "Speed Swap", "Smart Strike", "Purify", "Revelation Dance", "Core Enforcer", 360 | "Trop Kick", "Instruct", "Beak Blast", "Clanging Scales", "Dragon Hammer", "Brutal Swing", "Aurora Veil", "Sinister Arrow Raid", 361 | "Malicious Moonsault", "Oceanic Operetta", "Guardian of Alola", "Soul-Stealing 7-Star Strike", "Stoked Sparksurfer", "Pulverizing Pancake", 362 | "Extreme Evoboost", "Genesis Supernova", "Shell Trap", "Fleur Cannon", "Psychic Fangs", "Stomping Tantrum", "Shadow Bone", "Accelerock", 363 | "Liquidation", "Prismatic Laser", "Spectral Thief", "Sunsteel Strike", "Moongeist Beam", "Tearful Look", "Zing Zap", "Nature’s Madness", 364 | "Multi-Attack", "10,000,000 Volt Thunderbolt", "Mind Blown", "Plasma Fists", "Photon Geyser", "Light That Burns the Sky", 365 | "Searing Sunraze Smash", "Menacing Moonraze Maelstrom", "Let’s Snuggle Forever", "Splintered Stormshards", "Clangorous Soulblaze", 366 | "Zippy Zap", "Splishy Splash", "Floaty Fall", "Pika Papow", "Bouncy Bubble", "Buzzy Buzz", "Sizzly Slide", "Glitzy Glow", "Baddy Bad", 367 | "Sappy Seed", "Freezy Frost", "Sparkly Swirl", "Veevee Volley", "Double Iron Bash", 368 | -- Gen 8 369 | "Max Guard", "Dynamax Cannon", "Snipe Shot", "Jaw Lock", "Stuff Cheeks", "No Retreat", "Tar Shot", "Magic Powder", "Dragon Darts", 370 | "Teatime", "Octolock", "Bolt Beak", "Fishious Rend", "Court Change", "Max Flare", "Max Flutterby", "Max Lightning", 371 | "Max Strike", "Max Knuckle", "Max Phantasm", "Max Hailstorm", "Max Ooze", "Max Geyser", "Max Airstream", "Max Starfall", 372 | "Max Wyrmwind", "Max Mindstorm", "Max Rockfall", "Max Quake", "Max Darkness", "Max Overgrowth", "Max Steelspike", "Clangorous Soul", 373 | "Body Press", "Decorate", "Drum Beating", "Snap Trap", "Pyro Ball", "Behemoth Blade", "Behemoth Bash", "Aura Wheel", 374 | "Breaking Swipe", "Branch Poke", "Overdrive", "Apple Acid", "Grav Apple", "Spirit Break", "Strange Steam", "Life Dew", 375 | "Obstruct", "False Surrender", "Meteor Assault", "Eternabeam", "Steel Beam", "Expanding Force", "Steel Roller", "Scale Shot", 376 | "Meteor Beam", "Shell Side Arm", "Misty Explosion", "Grassy Glide", "Rising Voltage", "Terrain Pulse", "Skitter Smack", "Burning Jealousy", 377 | "Lash Out", "Poltergeist", "Corrosive Gas", "Coaching", "Flip Turn", "Triple Axel", "Dual Wingbeat", "Scorching Sands", 378 | "Jungle Healing", "Wicked Blow", "Surging Strikes", "Thunder Cage", "Dragon Energy", "Freezing Glare", "Fiery Wrath", "Thunderous Kick", 379 | "Glacial Lance", "Astral Barrage", "Eerie Spell"} 380 | 381 | local itemNamesList = { 382 | "None", "Master Ball", "Ultra Ball", "Great Ball", "Poké Ball", "Safari Ball", "Net Ball", "Dive Ball", 383 | "Nest Ball", "Repeat Ball", "Timer Ball", "Luxury Ball", "Premier Ball", "Dusk Ball", "Heal Ball", "Quick Ball", 384 | "Cherish Ball", "Potion", "Antidote", "Burn Heal", "Ice Heal", "Awakening", "Paralyze Heal", "Full Restore", 385 | "Max Potion", "Hyper Potion", "Super Potion", "Full Heal", "Revive", "Max Revive", "Fresh Water", "Soda Pop", 386 | "Lemonade", "Moomoo Milk", "Energy Powder", "Energy Root", "Heal Powder", "Revival Herb", "Ether", "Max Ether", 387 | "Elixir", "Max Elixir", "Lava Cookie", "Berry Juice", "Sacred Ash", "HP Up", "Protein", "Iron", 388 | "Carbos", "Calcium", "Rare Candy", "PP Up", "Zinc", "PP Max", "Old Gateau", "Guard Spec.", 389 | "Dire Hit", "X Attack", "X Defense", "X Speed", "X Accuracy", "X Sp. Atk", "X Sp. Def", "Poké Doll", 390 | "Fluffy Tail", "Blue Flute", "Yellow Flute", "Red Flute", "Black Flute", "White Flute", "Shoal Salt", "Shoal Shell", 391 | "Red Shard", "Blue Shard", "Yellow Shard", "Green Shard", "Super Repel", "Max Repel", "Escape Rope", "Repel", 392 | "Sun Stone", "Moon Stone", "Fire Stone", "Thunder Stone", "Water Stone", "Leaf Stone", "Tiny Mushroom", "Big Mushroom", 393 | "Pearl", "Big Pearl", "Stardust", "Star Piece", "Nugget", "Heart Scale", "Honey", "Growth Mulch", 394 | "Damp Mulch", "Stable Mulch", "Gooey Mulch", "Root Fossil", "Claw Fossil", "Helix Fossil", "Dome Fossil", "Old Amber", 395 | "Armor Fossil", "Skull Fossil", "Rare Bone", "Shiny Stone", "Dusk Stone", "Dawn Stone", "Oval Stone", "Odd Keystone", 396 | "Griseous Orb", "Tea", "unknown", "Autograph", "Douse Drive", "Shock Drive", "Burn Drive", "Chill Drive", 397 | "unknown", "Pokémon Box Link", "Medicine Pocket", "TM Case", "Candy Jar", "Power-Up Pocket", "Clothing Trunk", "Catching Pocket", 398 | "Battle Pocket", "unknown", "unknown", "unknown", "unknown", "unknown", "Sweet Heart", "Adamant Orb", 399 | "Lustrous Orb", "Greet Mail", "Favored Mail", "RSVP Mail", "Thanks Mail", "Inquiry Mail", "Like Mail", "Reply Mail", 400 | "Bridge Mail S", "Bridge Mail D", "Bridge Mail T", "Bridge Mail V", "Bridge Mail M", "Cheri Berry", "Chesto Berry", "Pecha Berry", 401 | "Rawst Berry", "Aspear Berry", "Leppa Berry", "Oran Berry", "Persim Berry", "Lum Berry", "Sitrus Berry", "Figy Berry", 402 | "Wiki Berry", "Mago Berry", "Aguav Berry", "Iapapa Berry", "Razz Berry", "Bluk Berry", "Nanab Berry", "Wepear Berry", 403 | "Pinap Berry", "Pomeg Berry", "Kelpsy Berry", "Qualot Berry", "Hondew Berry", "Grepa Berry", "Tamato Berry", "Cornn Berry", 404 | "Magost Berry", "Rabuta Berry", "Nomel Berry", "Spelon Berry", "Pamtre Berry", "Watmel Berry", "Durin Berry", "Belue Berry", 405 | "Occa Berry", "Passho Berry", "Wacan Berry", "Rindo Berry", "Yache Berry", "Chople Berry", "Kebia Berry", "Shuca Berry", 406 | "Coba Berry", "Payapa Berry", "Tanga Berry", "Charti Berry", "Kasib Berry", "Haban Berry", "Colbur Berry", "Babiri Berry", 407 | "Chilan Berry", "Liechi Berry", "Ganlon Berry", "Salac Berry", "Petaya Berry", "Apicot Berry", "Lansat Berry", "Starf Berry", 408 | "Enigma Berry", "Micle Berry", "Custap Berry", "Jaboca Berry", "Rowap Berry", "Bright Powder", "White Herb", "Macho Brace", 409 | "Exp. Share", "Quick Claw", "Soothe Bell", "Mental Herb", "Choice Band", "King’s Rock", "Silver Powder", "Amulet Coin", 410 | "Cleanse Tag", "Soul Dew", "Deep Sea Tooth", "Deep Sea Scale", "Smoke Ball", "Everstone", "Focus Band", "Lucky Egg", 411 | "Scope Lens", "Metal Coat", "Leftovers", "Dragon Scale", "Light Ball", "Soft Sand", "Hard Stone", "Miracle Seed", 412 | "Black Glasses", "Black Belt", "Magnet", "Mystic Water", "Sharp Beak", "Poison Barb", "Never-Melt Ice", "Spell Tag", 413 | "Twisted Spoon", "Charcoal", "Dragon Fang", "Silk Scarf", "Upgrade", "Shell Bell", "Sea Incense", "Lax Incense", 414 | "Lucky Punch", "Metal Powder", "Thick Club", "Leek", "Red Scarf", "Blue Scarf", "Pink Scarf", "Green Scarf", 415 | "Yellow Scarf", "Wide Lens", "Muscle Band", "Wise Glasses", "Expert Belt", "Light Clay", "Life Orb", "Power Herb", 416 | "Toxic Orb", "Flame Orb", "Quick Powder", "Focus Sash", "Zoom Lens", "Metronome", "Iron Ball", "Lagging Tail", 417 | "Destiny Knot", "Black Sludge", "Icy Rock", "Smooth Rock", "Heat Rock", "Damp Rock", "Grip Claw", "Choice Scarf", 418 | "Sticky Barb", "Power Bracer", "Power Belt", "Power Lens", "Power Band", "Power Anklet", "Power Weight", "Shed Shell", 419 | "Big Root", "Choice Specs", "Flame Plate", "Splash Plate", "Zap Plate", "Meadow Plate", "Icicle Plate", "Fist Plate", 420 | "Toxic Plate", "Earth Plate", "Sky Plate", "Mind Plate", "Insect Plate", "Stone Plate", "Spooky Plate", "Draco Plate", 421 | "Dread Plate", "Iron Plate", "Odd Incense", "Rock Incense", "Full Incense", "Wave Incense", "Rose Incense", "Luck Incense", 422 | "Pure Incense", "Protector", "Electirizer", "Magmarizer", "Dubious Disc", "Reaper Cloth", "Razor Claw", "Razor Fang", 423 | "TM01", "TM02", "TM03", "TM04", "TM05", "TM06", "TM07", "TM08", 424 | "TM09", "TM10", "TM11", "TM12", "TM13", "TM14", "TM15", "TM16", 425 | "TM17", "TM18", "TM19", "TM20", "TM21", "TM22", "TM23", "TM24", 426 | "TM25", "TM26", "TM27", "TM28", "TM29", "TM30", "TM31", "TM32", 427 | "TM33", "TM34", "TM35", "TM36", "TM37", "TM38", "TM39", "TM40", 428 | "TM41", "TM42", "TM43", "TM44", "TM45", "TM46", "TM47", "TM48", 429 | "TM49", "TM50", "TM51", "TM52", "TM53", "TM54", "TM55", "TM56", 430 | "TM57", "TM58", "TM59", "TM60", "TM61", "TM62", "TM63", "TM64", 431 | "TM65", "TM66", "TM67", "TM68", "TM69", "TM70", "TM71", "TM72", 432 | "TM73", "TM74", "TM75", "TM76", "TM77", "TM78", "TM79", "TM80", 433 | "TM81", "TM82", "TM83", "TM84", "TM85", "TM86", "TM87", "TM88", 434 | "TM89", "TM90", "TM91", "TM92", "TM93", "TM94", "TM95", "TM96", 435 | "TM97", "TM98", "TM99", "TM100", "Explorer Kit", "Loot Sack", "Rule Book", "Poké Radar", 436 | "Point Card", "Guidebook", "Sticker Case", "Fashion Case", "Sticker Bag", "Pal Pad", "Works Key", "Old Charm", 437 | "Galactic Key", "Red Chain", "Town Map", "Vs. Seeker", "Coin Case", "Old Rod", "Good Rod", "Super Rod", 438 | "Sprayduck", "Poffin Case", "Bike", "Suite Key", "Oak’s Letter", "Lunar Feather", "Member Card", "unknown", 439 | "S.S. Ticket", "Contest Pass", "Magma Stone", "Parcel", "Coupon 1", "Coupon 2", "Coupon 3", "Storage Key", 440 | "Secret Medicine", "Vs. Recorder", "Gracidea", "Secret Key", "Apricorn Box", "Unown Report", "Berry Pots", "Dowsing Machine", 441 | "Blue Card", "Slowpoke Tail", "Clear Bell", "Card Key", "Basement Key", "Squirt Bottle", "Red Scale", "Lost Item", 442 | "Pass", "Machine Part", "Silver Wing", "Rainbow Wing", "Mystery Egg", "Red Apricorn", "Blue Apricorn", "Yellow Apricorn", 443 | "Green Apricorn", "Pink Apricorn", "White Apricorn", "Black Apricorn", "Fast Ball", "Level Ball", "Lure Ball", "Heavy Ball", 444 | "Love Ball", "Friend Ball", "Moon Ball", "Sport Ball", "Park Ball", "Photo Album", "GB Sounds", "Tidal Bell", 445 | "Rage Candy Bar", "Data Card 01", "Data Card 02", "Data Card 03", "Data Card 04", "Data Card 05", "Data Card 06", "Data Card 07", 446 | "Data Card 08", "Data Card 09", "Data Card 10", "Data Card 11", "Data Card 12", "Data Card 13", "Data Card 14", "Data Card 15", 447 | "Data Card 16", "Data Card 17", "Data Card 18", "Data Card 19", "Data Card 20", "Data Card 21", "Data Card 22", "Data Card 23", 448 | "Data Card 24", "Data Card 25", "Data Card 26", "Data Card 27", "Jade Orb", "Lock Capsule", "Red Orb", "Blue Orb", 449 | "Enigma Stone", "Prism Scale", "Eviolite", "Float Stone", "Rocky Helmet", "Air Balloon", "Red Card", "Ring Target", 450 | "Binding Band", "Absorb Bulb", "Cell Battery", "Eject Button", "Fire Gem", "Water Gem", "Electric Gem", "Grass Gem", 451 | "Ice Gem", "Fighting Gem", "Poison Gem", "Ground Gem", "Flying Gem", "Psychic Gem", "Bug Gem", "Rock Gem", 452 | "Ghost Gem", "Dragon Gem", "Dark Gem", "Steel Gem", "Normal Gem", "Health Feather", "Muscle Feather", "Resist Feather", 453 | "Genius Feather", "Clever Feather", "Swift Feather", "Pretty Feather", "Cover Fossil", "Plume Fossil", "Liberty Pass", "Pass Orb", 454 | "Dream Ball", "Poké Toy", "Prop Case", "Dragon Skull", "Balm Mushroom", "Big Nugget", "Pearl String", "Comet Shard", 455 | "Relic Copper", "Relic Silver", "Relic Gold", "Relic Vase", "Relic Band", "Relic Statue", "Relic Crown", "Casteliacone", 456 | "Dire Hit 2", "X Speed 2", "X Sp. Atk 2", "X Sp. Def 2", "X Defense 2", "X Attack 2", "X Accuracy 2", "X Speed 3", 457 | "X Sp. Atk 3", "X Sp. Def 3", "X Defense 3", "X Attack 3", "X Accuracy 3", "X Speed 6", "X Sp. Atk 6", "X Sp. Def 6", 458 | "X Defense 6", "X Attack 6", "X Accuracy 6", "Ability Urge", "Item Drop", "Item Urge", "Reset Urge", "Dire Hit 3", 459 | "Light Stone", "Dark Stone", "TM93", "TM94", "TM95", "Xtransceiver", "unknown", "Gram 1", 460 | "Gram 2", "Gram 3", "Xtransceiver", "Medal Box", "DNA Splicers", "DNA Splicers", "Permit", "Oval Charm", 461 | "Shiny Charm", "Plasma Card", "Grubby Hanky", "Colress Machine", "Dropped Item", "Dropped Item", "Reveal Glass", "Weakness Policy", 462 | "Assault Vest", "Holo Caster", "Prof’s Letter", "Roller Skates", "Pixie Plate", "Ability Capsule", "Whipped Dream", "Sachet", 463 | "Luminous Moss", "Snowball", "Safety Goggles", "Poké Flute", "Rich Mulch", "Surprise Mulch", "Boost Mulch", "Amaze Mulch", 464 | "Gengarite", "Gardevoirite", "Ampharosite", "Venusaurite", "Charizardite X", "Blastoisinite", "Mewtwonite X", "Mewtwonite Y", 465 | "Blazikenite", "Medichamite", "Houndoominite", "Aggronite", "Banettite", "Tyranitarite", "Scizorite", "Pinsirite", 466 | "Aerodactylite", "Lucarionite", "Abomasite", "Kangaskhanite", "Gyaradosite", "Absolite", "Charizardite Y", "Alakazite", 467 | "Heracronite", "Mawilite", "Manectite", "Garchompite", "Latiasite", "Latiosite", "Roseli Berry", "Kee Berry", 468 | "Maranga Berry", "Sprinklotad", "TM96", "TM97", "TM98", "TM99", "TM100", "Power Plant Pass", 469 | "Mega Ring", "Intriguing Stone", "Common Stone", "Discount Coupon", "Elevator Key", "TMV Pass", "Honor of Kalos", "Adventure Guide", 470 | "Strange Souvenir", "Lens Case", "Makeup Bag", "Travel Trunk", "Lumiose Galette", "Shalour Sable", "Jaw Fossil", "Sail Fossil", 471 | "Looker Ticket", "Bike", "Holo Caster", "Fairy Gem", "Mega Charm", "Mega Glove", "Mach Bike", "Acro Bike", 472 | "Wailmer Pail", "Devon Parts", "Soot Sack", "Basement Key", "Pokéblock Kit", "Letter", "Eon Ticket", "Scanner", 473 | "Go-Goggles", "Meteorite", "Key to Room 1", "Key to Room 2", "Key to Room 4", "Key to Room 6", "Storage Key", "Devon Scope", 474 | "S.S. Ticket", "HM07", "Devon Scuba Gear", "Contest Costume", "Contest Costume", "Magma Suit", "Aqua Suit", "Pair of Tickets", 475 | "Mega Bracelet", "Mega Pendant", "Mega Glasses", "Mega Anchor", "Mega Stickpin", "Mega Tiara", "Mega Anklet", "Meteorite", 476 | "Swampertite", "Sceptilite", "Sablenite", "Altarianite", "Galladite", "Audinite", "Metagrossite", "Sharpedonite", 477 | "Slowbronite", "Steelixite", "Pidgeotite", "Glalitite", "Diancite", "Prison Bottle", "Mega Cuff", "Cameruptite", 478 | "Lopunnite", "Salamencite", "Beedrillite", "Meteorite", "Meteorite", "Key Stone", "Meteorite Shard", "Eon Flute", 479 | "Normalium Z", "Firium Z", "Waterium Z", "Electrium Z", "Grassium Z", "Icium Z", "Fightinium Z", "Poisonium Z", 480 | "Groundium Z", "Flyinium Z", "Psychium Z", "Buginium Z", "Rockium Z", "Ghostium Z", "Dragonium Z", "Darkinium Z", 481 | "Steelium Z", "Fairium Z", "Pikanium Z", "Bottle Cap", "Gold Bottle Cap", "Z-Ring", "Decidium Z", "Incinium Z", 482 | "Primarium Z", "Tapunium Z", "Marshadium Z", "Aloraichium Z", "Snorlium Z", "Eevium Z", "Mewnium Z", "Normalium Z", 483 | "Firium Z", "Waterium Z", "Electrium Z", "Grassium Z", "Icium Z", "Fightinium Z", "Poisonium Z", "Groundium Z", 484 | "Flyinium Z", "Psychium Z", "Buginium Z", "Rockium Z", "Ghostium Z", "Dragonium Z", "Darkinium Z", "Steelium Z", 485 | "Fairium Z", "Pikanium Z", "Decidium Z", "Incinium Z", "Primarium Z", "Tapunium Z", "Marshadium Z", "Aloraichium Z", 486 | "Snorlium Z", "Eevium Z", "Mewnium Z", "Pikashunium Z", "Pikashunium Z", "unknown", "unknown", "unknown", 487 | "unknown", "Forage Bag", "Fishing Rod", "Professor’s Mask", "Festival Ticket", "Sparkling Stone", "Adrenaline Orb", "Zygarde Cube", 488 | "unknown", "Ice Stone", "Ride Pager", "Beast Ball", "Big Malasada", "Red Nectar", "Yellow Nectar", "Pink Nectar", 489 | "Purple Nectar", "Sun Flute", "Moon Flute", "unknown", "Enigmatic Card", "Silver Razz Berry", "Golden Razz Berry", "Silver Nanab Berry", 490 | "Golden Nanab Berry", "Silver Pinap Berry", "Golden Pinap Berry", "unknown", "unknown", "unknown", "unknown", "unknown", 491 | "Secret Key", "S.S. Ticket", "Silph Scope", "Parcel", "Card Key", "Gold Teeth", "Lift Key", "Terrain Extender", 492 | "Protective Pads", "Electric Seed", "Psychic Seed", "Misty Seed", "Grassy Seed", "Stretchy Spring", "Chalky Stone", "Marble", 493 | "Lone Earring", "Beach Glass", "Gold Leaf", "Silver Leaf", "Polished Mud Ball", "Tropical Shell", "Leaf Letter", "Leaf Letter", 494 | "Small Bouquet", "unknown", "unknown", "unknown", "Lure", "Super Lure", "Max Lure", "Pewter Crunchies", 495 | "Fighting Memory", "Flying Memory", "Poison Memory", "Ground Memory", "Rock Memory", "Bug Memory", "Ghost Memory", "Steel Memory", 496 | "Fire Memory", "Water Memory", "Grass Memory", "Electric Memory", "Psychic Memory", "Ice Memory", "Dragon Memory", "Dark Memory", 497 | "Fairy Memory", "Solganium Z", "Lunalium Z", "Ultranecrozium Z", "Mimikium Z", "Lycanium Z", "Kommonium Z", "Solganium Z", 498 | "Lunalium Z", "Ultranecrozium Z", "Mimikium Z", "Lycanium Z", "Kommonium Z", "Z-Power Ring", "Pink Petal", "Orange Petal", 499 | "Blue Petal", "Red Petal", "Green Petal", "Yellow Petal", "Purple Petal", "Rainbow Flower", "Surge Badge", "N-Solarizer", 500 | "N-Lunarizer", "N-Solarizer", "N-Lunarizer", "Ilima Normalium Z", "Left Poké Ball", "Roto Hatch", "Roto Bargain", "Roto Prize Money", 501 | "Roto Exp. Points", "Roto Friendship", "Roto Encounter", "Roto Stealth", "Roto HP Restore", "Roto PP Restore", "Roto Boost", "Roto Catch", 502 | "Health Candy", "Mighty Candy", "Tough Candy", "Smart Candy", "Courage Candy", "Quick Candy", "Health Candy L", "Mighty Candy L", 503 | "Tough Candy L", "Smart Candy L", "Courage Candy L", "Quick Candy L", "Health Candy XL", "Mighty Candy XL", "Tough Candy XL", 504 | "Smart Candy XL", "Courage Candy XL", "Quick Candy XL", "Bulbasaur Candy", "Charmander Candy", "Squirtle Candy", "Caterpie Candy", 505 | "Weedle Candy", "Pidgey Candy", "Rattata Candy", "Spearow Candy", "Ekans Candy", "Pikachu Candy", "Sandshrew Candy", "Nidoran♀ Candy", 506 | "Nidoran♂ Candy", "Clefairy Candy", "Vulpix Candy", "Jigglypuff Candy", "Zubat Candy", "Oddish Candy", "Paras Candy", "Venonat Candy", 507 | "Diglett Candy", "Meowth Candy", "Psyduck Candy", "Mankey Candy", "Growlithe Candy", "Poliwag Candy", "Abra Candy", "Machop Candy", 508 | "Bellsprout Candy", "Tentacool Candy", "Geodude Candy", "Ponyta Candy", "Slowpoke Candy", "Magnemite Candy", "Farfetch’d Candy", 509 | "Doduo Candy", "Seel Candy", "Grimer Candy", "Shellder Candy", "Gastly Candy", "Onix Candy", "Drowzee Candy", "Krabby Candy", 510 | "Voltorb Candy", "Exeggcute Candy", "Cubone Candy", "Hitmonlee Candy", "Hitmonchan Candy", "Lickitung Candy", "Koffing Candy", 511 | "Rhyhorn Candy", "Chansey Candy", "Tangela Candy", "Kangaskhan Candy", "Horsea Candy", "Goldeen Candy", "Staryu Candy", "Mr. Mime Candy", 512 | "Scyther Candy", "Jynx Candy", "Electabuzz Candy", "Pinsir Candy", "Tauros Candy", "Magikarp Candy", "Lapras Candy", "Ditto Candy", 513 | "Eevee Candy", "Porygon Candy", "Omanyte Candy", "Kabuto Candy", "Aerodactyl Candy", "Snorlax Candy", "Articuno Candy", "Zapdos Candy", 514 | "Moltres Candy", "Dratini Candy", "Mewtwo Candy", "Mew Candy", "Meltan Candy", "Magmar Candy", "unknown", "unknown", "unknown", "unknown", 515 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 516 | "unknown", "unknown", "Endorsement", "Pokémon Box Link", "Wishing Star", "Dynamax Band", "unknown", "unknown", 517 | "Fishing Rod", "Rotom Bike", "unknown", "unknown", "Sausages", "Bob’s Food Tin", "Bach’s Food Tin", "Tin of Beans", 518 | "Bread", "Pasta", "Mixed Mushrooms", "Smoke-Poke Tail", "Large Leek", "Fancy Apple", "Brittle Bones", "Pack of Potatoes", 519 | "Pungent Root", "Salad Mix", "Fried Food", "Boiled Egg", "Camping Gear", "unknown", "unknown", "Rusted Sword", 520 | "Rusted Shield", "Fossilized Bird", "Fossilized Fish", "Fossilized Drake", "Fossilized Dino", "Strawberry Sweet", "Love Sweet", 521 | "Berry Sweet", "Clover Sweet", "Flower Sweet", "Star Sweet", "Ribbon Sweet", "Sweet Apple", "Tart Apple", "Throat Spray", "Eject Pack", 522 | "Heavy-Duty Boots", "Blunder Policy", "Room Service", "Utility Umbrella", "Exp. Candy XS", "Exp. Candy S", "Exp. Candy M", "Exp. Candy L", 523 | "Exp. Candy XL", "Dynamax Candy", "TR00", "TR01", "TR02", "TR03", "TR04", "TR05", 524 | "TR06", "TR07", "TR08", "TR09", "TR10", "TR11", "TR12", "TR13", 525 | "TR14", "TR15", "TR16", "TR17", "TR18", "TR19", "TR20", "TR21", 526 | "TR22", "TR23", "TR24", "TR25", "TR26", "TR27", "TR28", "TR29", 527 | "TR30", "TR31", "TR32", "TR33", "TR34", "TR35", "TR36", "TR37", 528 | "TR38", "TR39", "TR40", "TR41", "TR42", "TR43", "TR44", "TR45", 529 | "TR46", "TR47", "TR48", "TR49", "TR50", "TR51", "TR52", "TR53", 530 | "TR54", "TR55", "TR56", "TR57", "TR58", "TR59", "TR60", "TR61", 531 | "TR62", "TR63", "TR64", "TR65", "TR66", "TR67", "TR68", "TR69", 532 | "TR70", "TR71", "TR72", "TR73", "TR74", "TR75", "TR76", "TR77", 533 | "TR78", "TR79", "TR80", "TR81", "TR82", "TR83", "TR84", "TR85", 534 | "TR86", "TR87", "TR88", "TR89", "TR90", "TR91", "TR92", "TR93", 535 | "TR94", "TR95", "TR96", "TR97", "TR98", "TR99", "TM00", "Lonely Mint", 536 | "Adamant Mint", "Naughty Mint", "Brave Mint", "Bold Mint", "Impish Mint", "Lax Mint", "Relaxed Mint", "Modest Mint", 537 | "Mild Mint", "Rash Mint", "Quiet Mint", "Calm Mint", "Gentle Mint", "Careful Mint", "Sassy Mint", "Timid Mint", 538 | "Hasty Mint", "Jolly Mint", "Naive Mint", "Serious Mint", "Wishing Piece", "Cracked Pot", "Chipped Pot", "Hi-tech Earbuds", 539 | "Fruit Bunch", "Moomoo Cheese", "Spice Mix", "Fresh Cream", "Packaged Curry", "Coconut Milk", "Instant Noodles", "Precooked Burger", 540 | "Gigantamix", "Wishing Chip", "Rotom Bike", "Catching Charm", "unknown", "Old Letter", "Band Autograph", "Sonia’s Book", 541 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "Rotom Catalog", "★And458", 542 | "★And15", "★And337", "★And603", "★And390", "★Sgr6879", "★Sgr6859", "★Sgr6913", "★Sgr7348", 543 | "★Sgr7121", "★Sgr6746", "★Sgr7194", "★Sgr7337", "★Sgr7343", "★Sgr6812", "★Sgr7116", "★Sgr7264", 544 | "★Sgr7597", "★Del7882", "★Del7906", "★Del7852", "★Psc596", "★Psc361", "★Psc510", "★Psc437", 545 | "★Psc8773", "★Lep1865", "★Lep1829", "★Boo5340", "★Boo5506", "★Boo5435", "★Boo5602", "★Boo5733", 546 | "★Boo5235", "★Boo5351", "★Hya3748", "★Hya3903", "★Hya3418", "★Hya3482", "★Hya3845", "★Eri1084", 547 | "★Eri472", "★Eri1666", "★Eri897", "★Eri1231", "★Eri874", "★Eri1298", "★Eri1325", "★Eri984", 548 | "★Eri1464", "★Eri1393", "★Eri850", "★Tau1409", "★Tau1457", "★Tau1165", "★Tau1791", "★Tau1910", 549 | "★Tau1346", "★Tau1373", "★Tau1412", "★CMa2491", "★CMa2693", "★CMa2294", "★CMa2827", "★CMa2282", 550 | "★CMa2618", "★CMa2657", "★CMa2646", "★UMa4905", "★UMa4301", "★UMa5191", "★UMa5054", "★UMa4295", 551 | "★UMa4660", "★UMa4554", "★UMa4069", "★UMa3569", "★UMa3323", "★UMa4033", "★UMa4377", "★UMa4375", 552 | "★UMa4518", "★UMa3594", "★Vir5056", "★Vir4825", "★Vir4932", "★Vir4540", "★Vir4689", "★Vir5338", 553 | "★Vir4910", "★Vir5315", "★Vir5359", "★Vir5409", "★Vir5107", "★Ari617", "★Ari553", "★Ari546", 554 | "★Ari951", "★Ori1713", "★Ori2061", "★Ori1790", "★Ori1903", "★Ori1948", "★Ori2004", "★Ori1852", 555 | "★Ori1879", "★Ori1899", "★Ori1543", "★Cas21", "★Cas168", "★Cas403", "★Cas153", "★Cas542", 556 | "★Cas219", "★Cas265", "★Cnc3572", "★Cnc3208", "★Cnc3461", "★Cnc3449", "★Cnc3429", "★Cnc3627", 557 | "★Cnc3268", "★Cnc3249", "★Com4968", "★Crv4757", "★Crv4623", "★Crv4662", "★Crv4786", "★Aur1708", 558 | "★Aur2088", "★Aur1605", "★Aur2095", "★Aur1577", "★Aur1641", "★Aur1612", "★Pav7790", "★Cet911", 559 | "★Cet681", "★Cet188", "★Cet539", "★Cet804", "★Cep8974", "★Cep8162", "★Cep8238", "★Cep8417", 560 | "★Cen5267", "★Cen5288", "★Cen551", "★Cen5459", "★Cen5460", "★CMi2943", "★CMi2845", "★Equ8131", 561 | "★Vul7405", "★UMi424", "★UMi5563", "★UMi5735", "★UMi6789", "★Crt4287", "★Lyr7001", "★Lyr7178", 562 | "★Lyr7106", "★Lyr7298", "★Ara6585", "★Sco6134", "★Sco6527", "★Sco6553", "★Sco5953", "★Sco5984", 563 | "★Sco6508", "★Sco6084", "★Sco5944", "★Sco6630", "★Sco6027", "★Sco6247", "★Sco6252", "★Sco5928", 564 | "★Sco6241", "★Sco6165", "★Tri544", "★Leo3982", "★Leo4534", "★Leo4357", "★Leo4057", "★Leo4359", 565 | "★Leo4031", "★Leo3852", "★Leo3905", "★Leo3773", "★Gru8425", "★Gru8636", "★Gru8353", "★Lib5685", 566 | "★Lib5531", "★Lib5787", "★Lib5603", "★Pup3165", "★Pup3185", "★Pup3045", "★Cyg7924", "★Cyg7417", 567 | "★Cyg7796", "★Cyg8301", "★Cyg7949", "★Cyg7528", "★Oct7228", "★Col1956", "★Col2040", "★Col2177", 568 | "★Gem2990", "★Gem2891", "★Gem2421", "★Gem2473", "★Gem2216", "★Gem2777", "★Gem2650", "★Gem2286", 569 | "★Gem2484", "★Gem2930", "★Peg8775", "★Peg8781", "★Peg39", "★Peg8308", "★Peg8650", "★Peg8634", 570 | "★Peg8684", "★Peg8450", "★Peg8880", "★Peg8905", "★Oph6556", "★Oph6378", "★Oph6603", "★Oph6149", 571 | "★Oph6056", "★Oph6075", "★Ser5854", "★Ser7141", "★Ser5879", "★Her6406", "★Her6148", "★Her6410", 572 | "★Her6526", "★Her6117", "★Her6008", "★Per936", "★Per1017", "★Per1131", "★Per1228", "★Per834", 573 | "★Per941", "★Phe99", "★Phe338", "★Vel3634", "★Vel3485", "★Vel3734", "★Aqr8232", "★Aqr8414", 574 | "★Aqr8709", "★Aqr8518", "★Aqr7950", "★Aqr8499", "★Aqr8610", "★Aqr8264", "★Cru4853", "★Cru4730", 575 | "★Cru4763", "★Cru4700", "★Cru4656", "★PsA8728", "★TrA6217", "★Cap7776", "★Cap7754", "★Cap8278", 576 | "★Cap8322", "★Cap7773", "★Sge7479", "★Car2326", "★Car3685", "★Car3307", "★Car3699", "★Dra5744", 577 | "★Dra5291", "★Dra6705", "★Dra6536", "★Dra7310", "★Dra6688", "★Dra4434", "★Dra6370", "★Dra7462", 578 | "★Dra6396", "★Dra6132", "★Dra6636", "★CVn4915", "★CVn4785", "★CVn4846", "★Aql7595", "★Aql7557", 579 | "★Aql7525", "★Aql7602", "★Aql7235", "Max Honey", "Max Mushrooms", "Galarica Twig", "Galarica Cuff", "Style Card", 580 | "Armor Pass", "Rotom Bike", "Rotom Bike", "Exp. Charm", "Armorite Ore", "Mark Charm", "Reins of Unity", "Reins of Unity", 581 | "Galarica Wreath", "Legendary Clue 1", "Legendary Clue 2", "Legendary Clue 3", "Legendary Clue?", "Crown Pass", "Wooden Crown", 582 | "Radiant Petal", "White Mane Hair", "Black Mane Hair", "Iceroot Carrot", "Shaderoot Carrot", "Dynite Ore", "Carrot Seeds", 583 | "Ability Patch", "Reins of Unity", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 584 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 585 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 586 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 587 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 588 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 589 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 590 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 591 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 592 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 593 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 594 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 595 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 596 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 597 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 598 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 599 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 600 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 601 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 602 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 603 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 604 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 605 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 606 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 607 | "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", 608 | "Mysterious Shard S", "Mysterious Shard L", "Digger Drill", "Kanto Slate", "Johto Slate", "Soul Slate", "Rainbow Slate", "Squall Slate", 609 | "Oceanic Slate", "Tectonic Slate", "Stratospheric Slate", "Genome Slate", "Discovery Slate", "Distortion Slate", "DS Sounds"} 610 | 611 | local STOREDSIZE = 328 612 | local BLOCKSIZE = 80 613 | 614 | local BLOCKPOSITION = { 615 | 0, 1, 2, 3, 616 | 0, 1, 3, 2, 617 | 0, 2, 1, 3, 618 | 0, 3, 1, 2, 619 | 0, 2, 3, 1, 620 | 0, 3, 2, 1, 621 | 1, 0, 2, 3, 622 | 1, 0, 3, 2, 623 | 2, 0, 1, 3, 624 | 3, 0, 1, 2, 625 | 2, 0, 3, 1, 626 | 3, 0, 2, 1, 627 | 1, 2, 0, 3, 628 | 1, 3, 0, 2, 629 | 2, 1, 0, 3, 630 | 3, 1, 0, 2, 631 | 2, 3, 0, 1, 632 | 3, 2, 0, 1, 633 | 1, 2, 3, 0, 634 | 1, 3, 2, 0, 635 | 2, 1, 3, 0, 636 | 3, 1, 2, 0, 637 | 2, 3, 1, 0, 638 | 3, 2, 1, 0, 639 | 640 | --duplicates of 0-7 to eliminate modulus 641 | 0, 1, 2, 3, 642 | 0, 1, 3, 2, 643 | 0, 2, 1, 3, 644 | 0, 3, 1, 2, 645 | 0, 2, 3, 1, 646 | 0, 3, 2, 1, 647 | 1, 0, 2, 3, 648 | 1, 0, 3, 2} 649 | 650 | local function leValue(str) 651 | local noSpaceStr = str:gsub("%s+", "") 652 | local i = #noSpaceStr 653 | local leStr = "" 654 | 655 | while i > 1 do 656 | leStr = leStr..noSpaceStr:sub(i - 1, i) 657 | i = i - 2 658 | end 659 | 660 | return tonumber(leStr, 16) 661 | end 662 | 663 | local function LCRNG(s) 664 | local a = 0x41C6 * (s % 0x10000) + bShr(s, 16) * 0x4E6D 665 | local b = 0x4E6D * (s % 0x10000) + (a % 0x10000) * 0x10000 + 0x6073 666 | local c = b % 4294967296 667 | 668 | return c 669 | end 670 | 671 | PK8 = {} 672 | PK8.__index = PK8 673 | 674 | function PK8.new(cryptedPKString) 675 | local o = setmetatable({}, PK8) 676 | o.buff = cryptedPKString 677 | 678 | return o 679 | end 680 | 681 | function PK8:getEC() 682 | local ec = self.buff:sub(1, (0x4 * 3) - 1) 683 | 684 | return leValue(ec) 685 | end 686 | 687 | function PK8:getSpecies() 688 | local species = self.buff:sub((0x8 * 3) + 1, (0x8 * 3) + ((0x2 * 3) - 1)) 689 | 690 | return leValue(species) 691 | end 692 | 693 | function PK8:getHeldItem() 694 | local heldItem = self.buff:sub((0xA * 3) + 1, (0xA * 3) + ((0x2 * 3) - 1)) 695 | 696 | return leValue(heldItem) 697 | end 698 | 699 | function PK8:getSIDTID() 700 | local sidtid = self.buff:sub((0x0C * 3) + 1, (0x0C * 3) + ((0x4 * 3) - 1)) 701 | 702 | return leValue(sidtid) 703 | end 704 | 705 | function PK8:getAbility() 706 | local ability = self.buff:sub((0x14 * 3) + 1, (0x14 * 3) + ((0x2 * 3) - 1)) 707 | 708 | return leValue(ability) 709 | end 710 | 711 | function PK8:getAbilityNum() 712 | local abilityNum = self.buff:sub((0x16 * 3) + 1, (0x16 * 3) + 2) 713 | 714 | return bAnd(leValue(abilityNum), 0x7) 715 | end 716 | 717 | function PK8:getPID() 718 | local pid = self.buff:sub((0x1C * 3) + 1, (0x1C * 3) + ((0x4 * 3) - 1)) 719 | 720 | return leValue(pid) 721 | end 722 | 723 | function PK8:getNature() 724 | local nature = self.buff:sub((0x20 * 3) + 1, (0x20 * 3) + 2) 725 | 726 | return leValue(nature) 727 | end 728 | 729 | function PK8:getMove1() 730 | local move1 = self.buff:sub((0x72 * 3) + 1, (0x72 * 3) + ((0x2 * 3) - 1)) 731 | 732 | return leValue(move1) 733 | end 734 | 735 | function PK8:getMove2() 736 | local move2 = self.buff:sub((0x74 * 3) + 1, (0x74 * 3) + ((0x2 * 3) - 1)) 737 | 738 | return leValue(move2) 739 | end 740 | 741 | function PK8:getMove3() 742 | local move3 = self.buff:sub((0x76 * 3) + 1, (0x76 * 3) + ((0x2 * 3) - 1)) 743 | 744 | return leValue(move3) 745 | end 746 | 747 | function PK8:getMove4() 748 | local move4 = self.buff:sub((0x78 * 3) + 1, (0x78 * 3) + ((0x2 * 3) - 1)) 749 | 750 | return leValue(move4) 751 | end 752 | 753 | function PK8:getIV32() 754 | local iv32 = self.buff:sub((0x8C * 3) + 1, (0x8C * 3) + ((0x4 * 3) - 1)) 755 | 756 | return leValue(iv32) 757 | end 758 | 759 | function PK8:getIVs() 760 | local iv32 = self:getIV32() 761 | local ivHp = bAnd(iv32, 0x1F) 762 | local ivAtk = bAnd(bShr(iv32, 5), 0x1F) 763 | local ivDef = bAnd(bShr(iv32, 10), 0x1F) 764 | local ivSpAtk = bAnd(bShr(iv32, 20), 0x1F) 765 | local ivSpDef = bAnd(bShr(iv32, 25), 0x1F) 766 | local ivSpd = bAnd(bShr(iv32, 15), 0x1F) 767 | 768 | return string.format("%d/%d/%d/%d/%d/%d", ivHp, ivAtk, ivDef, ivSpAtk, ivSpDef, ivSpd) 769 | end 770 | 771 | function PK8:getFakeXor() 772 | local SIDTID = self:getSIDTID() 773 | local PID = self:getPID() 774 | return bShr(SIDTID, 16) ~ (bAnd(SIDTID, 0xFFFF) ~ bShr(PID, 16) ~ bAnd(PID, 0xFFFF)) 775 | end 776 | 777 | function PK8:getShinyType() 778 | local PID = self:getPID() 779 | local fakeXor = self:getFakeXor() 780 | 781 | if fakeXor > 15 then 782 | return 0 783 | else 784 | if fakeXor == 0 then 785 | return 2 786 | else 787 | return 1 788 | end 789 | end 790 | end 791 | 792 | function PK8:shinyString() 793 | local shinyType = self:getShinyType() 794 | 795 | if shinyType == 0 then 796 | return "" 797 | elseif shinyType == 1 then 798 | return " (★)" 799 | else 800 | return " (◆)" 801 | end 802 | end 803 | 804 | function PK8:getFinalPID() 805 | local PID = self:getPID() 806 | local fakeXor = self:getFakeXor() 807 | local PSV = bShr(bShr(PID, 16) ~ bAnd(PID, 0xFFFF), 4) 808 | local realXor = bShr(PID, 16) ~ bAnd(PID, 0xFFFF) ~ TID ~ SID 809 | 810 | if fakeXor < 16 then -- Force shiny 811 | local shinyType = self:getShinyType() 812 | 813 | if fakeXor ~= realXor then 814 | local high = bAnd(PID, 0xFFFF) ~ TID ~ SID ~ (2 - shinyType) 815 | PID = bOr(bShl(high, 16), bAnd(PID, 0xFFFF)) 816 | end 817 | else -- Force non shiny 818 | if PSV == TSV then 819 | PID = PID ~ 0x10000000 820 | end 821 | end 822 | 823 | return PID 824 | end 825 | 826 | function PK8:getAbilityString() 827 | if self:getAbilityNum() < 1 then 828 | return "0" 829 | elseif self:getAbilityNum() < 4 then 830 | return tostring(self:getAbilityNum() - 1) 831 | else 832 | return "H" 833 | end 834 | end 835 | 836 | function PK8:getIsEgg() 837 | return bAnd(bShr(self:getIV32(), 30), 1) == 1 838 | end 839 | 840 | function PK8:cryptPKM(seed, start, ending) 841 | local i = (start * 3) + 1 842 | 843 | while i <= (ending * 3) - 5 do 844 | seed = LCRNG(seed) 845 | self.buff = self.buff:sub(1, i - 1)..string.format("%02X", tonumber(self.buff:sub(i, i + 1), 16) ~ bAnd(bShr(seed, 16), 0xFF))..self.buff:sub(i + 2) 846 | i = i + 3 847 | self.buff = self.buff:sub(1, i - 1)..string.format("%02X", tonumber(self.buff:sub(i, i + 1), 16) ~ bAnd(bShr(seed, 24), 0xFF))..self.buff:sub(i + 2) 848 | i = i + 3 849 | end 850 | end 851 | 852 | function PK8:shuffle(sv) 853 | local idx = 4 * sv 854 | local sdata = self.buff 855 | 856 | for block = 0, 3 do 857 | local ofs = BLOCKPOSITION[idx + block + 1] 858 | self.buff = self.buff:sub(1, (8 + BLOCKSIZE * block) * 3)..sdata:sub(((8 + BLOCKSIZE * ofs) * 3) + 1, ((8 + BLOCKSIZE * (ofs + 1)) * 3) - 3)..self.buff:sub(((8 + BLOCKSIZE * (block + 1)) * 3) - 2) 859 | end 860 | end 861 | 862 | function PK8:decrypt() 863 | local seed = self:getEC() 864 | local sv = bAnd(bShr(seed, 13), 0x1F) 865 | 866 | self:cryptPKM(seed, 8, STOREDSIZE) 867 | self:shuffle(sv) 868 | end 869 | 870 | function PK8:print() 871 | print(string.format("Species: %s", speciesNamesList[self:getSpecies() + 1])) 872 | print(string.format("PID: %08X%s", self:getFinalPID(), self:shinyString())) 873 | print(string.format("Nature: %s", natureNamesList[self:getNature() + 1])) 874 | print(string.format("Ability: %s (%s)", abilityNamesList[self:getAbility() + 1], self:getAbilityString())) 875 | print(string.format("IVs: %s", self:getIVs())) 876 | print(string.format("Held Item: %s\n", itemNamesList[self:getHeldItem() + 1])) 877 | print(string.format("Move: %s", moveNamesList[self:getMove1() + 1])) 878 | print(string.format("Move: %s", moveNamesList[self:getMove2() + 1])) 879 | print(string.format("Move: %s", moveNamesList[self:getMove3() + 1])) 880 | print(string.format("Move: %s", moveNamesList[self:getMove4() + 1])) 881 | end 882 | 883 | 884 | 885 | -- Roamer8 class 886 | Roamer8 = {} 887 | Roamer8.__index = Roamer8 888 | 889 | function Roamer8.new(roamerListAddr) 890 | local o = setmetatable({}, Roamer8) 891 | 892 | local roamerAddr = roamerListAddr + baseAddr + 0x20 + (slotIndex * 0x20) 893 | o.EC = readInteger(roamerAddr + 0x4) 894 | o.species = readSmallInteger(roamerAddr + 0xC) 895 | 896 | local r = XoroShiro128Plus.new(o.EC) 897 | local OTID = r:next() 898 | o.PID = r:next() 899 | 900 | local fakeXor = bShr(OTID, 16) ~ bAnd(OTID, 0xFFFF) ~ bShr(o.PID, 16) ~ bAnd(o.PID, 0xFFFF) 901 | local PSV = bShr(bShr(o.PID, 16) ~ bAnd(o.PID, 0xFFFF), 4) 902 | local realXor = bShr(o.PID, 16) ~ bAnd(o.PID, 0xFFFF) ~ TID ~ SID 903 | local TSV = bShr((TID ~ SID), 4) 904 | 905 | if fakeXor < 16 then -- Force shiny 906 | if fakeXor == 0 then 907 | o.shinyType = 2 908 | else 909 | o.shinyType = 1 910 | end 911 | 912 | if fakeXor ~= realXor then 913 | local high = bAnd(o.PID, 0xFFFF) ~ TID ~ SID ~ (2 - o.shinyType) 914 | o.PID = bOr(bShl(high, 16), bAnd(o.PID, 0xFFFF)) 915 | end 916 | 917 | if fakeXor == 0 then 918 | o.shinyType = " (◆)" 919 | else 920 | o.shinyType = " (★)" 921 | end 922 | else -- Force non shiny 923 | o.shinyType = "" 924 | 925 | if PSV == TSV then 926 | o.PID = o.PID ~ 0x10000000 927 | end 928 | end 929 | 930 | o.IVs = {} 931 | local i = 0 932 | while i < 3 do 933 | local stat = r:quickrand1(0x6) 934 | 935 | if o.IVs[stat + 1] == nil then 936 | o.IVs[stat + 1] = 31 937 | i = i + 1 938 | end 939 | end 940 | 941 | for i = 1, 6 do 942 | if o.IVs[i] == nil then 943 | o.IVs[i] = r:quickrand2(0x1F) 944 | end 945 | end 946 | 947 | o.ability = r:quickrand2(0x1) 948 | o.nature = r:quickrand1(25) 949 | 950 | return o 951 | end 952 | 953 | function Roamer8:print() 954 | print(string.format("Species: %s", speciesNamesList[self.species + 1])) 955 | print(string.format("PID: %08X%s", self.PID, self.shinyType)) 956 | print(string.format("Nature: %s", natureNamesList[self.nature + 1])) 957 | print(string.format("Ability: Levitate (%s)", self.ability)) 958 | print(string.format("IVs: %d/%d/%d/%d/%d/%d", self.IVs[1], self.IVs[2], self.IVs[3], self.IVs[4], self.IVs[5], self.IVs[6])) 959 | end 960 | 961 | 962 | 963 | -- Pokemon addresses functions 964 | local function getWildPokemonAddr() 965 | local wildPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x7E8) 966 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x58) 967 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x28) 968 | 969 | if wildPokemonAddr ~= 0 then 970 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x10) 971 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x20) 972 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x20) 973 | wildPokemonAddr = readQword(wildPokemonAddr + baseAddr + 0x18) 974 | wildPokemonAddr = wildPokemonAddr + baseAddr + 0x20 975 | end 976 | 977 | return wildPokemonAddr 978 | end 979 | 980 | local function getPartyPokemonAddr() 981 | local partySlotIndex = slotIndex 982 | 983 | if viewMode[viewModeIndex] == "Breeding" then 984 | local partyMemberCountAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x7F0) 985 | partySlotIndex = readBytes(partyMemberCountAddr + baseAddr + 0x18) - 1 986 | end 987 | 988 | local partyPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x7F0) 989 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x10) 990 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x20 + (8 * partySlotIndex)) 991 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x20) 992 | partyPokemonAddr = readQword(partyPokemonAddr + baseAddr + 0x18) 993 | partyPokemonAddr = partyPokemonAddr + baseAddr + 0x20 994 | 995 | return partyPokemonAddr 996 | end 997 | 998 | local function getBoxPokemonAddr() 999 | local boxPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0xA0) 1000 | boxPokemonAddr = readQword(boxPokemonAddr + baseAddr + 0x20 + (8 * boxNumberIndex)) 1001 | boxPokemonAddr = readQword(boxPokemonAddr + baseAddr + 0x20 + (8 * slotIndex)) 1002 | boxPokemonAddr = boxPokemonAddr + baseAddr + 0x20 1003 | 1004 | return boxPokemonAddr 1005 | end 1006 | 1007 | local function getRoamerListAddr() 1008 | local roamerPokemonAddr = readQword(playerPrefsProviderAddr + baseAddr + 0x2A0) 1009 | 1010 | return roamerPokemonAddr 1011 | end 1012 | 1013 | 1014 | 1015 | -- Input functions 1016 | local function getStateSizeModeIndexInput() 1017 | if isKeyPressed(VK_3) or isKeyPressed(VK_NUMPAD3) then 1018 | stateSizeModeIndex = 1 1019 | elseif isKeyPressed(VK_6) or isKeyPressed(VK_NUMPAD6) then 1020 | stateSizeModeIndex = 2 1021 | end 1022 | end 1023 | 1024 | local function getViewModeIndexInput() 1025 | if (isKeyPressed(VK_2) or isKeyPressed(VK_NUMPAD2)) and viewModeIndex < 5 and not prevKeyPressed then 1026 | slotIndex = 0 1027 | boxNumberIndex = 0 1028 | viewModeIndex = viewModeIndex + 1 1029 | prevKeyPressed = true 1030 | elseif (isKeyPressed(VK_1) or isKeyPressed(VK_NUMPAD1)) and viewModeIndex > 1 and not prevKeyPressed then 1031 | slotIndex = 0 1032 | boxNumberIndex = 0 1033 | viewModeIndex = viewModeIndex - 1 1034 | prevKeyPressed = true 1035 | else 1036 | prevKeyPressed = false 1037 | end 1038 | end 1039 | 1040 | local function getPartySlotIndexInput() 1041 | if (isKeyPressed(VK_5) or isKeyPressed(VK_NUMPAD5)) and slotIndex < 5 and not prevKeyPressed then 1042 | slotIndex = slotIndex + 1 1043 | prevKeyPressed = true 1044 | elseif (isKeyPressed(VK_4) or isKeyPressed(VK_NUMPAD4)) and slotIndex > 0 and not prevKeyPressed then 1045 | slotIndex = slotIndex - 1 1046 | prevKeyPressed = true 1047 | else 1048 | prevKeyPressed = false 1049 | end 1050 | end 1051 | 1052 | local function getBoxNumberIndexInput() 1053 | if (isKeyPressed(VK_8) or isKeyPressed(VK_NUMPAD8)) and boxNumberIndex < 39 and not prevKeyPressed then 1054 | slotIndex = 0 1055 | boxNumberIndex = boxNumberIndex + 1 1056 | prevKeyPressed = true 1057 | elseif (isKeyPressed(VK_7) or isKeyPressed(VK_NUMPAD7)) and boxNumberIndex > 0 and not prevKeyPressed then 1058 | slotIndex = 0 1059 | boxNumberIndex = boxNumberIndex - 1 1060 | prevKeyPressed = true 1061 | else 1062 | prevKeyPressed = false 1063 | end 1064 | end 1065 | 1066 | local function getBoxSlotIndexInput() 1067 | if (isKeyPressed(VK_5) or isKeyPressed(VK_NUMPAD5)) and slotIndex < 29 and not prevKeyPressed then 1068 | slotIndex = slotIndex + 1 1069 | prevKeyPressed = true 1070 | elseif (isKeyPressed(VK_4) or isKeyPressed(VK_NUMPAD4)) and slotIndex > 0 and not prevKeyPressed then 1071 | slotIndex = slotIndex - 1 1072 | prevKeyPressed = true 1073 | else 1074 | prevKeyPressed = false 1075 | end 1076 | end 1077 | 1078 | local function getRoamerSlotIndexInput() 1079 | if (isKeyPressed(VK_5) or isKeyPressed(VK_NUMPAD5)) and slotIndex < 1 and not prevKeyPressed then 1080 | slotIndex = slotIndex + 1 1081 | prevKeyPressed = true 1082 | elseif (isKeyPressed(VK_4) or isKeyPressed(VK_NUMPAD4)) and slotIndex > 0 and not prevKeyPressed then 1083 | slotIndex = slotIndex - 1 1084 | prevKeyPressed = true 1085 | else 1086 | prevKeyPressed = false 1087 | end 1088 | end 1089 | 1090 | local function getPokemonIndexInput() 1091 | if viewMode[viewModeIndex] == "Party" then 1092 | getPartySlotIndexInput() 1093 | elseif viewMode[viewModeIndex] == "Box" then 1094 | getBoxNumberIndexInput() 1095 | getBoxSlotIndexInput() 1096 | elseif viewMode[viewModeIndex] == "Roamer" then 1097 | getRoamerSlotIndexInput() 1098 | end 1099 | end 1100 | 1101 | 1102 | 1103 | -- Printing functions 1104 | local function printTrainerInfo() 1105 | print("Trainer Info:") 1106 | print(string.format("G8TID: %d", G8TID)) 1107 | print(string.format("TID: %d", TID)) 1108 | print(string.format("SID: %d", SID)) 1109 | print(string.format("TSV: %d", TSV)) 1110 | print("\n") 1111 | end 1112 | 1113 | local function getCurrentViewModePokemonAddr() 1114 | if viewMode[viewModeIndex] == "Wild" then 1115 | return getWildPokemonAddr() 1116 | elseif viewMode[viewModeIndex] == "Breeding" or viewMode[viewModeIndex] == "Party" then 1117 | return getPartyPokemonAddr() 1118 | elseif viewMode[viewModeIndex] == "Box" then 1119 | return getBoxPokemonAddr() 1120 | elseif viewMode[viewModeIndex] == "Roamer" then 1121 | return getRoamerListAddr() 1122 | end 1123 | end 1124 | 1125 | local function printEggInfo() 1126 | local isEggReady = readQword(isEggReadyFlagAddr) == 0x01 1127 | local eggStepsCounter = 180 - readBytes(eggStepsCounterAddr) 1128 | 1129 | if not isEggReady then 1130 | print("Egg Steps Counter: "..eggStepsCounter) 1131 | print("Egg is not ready") 1132 | end 1133 | 1134 | if isEggReady then 1135 | local eggSeed = readInteger(eggSeedAddr) 1136 | print("Egg generated, go get it!") 1137 | print(string.format("Egg Seed: %08X\n", eggSeed)) 1138 | elseif eggStepsCounter == 1 then 1139 | print("Next step might generate an egg!\n") 1140 | elseif eggStepsCounter == 180 then 1141 | print("180th step taken\n") 1142 | else 1143 | print("Keep on steppin'\n") 1144 | end 1145 | end 1146 | 1147 | local function getPK8(buffAddr) 1148 | local decStringBuff = table.concat(readBytes(buffAddr, STOREDSIZE, true), " ") 1149 | local hexStringBuff = decStringBuff:gsub("%S+", function (c) return string.format("%02X", c) end) 1150 | 1151 | return PK8.new(hexStringBuff) 1152 | end 1153 | 1154 | local function printPokemonInfo() 1155 | print(string.format("Mode: %s\t(Change mode pressing keyboard key 1 or 2)\n", viewMode[viewModeIndex])) 1156 | 1157 | if viewMode[viewModeIndex] == "Party" then 1158 | print(string.format("Slot: %d\t\t(Change slot pressing keyboard key 4 or 5)\n", slotIndex + 1)) 1159 | elseif viewMode[viewModeIndex] == "Box" then 1160 | print(string.format("Number: %d\t(Change box number pressing keyboard key 7 or 8)", boxNumberIndex + 1)) 1161 | print(string.format("Slot: %d\t\t(Change slot pressing keyboard key 4 or 5)\n", slotIndex + 1)) 1162 | elseif viewMode[viewModeIndex] == "Breeding" then 1163 | printEggInfo() 1164 | elseif viewMode[viewModeIndex] == "Roamer" then 1165 | print(string.format("Slot: %d\t\t(Change slot pressing keyboard key 4 or 5)\n", slotIndex + 1)) 1166 | end 1167 | 1168 | print("Pokemon Info:") 1169 | 1170 | local pokemonBlockAddr = getCurrentViewModePokemonAddr() 1171 | local pk = nil 1172 | 1173 | if pokemonBlockAddr ~= 0 then 1174 | if viewMode[viewModeIndex] == "Roamer" then 1175 | pk = Roamer8.new(pokemonBlockAddr) 1176 | else 1177 | pk = getPK8(pokemonBlockAddr) 1178 | pk:decrypt() 1179 | end 1180 | end 1181 | 1182 | if pk ~= nil and (viewMode[viewModeIndex] ~= "Breeding" or pk:getIsEgg()) then 1183 | pk:print() 1184 | elseif viewMode[viewModeIndex] == "Breeding" then 1185 | print("No egg in last party slot") 1186 | else 1187 | print("No Pokemon") 1188 | end 1189 | end 1190 | 1191 | local function printRngInfo() 1192 | local currRamS0 = readInteger(stateAddr) 1193 | local currRamS1 = readInteger(stateAddr + 0x4) 1194 | local currRamS2 = readInteger(stateAddr + 0x8) 1195 | local currRamS3 = readInteger(stateAddr + 0xC) 1196 | local skips = 0 1197 | 1198 | while (currRamS0 ~= initRNG.currS0 or currRamS1 ~= initRNG.currS1 or currRamS2 ~= initRNG.currS2 or currRamS3 ~= initRNG.currS3) and skips < 99999 do 1199 | initRNG:next() 1200 | skips = skips + 1 1201 | 1202 | if currRamS0 == initRNG.currS0 and currRamS1 == initRNG.currS1 and currRamS2 == initRNG.currS2 and currRamS3 == initRNG.currS3 then 1203 | GetLuaEngine().MenuItem5.doClick() 1204 | initRNG:print() 1205 | printTrainerInfo() 1206 | printPokemonInfo() 1207 | end 1208 | end 1209 | end 1210 | 1211 | 1212 | 1213 | -- Timer function 1214 | local function aTimerTick(timer) 1215 | if isKeyPressed(VK_0) or isKeyPressed(VK_NUMPAD0) then 1216 | timer.destroy() 1217 | end 1218 | 1219 | getStateSizeModeIndexInput() 1220 | getViewModeIndexInput() 1221 | getPokemonIndexInput() 1222 | printRngInfo() 1223 | end 1224 | 1225 | 1226 | 1227 | -- Main 1228 | initRNG:print() 1229 | printTrainerInfo() 1230 | printPokemonInfo() 1231 | 1232 | local aTimer = nil 1233 | local timerInterval = 50 1234 | 1235 | aTimer = createTimer(getMainForm()) 1236 | aTimer.Interval = timerInterval 1237 | aTimer.OnTimer = aTimerTick 1238 | aTimer.Enabled = true --------------------------------------------------------------------------------