Faction reward messages moved back to L2PcInstance method.

This commit is contained in:
MobiusDev
2017-10-08 14:10:30 +00:00
parent d119b09466
commit da9aaa29ac
2 changed files with 10 additions and 18 deletions

View File

@@ -13910,13 +13910,20 @@ public final class L2PcInstance extends L2Playable
public void addFactionPoints(Faction faction, int count)
{
final int currentPoints = getFactionPoints(faction);
final int oldLevel = getFactionLevel(faction);
if ((currentPoints + count) < faction.getPointsOfLevel(faction.getLevelCount() - 1))
{
getVariables().set(faction.toString(), currentPoints + count);
sendMessage("You obtained " + count + " Faction Points for " + faction.toString().toLowerCase().replace("_", " ") + ".");
}
else
{
getVariables().set(faction.toString(), faction.getPointsOfLevel(faction.getLevelCount() - 1));
}
if (oldLevel < getFactionLevel(faction))
{
sendMessage("The Faction Level of " + faction.toString().toLowerCase().replace("_", " ") + " has increased. Open the Factions window to check.");
}
}

View File

@@ -2999,26 +2999,11 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
* Add faction points as quest reward.
* @param player the player whom to reward with the faction points.
* @param faction the faction to which the points belong
* @param factionPoints the base amount of faction points to give to the player. It will be influenced by RATE_QUEST_REWARD_FP.
* @param points the base amount of faction points to give to the player. It is influenced by RATE_QUEST_REWARD_FP.
*/
public static void addFactionPoints(L2PcInstance player, Faction faction, int factionPoints)
public static void addFactionPoints(L2PcInstance player, Faction faction, int points)
{
factionPoints *= Config.RATE_QUEST_REWARD_FP;
final int currentPoints = player.getFactionPoints(faction);
final int oldLevel = player.getFactionLevel(faction);
if ((currentPoints + factionPoints) < faction.getPointsOfLevel(faction.getLevelCount() - 1))
{
player.sendPacket(new ExShowScreenMessage("Your reputation with the " + faction.toString().toLowerCase().replace("_", " ") + " faction was increased by " + factionPoints + " points.", 5000));
}
player.addFactionPoints(faction, factionPoints);
final int newLevel = player.getFactionLevel(faction);
if (oldLevel < newLevel)
{
player.sendPacket(new ExShowScreenMessage("Your reputation level with the " + faction.toString().toLowerCase().replace("_", " ") + " faction has increased.", 5000));
}
player.addFactionPoints(faction, (int) (points * Config.RATE_QUEST_REWARD_FP));
}
/**