How can we add custom start tittle?

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
L2GOT
Posts: 30
Joined: Wed Nov 05, 2014 9:56 pm

How can we add custom start tittle?

Post by L2GOT »

Hello, i have the last rev hi5.

i have try everything patches, guides etc. and nothing happent
even this

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

### Eclipse Workspace Patch 1.0
#P L2J_Server_BETA
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 6665)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -935,6 +935,8 @@
player.setNewbie(1);
// Give 20 recommendations
player.setRecomLeft(20);
+ // Set custom title
+ player.setTitle("Uber custom title!");
// Add the player in the characters table of the database
return player.createDb() ? player : null;
}



But when i make new character then nothing happent.
is there any other way? any guide?
thanks
User avatar
Gries
Posts: 307
Joined: Fri Jun 17, 2011 9:45 am

Re: How can we add custom start tittle?

Post by Gries »

Open CharacterCreate.java file and find this part of the code:

Code: Select all

newChar.setTitle("");
Change the brackets part like this:

Code: Select all

newChar.setTitle("TITLE HERE");
I think it should work like that.
L2GOT
Posts: 30
Joined: Wed Nov 05, 2014 9:56 pm

Re: How can we add custom start tittle?

Post by L2GOT »

Gries i did that, but again nothing happent :/
where's the problem ?
L2GOT
Posts: 30
Joined: Wed Nov 05, 2014 9:56 pm

Re: How can we add custom start tittle?

Post by L2GOT »

{
if (Config.CHAR_TITLE)
{
newChar.setTitle(Config.ADD_CHAR_TITLE);
}
else
{
newChar.setTitle("Slave");
}


what is the Config.ADD_CHAR_TITLE); ? should i do something else?
User avatar
Zephyr
L2j Veteran
L2j Veteran
Posts: 331
Joined: Wed Sep 19, 2012 10:44 pm
Location: Argentina

Re: How can we add custom start tittle?

Post by Zephyr »

L2GOT wrote:{
if (Config.CHAR_TITLE)
{
newChar.setTitle(Config.ADD_CHAR_TITLE);
}
else
{
newChar.setTitle("Slave");
}


what is the Config.ADD_CHAR_TITLE); ? should i do something else?
Check it out in java/com/l2jserver/Config.java :mrgreen:
L2GOT
Posts: 30
Joined: Wed Nov 05, 2014 9:56 pm

Re: How can we add custom start tittle?

Post by L2GOT »

still llooking for help
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: How can we add custom start tittle?

Post by Attila »

Gries wrote:Open CharacterCreate.java file and find this part of the code:

Code: Select all

newChar.setTitle("");
Change the brackets part like this:

Code: Select all

newChar.setTitle("TITLE HERE");
I think it should work like that.
where can i fine CharacterCreate.java file ?
User avatar
DreamStage
Posts: 222
Joined: Mon Oct 11, 2010 2:38 am
Location: Portugal

Re: How can we add custom start tittle?

Post by DreamStage »

Hello L2GOT, how are you,

You can add the custom Title for every char at the folowing method from L2PcInstance.java class:

private static L2PcInstance restore(int objectId)
  • at player.setTitle(rset.getString("title")); -> you can change to a custom title as: player.setTitle("Custom Title Here");
    or
  • at player.setTitle(rset.getString("title")); -> you can make it from Config variable as -> player.setTitle(Config.ADD_CHAR_TITLE);
    +
    (add at Config.java file one new setting for this ADD_CHAR_TITLE variable with same name or your own setting, and ofc you will need to add this new setting configuration at the proper characters settings configuration file.
If you don't know how to do it, tell me which one you prefer and im happy to help you.
Ignorance comes when you dont want to know the truth about facts.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: How can we add custom start tittle?

Post by Attila »

DreamStage wrote:Hello L2GOT, how are you,

You can add the custom Title for every char at the folowing method from L2PcInstance.java class:

private static L2PcInstance restore(int objectId)
  • at player.setTitle(rset.getString("title")); -> you can change to a custom title as: player.setTitle("Custom Title Here");
    or
  • at player.setTitle(rset.getString("title")); -> you can make it from Config variable as -> player.setTitle(Config.ADD_CHAR_TITLE);
    +
    (add at Config.java file one new setting for this ADD_CHAR_TITLE variable with same name or your own setting, and ofc you will need to add this new setting configuration at the proper characters settings configuration file.
If you don't know how to do it, tell me which one you prefer and im happy to help you.
Please help me to make it whit
[*] at player.setTitle(rset.getString("title")); -> you can make it from Config variable as -> player.setTitle(Config.ADD_CHAR_TITLE);
User avatar
DreamStage
Posts: 222
Joined: Mon Oct 11, 2010 2:38 am
Location: Portugal

Re: How can we add custom start tittle?

Post by DreamStage »

Use this:

Code: Select all

### Eclipse Workspace Patch 1.0
#P L2J_HI5_Server
diff --git dist/game/config/Character.properties dist/game/config/Character.properties
index f1ab10d..e5648af 100644
--- dist/game/config/Character.properties
+++ dist/game/config/Character.properties
@@ -645,6 +645,10 @@
 # Default: 0
 StartingSP = 0
 
+# This is the title that a new character starts their character with.
+# Default: ""
+StartingTitle = ""
+
 # ---------------------------------------------------------------------------
 # Other Settings:
 # ---------------------------------------------------------------------------
diff --git java/com/l2jserver/Config.java java/com/l2jserver/Config.java
index 796d027..04c36a2 100644
--- java/com/l2jserver/Config.java
+++ java/com/l2jserver/Config.java
@@ -227,6 +227,7 @@
 	public static long STARTING_ADENA;
 	public static byte STARTING_LEVEL;
 	public static int STARTING_SP;
+	public static String STARTING_TITLE;
 	public static long MAX_ADENA;
 	public static boolean AUTO_LOOT;
 	public static boolean AUTO_LOOT_RAIDS;
@@ -1618,6 +1619,7 @@
 			STARTING_ADENA = Character.getLong("StartingAdena", 0);
 			STARTING_LEVEL = Character.getByte("StartingLevel", (byte) 1);
 			STARTING_SP = Character.getInt("StartingSP", 0);
+			STARTING_TITLE = Character.getString("StartingTitle", "");
 			MAX_ADENA = Character.getLong("MaxAdena", 99900000000L);
 			if (MAX_ADENA < 0)
 			{
diff --git java/com/l2jserver/gameserver/network/clientpackets/CharacterCreate.java java/com/l2jserver/gameserver/network/clientpackets/CharacterCreate.java
index f2148ea..101c6b1 100644
--- java/com/l2jserver/gameserver/network/clientpackets/CharacterCreate.java
+++ java/com/l2jserver/gameserver/network/clientpackets/CharacterCreate.java
@@ -260,7 +260,7 @@
 		final L2PcTemplate template = newChar.getTemplate();
 		Location createLoc = template.getCreationPoint();
 		newChar.setXYZInvisible(createLoc.getX(), createLoc.getY(), createLoc.getZ());
-		newChar.setTitle("");
+		newChar.setTitle(Config.STARTING_TITLE);
 		
 		if (Config.ENABLE_VITALITY)
 		{
Ignorance comes when you dont want to know the truth about facts.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: How can we add custom start tittle?

Post by Attila »

Thanks
This is what I wanted
He works well :P

thanks
Post Reply