Jump to content
  • 0

[Question] Colors Names


NazGhuL.

Question

Hello people, I'd like to ask how could i make this code work vice versa.

I mean, Instead of giving color for Pk to title giving it to Name. And instead giving color from pvp to name giving it to title.

That's the code

http://pastebin.com/BFKCkeDd

 

Any help with this Issue would be really helpfull.

Thank you once again =)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Reverse

 

getAppearance().setTitleColor(titleColor); for getAppearance().setNameColor(nameColor);

 

and the contrary as well.

 

x2, so 4 changes in all.

Link to comment
Share on other sites

  • 0

It is too simple dude.

Make it like that

#
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
#
===================================================================
#
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java        (revision 3893)
#
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java        (working copy)

+               if(getPvpKills() > 0)
#
+               {
#
+                       int titleColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(getPvpKills(), true));
#
+                       getAppearance().setTitleColor(titleColor);
#
+               }
#
+               if(getPkKills() > 0)
#
+               {
#
+                       int nameColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(getPkKills(), false));
#
+                       getAppearance().setNameColor(nameColor);
Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
#
===================================================================
#
--- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 3893)
#
+++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy)

+               if(activeChar.getPvpKills() > 0)
#
+               {
#
+                       int titleColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(activeChar.getPvpKills(), true));
#
+                       activeChar.getAppearance().setTitleColor(titleColor);
#
+               }
#
+               if(activeChar.getPkKills() > 0)
#
+               {
#
+                       int nameColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(activeChar.getPkKills(), false));
#
+                       activeChar.getAppearance().setNameColor(nameColor);

Link to comment
Share on other sites

  • 0

Replace that :

+               if(getPvpKills() > 0)
+               {
+                       int nameColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(getPvpKills(), true));
+                       getAppearance().setNameColor(nameColor);
+               }
#
+               if(getPkKills() > 0)
+               {
+                       int titleColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(getPkKills(), false));
+                       getAppearance().setTitleColor(titleColor);
+               }

 

for

 

+               if(getPvpKills() > 0)
+               {
+                       int nameColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(getPvpKills(), true));
+                       getAppearance().setTitleColor(titleColor);
+               }
#
+               if(getPkKills() > 0)
+               {
+                       int titleColor = Integer.decode("0x" + ColorNameManager.getInstance().getColor(getPkKills(), false));
+                       getAppearance().setNameColor(nameColor);
+               }

 

There are 2 times the same code, so copy paste twice.

 

If you fail... Just forget to develop. It's already very, very simple, and if you can't replace 4 lines alone, what will be next problem.

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
Answer this question...

×   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

    • ??? error   https://ibb.co/Srn4LsX
    • I also think this feature would bring more harm than good... another example is a dwarf rushing against your mobs so he takes priority, then he plays fake death and proceeds to grief the shit out of you. A minimum damage threshold is necessary, which would basically converge to what is the default feature (i.e. biggest damage dealer)
    • I bought the premium to watch the video and it's private. 😢
    • For some Majestic reason OP can't edit their topics anymore?    Let me update the potential offers, I got up to 2 spots to fill.   CONTACT TELEGRAM ONLY: https://t.me/asupport_g1     A credible team that SGuard represents is looking for java developers.    These positions is full time only i.e. your time is mostly dedicated within the team and team tasks, side gigs are fine, as long as you are able to combine your gig and main.  All necessary tools are provided.  The team is consistent with > 10 team members and the team is looking to expand to meet various goals. A decent Lineage 2 Essense OR Main (GOD) knowledge is needed.  Experience with l2r/l2p/l2s. mobius is fine too for referrence only. The team is friendly and goal oriented, very active and resourceful.   Requirements are standard, java knowledge is optional.  Multi language is a plus but not necessary (English/Russian), any is accepted.   Terms and conditions including compensation are reasonable and considered to be up for the industry standards. Details are negotiable with suitable candidates.   You will need to have a headset and a mic just for the initial processing, there're no team meetings or conferences after that. There's a small 30min interview process to demonstrate knowledge and just to meet each other.   The team has decided it is in their best interest to not publish their information at this time. Details will be available only for suitable candidates.   CONTACT TELEGRAM ONLY: https://t.me/asupport_g1
    • Thanks for the detailed info. I also have some ideas in mind but the execution may be hard. Thanks again!
  • Topics

×
×
  • Create New...