PvP reward item and title color configs.

This commit is contained in:
MobiusDev
2018-04-11 13:40:39 +00:00
parent cf835b71f1
commit c604eb6223
5 changed files with 175 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# ---------------------------------------------------------------------------
# PvP/PK Reward Item
# ---------------------------------------------------------------------------
# Reward item on PvP
RewardPvpItem = False
# Reward PvP item ID
RewardPvpItemId = 57
# Reward PvP item Amount
RewardPvpItemAmount = 1000
# Show PvP item reward message?
RewardPvpItemMessage = True
# Reward item on PK
RewardPkItem = False
# Reward PK item ID
RewardPkItemId = 57
# Reward PK item Amount
RewardPkItemAmount = 500
# Show PK item reward message?
RewardPkItemMessage = True
# Disable rewards in instances.
DisableRewardsInInstances = True
# Disable rewards in PvP zones.
DisableRewardsInPvpZones = True

View File

@@ -0,0 +1,33 @@
#-------------------------------------------------------------
# Custom PvP Titles and Colors
#-------------------------------------------------------------
# Example: PvpAmmount1 = 150, Player with 500 PvP will have a title with the color specified in ColorPvpSystem.
# Attention: Colors should be specified only in RGB format, one color for each rank.
# Attention: Do not use with Faction system.
EnablePvPColorSystem = False
# Rank 1
PvpAmount1 = 500
ColorForAmount1 = 9C9C9C
PvPTitleForAmount1 = Sergeant
# Rank 2
PvpAmount2 = 1000
ColorForAmount2 = 696969
PvPTitleForAmount2 = Lieutenant
# Rank 3
PvpAmount3 = 1500
ColorForAmount3 = 4F4F4F
PvPTitleForAmount3 = Captain
# Rank 4
PvpAmount4 = 2500
ColorForAmount4 = 363636
PvPTitleForAmount4 = Major
# Rank 5
PvpAmount5 = 5000
ColorForAmount5 = 1C1C1C
PvPTitleForAmount5 = General

View File

