Addition of player fame and raidpoint limit checks.

This commit is contained in:
MobiusDevelopment
2021-09-30 06:21:07 +00:00
parent a58c0345d3
commit 699ef110ed
21 changed files with 501 additions and 80 deletions

View File

@ -2276,13 +2276,24 @@ public class PlayerInstance extends Playable
}
/**
* Set the Fame of this NcInstane
* Set the Fame of this PlayerInstane
* @param fame
*/
public void setFame(int fame)
{
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this);
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : fame;
int newFame = fame;
if (fame > Config.MAX_PERSONAL_FAME_POINTS)
{
newFame = Config.MAX_PERSONAL_FAME_POINTS;
}
else if (fame < 0)
{
newFame = 0;
}
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, newFame), this);
_fame = newFame;
}
/**
@ -2299,7 +2310,17 @@ public class PlayerInstance extends Playable
*/
public void setRaidbossPoints(int points)
{
_raidbossPoints = points;
int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
}
/**