std::string Player::getDescription(int32_t lookDistance) const
{
std::stringstream s;
if(lookDistance == -1)
{
s << "yourself.";
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
s << " You are " << group->getName();
else if(vocationId != 0)
s << " You are " << vocation->getDescription();
else
s << " You have no vocation";
}
else
{
s << nameDescription;
if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
s << " (Level " << level << ")";
s << ". " << (sex % 2 ? "He" : "She");
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
s << " is " << group->getName();
else if(vocationId != 0)
s << " is " << vocation->getDescription();
else
s << " has no vocation";
s << getSpecialDescription();
}
std::string tmp;
if(marriage && IOLoginData::getInstance()->getNameByGuid(marriage, tmp))
{
s << ", ";
if(vocationId == 0)
{
if(lookDistance == -1)
s << "and you are";
else
s << "and is";
s << " ";
}
s << (sex % 2 ? "husband" : "wife") << " of " << tmp;
}
s << ".";
if(guildId)
{
if(lookDistance == -1)
s << " You are ";
else
s << " " << (sex % 2 ? "He" : "She") << " is ";
s << (rankName.empty() ? "a member" : rankName)<< " of the " << guildName;
if(!guildNick.empty())
s << " (" << guildNick << ")";
s << ".";
}
return s.str();
}