I have here a preliminary formula concerning the experience gain, though:
_it only works when the levels of both your Pokémon and the foe are the same;
_it doesn't work for level 84 and afterwards (there is another formula).
Exp=
math.floor(math.floor((
math.floor(math.floor(BaseExp *
LevelFoe *
WT) / (5 *
ExpShare)
) + 1) *
OT) *
Lucky Egg)
where:
BaseExp is the Base Experience yield of the defeated Pokémon
LevelFoe is the Level of the foe
WT stands for Wild or Trainer
WT is equal to 1 if you're up against a wild Pokémon
WT is equal to 1.5 if you're up against a trainer's Pokémon
ExpShare (not limited to the item) is here in case more than 1 Pokémon have participated in the fight (and have not fainted)
OT stands for Original Trainer (has priority over the modifier LuckyEgg)
OT is equal to 1 if the Pokémon is yours
OT is equal to 1.5 if the Pokémon was traded (same language)
OT is equal to 1.7 if the Pokémon is from a foreign country (international trade)
Lucky Egg is obvious
Lucky Egg is equal to 1 if your Pokémon doesn't hold the item
Lucky Egg is equal to 1.5 if your Pokémon holds the item
As a reminder the general formula has yet to be discovered, and as such anyone who is really willing to put their effort into finding this one should do so.
For now, I'm just giving up into trying to find the experience formula, for me it just seems so odd, so arbitrary, so random....
And just so you know, a level 1 foreign Pokémon holding a Lucky Egg defeating a level 83 Blissey belonging to a trainer will earn up to 185 172 Exp. points (the maximum a Pokémon can gain in a single defeated foe)!!!
EDIT:
"rnddown" is known mathematically as "math.floor"
Good work, though, I'm interested to know how it works with scaling.
Didn't know that, thanks for the input, I corrected accordingly.