Jump to content

Announce Enchant Success


Recommended Posts

  • 5 months later...

Hello here is for Acis.

Index: config/players.properties
===================================================================
--- config/players.properties	(revision 6)
+++ config/players.properties	(working copy)
@@ -294,4 +288,55 @@
 MaxBuffsAmount = 20
 
 # Store buffs/debuffs on user logout?
-StoreSkillCooltime = True
\ No newline at end of file
+StoreSkillCooltime = True
+
+# ----------------------
+# 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 = 6
\ No newline at end of file

Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java    (revision 6)
+++ java/net/sf/l2j/Config.java    (working copy)
@@ -495,6 +492,25 @@
     public static boolean STORE_SKILL_COOLTIME;
     public static int BUFFS_MAX_AMOUNT;
     
+    public static boolean ENABLE_ENCHANT_ANNOUNCE;
+    public static int ENCHANT_ANNOUNCE_LEVEL;
+
     // --------------------------------------------------
     // Server
     // --------------------------------------------------
@@ -1204,6 +1228,48 @@
         
         BUFFS_MAX_AMOUNT = players.getProperty("MaxBuffsAmount", 20);
         STORE_SKILL_COOLTIME = players.getProperty("StoreSkillCooltime", true);
+
+        ENABLE_ENCHANT_ANNOUNCE = players.getProperty("EnableEnchantAnnounce", false);
+        ENCHANT_ANNOUNCE_LEVEL = players.getProperty("EnchantAnnounceLevel", 16);
     }
     
     /**
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (revision 6)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (working copy)
@@ -34,6 +34,7 @@
 import net.sf.l2j.gameserver.network.serverpackets.ItemList;
 import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.util.Broadcast;
 import net.sf.l2j.gameserver.util.Util;
 
 public final class RequestEnchantItem extends AbstractEnchantPacket
@@ -129,11 +130,15 @@
                 // announce the success
                 SystemMessage sm;
                 
+                int nextEnchantLevel = item.getEnchantLevel() + 1;
+
                 if (item.getEnchantLevel() == 0)
                 {
                     sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
                     sm.addItemName(item.getItemId());
                     activeChar.sendPacket(sm);
+                    if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0)
+                        Broadcast.announceToOnlinePlayers("Congratulations to " + activeChar.getName() + "! Your " + item.getItemName() + " has been successfully enchanted to +" + nextEnchantLevel);
                 }
                 else
                 {
@@ -141,6 +146,8 @@
                     sm.addNumber(item.getEnchantLevel());
                     sm.addItemName(item.getItemId());
                     activeChar.sendPacket(sm);
+                    if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel())
+                        Broadcast.announceToOnlinePlayers("Congratulations to " + activeChar.getName() + "! Your " + item.getItemName() + " has been successfully enchanted to +" + nextEnchantLevel);
                 }
                 
                 item.setEnchantLevel(item.getEnchantLevel() + 1);

 

Edited by dimityr203
Link to comment
Share on other sites

1 hour ago, dimityr203 said:

Hello here is for Acis.


Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (revision 6)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (working copy)
@@ -34,6 +34,7 @@
 import net.sf.l2j.gameserver.network.serverpackets.ItemList;
 import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.util.Broadcast;
 import net.sf.l2j.gameserver.util.Util;
 
 public final class RequestEnchantItem extends AbstractEnchantPacket
@@ -129,11 +130,15 @@
                 // announce the success
                 SystemMessage sm;
                 
+                int nextEnchantLevel = item.getEnchantLevel() + 1;
+
                 if (item.getEnchantLevel() == 0)
                 {
                     sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
                     sm.addItemName(item.getItemId());
                     activeChar.sendPacket(sm);
+                    if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0)
+                        Broadcast.announceToOnlinePlayers("Congratulations to " + activeChar.getName() + "! Your " + item.getItemName() + " has been successfully enchanted to +" + nextEnchantLevel);
                 }
                 else
                 {
@@ -141,6 +146,8 @@
                     sm.addNumber(item.getEnchantLevel());
                     sm.addItemName(item.getItemId());
                     activeChar.sendPacket(sm);
+                    if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel())
+                        Broadcast.announceToOnlinePlayers("Congratulations to " + activeChar.getName() + "! Your " + item.getItemName() + " has been successfully enchanted to +" + nextEnchantLevel);
                 }
                 
                 item.setEnchantLevel(item.getEnchantLevel() + 1);

 

 

The code in RequestEnchantItem can be replaced with:
(Both codes will work)
 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java	(revision 239)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java	(working copy)
@@ -127,6 +127,9 @@
 				}
 				
 				item.setEnchantLevel(item.getEnchantLevel() + 1);
+
+				if(Config.ENABLE_ENCHANT_ANNOUNCE && (Config.ENCHANT_ANNOUNCE_LEVEL == 0 || Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel()))
+					  Broadcast.announceToOnlinePlayers("Congratulations to " + activeChar.getName() + "! Your " + item.getItemName() + " has been successfully enchanted to +" + item.getEnchantLevel());
+
 				item.updateDatabase();
 				
 				// If item is equipped, verify the skill obtention (+4 duals, +6 armorset).

 

Edited by melron
Link to comment
Share on other sites

  • 3 months later...

Well... i'm new and looking things to play with my server and i wanted to comment only because i found this actualy wrong,
as i found wrong all the things that destroy l2 uniqueness, you should not know what other do/wear/combo strategy they build
because everyone is unique, if you inform what someone have you avoid to fight him, or just even a n00b c/p him.
Gr8 work but no the things i use to add for what I've said above.

(old post but just a motivation on people do those codes can make many difirent things instead of that, peace.)

Link to comment
Share on other sites

  • Vision locked this topic
Guest
This topic is now closed to further replies.


×
×
  • Create New...