diff --git a/game-server/config/main/membership.properties b/game-server/config/main/membership.properties index f05606f00..4e02df0ed 100644 --- a/game-server/config/main/membership.properties +++ b/game-server/config/main/membership.properties @@ -39,30 +39,6 @@ gameserver.instances.quest.requirement = 10 # Default: 10 gameserver.instances.cooldown = 10 -# All items can be storable in warehouse -# Default: 10 -gameserver.store.wh.all = 10 - -# All items can be storable in account warehouse -# Default: 10 -gameserver.store.accountwh.all = 10 - -# All items can be storable in legion warehouse -# Default: 10 -gameserver.store.legionwh.all = 10 - -# All items can be tradeable -# Default: 10 -gameserver.trade.all = 10 - -# Soulbound items can be tradeable -# Default: 10 -gameserver.disable.soulbind = 10 - -# All items can be remodelable -# Default: 10 -gameserver.remodel.all = 10 - # All emotions available # Default: 10 gameserver.emotions.all = 10 diff --git a/game-server/data/static_data/items/item_templates.xml b/game-server/data/static_data/items/item_templates.xml index 94d34ff5e..7f30f7fa0 100644 --- a/game-server/data/static_data/items/item_templates.xml +++ b/game-server/data/static_data/items/item_templates.xml @@ -919318,7 +919318,7 @@ - + diff --git a/game-server/src/com/aionemu/gameserver/configs/main/MembershipConfig.java b/game-server/src/com/aionemu/gameserver/configs/main/MembershipConfig.java index 209b27243..738ec01a5 100644 --- a/game-server/src/com/aionemu/gameserver/configs/main/MembershipConfig.java +++ b/game-server/src/com/aionemu/gameserver/configs/main/MembershipConfig.java @@ -28,24 +28,6 @@ public class MembershipConfig { @Property(key = "gameserver.instances.cooldown", defaultValue = "10") public static byte INSTANCES_COOLDOWN; - @Property(key = "gameserver.store.wh.all", defaultValue = "10") - public static byte STORE_WH_ALL; - - @Property(key = "gameserver.store.accountwh.all", defaultValue = "10") - public static byte STORE_AWH_ALL; - - @Property(key = "gameserver.store.legionwh.all", defaultValue = "10") - public static byte STORE_LWH_ALL; - - @Property(key = "gameserver.trade.all", defaultValue = "10") - public static byte TRADE_ALL; - - @Property(key = "gameserver.disable.soulbind", defaultValue = "10") - public static byte DISABLE_SOULBIND; - - @Property(key = "gameserver.remodel.all", defaultValue = "10") - public static byte REMODEL_ALL; - @Property(key = "gameserver.emotions.all", defaultValue = "10") public static byte EMOTIONS_ALL; diff --git a/game-server/src/com/aionemu/gameserver/model/gameobjects/Item.java b/game-server/src/com/aionemu/gameserver/model/gameobjects/Item.java index 05792c49d..125a97ccc 100644 --- a/game-server/src/com/aionemu/gameserver/model/gameobjects/Item.java +++ b/game-server/src/com/aionemu/gameserver/model/gameobjects/Item.java @@ -5,7 +5,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.aionemu.gameserver.configs.main.MembershipConfig; import com.aionemu.gameserver.dao.ItemStoneListDAO; import com.aionemu.gameserver.dataholders.DataManager; import com.aionemu.gameserver.model.Expirable; @@ -550,13 +549,6 @@ public boolean isSoulBound() { return isSoulBound; } - private boolean isSoulBound(Player player) { - if (player.hasPermission(MembershipConfig.DISABLE_SOULBIND)) { - return false; - } else - return isSoulBound; - } - public void setSoulBound(boolean isSoulBound) { this.isSoulBound = isSoulBound; setPersistentState(PersistentState.UPDATE_REQUIRED); @@ -630,57 +622,28 @@ public int getSockets(boolean isFusionItem) { return 0; } - public int getItemMask(Player player) { - return checkConfig(player, itemTemplate.getMask()); - } - - private int checkConfig(Player player, int mask) { - int newMask = mask; - if (player.hasPermission(MembershipConfig.STORE_WH_ALL)) { - newMask = newMask | ItemMask.STORABLE_IN_WH; - } - if (player.hasPermission(MembershipConfig.STORE_AWH_ALL)) { - newMask = newMask | ItemMask.STORABLE_IN_AWH; - } - if (player.hasPermission(MembershipConfig.STORE_LWH_ALL)) { - newMask = newMask | ItemMask.STORABLE_IN_LWH; - } - if (player.hasPermission(MembershipConfig.TRADE_ALL)) { - newMask = newMask | ItemMask.TRADEABLE; - } - if (player.hasPermission(MembershipConfig.REMODEL_ALL)) { - newMask = newMask | ItemMask.REMODELABLE; - } - - return newMask; - } - - public boolean isStorableinWarehouse(Player player) { - return (getItemMask(player) & ItemMask.STORABLE_IN_WH) == ItemMask.STORABLE_IN_WH; + public boolean isStorableInWarehouse() { + return (getItemMask() & ItemMask.STORABLE_IN_WH) == ItemMask.STORABLE_IN_WH; } - public boolean isStorableinAccWarehouse(Player player) { - return (getItemMask(player) & ItemMask.STORABLE_IN_AWH) == ItemMask.STORABLE_IN_AWH && !isSoulBound(player); + public boolean isStorableInAccWarehouse() { + return (getItemMask() & ItemMask.STORABLE_IN_AWH) == ItemMask.STORABLE_IN_AWH && !isSoulBound(); } - public boolean isStorableinLegWarehouse(Player player) { - return (getItemMask(player) & ItemMask.STORABLE_IN_LWH) == ItemMask.STORABLE_IN_LWH && !isSoulBound(player); + public boolean isStorableInLegWarehouse() { + return (getItemMask() & ItemMask.STORABLE_IN_LWH) == ItemMask.STORABLE_IN_LWH && !isSoulBound(); } - public boolean isTradeable(Player player) { - return (getItemMask(player) & ItemMask.TRADEABLE) == ItemMask.TRADEABLE && !isSoulBound(player); + public boolean isTradeable() { + return (getItemMask() & ItemMask.TRADEABLE) == ItemMask.TRADEABLE && !isSoulBound(); } - public boolean isLegionTradeable(Player player, Player partner) { - if ((getItemMask(player) & ItemMask.LEGION_TRADEABLE) != ItemMask.LEGION_TRADEABLE || isSoulBound(player)) - return false; - if (player.getLegion() == null || partner.getLegion() == null) - return false; - return player.getLegion().getLegionId() == partner.getLegion().getLegionId(); + public boolean isLegionTradeable() { + return (getItemMask() & ItemMask.LEGION_TRADEABLE) == ItemMask.LEGION_TRADEABLE && !isSoulBound(); } - public boolean isRemodelable(Player player) { - return (getItemMask(player) & ItemMask.REMODELABLE) == ItemMask.REMODELABLE; + public boolean isRemodelable() { + return (getItemMask() & ItemMask.REMODELABLE) == ItemMask.REMODELABLE; } public boolean isSellable() { diff --git a/game-server/src/com/aionemu/gameserver/network/aion/iteminfo/GeneralInfoBlobEntry.java b/game-server/src/com/aionemu/gameserver/network/aion/iteminfo/GeneralInfoBlobEntry.java index ce2a6af3e..6ab0e195f 100644 --- a/game-server/src/com/aionemu/gameserver/network/aion/iteminfo/GeneralInfoBlobEntry.java +++ b/game-server/src/com/aionemu/gameserver/network/aion/iteminfo/GeneralInfoBlobEntry.java @@ -19,7 +19,7 @@ public class GeneralInfoBlobEntry extends ItemBlobEntry { @Override public void writeThisBlob(ByteBuffer buf) {// TODO what with kinah? - writeH(buf, ownerItem.getItemMask(owner)); + writeH(buf, ownerItem.getItemMask()); writeQ(buf, ownerItem.getItemCount()); writeS(buf, ownerItem.getItemCreator());// Creator name writeC(buf, 0); diff --git a/game-server/src/com/aionemu/gameserver/services/BrokerService.java b/game-server/src/com/aionemu/gameserver/services/BrokerService.java index d026b600a..e3d4bb7d3 100644 --- a/game-server/src/com/aionemu/gameserver/services/BrokerService.java +++ b/game-server/src/com/aionemu/gameserver/services/BrokerService.java @@ -427,7 +427,7 @@ public void registerItem(Player player, int itemUniqueId, long count, long price } // Check Trade Hack - if (itemToRegister.getPackCount() <= 0 && !itemToRegister.isTradeable(player)) + if (itemToRegister.getPackCount() <= 0 && !itemToRegister.isTradeable()) return; if (!AdminService.getInstance().canOperate(player, null, itemToRegister, "broker")) diff --git a/game-server/src/com/aionemu/gameserver/services/ExchangeService.java b/game-server/src/com/aionemu/gameserver/services/ExchangeService.java index f582e4667..d7d0c21e8 100644 --- a/game-server/src/com/aionemu/gameserver/services/ExchangeService.java +++ b/game-server/src/com/aionemu/gameserver/services/ExchangeService.java @@ -127,11 +127,6 @@ public void addKinah(Player activePlayer, long itemCount) { } } - /** - * @param activePlayer - * @param itemObjId - * @param itemCount - */ public void addItem(Player activePlayer, int itemObjId, long itemCount) { Item item = activePlayer.getInventory().getItemByObjId(itemObjId); if (item == null) @@ -140,11 +135,10 @@ public void addItem(Player activePlayer, int itemObjId, long itemCount) { Player partner = getCurrentParter(activePlayer); if (partner == null) return; - if (!TemporaryTradeTimeTask.getInstance().canTrade(item, partner.getObjectId())) - if (item.getPackCount() <= 0 && !item.isTradeable(activePlayer)) { - if (!item.isLegionTradeable(activePlayer, partner)) - return; - } + if (item.getPackCount() <= 0 && !item.isTradeable() && !TemporaryTradeTimeTask.getInstance().canTrade(item, partner.getObjectId())) { + if (!item.isLegionTradeable() || activePlayer.getLegion() == null || !activePlayer.getLegion().equals(partner.getLegion())) + return; + } if (itemCount < 1) return; diff --git a/game-server/src/com/aionemu/gameserver/services/PrivateStoreService.java b/game-server/src/com/aionemu/gameserver/services/PrivateStoreService.java index 336f5124b..3728161f2 100644 --- a/game-server/src/com/aionemu/gameserver/services/PrivateStoreService.java +++ b/game-server/src/com/aionemu/gameserver/services/PrivateStoreService.java @@ -95,7 +95,7 @@ private static boolean validateItem(PrivateStore store, Item item, TradePSItem p PacketSendUtility.sendPacket(store.getOwner(), SM_SYSTEM_MESSAGE.STR_PERSONAL_SHOP_FULL_BASKET()); return false; } - if (item.getPackCount() <= 0 && !item.isTradeable(store.getOwner())) { + if (item.getPackCount() <= 0 && !item.isTradeable()) { PacketSendUtility.sendPacket(store.getOwner(), SM_SYSTEM_MESSAGE.STR_PERSONAL_SHOP_CANNOT_BE_EXCHANGED()); return false; } diff --git a/game-server/src/com/aionemu/gameserver/services/item/ItemRemodelService.java b/game-server/src/com/aionemu/gameserver/services/item/ItemRemodelService.java index b239d937c..56efc22e8 100644 --- a/game-server/src/com/aionemu/gameserver/services/item/ItemRemodelService.java +++ b/game-server/src/com/aionemu/gameserver/services/item/ItemRemodelService.java @@ -87,12 +87,12 @@ public static void remodelItem(Player player, int keepItemObjId, int extractItem return; } - if (!keepItem.isRemodelable(player)) { + if (!keepItem.isRemodelable()) { PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_CHANGE_ITEM_SKIN_NOT_SKIN_CHANGABLE_ITEM(keepItem.getItemTemplate().getL10n())); return; } - if (!extractItem.isRemodelable(player)) { + if (!extractItem.isRemodelable()) { PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_CHANGE_ITEM_SKIN_CAN_NOT_REMOVE_SKIN_ITEM(extractItem.getItemTemplate().getL10n())); return; } diff --git a/game-server/src/com/aionemu/gameserver/services/item/ItemRestrictionService.java b/game-server/src/com/aionemu/gameserver/services/item/ItemRestrictionService.java index 960832c78..13abdd00a 100644 --- a/game-server/src/com/aionemu/gameserver/services/item/ItemRestrictionService.java +++ b/game-server/src/com/aionemu/gameserver/services/item/ItemRestrictionService.java @@ -41,21 +41,21 @@ public static boolean isItemRestrictedTo(Player player, Item item, byte storage) StorageType type = StorageType.getStorageTypeById(storage); switch (type) { case REGULAR_WAREHOUSE: - if (!item.isStorableinWarehouse(player)) { + if (!item.isStorableInWarehouse()) { // You cannot store this in the warehouse. PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_WAREHOUSE_CANT_DEPOSIT_ITEM()); return true; } break; case ACCOUNT_WAREHOUSE: - if (!item.isStorableinAccWarehouse(player)) { + if (!item.isStorableInAccWarehouse()) { // You cannot store this item in the account warehouse. PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_WAREHOUSE_CANT_ACCOUNT_DEPOSIT()); return true; } break; case LEGION_WAREHOUSE: - if (!item.isStorableinLegWarehouse(player) || !LegionConfig.LEGION_WAREHOUSE) { + if (!item.isStorableInLegWarehouse() || !LegionConfig.LEGION_WAREHOUSE) { // You cannot store this item in the Legion warehouse. PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_WAREHOUSE_CANT_LEGION_DEPOSIT()); return true; diff --git a/game-server/src/com/aionemu/gameserver/services/mail/MailService.java b/game-server/src/com/aionemu/gameserver/services/mail/MailService.java index eb9135a15..7ccfe6048 100644 --- a/game-server/src/com/aionemu/gameserver/services/mail/MailService.java +++ b/game-server/src/com/aionemu/gameserver/services/mail/MailService.java @@ -111,7 +111,7 @@ public static void sendMail(Player sender, String recipientName, String title, S Item attachedItem = null; if (senderItem != null) { // Check Mailing untradables with Cash items (Special courier passes) - if (senderItem.getPackCount() <= 0 && !senderItem.isTradeable(sender)) { + if (senderItem.getPackCount() <= 0 && !senderItem.isTradeable()) { Disposition dispo = senderItem.getItemTemplate().getDisposition(); if (dispo == null || dispo.getId() == 0 || dispo.getCount() == 0) // can not be traded, hack return;