Permitting the usage of community board multisells.

This commit is contained in:
MobiusDev
2017-11-29 18:47:31 +00:00
parent 66679bcae8
commit e06653cd84
10 changed files with 15 additions and 20 deletions

View File

@@ -45,7 +45,6 @@ import com.l2jmobius.gameserver.model.holders.MultisellListHolder;
import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder; import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.network.serverpackets.MultiSellList; import com.l2jmobius.gameserver.network.serverpackets.MultiSellList;
import com.l2jmobius.gameserver.util.Util;
public final class MultisellData implements IGameXmlReader public final class MultisellData implements IGameXmlReader
{ {
@@ -149,7 +148,7 @@ public final class MultisellData implements IGameXmlReader
{ {
// Initialize NPCs with the size of child nodes. // Initialize NPCs with the size of child nodes.
final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength()); final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength());
forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()) && Util.isDigit(n.getTextContent()), n -> allowNpc.add(Integer.parseInt(n.getTextContent()))); forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()), n -> allowNpc.add(Integer.parseInt(n.getTextContent())));
// Add npcs to stats set. // Add npcs to stats set.
set.set("allowNpc", allowNpc); set.set("allowNpc", allowNpc);
@@ -212,7 +211,7 @@ public final class MultisellData implements IGameXmlReader
return; 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())))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -116,7 +116,7 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
final L2Npc npc = player.getLastFolkNPC(); final L2Npc npc = player.getLastFolkNPC();
if (!isAllowedToUse(player, npc, list)) if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -45,7 +45,6 @@ import com.l2jmobius.gameserver.model.holders.MultisellListHolder;
import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder; import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.network.serverpackets.MultiSellList; import com.l2jmobius.gameserver.network.serverpackets.MultiSellList;
import com.l2jmobius.gameserver.util.Util;
public final class MultisellData implements IGameXmlReader public final class MultisellData implements IGameXmlReader
{ {
@@ -149,7 +148,7 @@ public final class MultisellData implements IGameXmlReader
{ {
// Initialize NPCs with the size of child nodes. // Initialize NPCs with the size of child nodes.
final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength()); final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength());
forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()) && Util.isDigit(n.getTextContent()), n -> allowNpc.add(Integer.parseInt(n.getTextContent()))); forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()), n -> allowNpc.add(Integer.parseInt(n.getTextContent())));
// Add npcs to stats set. // Add npcs to stats set.
set.set("allowNpc", allowNpc); set.set("allowNpc", allowNpc);
@@ -212,7 +211,7 @@ public final class MultisellData implements IGameXmlReader
return; 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())))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -133,7 +133,7 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
final L2Npc npc = player.getLastFolkNPC(); final L2Npc npc = player.getLastFolkNPC();
if (!isAllowedToUse(player, npc, list)) if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -45,7 +45,6 @@ import com.l2jmobius.gameserver.model.holders.MultisellListHolder;
import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder; import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.network.serverpackets.MultiSellList; import com.l2jmobius.gameserver.network.serverpackets.MultiSellList;
import com.l2jmobius.gameserver.util.Util;
public final class MultisellData implements IGameXmlReader public final class MultisellData implements IGameXmlReader
{ {
@@ -149,7 +148,7 @@ public final class MultisellData implements IGameXmlReader
{ {
// Initialize NPCs with the size of child nodes. // Initialize NPCs with the size of child nodes.
final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength()); final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength());
forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()) && Util.isDigit(n.getTextContent()), n -> allowNpc.add(Integer.parseInt(n.getTextContent()))); forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()), n -> allowNpc.add(Integer.parseInt(n.getTextContent())));
// Add npcs to stats set. // Add npcs to stats set.
set.set("allowNpc", allowNpc); set.set("allowNpc", allowNpc);
@@ -212,7 +211,7 @@ public final class MultisellData implements IGameXmlReader
return; 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())))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -133,7 +133,7 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
final L2Npc npc = player.getLastFolkNPC(); final L2Npc npc = player.getLastFolkNPC();
if (!isAllowedToUse(player, npc, list)) if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -45,7 +45,6 @@ import com.l2jmobius.gameserver.model.holders.MultisellListHolder;
import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder; import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.network.serverpackets.MultiSellList; import com.l2jmobius.gameserver.network.serverpackets.MultiSellList;
import com.l2jmobius.gameserver.util.Util;
public final class MultisellData implements IGameXmlReader public final class MultisellData implements IGameXmlReader
{ {
@@ -149,7 +148,7 @@ public final class MultisellData implements IGameXmlReader
{ {
// Initialize NPCs with the size of child nodes. // Initialize NPCs with the size of child nodes.
final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength()); final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength());
forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()) && Util.isDigit(n.getTextContent()), n -> allowNpc.add(Integer.parseInt(n.getTextContent()))); forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()), n -> allowNpc.add(Integer.parseInt(n.getTextContent())));
// Add npcs to stats set. // Add npcs to stats set.
set.set("allowNpc", allowNpc); set.set("allowNpc", allowNpc);
@@ -212,7 +211,7 @@ public final class MultisellData implements IGameXmlReader
return; 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())))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -133,7 +133,7 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
final L2Npc npc = player.getLastFolkNPC(); final L2Npc npc = player.getLastFolkNPC();
if (!isAllowedToUse(player, npc, list)) if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -45,7 +45,6 @@ import com.l2jmobius.gameserver.model.holders.MultisellListHolder;
import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder; import com.l2jmobius.gameserver.model.holders.PreparedMultisellListHolder;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.network.serverpackets.MultiSellList; import com.l2jmobius.gameserver.network.serverpackets.MultiSellList;
import com.l2jmobius.gameserver.util.Util;
public final class MultisellData implements IGameXmlReader public final class MultisellData implements IGameXmlReader
{ {
@@ -149,7 +148,7 @@ public final class MultisellData implements IGameXmlReader
{ {
// Initialize NPCs with the size of child nodes. // Initialize NPCs with the size of child nodes.
final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength()); final Set<Integer> allowNpc = new HashSet<>(itemNode.getChildNodes().getLength());
forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()) && Util.isDigit(n.getTextContent()), n -> allowNpc.add(Integer.parseInt(n.getTextContent()))); forEach(itemNode, n -> "npc".equalsIgnoreCase(n.getNodeName()), n -> allowNpc.add(Integer.parseInt(n.getTextContent())));
// Add npcs to stats set. // Add npcs to stats set.
set.set("allowNpc", allowNpc); set.set("allowNpc", allowNpc);
@@ -212,7 +211,7 @@ public final class MultisellData implements IGameXmlReader
return; 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())))
{ {
if (player.isGM()) if (player.isGM())
{ {

View File

@@ -133,7 +133,7 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
final L2Npc npc = player.getLastFolkNPC(); final L2Npc npc = player.getLastFolkNPC();
if (!isAllowedToUse(player, npc, list)) if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
{ {
if (player.isGM()) if (player.isGM())
{ {