diff --git a/trunk/dist/game/config/Custom.properties b/trunk/dist/game/config/Custom.properties index e6c7f8498f..5f0ab91c18 100644 --- a/trunk/dist/game/config/Custom.properties +++ b/trunk/dist/game/config/Custom.properties @@ -601,6 +601,10 @@ CommunityTeleportPrice = 0 # Default: 0 (free) CommunityBuffPrice = 0 +# Disable Community Board while in combat. +# Default: True +CommunityCombatDisabled = True + # --------------------------------------------------------------------------- # Faction System (Good vs Evil) diff --git a/trunk/dist/game/data/multisell/custom/600001.xml b/trunk/dist/game/data/multisell/custom/600001.xml index fcce0c2347..e14a2b5054 100644 --- a/trunk/dist/game/data/multisell/custom/600001.xml +++ b/trunk/dist/game/data/multisell/custom/600001.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600002.xml b/trunk/dist/game/data/multisell/custom/600002.xml index 5f6aad162e..a530555154 100644 --- a/trunk/dist/game/data/multisell/custom/600002.xml +++ b/trunk/dist/game/data/multisell/custom/600002.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600003.xml b/trunk/dist/game/data/multisell/custom/600003.xml index bd0013da4f..1d1b92b677 100644 --- a/trunk/dist/game/data/multisell/custom/600003.xml +++ b/trunk/dist/game/data/multisell/custom/600003.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600004.xml b/trunk/dist/game/data/multisell/custom/600004.xml index c095ac5acc..5fb1eb02ae 100644 --- a/trunk/dist/game/data/multisell/custom/600004.xml +++ b/trunk/dist/game/data/multisell/custom/600004.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600005.xml b/trunk/dist/game/data/multisell/custom/600005.xml index 76b69055ca..7f38dddbe7 100644 --- a/trunk/dist/game/data/multisell/custom/600005.xml +++ b/trunk/dist/game/data/multisell/custom/600005.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600006.xml b/trunk/dist/game/data/multisell/custom/600006.xml index b66e62ef03..0b0c253f66 100644 --- a/trunk/dist/game/data/multisell/custom/600006.xml +++ b/trunk/dist/game/data/multisell/custom/600006.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600007.xml b/trunk/dist/game/data/multisell/custom/600007.xml index 3904b30ccb..de13e1f670 100644 --- a/trunk/dist/game/data/multisell/custom/600007.xml +++ b/trunk/dist/game/data/multisell/custom/600007.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600008.xml b/trunk/dist/game/data/multisell/custom/600008.xml index 02edd384ef..7489c999d0 100644 --- a/trunk/dist/game/data/multisell/custom/600008.xml +++ b/trunk/dist/game/data/multisell/custom/600008.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600009.xml b/trunk/dist/game/data/multisell/custom/600009.xml index 410e52d06c..4a8f13bd13 100644 --- a/trunk/dist/game/data/multisell/custom/600009.xml +++ b/trunk/dist/game/data/multisell/custom/600009.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600010.xml b/trunk/dist/game/data/multisell/custom/600010.xml index c798af8b3a..2687f010a0 100644 --- a/trunk/dist/game/data/multisell/custom/600010.xml +++ b/trunk/dist/game/data/multisell/custom/600010.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600011.xml b/trunk/dist/game/data/multisell/custom/600011.xml index ecd9ae6cfe..ca17b2d311 100644 --- a/trunk/dist/game/data/multisell/custom/600011.xml +++ b/trunk/dist/game/data/multisell/custom/600011.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600012.xml b/trunk/dist/game/data/multisell/custom/600012.xml index 44fe63fd8f..dfc789c418 100644 --- a/trunk/dist/game/data/multisell/custom/600012.xml +++ b/trunk/dist/game/data/multisell/custom/600012.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600013.xml b/trunk/dist/game/data/multisell/custom/600013.xml index 3d229b2bc4..4ec1284327 100644 --- a/trunk/dist/game/data/multisell/custom/600013.xml +++ b/trunk/dist/game/data/multisell/custom/600013.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600014.xml b/trunk/dist/game/data/multisell/custom/600014.xml index e34b142393..afc2d06d58 100644 --- a/trunk/dist/game/data/multisell/custom/600014.xml +++ b/trunk/dist/game/data/multisell/custom/600014.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600015.xml b/trunk/dist/game/data/multisell/custom/600015.xml index 3a21839d4a..eaba992bea 100644 --- a/trunk/dist/game/data/multisell/custom/600015.xml +++ b/trunk/dist/game/data/multisell/custom/600015.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600016.xml b/trunk/dist/game/data/multisell/custom/600016.xml index 95d2436a08..9451f9662d 100644 --- a/trunk/dist/game/data/multisell/custom/600016.xml +++ b/trunk/dist/game/data/multisell/custom/600016.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600017.xml b/trunk/dist/game/data/multisell/custom/600017.xml index 1753e4886c..4ebdc341d1 100644 --- a/trunk/dist/game/data/multisell/custom/600017.xml +++ b/trunk/dist/game/data/multisell/custom/600017.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600018.xml b/trunk/dist/game/data/multisell/custom/600018.xml index e4b8723a78..56eed2907e 100644 --- a/trunk/dist/game/data/multisell/custom/600018.xml +++ b/trunk/dist/game/data/multisell/custom/600018.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600019.xml b/trunk/dist/game/data/multisell/custom/600019.xml index f589edf475..28248d612b 100644 --- a/trunk/dist/game/data/multisell/custom/600019.xml +++ b/trunk/dist/game/data/multisell/custom/600019.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600020.xml b/trunk/dist/game/data/multisell/custom/600020.xml index 3bb715753f..254261d855 100644 --- a/trunk/dist/game/data/multisell/custom/600020.xml +++ b/trunk/dist/game/data/multisell/custom/600020.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600021.xml b/trunk/dist/game/data/multisell/custom/600021.xml index 26b598f5d8..62139af866 100644 --- a/trunk/dist/game/data/multisell/custom/600021.xml +++ b/trunk/dist/game/data/multisell/custom/600021.xml @@ -1,5 +1,8 @@  + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600022.xml b/trunk/dist/game/data/multisell/custom/600022.xml index af38f7e7af..cb49ce6064 100644 --- a/trunk/dist/game/data/multisell/custom/600022.xml +++ b/trunk/dist/game/data/multisell/custom/600022.xml @@ -1,5 +1,8 @@  + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600023.xml b/trunk/dist/game/data/multisell/custom/600023.xml index 06e36ea1ee..03e73c1216 100644 --- a/trunk/dist/game/data/multisell/custom/600023.xml +++ b/trunk/dist/game/data/multisell/custom/600023.xml @@ -1,5 +1,8 @@  + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600024.xml b/trunk/dist/game/data/multisell/custom/600024.xml index 978fd686b9..10dbb4ce56 100644 --- a/trunk/dist/game/data/multisell/custom/600024.xml +++ b/trunk/dist/game/data/multisell/custom/600024.xml @@ -1,5 +1,8 @@  + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600025.xml b/trunk/dist/game/data/multisell/custom/600025.xml index 4dc83089d3..b876233380 100644 --- a/trunk/dist/game/data/multisell/custom/600025.xml +++ b/trunk/dist/game/data/multisell/custom/600025.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600026.xml b/trunk/dist/game/data/multisell/custom/600026.xml index 51d267f540..c9e59b8e15 100644 --- a/trunk/dist/game/data/multisell/custom/600026.xml +++ b/trunk/dist/game/data/multisell/custom/600026.xml @@ -1,5 +1,8 @@  + + -1 + diff --git a/trunk/dist/game/data/multisell/custom/600027.xml b/trunk/dist/game/data/multisell/custom/600027.xml index 5f60131275..1870afaa7e 100644 --- a/trunk/dist/game/data/multisell/custom/600027.xml +++ b/trunk/dist/game/data/multisell/custom/600027.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data/scripts/handlers/communityboard/HomeBoard.java b/trunk/dist/game/data/scripts/handlers/communityboard/HomeBoard.java index b95bec1151..121cd1b069 100644 --- a/trunk/dist/game/data/scripts/handlers/communityboard/HomeBoard.java +++ b/trunk/dist/game/data/scripts/handlers/communityboard/HomeBoard.java @@ -65,6 +65,12 @@ public final class HomeBoard implements IParseBoardHandler @Override public boolean parseCommunityBoardCommand(String command, L2PcInstance activeChar) { + if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_COMBAT_DISABLED && activeChar.isInCombat()) + { + activeChar.sendMessage("You can't use the Community Board right now."); + return false; + } + if (command.equals("_bbshome") || command.equals("_bbstop")) { final String customPath = Config.CUSTOM_CB_ENABLED ? "Custom/" : ""; @@ -95,6 +101,7 @@ public final class HomeBoard implements IParseBoardHandler final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/Custom/" + page + ".html"); CommunityBoardHandler.separateAndSend(html, activeChar); MultisellData.getInstance().separateAndSend(multisellId, activeChar, null, false); + return true; } else if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_ENABLE_MULTISELLS && command.startsWith("_bbssell")) { @@ -103,6 +110,7 @@ public final class HomeBoard implements IParseBoardHandler CommunityBoardHandler.separateAndSend(html, activeChar); activeChar.sendPacket(new BuyList(BuyListData.getInstance().getBuyList(423), activeChar.getAdena(), 0)); activeChar.sendPacket(new ExBuySellList(activeChar, false)); + return true; } else if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_ENABLE_TELEPORTS && command.startsWith("_bbsteleport")) { @@ -150,7 +158,7 @@ public final class HomeBoard implements IParseBoardHandler final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/Custom/" + page + ".html"); CommunityBoardHandler.separateAndSend(html, activeChar); } - return true; + return false; } /** diff --git a/trunk/dist/game/data/xsd/multisell.xsd b/trunk/dist/game/data/xsd/multisell.xsd index 9a0ee96f1a..97c3bbbb13 100644 --- a/trunk/dist/game/data/xsd/multisell.xsd +++ b/trunk/dist/game/data/xsd/multisell.xsd @@ -8,10 +8,7 @@ - - - - + diff --git a/trunk/dist/game/data_classic/multisell/custom/600010.xml b/trunk/dist/game/data_classic/multisell/custom/600010.xml index 990fc5353e..dce58e5239 100644 --- a/trunk/dist/game/data_classic/multisell/custom/600010.xml +++ b/trunk/dist/game/data_classic/multisell/custom/600010.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data_classic/multisell/custom/600012.xml b/trunk/dist/game/data_classic/multisell/custom/600012.xml index 08dc4434e4..3b30ef89a4 100644 --- a/trunk/dist/game/data_classic/multisell/custom/600012.xml +++ b/trunk/dist/game/data_classic/multisell/custom/600012.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data_classic/multisell/custom/600014.xml b/trunk/dist/game/data_classic/multisell/custom/600014.xml index 7e65851f58..098d435668 100644 --- a/trunk/dist/game/data_classic/multisell/custom/600014.xml +++ b/trunk/dist/game/data_classic/multisell/custom/600014.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data_classic/multisell/custom/600016.xml b/trunk/dist/game/data_classic/multisell/custom/600016.xml index c85b6edba7..5ae1a54edb 100644 --- a/trunk/dist/game/data_classic/multisell/custom/600016.xml +++ b/trunk/dist/game/data_classic/multisell/custom/600016.xml @@ -1,5 +1,8 @@ + + -1 + diff --git a/trunk/dist/game/data_classic/multisell/custom/600024.xml b/trunk/dist/game/data_classic/multisell/custom/600024.xml index 121a2fe006..f2d4c0d292 100644 --- a/trunk/dist/game/data_classic/multisell/custom/600024.xml +++ b/trunk/dist/game/data_classic/multisell/custom/600024.xml @@ -1,5 +1,8 @@  + + -1 + diff --git a/trunk/dist/game/data_classic/scripts/handlers/communityboard/HomeBoard.java b/trunk/dist/game/data_classic/scripts/handlers/communityboard/HomeBoard.java index b95bec1151..121cd1b069 100644 --- a/trunk/dist/game/data_classic/scripts/handlers/communityboard/HomeBoard.java +++ b/trunk/dist/game/data_classic/scripts/handlers/communityboard/HomeBoard.java @@ -65,6 +65,12 @@ public final class HomeBoard implements IParseBoardHandler @Override public boolean parseCommunityBoardCommand(String command, L2PcInstance activeChar) { + if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_COMBAT_DISABLED && activeChar.isInCombat()) + { + activeChar.sendMessage("You can't use the Community Board right now."); + return false; + } + if (command.equals("_bbshome") || command.equals("_bbstop")) { final String customPath = Config.CUSTOM_CB_ENABLED ? "Custom/" : ""; @@ -95,6 +101,7 @@ public final class HomeBoard implements IParseBoardHandler final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/Custom/" + page + ".html"); CommunityBoardHandler.separateAndSend(html, activeChar); MultisellData.getInstance().separateAndSend(multisellId, activeChar, null, false); + return true; } else if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_ENABLE_MULTISELLS && command.startsWith("_bbssell")) { @@ -103,6 +110,7 @@ public final class HomeBoard implements IParseBoardHandler CommunityBoardHandler.separateAndSend(html, activeChar); activeChar.sendPacket(new BuyList(BuyListData.getInstance().getBuyList(423), activeChar.getAdena(), 0)); activeChar.sendPacket(new ExBuySellList(activeChar, false)); + return true; } else if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_ENABLE_TELEPORTS && command.startsWith("_bbsteleport")) { @@ -150,7 +158,7 @@ public final class HomeBoard implements IParseBoardHandler final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/CommunityBoard/Custom/" + page + ".html"); CommunityBoardHandler.separateAndSend(html, activeChar); } - return true; + return false; } /** diff --git a/trunk/dist/game/data_classic/xsd/multisell.xsd b/trunk/dist/game/data_classic/xsd/multisell.xsd index 9a0ee96f1a..97c3bbbb13 100644 --- a/trunk/dist/game/data_classic/xsd/multisell.xsd +++ b/trunk/dist/game/data_classic/xsd/multisell.xsd @@ -8,10 +8,7 @@ - - - - + diff --git a/trunk/java/com/l2jserver/Config.java b/trunk/java/com/l2jserver/Config.java index 2a9d00ac3b..cb02492f04 100644 --- a/trunk/java/com/l2jserver/Config.java +++ b/trunk/java/com/l2jserver/Config.java @@ -822,6 +822,7 @@ public final class Config public static boolean COMMUNITYBOARD_ENABLE_BUFFS; public static int COMMUNITYBOARD_TELEPORT_PRICE; public static int COMMUNITYBOARD_BUFF_PRICE; + public static boolean COMMUNITYBOARD_COMBAT_DISABLED; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; public static int FACTION_MANAGER_NPCID; @@ -2598,6 +2599,7 @@ public final class Config COMMUNITYBOARD_ENABLE_BUFFS = CustomSettings.getBoolean("CommunityEnableBuffs", true); COMMUNITYBOARD_TELEPORT_PRICE = CustomSettings.getInt("CommunityTeleportPrice", 0); COMMUNITYBOARD_BUFF_PRICE = CustomSettings.getInt("CommunityBuffPrice", 0); + COMMUNITYBOARD_COMBAT_DISABLED = CustomSettings.getBoolean("CommunityCombatDisabled", true); String[] tempString; FACTION_SYSTEM_ENABLED = Boolean.valueOf(CustomSettings.getBoolean("EnableFactionSystem", false)); diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java index ece5bb1e42..c9b1a021f2 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java @@ -241,7 +241,7 @@ public final class MultisellData implements IXmlReader return; } - if (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())) + if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly()))) { LOGGER.warning(getClass().getSimpleName() + ": player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!"); return; diff --git a/trunk/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java b/trunk/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java index 6ca14d4500..3107066e32 100644 --- a/trunk/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java +++ b/trunk/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java @@ -99,7 +99,7 @@ public class MultiSellChoose extends L2GameClientPacket } final L2Npc npc = player.getLastFolkNPC(); - if (((npc != null) && !list.isNpcAllowed(npc.getId())) || ((npc == null) && list.isNpcOnly())) + if (!list.isNpcAllowed(-1) && (((npc != null) && !list.isNpcAllowed(npc.getId())) || ((npc == null) && list.isNpcOnly()))) { player.setMultiSell(null); return; diff --git a/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestRefundItem.java b/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestRefundItem.java index 39e7e4d419..db28ae14e1 100644 --- a/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestRefundItem.java +++ b/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestRefundItem.java @@ -43,6 +43,7 @@ public final class RequestRefundItem extends L2GameClientPacket private static final String _C__D0_75_REQUESTREFUNDITEM = "[C] D0:75 RequestRefundItem"; private static final int BATCH_LENGTH = 4; // length of the one item + private static final int CUSTOM_CB_SELL_LIST = 423; private int _listId; private int[] _items = null; @@ -91,25 +92,19 @@ public final class RequestRefundItem extends L2GameClientPacket return; } - L2Object target = player.getTarget(); - if (!player.isGM() && ((target == null) || !(target instanceof L2MerchantInstance) || (player.getInstanceId() != target.getInstanceId()) || !player.isInsideRadius(target, INTERACTION_DISTANCE, true, false))) - { - sendPacket(ActionFailed.STATIC_PACKET); - return; - } - + final L2Object target = player.getTarget(); L2Character merchant = null; - if (target instanceof L2MerchantInstance) + if (!player.isGM() && (_listId != CUSTOM_CB_SELL_LIST)) { + if (!(target instanceof L2MerchantInstance) || (!player.isInsideRadius(target, INTERACTION_DISTANCE, true, false)) || (player.getInstanceId() != target.getInstanceId())) + { + sendPacket(ActionFailed.STATIC_PACKET); + return; + } merchant = (L2Character) target; } - else if (!player.isGM()) - { - sendPacket(ActionFailed.STATIC_PACKET); - return; - } - if (merchant == null) + if ((merchant == null) && !player.isGM() && (_listId != CUSTOM_CB_SELL_LIST)) { sendPacket(ActionFailed.STATIC_PACKET); return; @@ -122,7 +117,7 @@ public final class RequestRefundItem extends L2GameClientPacket return; } - if (!buyList.isNpcAllowed(merchant.getId())) + if ((merchant != null) && !buyList.isNpcAllowed(merchant.getId())) { sendPacket(ActionFailed.STATIC_PACKET); return;