Reputation system rework.
TODO: Add more proper formulas.
This commit is contained in:
@ -2539,6 +2539,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
getSkillChannelized().abortChannelization();
|
||||
}
|
||||
|
||||
// FIXME: Karma reduction tempfix.
|
||||
if (isMonster() && (killer != null) && killer.isPlayer() && (killer.getActingPlayer().getReputation() < 0))
|
||||
{
|
||||
if (killer.getLevel() >= (getLevel() - 5))
|
||||
{
|
||||
killer.getActingPlayer().setKarma(killer.getActingPlayer().getReputation() - (killer.getActingPlayer().getReputation() / 8));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5257,11 +5267,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (Config.ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE)
|
||||
{
|
||||
// allows red to be attacked and red to attack flagged players
|
||||
if ((target.getActingPlayer() != null) && (target.getActingPlayer().getKarma() > 0))
|
||||
if ((target.getActingPlayer() != null) && (target.getActingPlayer().getReputation() < 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((attacker.getActingPlayer() != null) && (attacker.getActingPlayer().getKarma() > 0) && (target.getActingPlayer() != null) && (target.getActingPlayer().getPvpFlag() > 0))
|
||||
if ((attacker.getActingPlayer() != null) && (attacker.getActingPlayer().getReputation() < 0) && (target.getActingPlayer() != null) && (target.getActingPlayer().getPvpFlag() > 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -5994,7 +6004,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (target.isPlayer())
|
||||
{
|
||||
// Casting non offensive skill on player with pvp flag set or with karma
|
||||
if (!(target.equals(this) || target.equals(player)) && ((target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getKarma() > 0)))
|
||||
if (!(target.equals(this) || target.equals(player)) && ((target.getActingPlayer().getPvpFlag() > 0) || (target.getActingPlayer().getReputation() < 0)))
|
||||
{
|
||||
player.updatePvPStatus();
|
||||
}
|
||||
|
@ -933,7 +933,7 @@ public class L2Npc extends L2Character
|
||||
player.setTarget(player);
|
||||
return;
|
||||
}
|
||||
if (player.getKarma() > 0)
|
||||
if (player.getReputation() < 0)
|
||||
{
|
||||
if (!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && (this instanceof L2MerchantInstance))
|
||||
{
|
||||
|
@ -232,7 +232,7 @@ public abstract class L2Playable extends L2Character
|
||||
return false; // Active player is null
|
||||
}
|
||||
|
||||
if (player.getKarma() != 0)
|
||||
if (player.getReputation() < 0)
|
||||
{
|
||||
return false; // Active player has karma
|
||||
}
|
||||
@ -247,7 +247,7 @@ public abstract class L2Playable extends L2Character
|
||||
{
|
||||
return false; // Target player is self
|
||||
}
|
||||
if (targetPlayer.getKarma() != 0)
|
||||
if (targetPlayer.getReputation() < 0)
|
||||
{
|
||||
return false; // Target player has karma
|
||||
}
|
||||
@ -346,8 +346,6 @@ public abstract class L2Playable extends L2Character
|
||||
|
||||
public abstract void doPickupItem(L2Object object);
|
||||
|
||||
public abstract int getKarma();
|
||||
|
||||
public abstract int getReputation();
|
||||
|
||||
public abstract byte getPvpFlag();
|
||||
|
@ -243,12 +243,6 @@ public abstract class L2Summon extends L2Playable
|
||||
return ExperienceData.getInstance().getExpForLevel(getLevel() + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getKarma()
|
||||
{
|
||||
return getOwner() != null ? getOwner().getKarma() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getReputation()
|
||||
{
|
||||
|
@ -50,10 +50,6 @@ public class PcAppearance
|
||||
/** The default title color is 0xECF9A2. */
|
||||
private int _titleColor = DEFAULT_TITLE_COLOR;
|
||||
|
||||
/** Karma and Reputation colors */
|
||||
private final int _redColor = 255;
|
||||
private final int _greenColor = 65280;
|
||||
|
||||
public PcAppearance(byte face, byte hColor, byte hStyle, boolean sex)
|
||||
{
|
||||
_face = face;
|
||||
@ -177,13 +173,9 @@ public class PcAppearance
|
||||
|
||||
public int getNameColor()
|
||||
{
|
||||
if (_owner.getKarma() > 0)
|
||||
if (_owner.getReputation() != 0)
|
||||
{
|
||||
return _redColor;
|
||||
}
|
||||
if (_owner.getReputation() > 0)
|
||||
{
|
||||
return _greenColor;
|
||||
return 0xFFFFFF; // Using 0xFFFFFF value in case _nameColor has changed.
|
||||
}
|
||||
return _nameColor;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class L2FriendlyMobInstance extends L2Attackable
|
||||
{
|
||||
if (attacker instanceof L2PcInstance)
|
||||
{
|
||||
return ((L2PcInstance) attacker).getKarma() > 0;
|
||||
return ((L2PcInstance) attacker).getReputation() < 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -368,8 +368,8 @@ public final class L2PcInstance extends L2Playable
|
||||
private static final String DELETE_ITEM_REUSE_SAVE = "DELETE FROM character_item_reuse_save WHERE charId=?";
|
||||
|
||||
// Character Character SQL String Definitions:
|
||||
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,reputation,fame,raidpoints,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,clan_privs,wantspeace,base_class,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,reputation=?,fame=?,raidpoints=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,pccafe_points=?,language=?,faction=? WHERE charId=?";
|
||||
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,reputation,fame,raidpoints,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,clan_privs,wantspeace,base_class,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,reputation=?,fame=?,raidpoints=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,pccafe_points=?,language=?,faction=? WHERE charId=?";
|
||||
private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE charId=?";
|
||||
|
||||
// Character Premium System String Definitions:
|
||||
@ -449,10 +449,7 @@ public final class L2PcInstance extends L2Playable
|
||||
/** The Experience of the L2PcInstance before the last Death Penalty */
|
||||
private long _expBeforeDeath;
|
||||
|
||||
/** The Karma of the L2PcInstance (if higher than 0, the name of the L2PcInstance appears in red) */
|
||||
private int _karma = 0;
|
||||
|
||||
/** The Reputation of the L2PcInstance (if higher than 0, the name of the L2PcInstance appears in green) */
|
||||
/** The Reputation of the L2PcInstance (defines PKK color) */
|
||||
private int _reputation;
|
||||
|
||||
/** The number of player killed during a PvP (the player killed was PvP Flagged) */
|
||||
@ -1986,15 +1983,6 @@ public final class L2PcInstance extends L2Playable
|
||||
return _expBeforeDeath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Karma of the L2PcInstance.
|
||||
*/
|
||||
@Override
|
||||
public int getKarma()
|
||||
{
|
||||
return _karma;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Karma of the L2PcInstance and send a Server->Client packet StatusUpdate (broadcast).
|
||||
* @param karma
|
||||
@ -2002,13 +1990,9 @@ public final class L2PcInstance extends L2Playable
|
||||
public void setKarma(int karma)
|
||||
{
|
||||
// Notify to scripts.
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerKarmaChanged(this, getKarma(), karma), this);
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerKarmaChanged(this, getReputation(), karma), this);
|
||||
|
||||
if (karma < 0)
|
||||
{
|
||||
karma = 0;
|
||||
}
|
||||
if ((_karma == 0) && (karma > 0))
|
||||
if ((getReputation() < 0) && (karma < 0))
|
||||
{
|
||||
Collection<L2Object> objs = getKnownList().getKnownObjects().values();
|
||||
|
||||
@ -2025,13 +2009,13 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((_karma > 0) && (karma == 0))
|
||||
else if ((getReputation() < 0) && (karma >= 0))
|
||||
{
|
||||
// Send a Server->Client StatusUpdate packet with Karma and PvP Flag to the L2PcInstance and all L2PcInstance to inform (broadcast)
|
||||
setKarmaFlag(0);
|
||||
}
|
||||
|
||||
_karma = karma;
|
||||
_reputation = karma;
|
||||
broadcastKarma();
|
||||
}
|
||||
|
||||
@ -5430,6 +5414,12 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
AntiFeedManager.getInstance().setLastDeathTime(getObjectId());
|
||||
|
||||
// FIXME: Karma reduction tempfix.
|
||||
if (getReputation() < 0)
|
||||
{
|
||||
setKarma(getReputation() - (getReputation() / 4));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5441,7 +5431,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
L2PcInstance pk = killer.getActingPlayer();
|
||||
if ((getKarma() <= 0) && (pk != null) && (pk.getClan() != null) && (getClan() != null) && (pk.getClan().isAtWarWith(getClanId())
|
||||
if ((getReputation() >= 0) && (pk != null) && (pk.getClan() != null) && (getClan() != null) && (pk.getClan().isAtWarWith(getClanId())
|
||||
// || getClan().isAtWarWith(((L2PcInstance)killer).getClanId())
|
||||
))
|
||||
{
|
||||
@ -5460,7 +5450,7 @@ public final class L2PcInstance extends L2Playable
|
||||
int dropLimit = 0;
|
||||
int dropPercent = 0;
|
||||
|
||||
if ((getKarma() > 0) && (getPkKills() >= pkLimit))
|
||||
if ((getReputation() < 0) && (getPkKills() >= pkLimit))
|
||||
{
|
||||
isKarmaDrop = true;
|
||||
dropPercent = Config.KARMA_RATE_DROP;
|
||||
@ -5605,15 +5595,15 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
// 'No war' or 'One way war' -> 'Normal PK'
|
||||
if (targetPlayer.getKarma() > 0) // Target player has karma
|
||||
if (targetPlayer.getReputation() < 0) // Target player has karma
|
||||
{
|
||||
if (Config.KARMA_AWARD_PK_KILL)
|
||||
{
|
||||
increasePvpKills(target);
|
||||
}
|
||||
if ((_karma <= 0) && AntiFeedManager.getInstance().check(this, targetPlayer))
|
||||
if ((_reputation >= 0) && AntiFeedManager.getInstance().check(this, targetPlayer))
|
||||
{
|
||||
_reputation += 100;
|
||||
_reputation += 100; // FIXME: Find more proper calculation.
|
||||
broadcastUserInfo();
|
||||
}
|
||||
}
|
||||
@ -5664,7 +5654,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (!Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
setKarma(getKarma() + addedKarma);
|
||||
setKarma(getReputation() - addedKarma); // karma is negative reputation
|
||||
}
|
||||
// PK Points are increased only if you kill a player.
|
||||
if (target.isPlayer())
|
||||
@ -5676,7 +5666,6 @@ public final class L2PcInstance extends L2Playable
|
||||
_PvPRegTask.cancel(true);
|
||||
updatePvPFlag(0);
|
||||
}
|
||||
_reputation = 0;
|
||||
}
|
||||
|
||||
// Update player's UI.
|
||||
@ -5717,7 +5706,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getKarma() == 0))
|
||||
if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0))
|
||||
{
|
||||
if (checkIfPvP(player_target))
|
||||
{
|
||||
@ -5783,7 +5772,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
|
||||
if (getKarma() > 0)
|
||||
if (getReputation() < 0)
|
||||
{
|
||||
percentLost *= Config.RATE_KARMA_EXP_LOST;
|
||||
}
|
||||
@ -6851,7 +6840,7 @@ public final class L2PcInstance extends L2Playable
|
||||
public void setKarmaFlag(int flag)
|
||||
{
|
||||
StatusUpdate su = new StatusUpdate(this);
|
||||
su.addAttribute(StatusUpdate.PVP_FLAG, getKarma());
|
||||
su.addAttribute(StatusUpdate.PVP_FLAG, getReputation());
|
||||
sendPacket(su);
|
||||
|
||||
final Collection<L2PcInstance> plrs = getKnownList().getKnownPlayers().values();
|
||||
@ -6892,7 +6881,7 @@ public final class L2PcInstance extends L2Playable
|
||||
public void broadcastKarma()
|
||||
{
|
||||
StatusUpdate su = new StatusUpdate(this);
|
||||
su.addAttribute(StatusUpdate.KARMA, getKarma());
|
||||
su.addAttribute(StatusUpdate.KARMA, getReputation());
|
||||
sendPacket(su);
|
||||
|
||||
for (L2PcInstance player : getKnownList().getKnownPlayers().values())
|
||||
@ -6991,27 +6980,26 @@ public final class L2PcInstance extends L2Playable
|
||||
ps.setInt(14, getAppearance().getSex() ? 1 : 0);
|
||||
ps.setLong(15, getExp());
|
||||
ps.setLong(16, getSp());
|
||||
ps.setInt(17, getKarma());
|
||||
ps.setInt(18, getReputation());
|
||||
ps.setInt(19, getFame());
|
||||
ps.setInt(20, getRaidPoints());
|
||||
ps.setInt(21, getPvpKills());
|
||||
ps.setInt(22, getPkKills());
|
||||
ps.setInt(23, getClanId());
|
||||
ps.setInt(24, getRace().ordinal());
|
||||
ps.setInt(25, getClassId().getId());
|
||||
ps.setLong(26, getDeleteTimer());
|
||||
ps.setInt(27, hasDwarvenCraft() ? 1 : 0);
|
||||
ps.setString(28, getTitle());
|
||||
ps.setInt(29, getAppearance().getTitleColor());
|
||||
ps.setInt(30, getAccessLevel().getLevel());
|
||||
ps.setInt(31, isOnlineInt());
|
||||
ps.setInt(32, getClanPrivileges().getBitmask());
|
||||
ps.setInt(33, getWantsPeace());
|
||||
ps.setInt(34, getBaseClass());
|
||||
ps.setInt(35, isNoble() ? 1 : 0);
|
||||
ps.setLong(36, 0);
|
||||
ps.setTimestamp(37, new Timestamp(getCreateDate().getTimeInMillis()));
|
||||
ps.setInt(17, getReputation());
|
||||
ps.setInt(18, getFame());
|
||||
ps.setInt(19, getRaidPoints());
|
||||
ps.setInt(20, getPvpKills());
|
||||
ps.setInt(21, getPkKills());
|
||||
ps.setInt(22, getClanId());
|
||||
ps.setInt(23, getRace().ordinal());
|
||||
ps.setInt(24, getClassId().getId());
|
||||
ps.setLong(25, getDeleteTimer());
|
||||
ps.setInt(26, hasDwarvenCraft() ? 1 : 0);
|
||||
ps.setString(27, getTitle());
|
||||
ps.setInt(28, getAppearance().getTitleColor());
|
||||
ps.setInt(29, getAccessLevel().getLevel());
|
||||
ps.setInt(30, isOnlineInt());
|
||||
ps.setInt(31, getClanPrivileges().getBitmask());
|
||||
ps.setInt(32, getWantsPeace());
|
||||
ps.setInt(33, getBaseClass());
|
||||
ps.setInt(34, isNoble() ? 1 : 0);
|
||||
ps.setLong(35, 0);
|
||||
ps.setTimestamp(36, new Timestamp(getCreateDate().getTimeInMillis()));
|
||||
ps.executeUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -7062,7 +7050,6 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
player.setHeading(rs.getInt("heading"));
|
||||
|
||||
player.setKarma(rs.getInt("karma"));
|
||||
player.setReputation(rs.getInt("reputation"));
|
||||
player.setFame(rs.getInt("fame"));
|
||||
player.setRaidPoints(rs.getInt("raidpoints"));
|
||||
@ -7625,23 +7612,22 @@ public final class L2PcInstance extends L2Playable
|
||||
ps.setLong(16, exp);
|
||||
ps.setLong(17, getExpBeforeDeath());
|
||||
ps.setLong(18, sp);
|
||||
ps.setInt(19, getKarma());
|
||||
ps.setInt(20, getReputation());
|
||||
ps.setInt(21, getFame());
|
||||
ps.setInt(22, getRaidPoints());
|
||||
ps.setInt(23, getPvpKills());
|
||||
ps.setInt(24, getPkKills());
|
||||
ps.setInt(25, getClanId());
|
||||
ps.setInt(26, getRace().ordinal());
|
||||
ps.setInt(27, getClassId().getId());
|
||||
ps.setLong(28, getDeleteTimer());
|
||||
ps.setString(29, getTitle());
|
||||
ps.setInt(30, getAppearance().getTitleColor());
|
||||
ps.setInt(31, getAccessLevel().getLevel());
|
||||
ps.setInt(32, isOnlineInt());
|
||||
ps.setInt(33, getClanPrivileges().getBitmask());
|
||||
ps.setInt(34, getWantsPeace());
|
||||
ps.setInt(35, getBaseClass());
|
||||
ps.setInt(19, getReputation());
|
||||
ps.setInt(20, getFame());
|
||||
ps.setInt(21, getRaidPoints());
|
||||
ps.setInt(22, getPvpKills());
|
||||
ps.setInt(23, getPkKills());
|
||||
ps.setInt(24, getClanId());
|
||||
ps.setInt(25, getRace().ordinal());
|
||||
ps.setInt(26, getClassId().getId());
|
||||
ps.setLong(27, getDeleteTimer());
|
||||
ps.setString(28, getTitle());
|
||||
ps.setInt(29, getAppearance().getTitleColor());
|
||||
ps.setInt(30, getAccessLevel().getLevel());
|
||||
ps.setInt(31, isOnlineInt());
|
||||
ps.setInt(32, getClanPrivileges().getBitmask());
|
||||
ps.setInt(33, getWantsPeace());
|
||||
ps.setInt(34, getBaseClass());
|
||||
|
||||
long totalOnlineTime = _onlineTime;
|
||||
if (_onlineBeginTime > 0)
|
||||
@ -7649,21 +7635,21 @@ public final class L2PcInstance extends L2Playable
|
||||
totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||
}
|
||||
|
||||
ps.setLong(36, totalOnlineTime);
|
||||
ps.setInt(37, isNoble() ? 1 : 0);
|
||||
ps.setInt(38, getPowerGrade());
|
||||
ps.setInt(39, getPledgeType());
|
||||
ps.setInt(40, getLvlJoinedAcademy());
|
||||
ps.setLong(41, getApprentice());
|
||||
ps.setLong(42, getSponsor());
|
||||
ps.setLong(43, getClanJoinExpiryTime());
|
||||
ps.setLong(44, getClanCreateExpiryTime());
|
||||
ps.setString(45, getName());
|
||||
ps.setLong(46, 0); // unset
|
||||
ps.setInt(47, getBookMarkSlot());
|
||||
ps.setInt(48, _vitalityPoints); // unset
|
||||
ps.setInt(49, getPcBangPoints());
|
||||
ps.setString(50, getLang());
|
||||
ps.setLong(35, totalOnlineTime);
|
||||
ps.setInt(36, isNoble() ? 1 : 0);
|
||||
ps.setInt(37, getPowerGrade());
|
||||
ps.setInt(38, getPledgeType());
|
||||
ps.setInt(39, getLvlJoinedAcademy());
|
||||
ps.setLong(40, getApprentice());
|
||||
ps.setLong(41, getSponsor());
|
||||
ps.setLong(42, getClanJoinExpiryTime());
|
||||
ps.setLong(43, getClanCreateExpiryTime());
|
||||
ps.setString(44, getName());
|
||||
ps.setLong(45, 0); // unset
|
||||
ps.setInt(46, getBookMarkSlot());
|
||||
ps.setInt(47, _vitalityPoints); // unset
|
||||
ps.setInt(48, getPcBangPoints());
|
||||
ps.setString(49, getLang());
|
||||
|
||||
int factionId = 0;
|
||||
if (isGood())
|
||||
@ -7674,9 +7660,9 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
factionId = 2;
|
||||
}
|
||||
ps.setInt(51, factionId);
|
||||
ps.setInt(50, factionId);
|
||||
|
||||
ps.setInt(52, getObjectId());
|
||||
ps.setInt(51, getObjectId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -8701,7 +8687,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
// Check if the L2PcInstance has Karma
|
||||
if ((getKarma() > 0) || (getPvpFlag() > 0))
|
||||
if ((getReputation() < 0) || (getPvpFlag() > 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -9336,7 +9322,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
// On retail, it is impossible to debuff a "peaceful" player.
|
||||
if ((targetPlayer.getPvpFlag() == 0) && (targetPlayer.getKarma() == 0))
|
||||
if ((targetPlayer.getPvpFlag() == 0) && (targetPlayer.getReputation() >= 0))
|
||||
{
|
||||
// Check if skill can do dmg
|
||||
if ((skill.getEffectRange() > 0) && isCtrlPressed && (getTarget() == target))
|
||||
@ -9349,7 +9335,7 @@ public final class L2PcInstance extends L2Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getKarma() > 0))
|
||||
if ((targetPlayer.getPvpFlag() > 0) || (targetPlayer.getReputation() < 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -12810,7 +12796,7 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
if (killer.isInCategory(CategoryType.SHILENS_FOLLOWERS) || (Rnd.get(1, 100) <= ((Config.DEATH_PENALTY_CHANCE) * percent)))
|
||||
{
|
||||
if (!killer.isPlayable() || (getKarma() > 0))
|
||||
if (!killer.isPlayable() || (getReputation() < 0))
|
||||
{
|
||||
increaseShilensBreathDebuff();
|
||||
}
|
||||
@ -14374,7 +14360,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
else if ((getClan() == null) || (target.getClan() == null))
|
||||
{
|
||||
if ((target.getPvpFlag() == 0) && (target.getKarma() == 0))
|
||||
if ((target.getPvpFlag() == 0) && (target.getReputation() >= 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public final class L2TeleporterInstance extends L2Npc
|
||||
msg.setFile(player.getHtmlPrefix(), "html/teleporter/castleteleporter-busy.htm");
|
||||
player.sendPacket(msg);
|
||||
}
|
||||
else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (player.getKarma() != 0)) // TODO: Update me when Karma is replaced with Reputation system!
|
||||
else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (player.getReputation() < 0))
|
||||
{
|
||||
player.sendMessage("Go away, you're not welcome here.");
|
||||
}
|
||||
@ -516,7 +516,7 @@ public final class L2TeleporterInstance extends L2Npc
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
|
||||
return;
|
||||
}
|
||||
else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (player.getKarma() > 0)) // karma
|
||||
else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (player.getReputation() < 0)) // karma
|
||||
{
|
||||
player.sendMessage("Go away, you're not welcome here.");
|
||||
return;
|
||||
|
@ -217,7 +217,7 @@ public final class L2TrapInstance extends L2Npc
|
||||
}
|
||||
|
||||
final L2PcInstance player = target.getActingPlayer();
|
||||
if ((player == null) || ((player.getPvpFlag() == 0) && (player.getKarma() == 0)))
|
||||
if ((player == null) || ((player.getPvpFlag() == 0) && (player.getReputation() >= 0)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -248,9 +248,9 @@ public final class L2TrapInstance extends L2Npc
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getKarma()
|
||||
public int getReputation()
|
||||
{
|
||||
return _owner != null ? _owner.getKarma() : 0;
|
||||
return _owner != null ? _owner.getReputation() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -373,7 +373,7 @@ public final class L2TrapInstance extends L2Npc
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_owner != null) && (_owner.getPvpFlag() == 0) && (_owner.getKarma() == 0))
|
||||
if ((_owner != null) && (_owner.getPvpFlag() == 0) && (_owner.getReputation() >= 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class GuardKnownList extends AttackableKnownList
|
||||
if (object.isPlayer())
|
||||
{
|
||||
// Check if the object added is a L2PcInstance that owns Karma
|
||||
if (object.getActingPlayer().getKarma() > 0)
|
||||
if (object.getActingPlayer().getReputation() < 0)
|
||||
{
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ public class NpcKnownList extends CharKnownList
|
||||
|
||||
for (L2PcInstance pl : getKnownPlayers().values())
|
||||
{
|
||||
if (!pl.isDead() && !pl.isInvul() && pl.isInsideRadius(monster, monster.getAggroRange(), true, false) && (monster.isMonster() || (monster.isInstanceTypes(InstanceType.L2GuardInstance) && (pl.getKarma() > 0))))
|
||||
if (!pl.isDead() && !pl.isInvul() && pl.isInsideRadius(monster, monster.getAggroRange(), true, false) && (monster.isMonster() || (monster.isInstanceTypes(InstanceType.L2GuardInstance) && (pl.getReputation() < 0))))
|
||||
{
|
||||
// Send aggroRangeEnter
|
||||
if (monster.getHating(pl) == 0)
|
||||
|
@ -90,14 +90,14 @@ public class PcStat extends PlayableStat
|
||||
}
|
||||
|
||||
// Set new karma
|
||||
if (!activeChar.isCursedWeaponEquipped() && (activeChar.getKarma() > 0) && (activeChar.isGM() || !activeChar.isInsideZone(ZoneId.PVP)))
|
||||
if (!activeChar.isCursedWeaponEquipped() && (activeChar.getReputation() < 0) && (activeChar.isGM() || !activeChar.isInsideZone(ZoneId.PVP)))
|
||||
{
|
||||
int karmaLost = Formulas.calculateKarmaLost(activeChar, value);
|
||||
if (karmaLost > 0)
|
||||
{
|
||||
activeChar.setKarma(activeChar.getKarma() - karmaLost);
|
||||
activeChar.setReputation(activeChar.getReputation() + karmaLost);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
|
||||
msg.addInt(activeChar.getKarma());
|
||||
msg.addInt(activeChar.getReputation());
|
||||
activeChar.sendPacket(msg);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user