Skip to content

[Share]Olympiad Name Color + Olympiad Custom Title

Featured Replies

When the player is on Olympiad Match get Name Color.

 

config:
Index: net/sf/l2j/config/l2jmods.properties
# Specified reward item rnd qty
ChampionRewardItemQty = 1
+
+#---------------------------------------------------------------
+# Olympiad Custom Name Color                
+#---------------------------------------------------------------
OlympiadColorSystem = false
OlympiadNameColor = FFF000
+
=====
Index: net/sf/l2j/config.java
      public static int L2JMOD_CHAMPION_REWARD_ID;
      public static int L2JMOD_CHAMPION_REWARD_QTY;
+     public static boolean OLYMPIAD_COLOR_SYSTEM;
+     public static int OLYMPIAD_NAME_COLOR;

                  L2JMOD_CHAMPION_REWARD_ID             = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
                  L2JMOD_CHAMPION_REWARD_QTY            = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
+                 OLYMPIAD_COLOR_SYSTEM              = Boolean.parseBoolean(L2JModSettings.getProperty("OlympiadColorSystem", "false"));
+                 OLYMPIAD_NAME_COLOR            = Integer.decode("0x" + L2JModSettings.getProperty("OlympiadNameColor", "FFF000"));

=====
Index: sf/l2j/gameserver/Olympiad.java

                                //Remove Clan Skills
			if (player.getClan() != null)
			{
				for(L2Skill skill: player.getClan().getAllSkills())
					player.removeSkill(skill,false);
			}

+
+				//Olympiad Color Title
+				if (Config.OLYMPIAD_COLOR_SYSTEM)
+					{
+					if (player.isOlympiadStart())
+					player.getAppearance().setNameColor(Config.OLYMPIAD_NAME_COLOR);
+					broadcastUserInfo();
+				}
+

			//Abort casting if player casting  
			if (player.isCastingNow())

 

 

Well a second Code.

 

When the player is on Olympiad Match get Title "Go Fight".

 

config:
Index: net/sf/l2j/config/l2jmods.properties
# Specified reward item rnd qty
ChampionRewardItemQty = 1
+
#---------------------------------------------------------------
# Olympiad Custom Title               
#---------------------------------------------------------------
OlympiadTitleSystem = false
OlympiadTitle = "Go Fight"
+
=====
Index: net/sf/l2j/config.java
      public static int L2JMOD_CHAMPION_REWARD_ID;
      public static int L2JMOD_CHAMPION_REWARD_QTY;
+     public static boolean OLYMPIAD_TITLE_SYSTEM;
+     public static int OLYMPIAD_TITLE;

                  L2JMOD_CHAMPION_REWARD_ID             = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
                  L2JMOD_CHAMPION_REWARD_QTY            = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
+                 OLYMPIAD_TITLE_SYSTEM              = Boolean.parseBoolean(L2JModSettings.getProperty("OlympiadTitleSystem", "false"));
+                 OLYMPIAD_TITLE            = Integer.parseInt(L2JModSettings.getProperty("OlympiadTitle", "Go Fight"));


=====
Index: sf/l2j/gameserver/Olympiad.java

                                //Remove Clan Skills
			if (player.getClan() != null)
			{
				for(L2Skill skill: player.getClan().getAllSkills())
					player.removeSkill(skill,false);
			}

+
+						//Olympiad Title
+						if (Config.OLYMPIAD_TITLE_SYSTEM)
+							{
+							if (player.isOlympiadStart())
+							player.getAppearance().setTitle(Config.OLYMPIAD_TITLE);
+							      broadcastUserInfo();
+							}

			//Abort casting if player casting  
			if (player.isCastingNow())

 

Credit's:Me

Thanks to Fanky for the correction

I'll start pointin' out your mistakes starting from 1st to 2nd code.

 

first of all,

  OLYMPIAD_NAME_COLOR            = Integer.parseInt(L2JModSettings.getProperty("OlympiadNameColor", "FFF000"));

 

color its not parseInt,its Integer.decode

so the above line is wrong,the followin' one is the correct

OLYMPIAD_NAME_COLOR            = Integer.decode("0x" + L2JModSettings.getProperty("OlympiadNameColor", "FFF000"));

 

secondly,

+	private static final int OLYMPIAD_NAME_COLOR = 0;

that's completely wrong and useless,delete it.

 

To continue with,

updateNameColor(getNameColor());

completely useless,the broadcastUserInfo(); is doin' the job.

 

After that,delete them

+	/**
+	 * @return the olympiadNameColor
+	 */
+	public static int getOlympiadNameColor()
+	{
+		return OLYMPIAD_NAME_COLOR;
+	}
+}
+
+	/**
+	 * @return
+	 */
+	public Object getNameColor()
+	{
+		return null;
+	}
+
+	/**
+	 * 
+	 */
+	public void broadcastUserInfo()
+	{
+		
+	}
+
+	/**
+	 * @param nameColor
+	 */
+	public void updateNameColor(Object nameColor)
+	{
+		
+	}
+}

 

quick fix ain't always good >.>,keep that in your mind.

 

Now,2nd code.

 

private static final int OLYMPIAD_TITLE = 0;

its tittle dude,by this way you are setting the tittle as integer(aka number up to 2,1kkk (lol)).

 

same,before delete that

updateNameColor(getNameColor());

 

and delete every single method which you created after that,

for sure it'll pop up more errors since the code is still bad.

 

Hope I helped,anyway start doing smaller things(check my guide on gr section,I give some ideas for newbies)

Thank you Fanky.... I understand my mistake!

glad that I helped.

You should add a method to allow players to recover their previous title & name color, when leaving from olympiads, not?

I think it's much easier doing it via packets.

You should add a method to allow players to recover their previous title & name color, when leaving from olympiads, not?

I think it's much easier doing it via packets.

or just put whatever tittle & name color he wants when they are teleportin' back.

protected void portPlayersBack()
{
   //
}

 

ofc if he wanna have the previous status,that's not the way :P

hmm nice share  Baggos/Fanky!

just spamming around without even reading the comments,nice bussiness.

x.x

just spamming around without even reading the comments,nice bussiness.

x.x

wut? dude im just encourage ppl to make more shares here in forum.

wut? dude im just encourage ppl to make more shares here in forum.

my point was that this share isn't working,and I just pointed out his mistakes I didnt fix nor shared a new code.

 

how this comes?

hmm nice share  Baggos/Fanky!

I mean that if he fix that code it is gonna be a nice share.

I mean that if he fix that code it is gonna be a nice share.

 

and he means that you ... oh shit, this way i will be a spammer too?

fuck!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.