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.


  • Posts

    • for me the best designer on this forum we are very happy with @protoftw services!
    • DISCORD : utchiha_market telegram  https://t.me/utchiha_market SELLIX STORE : https://utchiha-market.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices  
    • Hello friend does skillgrp have Encrypt? I'm trying to open it to use in another version I play and it's not working, good job  
    • Σας καλωσορίζουμε θερμά στο ολοκαίνουργιο κοινωνικό φόρουμ της Ελλάδος! Εγγραφείτε τώρα εντελώς ΔΩΡΕΆΝ στο Chatter.gr.   Τα πρώτα 50 μέλη που θα εγγραφούν θα λάβουν ΔΩΡΕΆΝ Premium αναβάθμιση! https://chatter.gr/ Κάντε Like και Follow τη σελίδα μας στο Facebook και προωθήστε την σε φίλους και συγγενείς σας! https://www.facebook.com/chatter.gr/ Επικοινωνήστε σε πραγματικό χρόνο και πραγματοποιήστε βιντεοκλήσεις ή φωνητικές κλήσεις με τα μέλη της κοινότητάς μας! Συνδεθείτε τώρα στον διακομιστή μας! https://discord.gg/BbCv6deT
    • The most authentic love spells are the most reliable source you can rely on. The most authentic of all these spells is cast in a variety of ways. Love can be mended or broken and so anyone can choose how you want to use the spells. You might want to bring back your ex-girlfriend or boyfriend or divorce her. There are A lot of differences in the world of love. First of all, we need to know that there is a special spiritual being around us. A real man that follows us up and finds what lucks in our life and hence finds a better solution to help us. Most of us are naïve and ignorant about this and hence less of us believe in all this. Contact me right now so that we begin the rituals right away. Authentic love spells (973) 384-3997! Get Back your Ex / lost lover Permanently! The most authentic love spells are spread the universal over e to those who apply to get them. They have helped mend broken hearts that have no hope all over. My most efficient and authentic love spells contain the most meditated magical powers. The powers take a bit of time to work. My physical powers are so strong that I have come through meditation and concentration to work for you. Most Powerful love spells (973) 384-3997! Get Back your Ex / lost lover Permanently. The authentic love spells have a package for married people and so they will also grant you the love you deserve and happiness in marriage. Many marriages are breaking and facing hardships, but you have failed to get ways to make it out. Contact me so that your marriage life is helped not to fall and restore the happiness that you once shared. My love spells are easily made through marriage portions and oils that you can easily perform on your own. Call: (973)384-3997
  • Topics

×
×
  • Create New...