Jump to content

[Share]Olympiad Name Color + Olympiad Custom Title


Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.



  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
    • I can use this folder system for High Five offline server?   The folder does not have a l2.exe file.   Thank you very much if anyone can help me.   https://drive.google.com/file/d/13kU-g_4JJ-sP-kg2F7pqkUOVKmQdubFm/view
  • Topics

×
×
  • Create New...