• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved The look description of players.

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
solved. So basically: You see Cornwallis. He is a level 1 druid. He is Pwner of Everyone. He is the husband of Selena Gomez. <--- I'd tap.(: and if you look at yourself: You see yourself. You are a level 1 druid. You are Pwner of Everyone. You are the husband of Selena Gomez.
PHP:
std::string Player::getDescription(int32_t lookDistance) const
{
	std::stringstream s;
	if(lookDistance == -1)
	{
		s << "yourself.";
		if(hasCustomFlag(PlayerCustomFlag_DescriptionGroupInsteadVocation))
			s << " You are " << groupName;
		else if(vocation_id != 0)
			s << " You are a level " << level << " " << vocation->getVocDescription();
		else
			s << " You have no vocation";
	}
	else
	{
		s << nameDescription << ".";
		if(sex == PLAYERSEX_FEMALE)
			s << " She";
		else
			s << " He";
		if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
			s << " is a level " << level << " ";
		if(hasCustomFlag(PlayerCustomFlag_DescriptionGroupInsteadVocation))
			s << groupName;
		else if(vocation_id != 0)
			s << vocation->getVocDescription();
		else
			s << " and has no vocation";
	}

	std::string tmp;
	if(IOLoginData::getInstance()->getNameByGuid(marriage, tmp))
	{
		s << ", ";
		if(vocation_id == 0)
		{
			if(lookDistance == -1)
				s << "and you are";
			else
				s << "and is";

			s << " ";
		}

		if(sex == PLAYERSEX_FEMALE)
			s << "wife";
		else
			s << "husband";

		s << " of " << tmp;
	}

	s << ".";
	if(guildId)
	{
		if(lookDistance == -1)
			s << " You are ";
		else
		{
			if(sex == PLAYERSEX_FEMALE)
				s << " She is ";
			else
				s << " He is ";
		}

		if(guildRank.length())
			s << guildRank;
		else
			s << "a member";

		s << " of " << guildName;
		if(guildNick.length())
			s << " (" << guildNick << ")";

		s << ".";
	}

	return s.str();
}

BTW, in order for this to be proper looking, you must take out all the "an's, and and's" in voc description in vocation.xml
 
Last edited:

Similar threads

Back
Top