Jump to content

Recommended Posts

  • 1 month later...
Posted

or this code is good when i want just custom title for all?

+	// Custom Pk Color System - Start
+	public void updatePkColor(int pkKillAmount)
+	{
+			//Check if the character has GM access and if so, let them be, like above.
+			if (isGM())
+				return;
+			{
+				if ((pkKillAmount >= (0)))
+				{
+					getAppearance().setTitleColor(#FFF333);
+				}
+			}
+		}
+	//Custom Pk Color System - End
+	
    @Override
    public final void updateEffectIcons(boolean partyOnly)
    {
        // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
        sendPacket(new UserInfo(this));
    }
@@ -5047,6 +5120,10 @@
        setPkKills(getPkKills() + 1);
        setKarma(getKarma() + newKarma);

+        //Update the character's title color if they reached any of the 5 PK levels.
+        updatePkColor(getPkKills());
+        broadcastUserInfo();
+        
        // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
        sendPacket(new UserInfo(this));
    }

Posted

How can i know the color codes?

 

I wanna use this thing, but with other colors.

 

Can some one share the color codes?

 

Thx, and good share mate ;)

write html colors in google

take a little codes from here

http://www.w3schools.com/Html/html_colors.asp

Posted

well i already saw something (something) like that based on Python but without and pvp or pk point only give an item and take a color so it's more cool the whole code but it's to big if you can remake it with less codes

  • 2 months later...
Posted

« Reply #116 on: December 31, 2009, 04:35:08 PM »

So I won't undig anything ^^

 


 

Anyway, this topic exists in my AIO, which means that people are using it.

BUT, Vago's patch has a few errors, and people cannot apply it, even if they try to set it manually.

So I made a new one (It would be lame to open a new topic for it).

 

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 47)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -3583,6 +3583,74 @@
        	DuelManager.getInstance().broadcastToOppositTeam(this, update);
        }
	}
+	
+	// Custom PVP Color System - Start
+	 	public void updatePvPColor(int pvpKillAmount)
+	 	{
+	 		if (Config.PVP_COLOR_SYSTEM_ENABLED)
+	 		{
+	 			//Check if the character has GM access and if so, let them be.
+	 			if (isGM())
+	 				return;
+	 			{
+	 				if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount <= (Config.PVP_AMOUNT2)))
+	 				{
+	 					getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1);
+	 				}
+	 				else if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount <= (Config.PVP_AMOUNT3)))
+	 				{
+	 					getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2);
+	 				}
+	 				else if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount <= (Config.PVP_AMOUNT4)))
+	 				{
+						getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3);
+	 				}
+	 				else if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount <= (Config.PVP_AMOUNT5)))
+	 				{
+	 					getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4);
+	 				}
+	 				else if (pvpKillAmount >= (Config.PVP_AMOUNT5))
+	 				{
+	 					getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5);
+	 				}
+	 			}
+	 		}
+	 	}
+	 	//Custom PVP Color System - End
+	 	
+	 	// Custom Pk Color System - Start
+	 	public void updatePkColor(int pkKillAmount)
+	 	{
+	 		if (Config.PK_COLOR_SYSTEM_ENABLED)
+	 		{
+	 			//Check if the character has GM access and if so, let them be, like above.
+	 			if (isGM())
+	 				return;
+	 			{
+	 				if ((pkKillAmount >= (Config.PK_AMOUNT1)) && (pkKillAmount <= (Config.PVP_AMOUNT2)))
+					{
+	 					getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT1);
+	 				}
+	 				else if ((pkKillAmount >= (Config.PK_AMOUNT2)) && (pkKillAmount <= (Config.PVP_AMOUNT3)))
+	 				{
+	 					getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT2);
+	 				}
+	 				else if ((pkKillAmount >= (Config.PK_AMOUNT3)) && (pkKillAmount <= (Config.PVP_AMOUNT4)))
+	 				{
+	 					getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT3);
+	 				}
+	 				else if ((pkKillAmount >= (Config.PK_AMOUNT4)) && (pkKillAmount <= (Config.PVP_AMOUNT5)))
+	 				{
+	 					getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT4);
+	 				}
+	 				else if (pkKillAmount >= (Config.PK_AMOUNT5))
+	 				{
+	 					getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT5);
+	 				}
+	 			}
+	 		}
+	 	}
+	 	//Custom Pk Color System - End	

	/**
	 * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
@@ -4471,6 +4539,10 @@
        // Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);
        
+      //Update the character's name color if they reached any of the 5 PvP levels.
+      updatePvPColor(getPvpKills());
+      broadcastUserInfo();
+        
        addExpAndSp(Config.ADD_EXP, Config.ADD_SP);
        {
        	sendMessage("You win Exp and Sp From Pvp Kills!");
@@ -4540,6 +4612,11 @@
			setPkKills(getPkKills() + 1);
			setKarma(getKarma() + newKarma);
		}
+        
+       //Update the character's title color if they reached any of the 5 PK levels.
+       updatePkColor(getPkKills());
+       broadcastUserInfo();
+        
		if(Config.CUSTOM_PK_SYSTEM)
		{
			setPvpKills(getPvpKills() + 1);
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 48)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -882,6 +882,31 @@
    public static boolean L2JMOD_WEDDING_FORMALWEAR;
    public static int L2JMOD_WEDDING_DIVORCE_COSTS;
    
+    /** Custom PvP Color System - Start */
+    public static boolean		PVP_COLOR_SYSTEM_ENABLED;
+    public static int			PVP_AMOUNT1;
+    public static int			PVP_AMOUNT2;
+    public static int			PVP_AMOUNT3;
+    public static int			PVP_AMOUNT4;
+    public static int			PVP_AMOUNT5;
+    public static int			NAME_COLOR_FOR_PVP_AMOUNT1;
+    public static int			NAME_COLOR_FOR_PVP_AMOUNT2;
+    public static int			NAME_COLOR_FOR_PVP_AMOUNT3;
+    public static int			NAME_COLOR_FOR_PVP_AMOUNT4;
+    public static int			NAME_COLOR_FOR_PVP_AMOUNT5;
+    public static boolean		PK_COLOR_SYSTEM_ENABLED;
+    public static int			PK_AMOUNT1;
+    public static int			PK_AMOUNT2;
+    public static int			PK_AMOUNT3;
+    public static int			PK_AMOUNT4;
+    public static int			PK_AMOUNT5;
+    public static int			TITLE_COLOR_FOR_PK_AMOUNT1;
+    public static int			TITLE_COLOR_FOR_PK_AMOUNT2;
+    public static int			TITLE_COLOR_FOR_PK_AMOUNT3;
+    public static int			TITLE_COLOR_FOR_PK_AMOUNT4;
+    public static int			TITLE_COLOR_FOR_PK_AMOUNT5;
+    /** Custom PvP Color System - End */
+    
    /** Customs - Start            */
    public static boolean 	ALT_OLY_SAME_IP;
    public static boolean 	PACKET_HANDLER_DEBUG;
