Item mall renamed to prime shop to match newer branches.
This commit is contained in:
parent
5ad5c31753
commit
7647bfd74a
@ -840,16 +840,16 @@ BotReportDelay = 30
|
||||
AllowReportsFromSameClanMembers = False
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Item-Mall (Prime-Shop) Settings
|
||||
# Prime-Shop Settings
|
||||
# ---------------------------------------------------------------------------
|
||||
# Enable Item-Mall.
|
||||
# Enable Prime-Shop.
|
||||
# Must enable in L2.ini client file.
|
||||
# Default: False
|
||||
EnableItemMall = False
|
||||
EnablePrimeShop = False
|
||||
|
||||
# Item Id used by item mall.
|
||||
# Item Id used by prime shop.
|
||||
# Default: -1
|
||||
GamePointItemId = -1
|
||||
PrimeShopItemId = -1
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Developer Settings
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/ItemMall.xsd">
|
||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/PrimeShop.xsd">
|
||||
<!--
|
||||
category = Enchant 1
|
||||
category = Supplies 2
|
@ -30,7 +30,7 @@ import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemGroupsData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ItemMallData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.TransformData;
|
||||
@ -248,7 +248,7 @@ public class AdminReload implements IAdminCommandHandler
|
||||
}
|
||||
case "itemmall":
|
||||
{
|
||||
ItemMallData.getInstance().load();
|
||||
PrimeShopData.getInstance().load();
|
||||
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded item mall data.");
|
||||
break;
|
||||
}
|
||||
|
@ -668,8 +668,8 @@ public final class Config
|
||||
public static String[] BOTREPORT_RESETPOINT_HOUR;
|
||||
public static long BOTREPORT_REPORT_DELAY;
|
||||
public static boolean BOTREPORT_ALLOW_REPORTS_FROM_SAME_CLAN_MEMBERS;
|
||||
public static boolean ENABLE_ITEM_MALL;
|
||||
public static int GAME_POINT_ITEM_ID;
|
||||
public static boolean ENABLE_PRIME_SHOP;
|
||||
public static int PRIME_SHOP_ITEM_ID;
|
||||
|
||||
// --------------------------------------------------
|
||||
// FloodProtector Settings
|
||||
@ -2042,8 +2042,8 @@ public final class Config
|
||||
BOTREPORT_RESETPOINT_HOUR = General.getString("BotReportPointsResetHour", "00:00").split(":");
|
||||
BOTREPORT_REPORT_DELAY = General.getInt("BotReportDelay", 30) * 60000;
|
||||
BOTREPORT_ALLOW_REPORTS_FROM_SAME_CLAN_MEMBERS = General.getBoolean("AllowReportsFromSameClanMembers", false);
|
||||
ENABLE_ITEM_MALL = General.getBoolean("EnableItemMall", false);
|
||||
GAME_POINT_ITEM_ID = General.getInt("GamePointItemId", -1);
|
||||
ENABLE_PRIME_SHOP = General.getBoolean("EnablePrimeShop", false);
|
||||
PRIME_SHOP_ITEM_ID = General.getInt("PrimeShopItemId", -1);
|
||||
ENABLE_FALLING_DAMAGE = General.getBoolean("EnableFallingDamage", true);
|
||||
|
||||
// Load FloodProtector config file
|
||||
|
@ -59,7 +59,7 @@ import com.l2jmobius.gameserver.data.xml.impl.HennaData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.HitConditionBonusData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.InitialEquipmentData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.InitialShortcutData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ItemMallData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.KarmaData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||
@ -210,7 +210,7 @@ public final class GameServer
|
||||
FishingMonstersData.getInstance();
|
||||
FishingRodsData.getInstance();
|
||||
HennaData.getInstance();
|
||||
ItemMallData.getInstance();
|
||||
PrimeShopData.getInstance();
|
||||
|
||||
printSection("Characters");
|
||||
ClassListData.getInstance();
|
||||
|
@ -28,18 +28,18 @@ import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||
import com.l2jmobius.gameserver.model.ItemMallProduct;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.holders.PrimeShopProductHolder;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ItemMallData implements IGameXmlReader
|
||||
public class PrimeShopData implements IGameXmlReader
|
||||
{
|
||||
private static final Logger _log = Logger.getLogger(ItemMallData.class.getName());
|
||||
private final Map<Integer, ItemMallProduct> _mallList = new HashMap<>();
|
||||
private static final Logger LOGGER = Logger.getLogger(PrimeShopData.class.getName());
|
||||
private final Map<Integer, PrimeShopProductHolder> _products = new HashMap<>();
|
||||
|
||||
protected ItemMallData()
|
||||
protected PrimeShopData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@ -47,14 +47,14 @@ public class ItemMallData implements IGameXmlReader
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
_mallList.clear();
|
||||
_products.clear();
|
||||
|
||||
if (!Config.ENABLE_ITEM_MALL)
|
||||
if (!Config.ENABLE_PRIME_SHOP)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
parseDatapackFile("data/ItemMall.xml");
|
||||
parseDatapackFile("data/PrimeShop.xml");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -78,33 +78,33 @@ public class ItemMallData implements IGameXmlReader
|
||||
att = attrs.item(i);
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
final ItemMallProduct product = new ItemMallProduct(set.getInt("id"), set.getInt("category"), set.getInt("points"), set.getInt("item"), set.getInt("count"));
|
||||
_mallList.put(set.getInt("id"), product);
|
||||
final PrimeShopProductHolder product = new PrimeShopProductHolder(set.getInt("id"), set.getInt("category"), set.getInt("points"), set.getInt("item"), set.getInt("count"));
|
||||
_products.put(set.getInt("id"), product);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_log.info(getClass().getSimpleName() + ": Loaded " + _mallList.size() + " products.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _products.size() + " products.");
|
||||
}
|
||||
|
||||
public Collection<ItemMallProduct> getAllItems()
|
||||
public Collection<PrimeShopProductHolder> getAllItems()
|
||||
{
|
||||
return _mallList.values();
|
||||
return _products.values();
|
||||
}
|
||||
|
||||
public ItemMallProduct getProduct(int id)
|
||||
public PrimeShopProductHolder getProduct(int id)
|
||||
{
|
||||
return _mallList.get(id);
|
||||
return _products.get(id);
|
||||
}
|
||||
|
||||
public static ItemMallData getInstance()
|
||||
public static PrimeShopData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final ItemMallData _instance = new ItemMallData();
|
||||
protected static final PrimeShopData _instance = new PrimeShopData();
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.model;
|
||||
package com.l2jmobius.gameserver.model.holders;
|
||||
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
@ -22,7 +22,7 @@ import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class ItemMallProduct
|
||||
public class PrimeShopProductHolder
|
||||
{
|
||||
private final int _productId;
|
||||
private final int _category;
|
||||
@ -33,7 +33,7 @@ public class ItemMallProduct
|
||||
private final int _weight;
|
||||
private final boolean _tradable;
|
||||
|
||||
public ItemMallProduct(int productId, int category, int points, int item, int count)
|
||||
public PrimeShopProductHolder(int productId, int category, int points, int item, int count)
|
||||
{
|
||||
_productId = productId;
|
||||
_category = category;
|
@ -23,10 +23,10 @@ import java.util.logging.Level;
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ItemMallData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.model.ItemMallProduct;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.PrimeShopProductHolder;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExBrBuyProduct;
|
||||
@ -63,7 +63,7 @@ public class RequestBrBuyProduct implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemMallProduct product = ItemMallData.getInstance().getProduct(_productId);
|
||||
final PrimeShopProductHolder product = PrimeShopData.getInstance().getProduct(_productId);
|
||||
if (product == null)
|
||||
{
|
||||
player.sendPacket(new ExBrBuyProduct(ExBrBuyProduct.RESULT_WRONG_PRODUCT));
|
||||
@ -77,7 +77,7 @@ public class RequestBrBuyProduct implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final long gamePointSize = Config.GAME_POINT_ITEM_ID == -1 ? player.getGamePoints() : player.getInventory().getInventoryItemCount(Config.GAME_POINT_ITEM_ID, -1);
|
||||
final long gamePointSize = Config.PRIME_SHOP_ITEM_ID == -1 ? player.getGamePoints() : player.getInventory().getInventoryItemCount(Config.PRIME_SHOP_ITEM_ID, -1);
|
||||
if (totalPoints > gamePointSize)
|
||||
{
|
||||
player.sendPacket(new ExBrBuyProduct(ExBrBuyProduct.RESULT_NOT_ENOUGH_POINTS));
|
||||
@ -101,13 +101,13 @@ public class RequestBrBuyProduct implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Pay for Item
|
||||
if (Config.GAME_POINT_ITEM_ID == -1)
|
||||
if (Config.PRIME_SHOP_ITEM_ID == -1)
|
||||
{
|
||||
player.setGamePoints(player.getGamePoints() - totalPoints);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.getInventory().destroyItemByItemId("Buy Product" + _productId, Config.GAME_POINT_ITEM_ID, totalPoints, player, null);
|
||||
player.getInventory().destroyItemByItemId("Buy Product" + _productId, Config.PRIME_SHOP_ITEM_ID, totalPoints, player, null);
|
||||
}
|
||||
|
||||
// Buy Item
|
||||
|
@ -33,13 +33,13 @@ public class ExBrGamePoint implements IClientOutgoingPacket
|
||||
{
|
||||
_playerObj = player.getObjectId();
|
||||
|
||||
if (Config.GAME_POINT_ITEM_ID == -1)
|
||||
if (Config.PRIME_SHOP_ITEM_ID == -1)
|
||||
{
|
||||
_points = player.getGamePoints();
|
||||
}
|
||||
else
|
||||
{
|
||||
_points = player.getInventory().getInventoryItemCount(Config.GAME_POINT_ITEM_ID, -1);
|
||||
_points = player.getInventory().getInventoryItemCount(Config.PRIME_SHOP_ITEM_ID, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
package com.l2jmobius.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ItemMallData;
|
||||
import com.l2jmobius.gameserver.model.ItemMallProduct;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.model.holders.PrimeShopProductHolder;
|
||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
@ -26,11 +26,11 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
*/
|
||||
public class ExBrProductInfo implements IClientOutgoingPacket
|
||||
{
|
||||
private final ItemMallProduct _product;
|
||||
private final PrimeShopProductHolder _product;
|
||||
|
||||
public ExBrProductInfo(int id)
|
||||
{
|
||||
_product = ItemMallData.getInstance().getProduct(id);
|
||||
_product = PrimeShopData.getInstance().getProduct(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,8 +19,8 @@ package com.l2jmobius.gameserver.network.serverpackets;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ItemMallData;
|
||||
import com.l2jmobius.gameserver.model.ItemMallProduct;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.model.holders.PrimeShopProductHolder;
|
||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
@ -28,7 +28,7 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
*/
|
||||
public class ExBrProductList implements IClientOutgoingPacket
|
||||
{
|
||||
private final Collection<ItemMallProduct> _itemList = ItemMallData.getInstance().getAllItems();
|
||||
private final Collection<PrimeShopProductHolder> _itemList = PrimeShopData.getInstance().getAllItems();
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
@ -36,7 +36,7 @@ public class ExBrProductList implements IClientOutgoingPacket
|
||||
OutgoingPackets.EX_BR_PRODUCT_LIST.writeId(packet);
|
||||
packet.writeD(_itemList.size());
|
||||
|
||||
for (ItemMallProduct product : _itemList)
|
||||
for (PrimeShopProductHolder product : _itemList)
|
||||
{
|
||||
final int category = product.getCategory();
|
||||
|
||||
|
@ -25,9 +25,9 @@ import java.util.logging.Level;
|
||||
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.commons.network.PacketWriter;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ItemMallData;
|
||||
import com.l2jmobius.gameserver.model.ItemMallProduct;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.PrimeShopProductHolder;
|
||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
|
||||
/**
|
||||
@ -35,7 +35,7 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
*/
|
||||
public class ExBrRecentProductList implements IClientOutgoingPacket
|
||||
{
|
||||
private final List<ItemMallProduct> _itemList = new ArrayList<>();
|
||||
private final List<PrimeShopProductHolder> _itemList = new ArrayList<>();
|
||||
|
||||
public ExBrRecentProductList(L2PcInstance player)
|
||||
{
|
||||
@ -49,7 +49,7 @@ public class ExBrRecentProductList implements IClientOutgoingPacket
|
||||
{
|
||||
while (rset.next())
|
||||
{
|
||||
final ItemMallProduct product = ItemMallData.getInstance().getProduct(rset.getInt("productId"));
|
||||
final PrimeShopProductHolder product = PrimeShopData.getInstance().getProduct(rset.getInt("productId"));
|
||||
if ((product != null) && !_itemList.contains(product))
|
||||
{
|
||||
_itemList.add(product);
|
||||
@ -74,7 +74,7 @@ public class ExBrRecentProductList implements IClientOutgoingPacket
|
||||
OutgoingPackets.EX_BR_RECENT_PRODUCT_LIST.writeId(packet);
|
||||
packet.writeD(_itemList.size());
|
||||
|
||||
for (ItemMallProduct product : _itemList)
|
||||
for (PrimeShopProductHolder product : _itemList)
|
||||
{
|
||||
packet.writeD(product.getProductId());
|
||||
packet.writeH(product.getCategory());
|
||||
|
Loading…
Reference in New Issue
Block a user