@@ -120,6 +120,8 @@ public final class Config
public static final String CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE = "./config/Custom/PremiumSystem.ini"; public static final String CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE = "./config/Custom/PremiumSystem.ini";
public static final String CUSTOM_PRIVATE_STORE_RANGE_CONFIG_FILE = "./config/Custom/PrivateStoreRange.ini"; public static final String CUSTOM_PRIVATE_STORE_RANGE_CONFIG_FILE = "./config/Custom/PrivateStoreRange.ini";
public static final String CUSTOM_PVP_ANNOUNCE_CONFIG_FILE = "./config/Custom/PvpAnnounce.ini"; public static final String CUSTOM_PVP_ANNOUNCE_CONFIG_FILE = "./config/Custom/PvpAnnounce.ini";
public static final String CUSTOM_PVP_REWARD_ITEM_CONFIG_FILE = "./config/Custom/PvpRewardItem.ini";
public static final String CUSTOM_PVP_TITLE_CONFIG_FILE = "./config/Custom/PvpTitleColor.ini";
public static final String CUSTOM_RANDOM_SPAWNS_CONFIG_FILE = "./config/Custom/RandomSpawns.ini"; public static final String CUSTOM_RANDOM_SPAWNS_CONFIG_FILE = "./config/Custom/RandomSpawns.ini";
public static final String CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE = "./config/Custom/ScreenWelcomeMessage.ini"; public static final String CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE = "./config/Custom/ScreenWelcomeMessage.ini";
public static final String CUSTOM_SELL_BUFFS_CONFIG_FILE = "./config/Custom/SellBuffs.ini"; public static final String CUSTOM_SELL_BUFFS_CONFIG_FILE = "./config/Custom/SellBuffs.ini";
@@ -1173,6 +1175,32 @@ public final class Config
public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE; public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
public static String ANNOUNCE_PK_MSG; public static String ANNOUNCE_PK_MSG;
public static String ANNOUNCE_PVP_MSG; public static String ANNOUNCE_PVP_MSG;
public static boolean REWARD_PVP_ITEM;
public static int REWARD_PVP_ITEM_ID;
public static int REWARD_PVP_ITEM_AMOUNT;
public static boolean REWARD_PVP_ITEM_MESSAGE;
public static boolean REWARD_PK_ITEM;
public static int REWARD_PK_ITEM_ID;
public static int REWARD_PK_ITEM_AMOUNT;
public static boolean REWARD_PK_ITEM_MESSAGE;
public static boolean DISABLE_REWARDS_IN_INSTANCES;
public static boolean DISABLE_REWARDS_IN_PVP_ZONES;
public static boolean PVP_COLOR_SYSTEM_ENABLED;
public static int PVP_AMOUNT1;
public static int PVP_AMOUNT2;
public static int PVP_AMOUNT3;
public static int PVP_AMOUNT4;
public static int PVP_AMOUNT5;
public static int NAME_COLOR_FOR_PVP_AMOUNT1;
public static int NAME_COLOR_FOR_PVP_AMOUNT2;
public static int NAME_COLOR_FOR_PVP_AMOUNT3;
public static int NAME_COLOR_FOR_PVP_AMOUNT4;
public static int NAME_COLOR_FOR_PVP_AMOUNT5;
public static String TITLE_FOR_PVP_AMOUNT1;
public static String TITLE_FOR_PVP_AMOUNT2;
public static String TITLE_FOR_PVP_AMOUNT3;
public static String TITLE_FOR_PVP_AMOUNT4;
public static String TITLE_FOR_PVP_AMOUNT5;
public static boolean CHAT_ADMIN; public static boolean CHAT_ADMIN;
public static boolean MULTILANG_ENABLE; public static boolean MULTILANG_ENABLE;
public static List<String> MULTILANG_ALLOWED = new ArrayList<>(); public static List<String> MULTILANG_ALLOWED = new ArrayList<>();
@@ -2825,6 +2853,40 @@ public final class Config
ANNOUNCE_PK_MSG = PvpAnnounce.getString("AnnouncePkMsg", "$killer has slaughtered $target"); ANNOUNCE_PK_MSG = PvpAnnounce.getString("AnnouncePkMsg", "$killer has slaughtered $target");
ANNOUNCE_PVP_MSG = PvpAnnounce.getString("AnnouncePvpMsg", "$killer has defeated $target"); ANNOUNCE_PVP_MSG = PvpAnnounce.getString("AnnouncePvpMsg", "$killer has defeated $target");
// Load PvpRewardItem config file (if exists)
final PropertiesParser PvpRewardItem = new PropertiesParser(CUSTOM_PVP_REWARD_ITEM_CONFIG_FILE);
REWARD_PVP_ITEM = PvpRewardItem.getBoolean("RewardPvpItem", false);
REWARD_PVP_ITEM_ID = PvpRewardItem.getInt("RewardPvpItemId", 57);
REWARD_PVP_ITEM_AMOUNT = PvpRewardItem.getInt("RewardPvpItemAmount", 1000);
REWARD_PVP_ITEM_MESSAGE = PvpRewardItem.getBoolean("RewardPvpItemMessage", true);
REWARD_PK_ITEM = PvpRewardItem.getBoolean("RewardPkItem", false);
REWARD_PK_ITEM_ID = PvpRewardItem.getInt("RewardPkItemId", 57);
REWARD_PK_ITEM_AMOUNT = PvpRewardItem.getInt("RewardPkItemAmount", 500);
REWARD_PK_ITEM_MESSAGE = PvpRewardItem.getBoolean("RewardPkItemMessage", true);
DISABLE_REWARDS_IN_INSTANCES = PvpRewardItem.getBoolean("DisableRewardsInInstances", true);
DISABLE_REWARDS_IN_PVP_ZONES = PvpRewardItem.getBoolean("DisableRewardsInPvpZones", true);
// Load PvpRewardItem config file (if exists)
final PropertiesParser PvpTitleColor = new PropertiesParser(CUSTOM_PVP_TITLE_CONFIG_FILE);
PVP_COLOR_SYSTEM_ENABLED = PvpTitleColor.getBoolean("EnablePvPColorSystem", false);
PVP_AMOUNT1 = PvpTitleColor.getInt("PvpAmount1", 500);
PVP_AMOUNT2 = PvpTitleColor.getInt("PvpAmount2", 1000);
PVP_AMOUNT3 = PvpTitleColor.getInt("PvpAmount3", 1500);
PVP_AMOUNT4 = PvpTitleColor.getInt("PvpAmount4", 2500);
PVP_AMOUNT5 = PvpTitleColor.getInt("PvpAmount5", 5000);
NAME_COLOR_FOR_PVP_AMOUNT1 = Integer.decode("0x" + PvpTitleColor.getString("ColorForAmount1", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT2 = Integer.decode("0x" + PvpTitleColor.getString("ColorForAmount2", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT3 = Integer.decode("0x" + PvpTitleColor.getString("ColorForAmount3", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT4 = Integer.decode("0x" + PvpTitleColor.getString("ColorForAmount4", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT5 = Integer.decode("0x" + PvpTitleColor.getString("ColorForAmount5", "00FF00"));
TITLE_FOR_PVP_AMOUNT1 = PvpTitleColor.getString("PvPTitleForAmount1", "Title");
TITLE_FOR_PVP_AMOUNT2 = PvpTitleColor.getString("PvPTitleForAmount2", "Title");
TITLE_FOR_PVP_AMOUNT3 = PvpTitleColor.getString("PvPTitleForAmount3", "Title");
TITLE_FOR_PVP_AMOUNT4 = PvpTitleColor.getString("PvPTitleForAmount4", "Title");
TITLE_FOR_PVP_AMOUNT5 = PvpTitleColor.getString("PvPTitleForAmount5", "Title");
// Load RandomSpawns config file (if exists) // Load RandomSpawns config file (if exists)
final PropertiesParser RandomSpawns = new PropertiesParser(CUSTOM_RANDOM_SPAWNS_CONFIG_FILE); final PropertiesParser RandomSpawns = new PropertiesParser(CUSTOM_RANDOM_SPAWNS_CONFIG_FILE);

View File

@@ -5052,6 +5052,22 @@ public final class L2PcInstance extends L2Playable
pk.getEventStatus().getKills().add(this); pk.getEventStatus().getKills().add(this);
} }
// pvp/pk item rewards
if (!(Config.DISABLE_REWARDS_IN_INSTANCES && (getInstanceId() != 0)) && //
!(Config.DISABLE_REWARDS_IN_PVP_ZONES && isInsideZone(ZoneId.PVP)))
{
// pvp
if (Config.REWARD_PVP_ITEM && (getPvpFlag() != 0))
{
pk.addItem("PvP Item Reward", Config.REWARD_PVP_ITEM_ID, Config.REWARD_PVP_ITEM_AMOUNT, this, Config.REWARD_PVP_ITEM_MESSAGE);
}
// pk
if (Config.REWARD_PK_ITEM && (getPvpFlag() == 0))
{
pk.addItem("PK Item Reward", Config.REWARD_PK_ITEM_ID, Config.REWARD_PK_ITEM_AMOUNT, this, Config.REWARD_PK_ITEM_MESSAGE);
}
}
// announce pvp/pk // announce pvp/pk
if (Config.ANNOUNCE_PK_PVP && !pk.isGM()) if (Config.ANNOUNCE_PK_PVP && !pk.isGM())
{ {

View File

@@ -163,6 +163,37 @@ 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)
{
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())
{ {