You have to add a button which set the new distibution mode(2) for party and extend the switch with a new case.
party.h
enum EPartyExpDistributionModes
{
PARTY_EXP_DISTRIBUTION_NON_PARITY,
PARTY_EXP_DISTRIBUTION_PARITY,
PARTY_EXP_DISTRIBUTION_EQUAL,
PARTY_EXP_DISTRIBUTION_MAX_NUM
};
char_battle.cpp
struct FPartyDistributor
{
int total;
LPCHARACTER c;
int x, y;
DWORD _iExp;
int m_iMode;
int m_iMemberCount;
FPartyDistributor(LPCHARACTER center, int member_count, int total, DWORD iExp, int iMode)
: total(total), c(center), x(center->GetX()), y(center->GetY()), _iExp(iExp), m_iMode(iMode), m_iMemberCount(member_count)
{
if (m_iMemberCount == 0)
m_iMemberCount = 1;
};
void operator () (LPCHARACTER ch)
{
if (DISTANCE_APPROX(ch->GetX() - x, ch->GetY() - y) <= PARTY_DEFAULT_RANGE)
{
DWORD iExp2 = 0;
switch (m_iMode)
{
case PARTY_EXP_DISTRIBUTION_NON_PARITY:
iExp2 = (DWORD) (_iExp * (float) __GetPartyExpNP(ch->GetLevel()) / total);
break;
case PARTY_EXP_DISTRIBUTION_PARITY:
iExp2 = _iExp / m_iMemberCount;
break;
case PARTY_EXP_DISTRIBUTION_EQUAL:
iExp2 = _iExp;
break;
default:
sys_err("Unknown party exp distribution mode %d", m_iMode);
return;
}
GiveExp(c, ch, iExp2);
}
}
};