Jump to content

Recommended Posts

Posted

Hello everyone!!!

 

1. Makes Announcements the Castle Lords

2. Every time login he get a wellcome message

3. When login can be seen all online players in this time

 

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
@@ -36,6 +36,7 @@

import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GameTimeController;
import net.sf.l2j.gameserver.GeoData;
import net.sf.l2j.gameserver.GmListTable;
@@ -9985,6 +9986,35 @@
		return _duelState;
	}
+ 	
+	public void CastleLordsAnnouncements()
+	{
+		if (Config.Announcements_CastleLord)
+          {
+		if (isCastleLord(3))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Giran"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+		
+		if (isCastleLord(1))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Gludio"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+	
+		if (isCastleLord(2))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Dion"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+		
+		if (isCastleLord(4))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Oren"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+		
+		if (isCastleLord(5))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Aden"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+
+		if (isCastleLord(6))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Innadril"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+		
+		if (isCastleLord(7))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Goddard"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+	
+		if (isCastleLord(8))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Rune"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+		
+		if (isCastleLord(9))
+		{		
+		Announcements.getInstance().announceToAll("Castle Lord of Schuttgart"+getName()+"is currently online");
+		sendMessage("Welcome Lord "+getName());  
+		sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");			
+		}
+           }
+       }
+
	/**
	 * Sets up the duel state using a non 0 duelId.
	 * @param duelId 0=not in a duel
Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	
+++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	
@@ -286,6 +287,7 @@
                 Hero.getInstance().getHeroes().containsKey(activeChar.getObjectId()))
             activeChar.setHero(true);

+        activeChar.CastleLordsAnnouncements();
         setPledgeClass(activeChar);
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
@@ -1185,5 +1185,46 @@

/** Alt Settings for devs */
    public static boolean ALT_DEV_NO_QUESTS;
    public static boolean ALT_DEV_NO_SPAWNS;

+
+   public static boolean Announcements_CastleLord;
+
/**
     * This class initializes all global variables for configuration.<br>
     * If key doesn't appear in properties file, a default value is setting on by this class.
     * @see #CONFIGURATION_FILE for configuring your server.
     */
    public static void load()

@@ 1904,17 1904,138 @@

                L2JMOD_WEDDING_SAMESEX                  = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
                L2JMOD_WEDDING_FORMALWEAR               = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
+
+               Announcements_CastleLord                = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncementsCastleLords", "False"));
+
                    if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                {
                    TVT_EVENT_ENABLED = false;
                    System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
                }

Index: java/Config/L2jmods.Properties
===================================================================
--- java/Config/L2jmods.Properties	
+++ java/Config/L2jmods.Properties
@@ -140,1 +140,1 @@

+#==================================================
+#          Castle Lords Announcements             =
+#==================================================
+#Set this options to true to enable Announcements.
+AnnouncementsCastleLords = False

 

If there is any bug-error just do a reply!!!

Posted

You're hardcoding L2PcInstance with no reason... btw seems that the code achieves its purpose...

 

Is Most good if i have the pcinstance code and then load the method in enterworld!!!

 

GJ...nice share buddy

 

THANKS :D

 

Posted

Is Most good if i have the pcinstance code and then load the method in enterworld!!!

 

THANKS :D

Hardcoding L2PcInstance is never the best option.

Just create a file with a simple void-->  public static void freakChecker(L2PcInstance char) and call from enterworld freakChecker(activeChar);

and then put your code inside that void.

You can also put the code inside enterworld... but not the best way...

Posted

sure you can.

enterworld.java

private void announceCastleOwner(L2PcInstance activeChar)
{
	L2Clan clan = activeChar.getClan();

	if (clan != null)
	{
		if (clan.getHasCastle() > 0)
		{
			Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle());
			if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
Announcements.getInstance().announceToAll(message");
		}
	}
}

 

and then,

announceCastleOwner(activeChar);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • We appreciate your feedback and want to make the service even better! If you have used our services and are ready to share your experience (any — positive or constructive), leave a review on Trustpilot and receive $1 as a thank-you. Link: https://www.trustpilot.com/review/socnet.pro How to receive the bonus: 1. Go to Trustpilot and leave your review 2. Send us a screenshot confirming the publication and a screenshot of your authorized account with the username matching the review. 3. Specify which store should receive the $1 bonus. Depending on the store, your username/email may be required. Your feedback helps us grow and makes the project better for every community member. Thank you for staying with us! Terms: The promotion applies to one unique user. Multi-accounting is not allowed. Active project links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the template “SEND ME BONUS, MY USERNAME IS...” — you must post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We appreciate your feedback and want to make the service even better! If you have used our services and are ready to share your experience (any — positive or constructive), leave a review on Trustpilot and receive $1 as a thank-you. Link: https://www.trustpilot.com/review/socnet.pro How to receive the bonus: 1. Go to Trustpilot and leave your review 2. Send us a screenshot confirming the publication and a screenshot of your authorized account with the username matching the review. 3. Specify which store should receive the $1 bonus. Depending on the store, your username/email may be required. Your feedback helps us grow and makes the project better for every community member. Thank you for staying with us! Terms: The promotion applies to one unique user. Multi-accounting is not allowed. Active project links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the template “SEND ME BONUS, MY USERNAME IS...” — you must post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We appreciate your feedback and want to make the service even better! If you have used our services and are ready to share your experience (any — positive or constructive), leave a review on Trustpilot and receive $1 as a thank-you. Link: https://www.trustpilot.com/review/socnet.pro How to receive the bonus: 1. Go to Trustpilot and leave your review 2. Send us a screenshot confirming the publication and a screenshot of your authorized account with the username matching the review. 3. Specify which store should receive the $1 bonus. Depending on the store, your username/email may be required. Your feedback helps us grow and makes the project better for every community member. Thank you for staying with us! Terms: The promotion applies to one unique user. Multi-accounting is not allowed. Active project links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the template “SEND ME BONUS, MY USERNAME IS...” — you must post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We appreciate your feedback and want to make the service even better! If you have used our services and are ready to share your experience (any — positive or constructive), leave a review on Trustpilot and receive $1 as a thank-you. Link: https://www.trustpilot.com/review/socnet.pro How to receive the bonus: 1. Go to Trustpilot and leave your review 2. Send us a screenshot confirming the publication and a screenshot of your authorized account with the username matching the review. 3. Specify which store should receive the $1 bonus. Depending on the store, your username/email may be required. Your feedback helps us grow and makes the project better for every community member. Thank you for staying with us! Terms: The promotion applies to one unique user. Multi-accounting is not allowed. Active project links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the template “SEND ME BONUS, MY USERNAME IS...” — you must post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • L2REBORN x10  l2reborn x1   LU4 MASTERWORRK BOHPTS - TOP PRICE discord - adver745645
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock