Jump to content

Recommended Posts

Posted
	public void setClan(Clan clan)
	{
		_clan = clan;
		setTitle("");
		
		if (clan == null)
		{
			_clanId = 0;
			_clanPrivileges = 0;
			_pledgeType = 0;
			_powerGrade = 0;
			_lvlJoinedAcademy = 0;
			_apprentice = 0;
			_sponsor = 0;
			return;
		}
		
		if (!clan.isMember(getName()))
		{
			// char has been kicked from clan
			setClan(null);
			return;
		}
		
		_clanId = clan.getClanId();
		
		// Add clan leader skills if clanleader
		addClanLeaderSkills(isClanLeader() && (clan.getLevel() >= 4));
	}

if i delete setTitle(""), will player be able to set title on their own again? please tell me

Posted
1 hour ago, Dramzes said:
	public void setClan(Clan clan)
	{
		_clan = clan;
		setTitle("");
		
		if (clan == null)
		{
			_clanId = 0;
			_clanPrivileges = 0;
			_pledgeType = 0;
			_powerGrade = 0;
			_lvlJoinedAcademy = 0;
			_apprentice = 0;
			_sponsor = 0;
			return;
		}
		
		if (!clan.isMember(getName()))
		{
			// char has been kicked from clan
			setClan(null);
			return;
		}
		
		_clanId = clan.getClanId();
		
		// Add clan leader skills if clanleader
		addClanLeaderSkills(isClanLeader() && (clan.getLevel() >= 4));
	}

if i delete setTitle(""), will player be able to set title on their own again? please tell me

Can, this code deletes the current title when joining a clan.

Posted
9 hours ago, Psygrammator said:

Can, this code deletes the current title when joining a clan.

ah, and how can i disable all titles to leave only pvp-pk title?

Posted
1 hour ago, Dramzes said:

i did add pvp pk title, but i can change my title, i want to disable players to change titles

So ... CharInfo and UserInfo packets sending the title info. Change inside this packets code to your conditions.
Some ideas: add a custom item to change the title (example id:4007). Or try to find any good dev to write the code for you. I guess its not more than 10 lines.

Posted

RequestGiveNickName() packet

 

find:

// Noblesse can bestow a title to themselves
        if (player.isNoble() && _name.matches(player.getName()))
        {
            player.setTitle(_title);
            player.sendPacket(SystemMessageId.TITLE_CHANGED);
            player.broadcastTitleInfo();
        }
        else
        {
            // Can the player change/give a title?
            if (!player.hasClanPrivileges(Clan.CP_CL_GIVE_TITLE))
            {
                player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
                return;
            }
            
            if (player.getClan().getLevel() < 3)
            {
                player.sendPacket(SystemMessageId.CLAN_LVL_3_NEEDED_TO_ENDOWE_TITLE);
                return;
            }
            
            final ClanMember member = player.getClan().getClanMember(_name);
            if (member != null)
            {
                final Player playerMember = member.getPlayerInstance();
                if (playerMember != null)
                {
                    playerMember.setTitle(_title);
                    
                    playerMember.sendPacket(SystemMessageId.TITLE_CHANGED);
                    if (player != playerMember)
                        player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_TITLE_CHANGED_TO_S2).addCharName(playerMember).addString(_title));
                    
                    playerMember.broadcastTitleInfo();
                }
                else
                    player.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
            }
            else
                player.sendPacket(SystemMessageId.TARGET_MUST_BE_IN_CLAN);
        }

 

and replace with

 

// Noblesse can bestow a title to themselves
        if (player.isNoble() && _name.matches(player.getName()))
        {
            player.sendMessage("Titles are disabled.");    
            return;
        }
        else
        {
            player.sendMessage("Titles are disabled.");    
            return;
        }

 

not tested but should work

 

 

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...