Reverting previous solution to avoid name color update problems.
This commit is contained in:
@@ -50,6 +50,10 @@ public class PcAppearance
|
|||||||
/** The default title color is 0xECF9A2. */
|
/** The default title color is 0xECF9A2. */
|
||||||
private int _titleColor = DEFAULT_TITLE_COLOR;
|
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)
|
public PcAppearance(byte face, byte hColor, byte hStyle, boolean sex)
|
||||||
{
|
{
|
||||||
_face = face;
|
_face = face;
|
||||||
@@ -173,6 +177,14 @@ public class PcAppearance
|
|||||||
|
|
||||||
public int getNameColor()
|
public int getNameColor()
|
||||||
{
|
{
|
||||||
|
if (_owner.getKarma() > 0)
|
||||||
|
{
|
||||||
|
return _redColor;
|
||||||
|
}
|
||||||
|
if (_owner.getReputation() > 0)
|
||||||
|
{
|
||||||
|
return _greenColor;
|
||||||
|
}
|
||||||
return _nameColor;
|
return _nameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,7 +68,7 @@ public final class RelationChanged extends L2GameServerPacket
|
|||||||
_singled._objId = activeChar.getObjectId();
|
_singled._objId = activeChar.getObjectId();
|
||||||
_singled._relation = relation;
|
_singled._relation = relation;
|
||||||
_singled._autoAttackable = autoattackable ? 1 : 0;
|
_singled._autoAttackable = autoattackable ? 1 : 0;
|
||||||
_singled._reputation = activeChar.getKarma() > 0 ? activeChar.getKarma() * -1 : activeChar.getReputation();
|
_singled._reputation = activeChar.getReputation();
|
||||||
_singled._pvpFlag = activeChar.getPvpFlag();
|
_singled._pvpFlag = activeChar.getPvpFlag();
|
||||||
setInvisible(activeChar.isInvisible());
|
setInvisible(activeChar.isInvisible());
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ public final class RelationChanged extends L2GameServerPacket
|
|||||||
r._objId = activeChar.getObjectId();
|
r._objId = activeChar.getObjectId();
|
||||||
r._relation = relation;
|
r._relation = relation;
|
||||||
r._autoAttackable = autoattackable ? 1 : 0;
|
r._autoAttackable = autoattackable ? 1 : 0;
|
||||||
r._reputation = activeChar.getKarma() > 0 ? activeChar.getKarma() * -1 : activeChar.getReputation();
|
r._reputation = activeChar.getReputation();
|
||||||
r._pvpFlag = activeChar.getPvpFlag();
|
r._pvpFlag = activeChar.getPvpFlag();
|
||||||
_multi.add(r);
|
_multi.add(r);
|
||||||
}
|
}
|
||||||
|
@@ -300,7 +300,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
{
|
{
|
||||||
writeH(22);
|
writeH(22);
|
||||||
writeC(_activeChar.getPvpFlag());
|
writeC(_activeChar.getPvpFlag());
|
||||||
writeD(_activeChar.getKarma() > 0 ? _activeChar.getKarma() * -1 : _activeChar.getReputation());
|
writeD(_activeChar.getReputation());
|
||||||
writeC(_activeChar.isNoble() ? 0x01 : 0x00);
|
writeC(_activeChar.isNoble() ? 0x01 : 0x00);
|
||||||
writeC(_activeChar.isHero() ? 0x01 : 0x00);
|
writeC(_activeChar.isHero() ? 0x01 : 0x00);
|
||||||
writeC(_activeChar.getPledgeClass());
|
writeC(_activeChar.getPledgeClass());
|
||||||
|
Reference in New Issue
Block a user