Mac SERVER_CalculateExperienceForUnit: uint32_t __fastcall (pGame, pUnit, nPlayerLevel, nKillerLevel, nBaseExperience)
Roles follow the Windows twin 0x0057e480. ECX = pGame (kept in [EBP-0x18] for the final CALC_Experience step). EDX = pUnit (type 0 -> class at +4 -> TXT_Experience_GetMaxLevel). [EBP+8] = nPlayerLevel (compared with max level, return 0 if reached). [EBP+0xc] = nKillerLevel (level difference against the player level for the penalty table). [EBP+0x10] = the base experience (clamped to 0x7fffff, <1 -> return 1). EAX returns the experience: SERVER_KillExperience uses it (IMUL ECX,EAX,0x56 at 0x00280bb8; passed to SERVER_PlayerUpdateExperience at 0x00280c81). Callers load ECX/EDX and store [ESP]..[ESP+8].
Changes 1, applied together
Set prototype
mac 0x00280d15signatureundefined SERVER_CalculateExperienceForUnit(void)→uint32_t SERVER_CalculateExperienceForUnit(D2GameStrc* pGame, D2UnitStrc* pUnit, int32_t nPlayerLevel, int32_t nKillerLevel, int32_t nBaseExperience)conventionunknown→__fastcall