>>54649742for data coming from Gen3 the ball iD the pokemon was catch'd-in was used (along many, many other tings) to encrypt the pokemon's data structure and substructure
for Gev4 onwards it is only part of Block D encrypted bytes.
theorically if you edit any value on any of the encrypted blocks (A, B, C or D) nothing else changes since those Blocks of data are used as libraries and the mon simply takes the data on those to do it's thing
Black A has stuff like the OT ID, OT SID, Current Held Item, Current Exp, EVs, Contest stats, Marks, Ability Slot, Language of Origin, steps to hatch, etc
Block B has it's current moveset, the current PP of each move, gender, form, encounter egg/met for certain specific games, etc
Block C contains it's Nickname and Game of origin
and finally Block D, it stores Ball, Pokerus, met date, date you got it's egg, level met, it's OT's gender, and encounter type
for the most part multiple of these values are dynamic and the game gives a damn if if Black B is storing data for Ice Beam and it's PPs and a second later it's now Protect.
never mess with encounter types tho