Reputation system rework.
TODO: Add more proper formulas.
This commit is contained in:
@@ -201,7 +201,7 @@ public class NpcBufferAI implements Runnable
|
||||
return true;
|
||||
}
|
||||
|
||||
if (targetPlayer.getKarma() != 0)
|
||||
if (targetPlayer.getReputation() < 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ public final class TvTManager extends AbstractNpcAI implements IVoicedCommandHan
|
||||
{
|
||||
htmltext = getHtm(player.getHtmlPrefix(), "Olympiad.html");
|
||||
}
|
||||
else if (player.getKarma() > 0)
|
||||
else if (player.getReputation() < 0)
|
||||
{
|
||||
htmltext = getHtm(player.getHtmlPrefix(), "Karma.html");
|
||||
}
|
||||
|
@@ -989,7 +989,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
adminReply.replace("%z%", String.valueOf(player.getZ()));
|
||||
adminReply.replace("%currenthp%", String.valueOf((int) player.getCurrentHp()));
|
||||
adminReply.replace("%maxhp%", String.valueOf(player.getMaxHp()));
|
||||
adminReply.replace("%karma%", String.valueOf(player.getKarma()));
|
||||
adminReply.replace("%karma%", String.valueOf(player.getReputation()));
|
||||
adminReply.replace("%currentmp%", String.valueOf((int) player.getCurrentMp()));
|
||||
adminReply.replace("%maxmp%", String.valueOf(player.getMaxMp()));
|
||||
adminReply.replace("%pvpflag%", String.valueOf(player.getPvpFlag()));
|
||||
@@ -1033,31 +1033,19 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if (newKarma >= 0)
|
||||
// for display
|
||||
int oldKarma = player.getReputation();
|
||||
// update reputation
|
||||
player.setReputation(newKarma);
|
||||
// Common character information
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
|
||||
sm.addInt(newKarma);
|
||||
player.sendPacket(sm);
|
||||
// Admin information
|
||||
activeChar.sendMessage("Successfully Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
// for display
|
||||
int oldKarma = player.getKarma();
|
||||
// update karma
|
||||
player.setKarma(newKarma);
|
||||
// Common character information
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
|
||||
sm.addInt(newKarma);
|
||||
player.sendPacket(sm);
|
||||
// Admin information
|
||||
activeChar.sendMessage("Successfully Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
_log.fine("[SET KARMA] [GM]" + activeChar.getName() + " Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// tell admin of mistake
|
||||
activeChar.sendMessage("You must enter a value for karma greater than or equal to 0.");
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
_log.fine("[SET KARMA] ERROR: [GM]" + activeChar.getName() + " entered an incorrect value for new karma: " + newKarma + " for " + player.getName() + ".");
|
||||
}
|
||||
_log.fine("[SET KARMA] [GM]" + activeChar.getName() + " Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1447,7 +1435,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
html.replace("%ai%", target.hasAI() ? String.valueOf(target.getAI().getIntention().name()) : "NULL");
|
||||
html.replace("%hp%", (int) target.getStatus().getCurrentHp() + "/" + target.getStat().getMaxHp());
|
||||
html.replace("%mp%", (int) target.getStatus().getCurrentMp() + "/" + target.getStat().getMaxMp());
|
||||
html.replace("%karma%", Integer.toString(target.getKarma()));
|
||||
html.replace("%karma%", Integer.toString(target.getReputation()));
|
||||
html.replace("%race%", target.getTemplate().getRace().toString());
|
||||
if (target instanceof L2PetInstance)
|
||||
{
|
||||
|
@@ -73,7 +73,7 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
activeChar.sendMessage("You can't use the Community Board right now.");
|
||||
return false;
|
||||
}
|
||||
if (Config.COMMUNITYBOARD_KARMA_DISABLED && (activeChar.getKarma() > 0))
|
||||
if (Config.COMMUNITYBOARD_KARMA_DISABLED && (activeChar.getReputation() < 0))
|
||||
{
|
||||
activeChar.sendMessage("Players with Karma cannot use the Community Board.");
|
||||
return false;
|
||||
|
@@ -146,7 +146,7 @@ public class AreaFriendly implements ITargetTypeHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getKarma() > 0))
|
||||
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getReputation() < 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -101,7 +101,7 @@ public class AuraFriendly implements ITargetTypeHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getKarma() > 0))
|
||||
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getReputation() < 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public class EnemySummon implements ITargetTypeHandler
|
||||
if (target.isSummon())
|
||||
{
|
||||
L2Summon targetSummon = (L2Summon) target;
|
||||
if ((activeChar.isPlayer() && (activeChar.getPet() != targetSummon) && activeChar.hasServitor(targetSummon.getObjectId()) && !targetSummon.isDead() && ((targetSummon.getOwner().getPvpFlag() != 0) || (targetSummon.getOwner().getKarma() > 0))) || (targetSummon.getOwner().isInsideZone(ZoneId.PVP) && activeChar.getActingPlayer().isInsideZone(ZoneId.PVP)) || (targetSummon.getOwner().isInDuel() && activeChar.getActingPlayer().isInDuel() && (targetSummon.getOwner().getDuelId() == activeChar.getActingPlayer().getDuelId())))
|
||||
if ((activeChar.isPlayer() && (activeChar.getPet() != targetSummon) && activeChar.hasServitor(targetSummon.getObjectId()) && !targetSummon.isDead() && ((targetSummon.getOwner().getPvpFlag() != 0) || (targetSummon.getOwner().getReputation() < 0))) || (targetSummon.getOwner().isInsideZone(ZoneId.PVP) && activeChar.getActingPlayer().isInsideZone(ZoneId.PVP)) || (targetSummon.getOwner().isInDuel() && activeChar.getActingPlayer().isInDuel() && (targetSummon.getOwner().getDuelId() == activeChar.getActingPlayer().getDuelId())))
|
||||
{
|
||||
return new L2Character[]
|
||||
{
|
||||
|
Reference in New Issue
Block a user