Improved previous commit.
This commit is contained in:
parent
3bd2d9fe24
commit
d4b301a5a6
@ -14011,21 +14011,20 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void addFactionPoints(Faction faction, int count)
|
public void addFactionPoints(Faction faction, int count)
|
||||||
{
|
{
|
||||||
final int currentPoints = getVariables().getInt(faction.toString(), 0);
|
final int currentPoints = getVariables().getInt(faction.toString(), 0);
|
||||||
|
final String message;
|
||||||
if ((currentPoints + count) > faction.getPointsOfLevel(faction.getLevelCount() - 1))
|
if ((currentPoints + count) > faction.getPointsOfLevel(faction.getLevelCount() - 1))
|
||||||
{
|
{
|
||||||
getVariables().set(faction.toString(), faction.getPointsOfLevel(faction.getLevelCount() - 1));
|
getVariables().set(faction.toString(), faction.getPointsOfLevel(faction.getLevelCount() - 1));
|
||||||
final String message = "Your reputation with the " + faction.toString().toLowerCase().replace("_", " ") + " faction is at the highest level possible.";
|
message = "Your reputation with the " + faction.toString().toLowerCase().replace("_", " ") + " faction is at the highest level possible.";
|
||||||
sendPacket(new ExShowScreenMessage(message, 5000));
|
|
||||||
sendMessage(message);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getVariables().set(faction.toString(), currentPoints + count);
|
getVariables().set(faction.toString(), currentPoints + count);
|
||||||
final String message = "Your reputation with the " + faction.toString().toLowerCase().replace("_", " ") + " faction was increased by " + count + " points.";
|
message = "Your reputation with the " + faction.toString().toLowerCase().replace("_", " ") + " faction was increased by " + count + " points.";
|
||||||
|
}
|
||||||
sendPacket(new ExShowScreenMessage(message, 5000));
|
sendPacket(new ExShowScreenMessage(message, 5000));
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initStatusUpdateCache()
|
protected void initStatusUpdateCache()
|
||||||
|
Loading…
Reference in New Issue
Block a user