Created L2PcInstance updatePvpTitleAndColor method.
This commit is contained in:
@@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
final L2PcInstance player = (L2PcInstance) target;
|
||||
player.setPvpKills(pvp);
|
||||
player.updatePvpTitleAndColor(false);
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new UserInfo(player));
|
||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||
|
@@ -5218,6 +5218,8 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
setPvpKills(_pvpKills + 1);
|
||||
|
||||
updatePvpTitleAndColor(true);
|
||||
}
|
||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||
{
|
||||
@@ -5237,6 +5239,43 @@ public final class L2PcInstance extends L2Playable
|
||||
checkItemRestriction();
|
||||
}
|
||||
|
||||
public void updatePvpTitleAndColor(boolean broadcastInfo)
|
||||
{
|
||||
if (Config.PVP_COLOR_SYSTEM_ENABLED && !Config.FACTION_SYSTEM_ENABLED) // Faction system uses title colors.
|
||||
{
|
||||
if ((_pvpKills >= (Config.PVP_AMOUNT1)) && (_pvpKills < (Config.PVP_AMOUNT2)))
|
||||
{
|
||||
setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT1 + " \u00AE");
|
||||
_appearance.setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1);
|
||||
}
|
||||
else if ((_pvpKills >= (Config.PVP_AMOUNT2)) && (_pvpKills < (Config.PVP_AMOUNT3)))
|
||||
{
|
||||
setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT2 + " \u00AE");
|
||||
_appearance.setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2);
|
||||
}
|
||||
else if ((_pvpKills >= (Config.PVP_AMOUNT3)) && (_pvpKills < (Config.PVP_AMOUNT4)))
|
||||
{
|
||||
setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT3 + " \u00AE");
|
||||
_appearance.setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3);
|
||||
}
|
||||
else if ((_pvpKills >= (Config.PVP_AMOUNT4)) && (_pvpKills < (Config.PVP_AMOUNT5)))
|
||||
{
|
||||
setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT4 + " \u00AE");
|
||||
_appearance.setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4);
|
||||
}
|
||||
else if (_pvpKills >= (Config.PVP_AMOUNT5))
|
||||
{
|
||||
setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT5 + " \u00AE");
|
||||
_appearance.setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5);
|
||||
}
|
||||
|
||||
if (broadcastInfo)
|
||||
{
|
||||
broadcastTitleInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePvPStatus()
|
||||
{
|
||||
if (isInsideZone(ZoneId.PVP))
|
||||
|
@@ -177,36 +177,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
// LOGGER.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
|
||||
// }
|
||||
|
||||
if (Config.PVP_COLOR_SYSTEM_ENABLED && !Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if ((activeChar.getPvpKills() >= (Config.PVP_AMOUNT1)) && (activeChar.getPvpKills() < (Config.PVP_AMOUNT2)))
|
||||
{
|
||||
activeChar.setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT1 + " \u00AE");
|
||||
activeChar.getAppearance().setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1);
|
||||
}
|
||||
else if ((activeChar.getPvpKills() >= (Config.PVP_AMOUNT2)) && (activeChar.getPvpKills() < (Config.PVP_AMOUNT3)))
|
||||
{
|
||||
activeChar.setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT2 + " \u00AE");
|
||||
activeChar.getAppearance().setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2);
|
||||
}
|
||||
else if ((activeChar.getPvpKills() >= (Config.PVP_AMOUNT3)) && (activeChar.getPvpKills() < (Config.PVP_AMOUNT4)))
|
||||
{
|
||||
activeChar.setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT3 + " \u00AE");
|
||||
activeChar.getAppearance().setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3);
|
||||
}
|
||||
else if ((activeChar.getPvpKills() >= (Config.PVP_AMOUNT4)) && (activeChar.getPvpKills() < (Config.PVP_AMOUNT5)))
|
||||
{
|
||||
activeChar.setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT4 + " \u00AE");
|
||||
activeChar.getAppearance().setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4);
|
||||
}
|
||||
else if (activeChar.getPvpKills() >= (Config.PVP_AMOUNT5))
|
||||
{
|
||||
activeChar.setTitle("\u00AE " + Config.TITLE_FOR_PVP_AMOUNT5 + " \u00AE");
|
||||
activeChar.getAppearance().setTitleColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5);
|
||||
}
|
||||
activeChar.sendMessage("Welcome " + activeChar.getName() + ", you PvP kill count is " + activeChar.getPvpKills() + " and get a special title.");
|
||||
activeChar.broadcastTitleInfo();
|
||||
}
|
||||
activeChar.updatePvpTitleAndColor(false);
|
||||
|
||||
// Apply special GM properties to the GM when entering
|
||||
if (activeChar.isGM())
|
||||
|
Reference in New Issue
Block a user