@@ -1884,6 +1909,30 @@
                L2JMOD_WEDDING_FORMALWEAR               = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));

+                /** Custom PvP Color System */
+                PVP_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePvPColorSystem", "false"));
+                PVP_AMOUNT1 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount1", "500"));
+                PVP_AMOUNT2 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount2", "1000"));
+                PVP_AMOUNT3 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount3", "1500"));
+                PVP_AMOUNT4 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount4", "2500"));
+                PVP_AMOUNT5 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount5", "5000"));
+                NAME_COLOR_FOR_PVP_AMOUNT1 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount1", "00FF00"));
+                NAME_COLOR_FOR_PVP_AMOUNT2 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount2", "00FF00"));
+                NAME_COLOR_FOR_PVP_AMOUNT3 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount3", "00FF00"));
+                NAME_COLOR_FOR_PVP_AMOUNT4 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));
+                NAME_COLOR_FOR_PVP_AMOUNT5 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));
+                PK_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePkColorSystem", "false"));
+                PK_AMOUNT1 = Integer.parseInt(L2JModSettings.getProperty("PkAmount1", "500"));
+                PK_AMOUNT2 = Integer.parseInt(L2JModSettings.getProperty("PkAmount2", "1000"));
+                PK_AMOUNT3 = Integer.parseInt(L2JModSettings.getProperty("PkAmount3", "1500"));
+                PK_AMOUNT4 = Integer.parseInt(L2JModSettings.getProperty("PkAmount4", "2500"));
+                PK_AMOUNT5 = Integer.parseInt(L2JModSettings.getProperty("PkAmount5", "5000"));
+                TITLE_COLOR_FOR_PK_AMOUNT1 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount1", "00FF00"));
+                TITLE_COLOR_FOR_PK_AMOUNT2 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount2", "00FF00"));
+                TITLE_COLOR_FOR_PK_AMOUNT3 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount3", "00FF00"));
+                TITLE_COLOR_FOR_PK_AMOUNT4 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount4", "00FF00"));
+                TITLE_COLOR_FOR_PK_AMOUNT5 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount5", "00FF00"));
+                
				/**  Custom Features        */
				ALT_OLY_SAME_IP 						= Boolean.parseBoolean(L2JModSettings.getProperty("AltOlySameIp", "False"));
				PACKET_HANDLER_DEBUG 					= Boolean.parseBoolean(L2JModSettings.getProperty("PacketHandlerDebug", "False"));
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 48)
+++ java/config/l2jmods.properties	(working copy)
@@ -201,3 +201,61 @@

