Page 1 of 1

How can we add custom start tittle?

Posted: Thu Nov 20, 2014 1:23 pm
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

Re: How can we add custom start tittle?

Posted: Thu Nov 20, 2014 2:15 pm
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.

Re: How can we add custom start tittle?

Posted: Thu Nov 20, 2014 4:08 pm
by L2GOT
Gries i did that, but again nothing happent :/
where's the problem ?

Re: How can we add custom start tittle?

Posted: Thu Nov 20, 2014 4:18 pm
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?

Re: How can we add custom start tittle?

Posted: Thu Nov 20, 2014 4:50 pm
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:

Re: How can we add custom start tittle?

Posted: Thu Nov 20, 2014 5:08 pm
by L2GOT
still llooking for help

Re: How can we add custom start tittle?

Posted: Sat Mar 28, 2015 5:00 pm
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 ?

Re: How can we add custom start tittle?

Posted: Sat Mar 28, 2015 6:18 pm
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.

Re: How can we add custom start tittle?

Posted: Sun Mar 29, 2015 12:48 pm
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);

Re: How can we add custom start tittle?

Posted: Sun Mar 29, 2015 8:02 pm
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)
 		{

Re: How can we add custom start tittle?

Posted: Mon Mar 30, 2015 6:48 pm
by Attila
Thanks
This is what I wanted
He works well :P

thanks