Jump to content

xfr

Member
  • Posts

    190
  • Joined

  • Last visited

Everything posted by xfr

  1. I suppose if you evolve a non-nicknamed gen4 pokemon with trash bytes, it will keep any remaining trash bytes after the length of the evolved form's name, if any, yes?
  2. There are two problems, lack of list(,) when unpacking and 32 bit overflow if the pokemon is nicknamed. You could temporarly unset the nickname flag by temporarly masking byte 0x3B with 0x7F and using your code, or proceed by 16-bit words, for instance for the HP IV use: $newIV = $row['HPIV']; list(,$i) = unpack("v", substr($q,0x38,2)); // HP, Attack, Def $i &= 0xFFE0; // Clear HP IV $i |= ($newIV & 0x1F) << 0; // Set new HP IV $q = substr($q,0,0x38).pack("v",$i).substr($q,0x3A); Of course for speed you'll need 0x39-0x3A, and for SA/SDef 0x3A-0x3B... for the other solution: $n = ord($q[0x3B]); $nicknamed = $n>>7; $q[0x3B] = chr($n & 0x7F); // ... Your pastebin code fixed with list(,) before unpacks if($nicknamed) $q[0x3B]=chr(ord($q[0x3B]) | 0x80); Third and best solution is use a 64 bit OS.
  3. There are 6 differents growth rates, and the level of a pokemon is a direct function of the growth rate and experience. The first link I posted is basically how to compute the level from the growth rate and experience. To compute the level of a pokemon you will thus need to know what is its growth rate. The second link I posted gives you growth rates for every evolution line (the growth rate is the same among members of the same evo line); to use that data you must use this file to find out the id of the evolution chain of the pokemon of which you want to know the level, then the two previous files can be used to compute the level.
  4. $newIV = $row['AttIV']; $i = unpack("V", substr($q,0x38,4)); $i &= 0xFFFFFC1F; // Clear Attack IV $i |= ($newIV & 0x1F) << 5; // Set new attack IV $q = substr($q,0,0x38).pack("V",$i).substr($q,0x3C); You only need GMP for 64 bit arithetic on 32 bit systems, for instance the PRNG (but you can use bcmath for that, although it's slow)
  5. To compute the level of a pokemon from its experience, you can use this file to give you the thresholds for each level for every exp growth rate, and this file to give you the growth rates of every evo line. You can thank Eevee from veekun.com for extracting those
  6. Interesting, I'll test that myself but if it turns out to be true it will make gts websites all the more useful.
  7. Did you remember to append sha1("HZEdGCzcGGLvguqUEKQN"+urlsafe_base64(response)+"HZEdGCzcGGLvguqUEKQN") to all server responses? I just added that to the wiki page on the GTS protocol but look at the first post for more information.
  8. I have updated the wiki with offsets for deposit pokemon data. Still have no idea what's in the 0x138-0x1B7 range though. You can see this in action on Pokécheck, it allows you to extract .pkm files from your game and import .pkm files from your pc (e.g. made with pokegen) onto your cartridge, no AR of flashcard required.
  9. Thanks to Kaarosu, magical, Eevee and others on IRC here is a list of new locations sorted by the value they have in .pkm files: Range 1-116: Range 30000-30014: Range 40000-40109 Range 60000-60003:
  10. It seems offset 0x37 of the GTS footer when receiving a pokemon is not some "Exchanged flag" flag but used for alternate forms. For the default form it should be set to 0x01 (not 0x00), and to the appropriate form value described on the data structure page of the wiki for alternate forms (e.g. skymin is 0x08)
  11. I am looking for an index for the hex values of locations, items and moves in black and white. It must have been done already seeing how the latest pokegen has all those but I can't find a simple text file with the english names sorted by hex value similar to what PPSE is using in its source code. Any pointer?
  12. Just to be sure, as this isn't stated explicitely in the first post but implied later in the thread, is there really no way to make this tool work with a DSi or DSi XL? Also what is the exact reason for this limitation and what needs to be changed in the source code to try to make it compatible?
×
×
  • Create New...