# Your Level Must Be Over
LevelNeededToUseNobleCustomItem = 76
+
+# ---------------------------------------
+# Section: PvP Title Color Change System by Level
+# ---------------------------------------
+# Each Amount will change the name color to the values defined here.
+# Example: PvpAmmount1 = 500, when a character's PvP counter reaches 500, their name color will change
+# according to the ColorForAmount value.
+# Note: Colors Must Use RBG format
+EnablePvPColorSystem = false
+
+# Pvp Amount & Name color level 1.
+PvpAmount1 = 500
+ColorForAmount1 = CCFF00
+
+# Pvp Amount & Name color level 2.
+PvpAmount2 = 1000
+ColorForAmount2 = 00FF00
+
+# Pvp Amount & Name color level 3.
+PvpAmount3 = 1500
+ColorForAmount3 = 00FF00
+
+# Pvp Amount & Name color level 4.
+PvpAmount4 = 2500
+ColorForAmount4 = 00FF00
+
+# Pvp Amount & Name color level 5.
+PvpAmount5 = 5000
+ColorForAmount5 = 00FF00
+
+# ---------------------------------------
+# Section: PvP Nick Color System by Level
+# ---------------------------------------
+# Same as above, with the difference that the PK counter changes the title color.
+# Example:  PkAmmount1 = 500, when a character's PK counter reaches 500, their title color will change
+# according to the Title For Amount
+# WAN: Colors Must Use RBG format
+EnablePkColorSystem = false
+
+# Pk Amount & Title color level 1.
+PkAmount1 = 500
+TitleForAmount1 = 00FF00
+
+# Pk Amount & Title color level 2.
+PkAmount2 = 1000
+TitleForAmount2 = 00FF00
+
+# Pk Amount & Title color level 3.
+PkAmount3 = 1500
+TitleForAmount3 = 00FF00
+
+# Pk Amount & Title color level 4.
+PkAmount4 = 2500
+TitleForAmount4 = 00FF00
+
+# Pk Amount & Title color level 5.
+PkAmount5 = 5000
+TitleForAmount5 = 00FF00
Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(revision 47)
+++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(working copy)
@@ -259,6 +259,15 @@
		Quest.playerEnter(activeChar);
		activeChar.sendPacket(new QuestList());

