Advertisement
LIONN

Announce Enchant Item

Dec 31st, 2011
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.79 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GameServer
  3. Index: head-src/com/l2jfrozen/Config.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/Config.java  (revision 986)
  6. +++ head-src/com/l2jfrozen/Config.java  (working copy)
  7. @@ -2891,6 +2891,8 @@
  8.     public static int GM_OVER_ENCHANT;
  9.     public static int MAX_ITEM_ENCHANT_KICK;
  10.  
  11. +   public static boolean ENABLE_ENCHANT_ANNOUNCE;
  12. +   public static int ENCHANT_ANNOUNCE_LEVEL;
  13.  
  14.     //============================================================
  15.     public static void loadEnchantConfig()
  16. @@ -3196,6 +3198,8 @@
  17.             MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0"));
  18.             GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0"));
  19.  
  20. +           ENABLE_ENCHANT_ANNOUNCE = Boolean.parseBoolean(ENCHANTSetting.getProperty("EnableEnchantAnnounce", "False"));
  21. +           ENCHANT_ANNOUNCE_LEVEL = Integer.parseInt(ENCHANTSetting.getProperty("EnchantAnnounceLevel", "16"));
  22.         }
  23.         catch(Exception e)
  24.         {
  25. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
  26. ===================================================================
  27. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 986)
  28. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
  29. @@ -25,6 +25,7 @@
  30.  import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  31.  import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  32.  import com.l2jfrozen.gameserver.model.base.Race;
  33. +import com.l2jfrozen.gameserver.model.entity.Announcements;
  34.  import com.l2jfrozen.gameserver.network.SystemMessageId;
  35.  import com.l2jfrozen.gameserver.network.serverpackets.EnchantResult;
  36.  import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate;
  37. @@ -301,6 +302,7 @@
  38.         int chance = 0;
  39.         int maxEnchantLevel = 0;
  40.         int minEnchantLevel = 0;
  41. +       int nextEnchantLevel = item.getEnchantLevel() + 1;
  42.  
  43.         if(item.getItem().getType2() == L2Item.TYPE2_WEAPON)
  44.         {
  45. @@ -565,6 +567,9 @@
  46.                     sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
  47.                     sm.addItemName(item.getItemId());
  48.                     activeChar.sendPacket(sm);
  49. +
  50. +                   if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0)
  51. +                       Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel);
  52.                 }
  53.                 else
  54.                 {
  55. @@ -572,6 +577,9 @@
  56.                     sm.addNumber(item.getEnchantLevel());
  57.                     sm.addItemName(item.getItemId());
  58.                     activeChar.sendPacket(sm);
  59. +
  60. +                   if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel())
  61. +                       Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel);
  62.                 }
  63.  
  64.                 item.setEnchantLevel(item.getEnchantLevel() + Config.CUSTOM_ENCHANT_VALUE);
  65. Index: config/head/enchant.properties
  66. ===================================================================
  67. --- config/head/enchant.properties  (revision 986)
  68. +++ config/head/enchant.properties  (working copy)
  69. @@ -131,4 +131,14 @@
  70.  # HOW WORKS: if you set it to 20, and player have an item > 20
  71.  # he will be kicked and the item will disappear!
  72.  # Enchant amount at which a player gets punished (0 disabled)
  73. -EnchantKick = 0
  74. \ No newline at end of file
  75. +EnchantKick = 0
  76. +
  77. +# ----------------------
  78. +# Enchant Announce -
  79. +# ----------------------
  80. +# Announce when a player successfully enchant an item to x
  81. +# Default: False
  82. +EnableEnchantAnnounce = False
  83. +
  84. +# The value of x is... set it here (No have default value)
  85. +EnchantAnnounceLevel = 16
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement