After fiddling with addon_pet.lua and with the help of
this post, I've come up with the following:
Code:
experience gained = (xpskill*(1+xpbonusskill+xpbonusmedal)+.017*enemykilledldr)*(1+xpbonusskill)*(herolvl/petlvl)*(enemyldr/heroldr)*herotype*.5
xpskill is experience of the dragon skill, as given in the OP (they are indeed correct)
xpbonusskill is the bonus from the training skill, 0/.2/.4/.6 for skill levels 0/1/2/3
xpbonusmedal is the bonus from the dragonslayer medal, 0/.1/.3/.5 for medal levels 0/1/2/3
enemykilledldr is the total leadership of the number of enemies killed by the skill, Ball of Lightning does NOT count for this
herolvl is the level of your hero
petlvl is the level of your pet
enemyldr is the total leadership of the enemy army at the time the skill is used
heroldr is the total leadership of your army at the time the skill is used
the leadership ratio is always 1 for the first skill use and can never be greater than 1
herotype is 1/.9/.7 for warrior/paladin/mage