Name DAMAGE_CalculatePhysicalDamage's parameters, tested in the running game
Ghidra v1799 · 2663303
Five generic parameters with clear jobs. EDX nonzero makes the function read min and max from the unit's stats; zero uses the two arguments as given. Stack[0xc] is the maximum beside the existing nMinDmg, Stack[0x10] a percent bonus, Stack[0x14] flat damage added to the roll, and Stack[0x18] a scale where 0x80 means 100%. Beyond reading the code, I called this function in a running 1.14d game with the unit's seed set so each draw was a chosen number, and every result matched a prediction from these meanings.
Changes 5, applied together
Rename variable
win 0x0057b420 EDXnamenParam1→bUseWeaponStatsRename variable
win 0x0057b420 Stack[0xc]namenParam2→nMaxDmgRename variable
win 0x0057b420 Stack[0x10]namenParam3→nBonusPercentRename variable
win 0x0057b420 Stack[0x14]namenParam→nFlatDamageRename variable
win 0x0057b420 Stack[0x18]namebParam→byScale