Jump to content

How To Change Color Of Party Member's Nickname ?


Recommended Posts

U can do it server side.

 

for(L2PcInstance p : player.getParty().getPartyMembers())

       p.setNameColor("#FF00FF");

 

Something like that i guess

Link to comment
Share on other sites

Thanks, that's nice to know. (It would be "#00FF00" for green though I think)

 

But It probably can be done client side, cant it ?

No. You can't add the name color by editing client side.

This is java side.

 

Also, you'll need to check the player on leave party. (Return the namecolor back to normal).

Link to comment
Share on other sites

It would be a lot harder to edit game client, this would require messing in Engine.dll

 

It is easier to make it in server core. What Solomun suggested will not work well, it will make party color to be seen by all players, not only by party members. If you are not into java, it will be hard to be done.

 

You need to:

- Check how CharInfo gets color of the nickname, it should have different method than UserInfo and any other call.

- CharInfo should provide PcInstance that is about to receive the color.

- Returned value should be different than original, if players are party members.

Link to comment
Share on other sites

It would be a lot harder to edit game client, this would require messing in Engine.dll

 

It is easier to make it in server core. What Solomun suggested will not work well, it will make party color to be seen by all players, not only by party members. If you are not into java, it will be hard to be done.

 

You need to:

- Check how CharInfo gets color of the nickname, it should have different method than UserInfo and any other call.

- CharInfo should provide PcInstance that is about to receive the color.

- Returned value should be different than original, if players are party members.

 

This is the second way i would suggest but i thought it would be the same. I can see the difference now :)

 

But this would need to refresh userInfo when a new party is created, right?

Link to comment
Share on other sites

No. When any user joins party, his UserInfo is sent to nearby players anyway. That broadcast is required to refresh relations.

Link to comment
Share on other sites

No. When any user joins party, his UserInfo is sent to nearby players anyway. That broadcast is required to refresh relations.

Ok i got it...Its just that im rusted since i didnt touch l2 coding for 4 years :)

Link to comment
Share on other sites

1 question

Setnamecolor(int)

but rgb colors have letters, when i set the int to String i get error

 

Edit:

What ive done:

private int afsd;
    private final int _PartyColorName = 0000;
if (_activeChar.isInParty() == true)
        {
            afsd = _activeChar.getAppearance().getNameColor();
            _activeChar.getAppearance().setNameColor(_PartyColorName);
        }
        else if (_activeChar.isInParty() == false)
        {
            _activeChar.getAppearance().setNameColor(afsd);
        }
Edited by ganjaradio
Link to comment
Share on other sites

 

1 question

Setnamecolor(int)

but rgb colors have letters, when i set the int to String i get error

 

Edit:

What ive done:

private int afsd;
    private final int _PartyColorName = 0000;
if (_activeChar.isInParty() == true)
        {
            afsd = _activeChar.getAppearance().getNameColor();
            _activeChar.getAppearance().setNameColor(_PartyColorName);
        }
        else if (_activeChar.isInParty() == false)
        {
            _activeChar.getAppearance().setNameColor(afsd);
        }
	private int _Color = 0xFFFF77;
	private int _PartyColorName = your color;
	
	activeChar.getAppearance().setNameColor(activeChar.isInParty() ? _PartyColorName : _Color);
Edited by melron
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.



×
×
  • Create New...