Various community board merchant improvements.

This commit is contained in:
MobiusDev
2015-05-07 20:43:24 +00:00
parent 998fca3057
commit 74bb130dd0
41 changed files with 134 additions and 27 deletions

View File

@@ -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)

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="50000000"/>
<production id="18069" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="30000000"/>
<production id="18035" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="20000000"/>
<production id="18001" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="50000000"/>
<production id="18083" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="35000000"/>
<production id="18049" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="18015" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="18033" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="35562" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="15246" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="5000"/>
<production id="886" count="2"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="22104" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="500"/>
<production id="736" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="500"/>
<production id="9546" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="1336100"/> <!-- Adena -->
<production id="78" count="1" chance="100"/> <!-- Great Sword -->

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="1336100"/> <!-- Adena -->
<production id="23066" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="319200"/> <!-- Adena -->
<production id="357" count="1" chance="100"/> <!-- Zubei's Breastplate -->

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="24000"/>
<production id="8732" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="2540000"/>
<production id="9588" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="750000"/>
<production id="6622" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="40000000"/>
<production id="6379" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="74946000"/>
<production id="9860" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="75000000"/>
<production id="15575" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="205668000"/>
<production id="15871" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="1419" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="28671000"/>
<production id="13687" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="20000000"/>
<production id="13950" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="50000000"/>
<production id="2375" count="1"/>

View File

@@ -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;
}
/**

View File

@@ -8,10 +8,7 @@
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="npc" minOccurs="1" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1" />
<xs:maxInclusive value="65535" />
</xs:restriction>
<xs:restriction base="xs:integer" />
</xs:simpleType>
</xs:element>
</xs:sequence>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="5000"/>
<production id="886" count="2"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="500"/>
<production id="736" count="1"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="1336100"/> <!-- Adena -->
<production id="78" count="1" chance="100"/> <!-- Great Sword -->

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="319200"/> <!-- Adena -->
<production id="357" count="1" chance="100"/> <!-- Zubei's Breastplate -->

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/multisell.xsd">
<npcs>
<npc>-1</npc> <!-- CB -->
</npcs>
<item>
<ingredient id="57" count="10000000"/>
<production id="1419" count="1"/>

View File

@@ -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;
}
/**

View File

@@ -8,10 +8,7 @@
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="npc" minOccurs="1" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1" />
<xs:maxInclusive value="65535" />
</xs:restriction>
<xs:restriction base="xs:integer" />
</xs:simpleType>
</xs:element>
</xs:sequence>

View File

@@ -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));

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;