+		// =================================================================================
+		// Color System checks - Start =====================================================
+		// Check if the custom PvP and PK color systems are enabled and if so ==============
+		// check the character's counters and apply any color changes that must be done. ===
+		if (activeChar.getPvpKills()>=(Config.PVP_AMOUNT1) && (Config.PVP_COLOR_SYSTEM_ENABLED)) activeChar.updatePvPColor(activeChar.getPvpKills());
+		if (activeChar.getPkKills()>=(Config.PK_AMOUNT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) activeChar.updatePkColor(activeChar.getPkKills());
+		// Color System checks - End =======================================================
+		// =================================================================================
+		
		if (Config.NAME_COLOR_SYSTEM)
		{
			activeChar.getAppearance().setNameColor(Config.NAME_COLOR);

 

 

Tested and works w/o errors.

 

Regards.

Posted

tested it on l2jInterlude  ..... FAILED dude ....... and btw this is so complicated .....

 

1) L2jInterlude? ahahahahahah you've got to be kidding me. The project where you tested it was a failure, not the patch ;)

2) What's so complicated in a normal patch? o.O

  • 4 weeks later...

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

    • Changeset 410 (3371)   Makers, NpcAi / Desires, Cursed Weapon rework, Bugfixes, Admincommands, Movement, Organization   Makers Fix ghost corpses. Introduce task manager for MultiSpawn spawn schedule. Introduce task managers for Npc respawn and despawn tasks. Add missing random treasurebox maker. NpcAi / Desires AttackableAttack > NpcAttack, allowing ATTACK_FINISHED event over Npc. Merge all reduceWeight from NpcAI operations. Don't broadcast MoveToPawn packet for cast hold scenarii. CH and CP managers use hold cast. Probably way more to add. Rework DesireQueue#addOrUpdate to avoid to generate a List. Drop _isInHitAnimation, avoid twice runAI calls upon attack end animation, save a ThreadPool. Implement Desire#isInvalid, used over the main loop to clean invalid Desires. All sided getDesires().removeIf are dropped, notably over AggroList/HateList. Cursed Weapon rework Fix potential task scheduling issues, reworking the whole layers. Reduce code by 1/3. Use L2OFF formulas/data for item drop rate, staging process. CW end duration now decreases when killing other Players. Bugfixes Revert schedule part from ThreadPool. Fix Pet inventory IU. Ty Denzel for the report. Fix Pet item timestamp reuse delay. Ty artemis for the fix. Disable automatic beastshots when his owner dies. Ty Root for the report. Player cannot craft while casting a skill, nor trade. Ty Root for the report. Add missing weight checks for player/summon pickup, and player craft. Ty Root for the report. Implement /graduatelist command, which displays a list of clan academy graduates for the past week. Ty RooT for the report. Fix PLAYING_FOR_LONG_TIME concept ; rest message is server related, not Player related. Ty RooT for the report. Player should stop movement when opening store. Fix Q351 occurences of itemId 4310 by 4407 one + slight fix. Fix Q365 missing memoState + poison skillId. Ty Root for the report. Fix Q417 Torai despawn over cond 11. Fix Q216 4 missing npcIds. Ty Karudin for the report. Fix the invalid comment of DeleteCharAfterDays Config. Fix NPC drop penalty level calculation. Ty Bandnentans for the report. Items are now dropped in a 30/45 donut shape around dropper. Ty Bandnentans for the report. PartyMatch fixes Don't show Party members or CW holder as available waiting members. You can't show overall List or join a PartyMatch room as CW holder. CW owner, upon acquisition, leave PartyMatch system. PartyMatch window is now automatically closed upon Player#removeMeFromPartyMatch. Remove Player from PartyMatch if Player and newly joined Party leader PartyMatch rooms differ. You can't join or be invited in a PartyMatch room if already partying/CW holding. Fix ShowLicence config when set to false. Ty artemis for the fix. Fix maximum number of macros. Ty artemis for the fix. Fix invalid IU update over //enchant. Ty artemis for the fix. Fix Castle Mass Gatekeeper HTMs. Ty kingNik0n for the fix. Drop _disabledItems implementation. Won't be used by next refactors. Ty artemis for the report. Fix loading handlers under debug. Ty Keku for the fix. Fix character_macroses table structure (commands = 12x32 chars minimum). Admincommands Merge all old spawn admincommands (//list_spawns, //spawn, //unspawnall, //respawnall, //delete) to //spawn and //unspawn (previously //delete). Generate //help. //unspawn works over all ASpawn. Merge all old fence admincommands (//spawnfence, //deletefence, //listfence) to //fence [add|remove], generate AdminFence. They now use proper Pagination. You can also teleport to it. Implementation of //show manor. Implementation of //set quest <id> [cond]. Related items must be hand-given. Implementation of //set henna [page] [add|remove symbolId]. The hennas are still bound to game logic (slots, canBeUsedBy). Movement - Ty LaRoja, Bandnentans Fix Boats IOOBE. Adapt getHeight logic from L2OFF. Introduce back WASD movement, handle boat board/unboard. Fix WATER/FLY movement logic. Avoid to pathfind diagonal cells with detected obstacle. Organization Addition of QuestVars class, holding all related variables from quests (itemIds, npcIds, questNames, sounds, etc), allowing to reduce length of each script while reusing variables. 100+ cloned variables were deleted. Refactor geometry package and Territory. Territory is now a unique 3D shape, holding any type of 2D geometry.  Remove few useless Location#clone uses. Implementation of ItemContainer#forEachItem. Clean many unused FrequentSkill. The whole enum is questionable. Drop MathUtil#checkIfInRange, implement WorldObject#isInStrictRadius (involve collision of that WorldObject, and potential WorldObject parameter). WorldObject#isIn2DRadius parameter is now a Point2D, not a Location (since a Location inherits Point2D, Location are still usable as parameter). Rework Pagination#generatePages to handle page number > 1000. Use Pagination over Tryskell SchemeBuffer. Ty CUCU23 for the share.
    • It's a custom instance used as Event not retail - like. You can re-create it easily.
    • GRAND OPENING TODAY !!! FROM - 16/05/2025, FRIDAY, 20:00 +3 GMT !
  • Topics

×
×
  • Create New...