Jump to content

Recommended Posts

Posted

Well,it has been shared again?If not,then it's good.Now a guy told me to make a code when someone is nobless to change his color name.And i did it.Nothing special though

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 4088)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -8223,6 +8223,9 @@
     public void setNoble(boolean val)
     {
+     	if (val)
+    	getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
+    	
    	if (val)
     		for (L2Skill s : NobleSkillTable.getInstance().GetNobleSkills())
     			addSkill(s, false); //Dont Save Noble skills to Sql
     	else
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 4088)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -881,6 +881,9 @@
     public static boolean L2JMOD_WEDDING_SAMESEX;
     public static boolean L2JMOD_WEDDING_FORMALWEAR;
     public static int L2JMOD_WEDDING_DIVORCE_COSTS;
+    
+    public static boolean ENABLE_NOBLESS_COLOR;
+    public static int NOBLESS_COLOR_NAME;

     // Packet information
     /** Count the amount of packets per minute ? */
@@ -1858,6 +1861,9 @@
                 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"));
+                
+                ENABLE_NOBLESS_COLOR                    = Boolean.parseBoolean(L2JModSettings.getProperty("EnableNoblessColor", "False"));
+                NOBLESS_COLOR_NAME                      = Integer.decode("0x" + L2JModSettings.getProperty("NoblessColorName", "000000"));

                 if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                 {
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 4088)
+++ java/config/l2jmods.properties	(working copy)
@@ -132,3 +132,13 @@
# ex.: 1;2;3;4;5;6
# no ";" at the start or end
TvTEventDoorsCloseOpenOnStartEnd =
+
+#---------------------------------------------------------------
+# Nobless Color Name                                              -
+#---------------------------------------------------------------
+# Enable Nobless Color Name?
+# Deafult: False
+EnableNoblessColor = False
+
+# Set Nobless Color
+NoblessColorName = 000000
Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(revision 4088)
+++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(working copy)
@@ -174,6 +174,15 @@
             engage(activeChar);
             notifyPartner(activeChar,activeChar.getPartnerId());
         }
+        
+        if (Config.ENABLE_NOBLESS_COLOR)
+        {
+        	if (activeChar.isNoble())
+        	{
+        	    activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
+        	}
+        }
+        

         if (activeChar.getAllEffects() != null)
         {

Tested and working

Credits : Ventic

Posted

well i believe that it is only usefull for low rate servers because on pvp everybody would have a color on their name

Posted

well i believe that it is only usefull for low rate servers because on pvp everybody would have a color on their name

w/e.someone can use it on pvp server too

Posted

Make a good credit, create a party matching on interlude :D Whatever THX.

a good credit?what do you mean?

Posted

I can't understand one thing why

 

+        if (Config.ENABLE_NOBLESS_COLOR)
+        {
+        	if (activeChar.isNoble())
+        	{
+        	    activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
+        	}
+        

         if (activeChar.getAllEffects() != null)
         {
@@ -347,6 +355,7 @@
             activeChar.sendPacket(new GameGuardQuery());*/

         TvTEvent.onLogin(activeChar);
+        }

and not

 

+        
+        if (Config.ENABLE_NOBLESS_COLOR)
+        {
+        	if (activeChar.isNoble())
+        	{
+        	    activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
+        	}
+        }

Posted

I can't understand one thing why

 

+        if (Config.ENABLE_NOBLESS_COLOR)
+        {
+        	if (activeChar.isNoble())
+        	{
+        	    activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
+        	}
+        

         if (activeChar.getAllEffects() != null)
         {
@@ -347,6 +355,7 @@
             activeChar.sendPacket(new GameGuardQuery());*/

         TvTEvent.onLogin(activeChar);
+        }

and not

 

+        
+        if (Config.ENABLE_NOBLESS_COLOR)
+        {
+        	if (activeChar.isNoble())
+        	{
+        	    activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
+        	}
+        }

well yes you are right.Let me fix it.

Thanks

Sorry a good code share:)  http://www.maxcheaters.com/forum/index.php?topic=139785.0  this is from gracia, maybe you make can make on INTERLUDE and share? I think this thing was be useful for everyone server owner.

 

i will try.

Posted

And someone will make this soon... :

 

+         if (activeChar.isHero())

+         {

+            activeChar.getAppearance().setNameColor(Config.HERO_COLOR_NAME);

+         }

 

Or :

 

+         if (activeChar.isNoble())

+         {

+            activeChar.getAppearance().setTitleColor(Config.NOBLESS_COLOR_TITLE);

+         }

 

Justy tried to avoid another shares like this...

Posted

And someone will make this soon... :

 

+        if (activeChar.isHero())

+        {

+            activeChar.getAppearance().setNameColor(Config.HERO_COLOR_NAME);

+        }

 

Or :

 

+        if (activeChar.isNoble())

+        {

+            activeChar.getAppearance().setTitleColor(Config.NOBLESS_COLOR_TITLE);

+        }

 

Justy tried to avoid another shares like this...

Did you ready my first words?A guy told me to code it and i did it.And since it hasn't been an another share like this i share it

Posted

Did you ready my first words?A guy told me to code it and i did it.And since it hasn't been an another share like this i share it

What I wanted to say was that someone will make that "Shares" you gave them this idea ;D

Posted

With this way, you make everytime that a player logs, to check if the player is noble in order to add the colour. Why don't you

make when the players become noble, to add the colour and have it permantly?

 

Yes its better way.

 

Because now you're forcing players to log out in order to change player name color.

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



×
×
  • 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..