转载请注明出处,如有问题请联系我们! 强化成功后世界公告扩展

简介:

源码:l2jfrozen
玩家强化道具/装备/武器/首饰等强化成功后世界公告庆祝
  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. +        public static boolean ENABLE_ENCHANT_ANNOUNCE;

  11. +        public static int ENCHANT_ANNOUNCE_LEVEL;


  12.          //============================================================

  13.          public static void loadEnchantConfig()

  14. @@ -3196,6 +3198,8 @@

  15.                          MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0"));

  16.                          GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0"));


  17. +                        ENABLE_ENCHANT_ANNOUNCE = Boolean.parseBoolean(ENCHANTSetting.getProperty("EnableEnchantAnnounce", "False"));

  18. +                        ENCHANT_ANNOUNCE_LEVEL = Integer.parseInt(ENCHANTSetting.getProperty("EnchantAnnounceLevel", "16"));

  19.                  }

  20.                  catch(Exception e)

  21.                  {

  22. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java

  23. ===================================================================

  24. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java        (revision 986)

  25. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java        (working copy)

  26. @@ -25,6 +25,7 @@

  27. import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;

  28. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;

  29. import com.l2jfrozen.gameserver.model.base.Race;

  30. +import com.l2jfrozen.gameserver.model.entity.Announcements;

  31. import com.l2jfrozen.gameserver.network.SystemMessageId;

  32. import com.l2jfrozen.gameserver.network.serverpackets.EnchantResult;

  33. import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate;

  34. @@ -301,6 +302,7 @@

  35.                  int chance = 0;

  36.                  int maxEnchantLevel = 0;

  37.                  int minEnchantLevel = 0;

  38. +                int nextEnchantLevel = item.getEnchantLevel() + 1;


  39.                  if(item.getItem().getType2() == L2Item.TYPE2_WEAPON)

  40.                  {

  41. @@ -565,6 +567,9 @@

  42.                                          sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);

  43.                                          sm.addItemName(item.getItemId());

  44.                                          activeChar.sendPacket(sm);

  45. +

  46. +                                        if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0)

  47. +                                                Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel);

  48.                                  }

  49.                                  else

  50.                                  {

  51. @@ -572,6 +577,9 @@

  52.                                          sm.addNumber(item.getEnchantLevel());

  53.                                          sm.addItemName(item.getItemId());

  54.                                          activeChar.sendPacket(sm);

  55. +

  56. +                                        if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel())

  57. +                                                Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel);

  58.                                  }


  59.                                  item.setEnchantLevel(item.getEnchantLevel() + Config.CUSTOM_ENCHANT_VALUE);

  60. Index: config/head/enchant.properties

  61. ===================================================================

  62. --- config/head/enchant.properties        (revision 986)

  63. +++ config/head/enchant.properties        (working copy)

  64. @@ -131,4 +131,14 @@

  65. # HOW WORKS: if you set it to 20, and player have an item > 20

  66. # he will be kicked and the item will disappear!

  67. # Enchant amount at which a player gets punished (0 disabled)

  68. -EnchantKick = 0

  69. \ No newline at end of file

  70. +EnchantKick = 0

  71. +

  72. +# ----------------------

  73. +# Enchant Announce -

  74. +# ----------------------

  75. +# Announce when a player successfully enchant an item to x

  76. +# Default: False

  77. +EnableEnchantAnnounce = False

  78. +

  79. +# The value of x is... set it here (No have default value)

  80. +EnchantAnnounceLevel = 16

标签 强化公告

免登录评论