Created L2PcInstance updatePvpTitleAndColor method.
This commit is contained in:
parent
7b31dfcf9f
commit
d710208ef4
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5212,6 +5212,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5231,6 +5233,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
if (isInsideZone(ZoneId.PVP))
|
||||||
|
@ -172,36 +172,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
// LOGGER.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5218,6 +5218,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5237,6 +5239,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
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.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5220,6 +5220,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5239,6 +5241,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
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.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5218,6 +5218,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5237,6 +5239,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
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.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -265,6 +265,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendPacket(new ExBrExtraUserInfo(player));
|
player.sendPacket(new ExBrExtraUserInfo(player));
|
||||||
|
@ -5376,6 +5376,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
{
|
{
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
|
|
||||||
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
|
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
|
||||||
sendPacket(new UserInfo(this));
|
sendPacket(new UserInfo(this));
|
||||||
sendPacket(new ExBrExtraUserInfo(this));
|
sendPacket(new ExBrExtraUserInfo(this));
|
||||||
@ -5408,6 +5410,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
sendPacket(new ExBrExtraUserInfo(this));
|
sendPacket(new ExBrExtraUserInfo(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
if (isInsideZone(ZoneId.PVP))
|
||||||
|
@ -164,36 +164,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
// LOGGER.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5184,6 +5184,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5203,6 +5205,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
if (isInsideZone(ZoneId.PVP))
|
||||||
|
@ -176,36 +176,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
// LOGGER.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5184,6 +5184,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5203,6 +5205,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
if (isInsideZone(ZoneId.PVP))
|
||||||
|
@ -176,36 +176,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
// LOGGER.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
@ -278,6 +278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
|
player.updatePvpTitleAndColor(false);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendMessage("A GM changed your PVP count to " + pvp);
|
player.sendMessage("A GM changed your PVP count to " + pvp);
|
||||||
|
@ -5185,6 +5185,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPvpKills(_pvpKills + 1);
|
setPvpKills(_pvpKills + 1);
|
||||||
|
|
||||||
|
updatePvpTitleAndColor(true);
|
||||||
}
|
}
|
||||||
else if ((getReputation() > 0) && (_pkKills == 0))
|
else if ((getReputation() > 0) && (_pkKills == 0))
|
||||||
{
|
{
|
||||||
@ -5204,6 +5206,43 @@ public final class L2PcInstance extends L2Playable
|
|||||||
checkItemRestriction();
|
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()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if (isInsideZone(ZoneId.PVP))
|
if (isInsideZone(ZoneId.PVP))
|
||||||
|
@ -176,36 +176,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
// LOGGER.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
|
// 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)
|
activeChar.updatePvpTitleAndColor(false);
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply special GM properties to the GM when entering
|
// Apply special GM properties to the GM when entering
|
||||||
if (activeChar.isGM())
|
if (activeChar.isGM())
|
||||||
|
Loading…
Reference in New Issue
Block a user