Jump to content

Mob Title L2J-Frozen


Recommended Posts


gameserver/Config.java

 

 

public static boolean SEND_SKILLS_CHANCE_TO_PLAYERS;

+ public static boolean L2MOB_NPC;

+ public static String L2MOB_TITLE;

 

 

 

CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(L2JfrozenSettings.getProperty("CustomSpawnlistTable", "True"));

 

+ /** MOB TITLE **/

+ L2MOB_NPC = Boolean.parseBoolean(L2JfrozenSettings.getProperty("EnableMobTitle", "True"));

+ L2MOB_TITLE = L2JfrozenSettings.getProperty("MobTitle", "L2J-frozen");

+

 

 

 

 

head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java

 

 

if (Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion())

{

_title = Config.L2JMOD_CHAMP_TITLE;

}

else if (cha.getTemplate().serverSideTitle)

{

_title = cha.getTemplate().title;

}

else

{

_title = cha.getTitle();

}

+

+ if (Config.L2MOB_NPC && _activeChar instanceof L2MonsterInstance)

+ {

+ _title = Config.L2MOB_TITLE;

+ }

+ else if (cha.getTemplate().serverSideTitle)

+ {

+ _title = cha.getTemplate().title;

+ }

+ else

+ {

+ _title = cha.getTitle();

+ }

+

 

 

 

 

 

 

gameserver/config/fuctions/l2jfrozen.properties

 

 

+

+#========================================

+# NPC TITLE BY KALLONE

+#========================================

+

+# Mob Custom Title

+EnableMobTitle = True

+MobTitle = L2J-frozen

Good as I had nothing to do I decided to make this code to l2j-frozen! use sparingly

 

sorry my english is not so good

 

 

They add a title on top of the mobs!

 

Edited by kallone
Link to comment
Share on other sites

You can cut the code by 3 :

- Drop EnableMobTitle and simply check if MobTitle isEmpty() to see if custom is enabled or not.

- You add a complete _title if if if check, while you only need to add the given check on the existing check.

+		else if (Config.L2MOB_NPC && _activeChar instanceof L2MonsterInstance)
+		{
+			_title = Config.L2MOB_TITLE;
+		}

Also, I'm not sure because I'm lazy to check, but _activeChar isn't supposed to be monster instance (at least, if it uses L2J naming convention, activeChar is 99% a player). You probably meant "cha".

Edited by Tryskell
Link to comment
Share on other sites

You can cut the code by 3 :

- Drop EnableMobTitle and simply check if MobTitle isEmpty() to see if custom is enabled or not.

- You add a complete _title if if if check, while you only need to add the given check on the existing check.

+		else if (Config.L2MOB_NPC && _activeChar instanceof L2MonsterInstance)
+		{
+			_title = Config.L2MOB_TITLE;
+		}

Also, I'm not sure because I'm lazy to check, but _activeChar isn't supposed to be monster instance (at least, if it uses L2J naming convention, activeChar is 99% a player). You probably meant "cha".

seui6a.jpg

Link to comment
Share on other sites

and if you want to put to appear on top of all Mobs and NPCs and so just add this code down!

		if (Config.L2MOB_NPC && _activeChar instanceof L2MonsterInstance)
		{
			_title = Config.L2MOB_TITLE;
		}
		else if (cha.getTemplate().serverSideTitle)
		{
			_title = cha.getTemplate().title;
		}
		else
		{
			_title = cha.getTitle();
		}
+		
+		if (Config.L2MOB_NPC && _activeChar instanceof L2NpcInstance)
+		{
+			_title = Config.L2MOB_TITLE;
+		}
+		else if (cha.getTemplate().serverSideTitle)
+		{
+			_title = cha.getTemplate().title;
+		}
+		else
+		{
+			_title = cha.getTitle();
+		}
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...