Jump to content

[Share]Nobless Color Name


Vkouk

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.




×
×
  • Create New...