Changed calculateExpAndSp damage parameter to long.

Thanks Sahar.
This commit is contained in:
MobiusDev
2018-06-07 20:20:38 +00:00
parent 04160e3878
commit a557eafe5d
31 changed files with 91 additions and 92 deletions

View File

@ -24,7 +24,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public final class DamageDoneInfo
{
private final L2PcInstance _attacker;
private int _damage = 0;
private long _damage = 0;
public DamageDoneInfo(L2PcInstance attacker)
{
@ -36,12 +36,12 @@ public final class DamageDoneInfo
return _attacker;
}
public void addDamage(int damage)
public void addDamage(long damage)
{
_damage += damage;
}
public int getDamage()
public long getDamage()
{
return _damage;
}

View File

@ -834,7 +834,7 @@ public class L2Party extends AbstractPlayerGroup
* @param partyDmg
* @param target
*/
public void distributeXpAndSp(double xpReward, double spReward, List<L2PcInstance> rewardedMembers, int topLvl, int partyDmg, L2Attackable target)
public void distributeXpAndSp(double xpReward, double spReward, List<L2PcInstance> rewardedMembers, int topLvl, long partyDmg, L2Attackable target)
{
final List<L2PcInstance> validMembers = getValidMembers(rewardedMembers, topLvl);

View File

@ -348,7 +348,7 @@ public class L2Attackable extends L2Npc
final Map<L2PcInstance, DamageDoneInfo> rewards = new ConcurrentHashMap<>();
L2PcInstance maxDealer = null;
int maxDamage = 0;
long maxDamage = 0;
long totalDamage = 0;
// While Iterating over This Map Removing Object is Not Allowed
// Go through the _aggroList of the L2Attackable
@ -359,7 +359,7 @@ public class L2Attackable extends L2Npc
if (attacker != null)
{
// Get damages done by this attacker
final int damage = info.getDamage();
final long damage = info.getDamage();
// Prevent unwanted behavior
if (damage > 1)
@ -450,7 +450,7 @@ public class L2Attackable extends L2Npc
final L2PcInstance attacker = reward.getAttacker();
// Total amount of damage done
final int damage = reward.getDamage();
final long damage = reward.getDamage();
// Get party
final L2Party attackerParty = attacker.getParty();
@ -524,7 +524,7 @@ public class L2Attackable extends L2Npc
else
{
// share with party members
int partyDmg = 0;
long partyDmg = 0;
double partyMul = 1;
int partyLvl = 0;
@ -1307,7 +1307,7 @@ public class L2Attackable extends L2Npc
* @param totalDamage The total damage done
* @return
*/
private double[] calculateExpAndSp(int charLevel, int damage, long totalDamage)
private double[] calculateExpAndSp(int charLevel, long damage, long totalDamage)
{
final int levelDiff = charLevel - getLevel();
double xp = 0;