Expect multisell NPC id to be properly set.
This commit is contained in:
parent
efbbe7a3b7
commit
f9031d41f9
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<!-- Pc Bang Point -->
|
||||
<ingredient count="600" id="-100" />
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -113,13 +115,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -606,30 +620,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<!-- Pc Bang Point -->
|
||||
<ingredient count="600" id="-100" />
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<!-- Pc Bang Point -->
|
||||
<ingredient count="600" id="-100" />
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<!-- Pc Bang Point -->
|
||||
<ingredient count="600" id="-100" />
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="10000" id="-100" /> <!-- Pc Bang Point -->
|
||||
<production count="1" id="24357" /> <!-- Draco's Hat - Warrior -->
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="10000" id="-100" /> <!-- Pc Bang Point -->
|
||||
<production count="1" id="24357" /> <!-- Draco's Hat - Warrior -->
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="10000" id="-100" /> <!-- Pc Bang Point -->
|
||||
<production count="1" id="24357" /> <!-- Draco's Hat - Warrior -->
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
|
||||
<!-- PC - Apocalypse Weapons -->
|
||||
<npcs>
|
||||
<npc>-1</npc>
|
||||
</npcs>
|
||||
<item>
|
||||
<ingredient count="20000" id="-100" />
|
||||
<production count="1" id="34509" />
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -241,10 +241,20 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly()))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final PreparedListContainer list = new PreparedListContainer(template, inventoryOnly, player, npc);
|
||||
|
@ -95,11 +95,6 @@ public class ListContainer
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -119,10 +119,20 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (((npc != null) && !list.isNpcAllowed(npc.getId())) || ((npc == null) && list.isNpcOnly()))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -239,16 +239,19 @@ public class MultisellData implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
if (!template.isNpcAllowed(-1) && (((npc != null) && !template.isNpcAllowed(npc.getId())) || ((npc == null) && template.isNpcOnly())))
|
||||
if (!template.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !template.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Player " + player + " attempted to open multisell " + listId + " from npc " + npc + " which is not allowed!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,6 @@ public class MultisellListHolder implements IIdentifiable
|
||||
|
||||
public boolean isNpcAllowed(int npcId)
|
||||
{
|
||||
return (_npcsAllowed == null) || _npcsAllowed.contains(npcId);
|
||||
}
|
||||
|
||||
public boolean isNpcOnly()
|
||||
{
|
||||
return _npcsAllowed != null;
|
||||
return (_npcsAllowed != null) && _npcsAllowed.contains(npcId);
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import static org.l2jmobius.gameserver.model.actor.Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
@ -130,13 +132,25 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final Npc npc = player.getLastFolkNPC();
|
||||
if (!list.isNpcAllowed(-1) && !isAllowedToUse(player, npc, list))
|
||||
if (!list.isNpcAllowed(-1))
|
||||
{
|
||||
if (player.isGM())
|
||||
if ((npc == null) || !list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
if (player.isGM())
|
||||
{
|
||||
player.sendMessage("Multisell " + _listId + " is restricted. Under current conditions cannot be used. Only GMs are allowed to use it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
if (!player.isGM() && (npc != null))
|
||||
{
|
||||
if (!player.isInsideRadius3D(npc, INTERACTION_DISTANCE) || (player.getInstanceId() != npc.getInstanceId()))
|
||||
{
|
||||
player.setMultiSell(null);
|
||||
return;
|
||||
@ -650,30 +664,4 @@ public class MultiSellChoose implements IClientIncomingPacket
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
* @param npc
|
||||
* @param list
|
||||
* @return {@code true} if player can buy stuff from the multisell, {@code false} otherwise.
|
||||
*/
|
||||
private boolean isAllowedToUse(PlayerInstance player, Npc npc, PreparedMultisellListHolder list)
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
if (!list.isNpcAllowed(npc.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (list.isNpcOnly() && (!list.checkNpcObjectId(npc.getObjectId()) || (npc.getInstanceWorld() != player.getInstanceWorld()) || !player.isInsideRadius3D(npc, Npc.INTERACTION_DISTANCE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (list.isNpcOnly())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user