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);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Hello,iv got fafurion running localy just for fun and seems that files dont have geodata couse i can hit through walls so are mobs.Anyone can tell me how to activate geodata or where to insert geodata files?
    • L2Extend_Server_by_Guytis_Rev_201.rar Trojan:Script/Sabsik.FLA!ml   LOL
    • Good luck with your g/o 😃
    • You're talking complete nonsense. The source code of SphereAPI, which handles all requests, is closed and has never been published anywhere.     That return $this doesn't affect anything, PHP just ignores it. Why are you showing it?     Yes, of course I want that, and I’m asking you — go ahead and hack it, I’d even be thankful. The most you can probably do is launch a DDoS attack, but that’s not hacking. The IP you see is just a public one, used by default to handle requests. There are many other IPs involved, which aren’t disclosed for privacy reasons. So, when should I expect your hacker attack? If you fail, it means you talked big for nothing. I hope you're not all talk and can actually back up your words. UPD: To make your task easier, I have disabled limits on incorrect and failed requests, so your site/IP won't get blocked.
    • Lineage2Dex Interlude+ x50 Server launches TODAY!       The wait is over – the Lineage2Dex Interlude+ x50 Server launches TODAY! Grand Opening - April 26 at 19:00 (UTC+3) Over 10,000 registered accounts are ready to dive in! Beta with massive activity over, thx all who participate on it! It's time to begin your real Jorney! 👉 Read full roadmap 👉 Full server description 👉 Download and registration The server will be split into 3 stages, each featuring multiple content episodes. Stage 1: April 26 – May 18 Welcome to the Classic Interlude Phase. This stage is built with minimal custom content, focused on delivering that pure Interlude experience. It’s perfect for both new players unfamiliar with our project and veterans who enjoy a traditional start. Expect a smooth and nostalgic journey with familiar mechanics. Stage 2: May 19 – June 22 Time to expand the world! As most Interlude content gets completed, we gradually introduce new elements. Hellbound will open first, followed by weekly content updates. Midway through this stage, the Isle of Prayer will become available — a new zone featuring Dynasty Gear and fresh challenges. Stage 3: From June 23 Welcome to full content access! Some location become to High-level location, offering great reward! Once this phase concludes, a full merge with Union server will take place — and yes, all your characters and items will carry over safely. We wish everyone a smooth start, fair play, and tons of fun on the new x50 server! See you in-game!
  • Topics

×
×
  • Create New...