RewardInfo reward = rewards.get(attacker);
if (reward == null)
{
continue;
}
Party party = attacker.getParty();
int maxHp = getMaxHp();
xpsp[0] = 0.;
xpsp[1] = 0.;
if (party == null)
{
int damage = Math.min(reward._dmg, maxHp);
if (damage > 0)
{
if (isInRangeZ(attacker, Config.ALT_PARTY_DISTRIBUTION_RANGE))
{
xpsp = calculateExpAndSp(attacker.getLevel(), damage);
}
xpsp[0] = applyOverhit(killer, xpsp[0]);
attacker.addExpAndCheckBonus(this, (long) xpsp[0], (long) xpsp[1], 1.);
}
rewards.remove(attacker);
}
else
{
int partyDmg = 0;
int partylevel = 1;
List<Player> rewardedMembers = new ArrayList<>();
for (Player partyMember : party.getPartyMembers())
{
RewardInfo ai = rewards.remove(partyMember);
if (partyMember.isDead() || !isInRangeZ(partyMember, Config.ALT_PARTY_DISTRIBUTION_RANGE))
{
continue;
}
if (ai != null)
{
partyDmg += ai._dmg;
}
rewardedMembers.add(partyMember);
if (partyMember.getLevel() > partylevel)
{
partylevel = partyMember.getLevel();
}
}
partyDmg = Math.min(partyDmg, maxHp);
if (partyDmg > 0)
{
xpsp = calculateExpAndSp(partylevel, partyDmg);
double partyMul = (double) partyDmg / maxHp;
xpsp[0] *= partyMul;
xpsp[1] *= partyMul;
xpsp[0] = applyOverhit(killer, xpsp[0]);
party.distributeXpAndSp(xpsp[0], xpsp[1], rewardedMembers, lastAttacker, this);
}
}
}
CursedWeaponsManager.getInstance().dropAttackable(this, killer);
if ((topDamager == null) || !topDamager.isPlayable())