Jump to content

Announce Enchant Success


Recommended Posts

Hello here is a gode for this http://postimg.org/image/gk2nw63l3/

#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

credits: RedHot

Edited by ThelwHelpRePaidia
Link to comment
Share on other sites

This code was created by me!

 

mtdqY.png

 

http://pastebin.com/SkRSXU4g

 


 

There is another code with an new version and announce only on same region  ;)

 

HKu0Q3t.jpg

 

http://pastebin.com/rUATUF3m

Edited by RedHoT
Link to comment
Share on other sites

okay then added credits

 

 

Edit: It would be better if you add with what scroll he did the enchant:P

Edited by ThelwHelpRePaidia
Link to comment
Share on other sites

  • 3 months later...

Hello, why dont work in my pack? i use jfrozen rev 1118. I dont have any error when i compile and when start the sv dont have error too. So, i enchant put dont put any message :( i use this code http://pastebin.com/SkRSXU4g

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
  • 2 months later...
  • 11 months later...

Hello here is a gode for this http://postimg.org/image/gk2nw63l3/

#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

credits: RedHot

Hello. I'm added your code, but for me doesn't work it. Everything added correct, but no effect. In console no errors. I'm adding on weapon from +15 to +16, but in chat nothing.

 

Regards,

Enduzo

Link to comment
Share on other sites

Hello. I'm added your code, but for me doesn't work it. Everything added correct, but no effect. In console no errors. I'm adding on weapon from +15 to +16, but in chat nothing.

 

Regards,

Enduzo

Did you add the configs the right way? Maybe u forgot to set them True?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Their innovative approach combines cutting-edge technology with expert insights to create resumes that truly stand out. As I explored their website https://skillroads.com/ , I was impressed by the user-friendly interface and the seamless process of using their AI Resume Writer tool. With just a few clicks, I was able to generate a professional resume tailored to my skills and experiences. Skillroads' commitment to excellence and their utilization of AI technology make them a standout choice for anyone looking to enhance their career prospects with a compelling resume.
    • We are giving out promo codes for 3GBs for testing Asocks proxy. All you need to do is post a reply in this thread.
    • Slim X Keto Gummies Slim X Keto Gummies Weight loss is everyone’s hassle those days. Many humans combat with themselves to reduce off their greater weight however couldn’t get a result. This demotivates a number of them and they will lose preference of dropping weight. Overweight reasons many health-associated issues that might create troubles for your ordinary life. If you observed that your every day exercise or a few tablets can also furthermore need to make you shed pounds in a brief fraction of time. Then this isn't always flow that will help you solely. You want to perform a piece detail that is useful for you frame as well. You want to begin following keto fast as possible. It is the super form of  however it can restriction your flavor buds however doesn’t restriction your eating. It allows you to consume however limits to a few form of food. But to cope with keto flu and to offer hundreds of power there’s a supplement.   https://atozsupplement.com/slim-x-keto-gummies/ https://www.facebook.com/slimxketogummies/ https://slimxketogummies.wixsite.com/slim-x-keto-gummies/ https://slim-x-keto-gummies.hp.peraichi.com/ https://slim-x-keto-gummies.jimdosite.com/ https://slim-x-keto-gummies.yolasite.com/ https://slim-x-keto-gummies.company.site/ https://slim-x-keto-gummies.webflow.io/ https://github.com/slim-x-keto-gummies https://slim-x-keto-gummies.tilda.ws/
    • GRAND OPENING  19.04.2024 OPEN BETA TEST  15.04.2024 - 18.04.2024     RATES XP/SP - x3 Adena Drop Chance - x2 Adena Drop Amount - x1 Drop Chance - x2 Drop Amount - x1 Spoil Chance - x2 Spoil Amount - x1 Raidboss Drop Chance - x5 Raidboss Drop Amount - x1 Quest Chance - x1 Quest Reward - x1   FEATURES 1. Added NPC Buffer with basic buffs (duration 60m). 2. Added Mana Drugs and Greater Mana Drugs, which work like Healing Potions. 3. Added skills "Summon Mana Drug" & "Summon Greater Mana Drug" to Elven and Shillen Elders. 4. Basic Mana Drugs can be bought in Grocery Store. 5. Blade Dancer and Sword Singer have both, Dances and Songs from Second Profession. 6. No need duals for dances from Second Profession 7. Increase Weight Limit +30% 8. Increase Inventory Slots from 80 to 120 9. Set Raidboss's respawn 24h +/- 30 minutes. 10. Remake monsters spawns. 11. Olympiad Period - 2 weeks. 12. Change Queen Ant, Core, Orfen, Zaken lvl to 75. 13. Increase Epic Jewelery Bonus. -Ring of Core +2 INT/WIT/MEN -Earring of Orfen +2 STR/DEX/CON     website - https://www.primeinterlude.com  facebook - https://www.facebook.com/profile.php?id=61550083156269 discord - https://discord.gg/2T7nTTz2Gt   Promo Video
  • Topics

×
×
  • Create New...