NazGhuL. Posted December 3, 2010 Posted December 3, 2010 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 =)
0 Tryskell Posted December 3, 2010 Posted December 3, 2010 Reverse getAppearance().setTitleColor(titleColor); for getAppearance().setNameColor(nameColor); and the contrary as well. x2, so 4 changes in all.
0 NazGhuL. Posted December 4, 2010 Author Posted December 4, 2010 Could you please correct it and post it? I always mess up the whole place :/
0 FighterBoss Posted December 4, 2010 Posted December 4, 2010 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);
0 Tryskell Posted December 4, 2010 Posted December 4, 2010 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.
Question
NazGhuL.
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 =)
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now