Jump to content
  • 0

[Help]Java, if (activeChar.isNiewbe).


Thelasthero

Question

Hi guys, i have tried to add custom title on my pack, but i got so many errors.......

Then i opened EnterWorld.java and after

protected void runImpl()

i added

if (activeChar.isNiewbe())
         {
                 activeChar.setTitle(Welcome);
         }

 

I am sure this is the correct place to add this, because i have added more codes there, like activeChar.setHero(true); and more.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

there says maximum of letters is 16 and down ..

starting tittle : i remember that and you write here but you have Write True ??

to accept your chose??

Link to comment
Share on other sites

  • 0

-if (activeChar.isNiewbe())

-         {

-                 activeChar.setTitle("Welcome");

-         }

 

+if (activeChar.isNewbie())

+    activeChar.setTitle("Welcome");

 

 

Link to comment
Share on other sites

  • 0

-if (activeChar.isNiewbe())

-        {

-                activeChar.setTitle("Welcome");

-        }

 

+if (activeChar.isNewbie())

+    activeChar.setTitle("Welcome");

 

 

 

you think compiler cares?

Link to comment
Share on other sites

  • 0

you think compiler cares?

Ofcourse it does. The first message refers to a non-existing method hence you'll have compilation issues.

Its the same as you trying to eat a cake that doesn't exist.

Link to comment
Share on other sites

  • 0

Ofcourse it does. The first message refers to a non-existing method hence you'll have compilation issues.

Its the same as you trying to eat a cake that doesn't exist.

 

duh i guess..

 

sorry lol, i was too wasted to see the red text.. and thought he meant the brackets {}.

Link to comment
Share on other sites

  • 0

if (activeChar.isNewbie())
{
   activeChar.setTitle("Welcome");
   return;
}

 

i hope i help you

 

or if it still gives you error try and this way

 

if (activeChar.isNewbie())
{
   activeChar.setTitle("Welcome");
}

Link to comment
Share on other sites

  • 0

why a check on enter world? o.o

 

Charactercreation.java

 

near to the adena given by config and you will see the method or add it by self ;]

so it will be like this?

 

CharacterCreate.java

find this first

newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
		newChar.setTitle("");

 

down of this paste this

if (Config.CHAR_TITLE)
		newChar.setTitle(Config.ADD_CHAR_TITLE);

 

at Config.java

public static boolean CHAR_TITLE;
public static String  ADD_CHAR_TITLE;

CHAR_TITLE       = Boolean.parseBoolean(L2JModSettings.getProperty("CharTitle", "False"));
ADD_CHAR_TITLE   = L2JModSettings.getProperty("AddCharTitle", "Welcome");

 

and at l2jmod.properties add this

+#---------------------------------------------------------------
# Custom Title                                                                        -
#---------------------------------------------------------------
# Deafult: False
CharTitle = False
AddCharTitle = Welcome

 

take the whole code if it's more helpful

Index: java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java	(revision 4017)
+++ java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java	(working copy)
@@ -174,6 +174,9 @@

		newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
		newChar.setTitle("");
+		
+		if (Config.CHAR_TITLE)
+			newChar.setTitle(Config.ADD_CHAR_TITLE);

		L2ShortCut shortcut;
		//add attack shortcut
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 4017)
+++ 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 CHAR_TITLE;
+    public static String  ADD_CHAR_TITLE;

    // 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"));
+                
+                CHAR_TITLE       = Boolean.parseBoolean(L2JModSettings.getProperty("CharTitle", "False"));
+                ADD_CHAR_TITLE   = L2JModSettings.getProperty("AddCharTitle", "Welcome");

                if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                {
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 4017)
+++ java/config/l2jmods.properties	(working copy)
@@ -132,3 +132,10 @@
# ex.: 1;2;3;4;5;6
# no ";" at the start or end
TvTEventDoorsCloseOpenOnStartEnd =
+
+#---------------------------------------------------------------
+# Custom Title                     -
+#---------------------------------------------------------------
+# Deafult: False
+CharTitle = False
+AddCharTitle = Welcome

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...