Jump to content

Recommended Posts

Posted

Hi everyone. I hope this will be some kind of 'solution' to 5k++ topics of entering pms.

 

I wonder why ppl hate maps. They give the admin much more options.

 

Anyway... Here:

 

Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(revision 126)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -18,6 +18,7 @@
 */
package net.sf.l2j.gameserver.network.clientpackets;

+import java.util.Set;
import java.util.logging.Logger;

import net.sf.l2j.Config;
@@ -48,6 +49,7 @@
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
import net.sf.l2j.gameserver.network.serverpackets.Die;
import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount;
@@ -262,6 +264,16 @@
				&& (!activeChar.isInSiege() || activeChar.getSiegeState() < 2) 
				&& activeChar.isInsideZone(L2Character.ZONE_SIEGE))
			activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+		
+		if (Config.ALLOW_ENTER_PMS)
+		{
+			Set<String> epks = Config.ENTER_PMS.keySet();
+			for (String i : epks)
+			{
+				CreatureSay cs = new CreatureSay(0, Config.ENTER_PMS_SYSTEM, Config.ENTER_PMS.get(i), i);
+				activeChar.sendPacket(cs);
+			}
+		}
	}

    private void engage(L2PcInstance cha)
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 126)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -29,11 +29,13 @@
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.logging.Logger;

import javolution.util.FastList;
+import javolution.util.FastMap;
import net.sf.l2j.util.StringUtil;

/**
@@ -443,6 +445,11 @@
    /** Buffs */
    public static boolean STORE_SKILL_COOLTIME;
    public static byte BUFFS_MAX_AMOUNT;
+    
+    /** Entering pms */
+    public static boolean ALLOW_ENTER_PMS;
+    public static int ENTER_PMS_SYSTEM;
+    public static Map<String, String> ENTER_PMS = new FastMap<String, String>();

    //--------------------------------------------------
	// Server
@@ -1147,6 +1154,16 @@
                
    	        BUFFS_MAX_AMOUNT = Byte.parseByte(players.getProperty("MaxBuffsAmount","20"));
    	        STORE_SKILL_COOLTIME = Boolean.parseBoolean(players.getProperty("StoreSkillCooltime", "true"));
+    	        
+    	        ALLOW_ENTER_PMS = Boolean.parseBoolean(players.getProperty("AllowEnterPms", "false"));
+    	        ENTER_PMS_SYSTEM = Integer.parseInt(players.getProperty("EnterPmsSystem", "0"));
+    	        String enter_pms = players.getProperty("EnterPms", "Welcome to L2 Server!,L2Server;Don't forget to vote.,L2Server;");
+    	        String[] enter_pms_splitted_1 = enter_pms.split(";");
+    	        for (String i : enter_pms_splitted_1)
+    	        {
+    	        	String eps2[] = i.split(",");
+    	        	ENTER_PMS.put(eps2[0], eps2[1]);
+    	        }
            }
            catch (Exception e)
            {
Index: config/players.properties
===================================================================
--- config/players.properties	(revision 126)
+++ config/players.properties	(working copy)
@@ -310,4 +310,17 @@
MaxBuffsAmount = 20

# Store buffs/debuffs on user logout?
-StoreSkillCooltime = True
\ No newline at end of file
+StoreSkillCooltime = True
+
+#=============================================================
+#                        Entering pms
+#=============================================================
+# Allow entering pms?
+AllowEnterPms = False
+# Entering pms system.
+# Aka CreatureSay packet chat type.
+# Default: purple, pms' one.
+# Note: You can find them in Say2 file.
+EnterPmsSystem = 2
+# Entering pms(works like pm,name;pm,name;pm,name;).
+EnterPms = Welcome to L2 Server!,L2Server;Don't forget to vote.,L2Server;
\ No newline at end of file

 

Coded on aCis, credits to me.

 

It is not tested, but it should work.

Posted

Stop being off-topic. I am still posting here, with the 'hope' that it will be reborned or something?

 

But anyway, i will fix it. It is dying not dead.

Yeah,you are the one who will reborn it,appreciate.

------------

 

This code isn't already shared?Just written on another way?

Btw hide it for some posts.

Posted

Yeah,you are the one who will reborn it,appreciate.

------------

 

This code isn't already shared?Just written on another way?

Btw hide it for some posts.

Lol. Anyway.... I didn't say i will reborn it, but everyone can help.

 

Yes it's shared 5k times ++. But if you check the configs of my share, it's done in a different way, with map. So you can add as many pms as you want.

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

    • LF the following chars / items on chronos   Elf - with class Aeore's Shillen Saint - this is possible if you had done a class change with a ticket in the past. Dwarf - with class Mystic Muse - same as above   Any greater jewels / Radiant Circle Grace or Foresight +5 and above Cloak      
    • First, you need to understand what you're doing and what you want to achieve. You have to choose a server core. After that, decide what you want your server to include, code it, modify the client to fit your server, go public, and drink champagne.   If you know how to code, creating a server is relatively easy — a few months of work and you can make it happen. Modifying the client is a completely different story. There’s a lack of tutorials, tools, and source materials. I’m currently working on the client myself, and I’ve already spent over three weeks just trying to get started due to the lack of information. If you don’t have the knowledge and experience, you’ll need a team and a bag of money — but realistically, it just won’t succeed.
    • The server has been online and stable for over 2 months now, and we’re still going strong! No wipes, no shortcuts ~ just continuous work, daily fixes, events, and improvements to ensure the best possible experience.   Great News! 🔥 CHAPTER II IS COMING — GRACIA FINAL 🔥 On February 16, L2Elixir enters a new era. The server will be officially updated to Gracia Final, opening Chapter II of our journey. Expect new content, improvements, and surprises that will refresh the gameplay while keeping the classic Gracia Final spirit alive.   More challenges, more competition, and more reasons to log in.   📅 Update Date: February 16 ⚔️ Chapter II: Gracia Final This is not a reset. This is evolution.   Prepare yourselves — Chapter II begins soon.   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs    
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here 👉https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..