跳转到帖子
Facebook Instagram Twitter Youtube

[L2J] Announce Enchant Success 强化成功公告


杀气丶

已推荐帖子

  • VIP
### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java        (revision 986)
+++ head-src/com/l2jfrozen/Config.java        (working copy)
@@ -2891,6 +2891,8 @@
         public static int GM_OVER_ENCHANT;
         public static int MAX_ITEM_ENCHANT_KICK;

+        public static boolean ENABLE_ENCHANT_ANNOUNCE;
+        public static int ENCHANT_ANNOUNCE_LEVEL;

         //============================================================
         public static void loadEnchantConfig()
@@ -3196,6 +3198,8 @@
                         MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0"));
                         GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0"));

+                        ENABLE_ENCHANT_ANNOUNCE = Boolean.parseBoolean(ENCHANTSetting.getProperty("EnableEnchantAnnounce", "False"));
+                        ENCHANT_ANNOUNCE_LEVEL = Integer.parseInt(ENCHANTSetting.getProperty("EnchantAnnounceLevel", "16"));
                 }
                 catch(Exception e)
                 {
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java        (revision 986)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java        (working copy)
@@ -25,6 +25,7 @@
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.base.Race;
+import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.network.SystemMessageId;
import com.l2jfrozen.gameserver.network.serverpackets.EnchantResult;
import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate;
@@ -301,6 +302,7 @@
                 int chance = 0;
                 int maxEnchantLevel = 0;
                 int minEnchantLevel = 0;
+                int nextEnchantLevel = item.getEnchantLevel() + 1;

                 if(item.getItem().getType2() == L2Item.TYPE2_WEAPON)
                 {
@@ -565,6 +567,9 @@
                                         sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
                                         sm.addItemName(item.getItemId());
                                         activeChar.sendPacket(sm);
+
+                                        if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0)
+                                                Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel);
                                 }
                                 else
                                 {
@@ -572,6 +577,9 @@
                                         sm.addNumber(item.getEnchantLevel());
                                         sm.addItemName(item.getItemId());
                                         activeChar.sendPacket(sm);
+
+                                        if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel())
+                                                Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel);
                                 }

                                 item.setEnchantLevel(item.getEnchantLevel() + Config.CUSTOM_ENCHANT_VALUE);
Index: config/head/enchant.properties
===================================================================
--- config/head/enchant.properties        (revision 986)
+++ config/head/enchant.properties        (working copy)
@@ -131,4 +131,14 @@
# HOW WORKS: if you set it to 20, and player have an item > 20 
# he will be kicked and the item will disappear!
# Enchant amount at which a player gets punished (0 disabled)
-EnchantKick = 0
\ No newline at end of file
+EnchantKick = 0
+
+# ----------------------
+# Enchant Announce -
+# ----------------------
+# Announce when a player successfully enchant an item to x
+# Default: False
+EnableEnchantAnnounce = False
+
+# The value of x is... set it here (No have default value)
+EnchantAnnounceLevel = 16

spacer.png

玩家在强化的时候,强化成功将发公告

意见的链接
分享到其他站点

参与讨论

你可以现在发布并稍后注册。 如果你有帐户,现在就登录发布帖子。

游客
回帖…

×   粘贴为富文本.   粘贴为纯文本来代替

  只允许使用75个表情符号.

×   你的链接已自动嵌入.   显示为链接来代替

×   你之前的帖子已恢复.   清除编辑器

×   你无法直接粘贴图像。要从网址上传或插入图像。

天堂2中文开源社区L2FATER.CN

专注于玩家游戏体验的交流社区.

血玫瑰社区bbs.l2fater.cn

关于血玫瑰社区

Important Links

×
×
  • 创建新的...