Configuration for making items depositable.

This commit is contained in:
MobiusDevelopment
2020-02-21 11:52:29 +00:00
parent 63e6425dca
commit ef51c8a3f3
45 changed files with 465 additions and 30 deletions

View File

@ -116,6 +116,7 @@ public class Config
private static final String CUSTOM_CHAT_MODERATION_CONFIG_FILE = "./config/Custom/ChatModeration.ini";
private static final String CUSTOM_CLASS_BALANCE_CONFIG_FILE = "./config/Custom/ClassBalance.ini";
private static final String CUSTOM_COMMUNITY_BOARD_CONFIG_FILE = "./config/Custom/CommunityBoard.ini";
private static final String CUSTOM_CUSTOM_DEPOSITABLE_ITEMS_CONFIG_FILE = "./config/Custom/CustomDepositableItems.ini";
private static final String CUSTOM_CUSTOM_MAIL_MANAGER_CONFIG_FILE = "./config/Custom/CustomMailManager.ini";
private static final String CUSTOM_DELEVEL_MANAGER_CONFIG_FILE = "./config/Custom/DelevelManager.ini";
private static final String CUSTOM_DUALBOX_CHECK_CONFIG_FILE = "./config/Custom/DualboxCheck.ini";
@ -1210,6 +1211,8 @@ public class Config
public static int COMMUNITY_PREMIUM_PRICE_PER_DAY;
public static List<Integer> COMMUNITY_AVAILABLE_BUFFS;
public static Map<String, Location> COMMUNITY_AVAILABLE_TELEPORTS;
public static boolean CUSTOM_DEPOSITABLE_ENABLED;
public static boolean CUSTOM_DEPOSITABLE_QUEST_ITEMS;
public static boolean CUSTOM_MAIL_MANAGER_ENABLED;
public static int CUSTOM_MAIL_MANAGER_DELAY;
public static boolean DELEVEL_MANAGER_ENABLED;
@ -3133,6 +3136,12 @@ public class Config
COMMUNITY_AVAILABLE_TELEPORTS.put(splitInfo[0], new Location(Integer.parseInt(splitInfo[1]), Integer.parseInt(splitInfo[2]), Integer.parseInt(splitInfo[3])));
}
// Load CustomDepositableItems config file (if exists)
final PropertiesParser CustomDepositableItems = new PropertiesParser(CUSTOM_CUSTOM_DEPOSITABLE_ITEMS_CONFIG_FILE);
CUSTOM_DEPOSITABLE_ENABLED = CustomDepositableItems.getBoolean("CustomDepositableEnabled", false);
CUSTOM_DEPOSITABLE_QUEST_ITEMS = CustomDepositableItems.getBoolean("DepositableQuestItems", false);
// Load CustomMailManager config file (if exists)
final PropertiesParser CustomMailManager = new PropertiesParser(CUSTOM_CUSTOM_MAIL_MANAGER_CONFIG_FILE);

View File

@ -205,10 +205,19 @@ public abstract class Item extends ListenersContainer implements IIdentifiable
_dropable = set.getBoolean("is_dropable", true);
_destroyable = set.getBoolean("is_destroyable", true);
_tradeable = set.getBoolean("is_tradable", true);
_depositable = set.getBoolean("is_depositable", true);
_questItem = set.getBoolean("is_questitem", false);
if (Config.CUSTOM_DEPOSITABLE_ENABLED)
{
_depositable = _questItem ? Config.CUSTOM_DEPOSITABLE_QUEST_ITEMS : true;
}
else
{
_depositable = set.getBoolean("is_depositable", true);
}
_elementable = set.getBoolean("element_enabled", false);
_enchantable = set.getInt("enchant_enabled", 0);
_questItem = set.getBoolean("is_questitem", false);
_freightable = set.getBoolean("is_freightable", false);
_allowSelfResurrection = set.getBoolean("allow_self_resurrection", false);
_isOlyRestricted = set.getBoolean("is_oly_restricted", false);