Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P core
- diff --git java/config/Olympiad.properties
- index 5c25403..2263ab6 100644
- --- java/config/Olympiad.properties
- +++ java/config/Olympiad.properties
- @@ -80,9 +80,12 @@
- AltOlyLosePointsOnTie = True
- # Hero tables show last month's winners or current status.
- # Default: True
- AltOlyShowMonthlyWinners = True
- # Enchant limit for items during Olympiad games. Disabled = -1.
- # Default: -1
- AltOlyEnchantLimit = -1
- +
- +# Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
- +AltOlyRestrictedItems = 7575,6379,858
- diff --git java/net/sf/l2j/Config.java
- index 88ec0a3..ac06dfa 100644
- --- java/net/sf/l2j/Config.java
- +++ java/net/sf/l2j/Config.java
- @@ -99,16 +99,18 @@
- public static boolean DEVELOPER;
- public static boolean ACCEPT_GEOEDITOR_CONN;
- /** Set if this server is a test server used for development */
- public static boolean TEST_SERVER;
- /** Enable upnp service */
- public static boolean ENABLE_UPNP;
- + public static String ALT_OLY_RESTRICTED_ITEMS;
- + public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>();
- /** Game Server ports */
- public static int PORT_GAME;
- /** Login Server port */
- public static int PORT_LOGIN;
- /** Login Server bind ip */
- public static String LOGIN_BIND_ADDRESS;
- /** Number of tries of login before ban */
- @@ -1920,17 +1922,22 @@
- {
- olympiadSettings.load(is);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- throw new Error("Failed to Load " + OLYMPIAD_FILE + " File.");
- }
- + ALT_OLY_RESTRICTED_ITEMS = olympiadSettings.getProperty("AltOlyRestrictedItems", "0");
- + LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>();
- + for (final String id : ALT_OLY_RESTRICTED_ITEMS.split(","))
- + {
- + LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
- + }
- ALT_OLY_START_TIME = Integer.parseInt(olympiadSettings.getProperty("AltOlyStartTime", "20"));
- ALT_OLY_MIN = Integer.parseInt(olympiadSettings.getProperty("AltOlyMin", "00"));
- ALT_OLY_CPERIOD = Long.parseLong(olympiadSettings.getProperty("AltOlyCPeriod", "14400000"));
- ALT_OLY_BATTLE = Long.parseLong(olympiadSettings.getProperty("AltOlyBattle", "180000"));
- ALT_OLY_BWAIT = Long.parseLong(olympiadSettings.getProperty("AltOlyBWait", "600000"));
- ALT_OLY_IWAIT = Long.parseLong(olympiadSettings.getProperty("AltOlyIWait", "300000"));
- ALT_OLY_WPERIOD = Long.parseLong(olympiadSettings.getProperty("AltOlyWPeriod", "604800000"));
- ALT_OLY_VPERIOD = Long.parseLong(olympiadSettings.getProperty("AltOlyVPeriod", "86400000"));
- diff --git java/net/sf/l2j/gameserver/model/L2ItemInstance.java
- index 7d9342f..d21a224 100644
- --- java/net/sf/l2j/gameserver/model/L2ItemInstance.java
- +++ java/net/sf/l2j/gameserver/model/L2ItemInstance.java
- @@ -597,16 +597,29 @@
- * Returns if item is tradeable
- * @return boolean
- */
- public boolean isTradeable()
- {
- return _item.isTradeable();
- }
- + public boolean isOlyRestrictedItem()
- + {
- + return (Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId));
- + }
- +
- + public boolean checkOlympCondition()
- + {
- + if (isOlyRestrictedItem())
- + return false;
- + return true;
- + }
- +
- /**
- * Returns if item is a hero item
- * @return boolean
- */
- public boolean isHeroItem()
- {
- return _item.isHeroItem();
- }
- diff --git java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- index c09140b..9436f23 100644
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- @@ -12401,16 +12401,48 @@
- }
- }
- catch (Exception e)
- {
- _log.warning("Error found in " + getName() + "'s FriendList: " + e.getMessage() + e);
- }
- }
- + public void checkItemOlympiad()
- + {
- + for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
- + {
- + final L2ItemInstance equippedItem = getInventory().getPaperdollItem(i);
- + if (equippedItem != null && !equippedItem.checkOlympCondition())
- + {
- + final L2ItemInstance[] items = getInventory().unEquipItemInSlotAndRecord(i);
- + if (equippedItem.isWear())
- + continue;
- + SystemMessage sm = null;
- + if (equippedItem.getEnchantLevel() > 0)
- + {
- + sm = new SystemMessage(SystemMessage.EQUIPMENT_S1_S2_REMOVED);
- + sm.addNumber(equippedItem.getEnchantLevel());
- + sm.addItemName(equippedItem.getItemId());
- + }
- + else
- + {
- + sm = new SystemMessage(SystemMessage.S1_DISARMED);
- + sm.addItemName(equippedItem.getItemId());
- + }
- + sendPacket(sm);
- + final InventoryUpdate iu = new InventoryUpdate();
- + iu.addItems(Arrays.asList(items));
- + sendPacket(iu);
- + broadcastUserInfo();
- + }
- + }
- + }
- +
- +
- /**
- * Notifies this user's friends upon log in.
- */
- private void notifyFriends()
- {
- for (int id : _friendList)
- {
- L2PcInstance friend = L2World.getInstance().getPlayer(id);
- diff --git java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java
- index a90442a..e676bdf 100644
- --- java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java
- +++ java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java
- @@ -196,16 +196,18 @@
- if (party != null)
- {
- party.removePartyMember(player, true);
- }
- // Remove forbidden items
- player.checkItemRestriction();
- + // Remove itens olympiadas custom
- + player.checkItemOlympiad();
- // Remove shot automation
- player.disableAutoShotsAll();
- // Discharge any active shots
- player.setChargedSoulShot(L2ItemInstance.CHARGED_NONE);
- player.setChargedSpiritShot(L2ItemInstance.CHARGED_NONE);
- // Cubic cleanup
- diff --git java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- index 302ea92..a47d89e 100644
- --- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- +++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- @@ -198,16 +198,21 @@
- int bodyPart = item.getItem().getBodyPart();
- // Prevent player to equip weapon/shield while mounted
- if (activeChar.isMounted() && ((bodyPart == L2Item.SLOT_LR_HAND) || (bodyPart == L2Item.SLOT_L_HAND) || (bodyPart == L2Item.SLOT_R_HAND)))
- {
- return;
- }
- + if (activeChar.isInOlympiadMode() && ((bodyPart == L2Item.SLOT_LR_HAND || bodyPart == L2Item.SLOT_L_HAND || bodyPart == L2Item.SLOT_R_HAND) && (item.getItemId() >= 6611 && item.getItemId() <= 6621 || item.getItemId() == 6842) || Config.LIST_OLY_RESTRICTED_ITEMS.contains(item.getItemId())))
- + {
- + return;
- + }
- +
- // Don't allow weapon/shield equipment if wearing formal wear
- if (activeChar.isWearingFormalWear() && ((bodyPart == L2Item.SLOT_LR_HAND) || (bodyPart == L2Item.SLOT_L_HAND) || (bodyPart == L2Item.SLOT_R_HAND)))
- {
- activeChar.sendPacket(new SystemMessage(SystemMessage.CANNOT_USE_ITEMS_SKILLS_WITH_FORMALWEAR));
- return;
- }
- SystemMessage sm = null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement