Jump to content

Recommended Posts

Posted

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

Posted

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)

Posted

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.

Posted

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

Posted

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!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...