sinceramente, não entendi nada do que você quis dizer, tente se explicar melhor.
Abç!
info
Grupo: Herói
Registrado: 12/03/11
Posts: 1.9k
Reputação: +284
Gênero: Masculino
Char no Tibia: Nokte

sinceramente, não entendi nada do que você quis dizer, tente se explicar melhor.
Abç!
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();
}
Você precisa editar várias funções nas sources.
Creio que você teria que editar a função que passei acima e editar estes em vocation.h
const std::string& getDescription() const {return description;}
void setDescription(const std::string& v) {description = v;}
Aconselho criar dois const, um para cada sexo.
E então editar essa parte da Player::getDescription
{
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();
}
Por exemplo:
{
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 " << (sex % 2 ? vocation->getMaleDescription() : vocation->getFemaleDescription);
else
s << " has no vocation";
s << getSpecialDescription();
}
Enfim isso é só um rascunho.
Um grande abraço.
Editado Junho 28 por Oneshot
info
Grupo: Campones
Registrado: 06/01/12
Posts: 3
Reputação: 0
Char no Tibia: Abarel

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(); }Você precisa editar várias funções nas sources. Creio que você teria que editar a função que passei acima e editar estes em vocation.h
const std::string& getDescription() const {return description;} void setDescription(const std::string& v) {description = v;}Aconselho criar dois const, um para cada sexo. E então editar essa parte da Player::getDescription
{ 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(); }Por exemplo:
{ 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 " << (sex % 2 ? vocation->getMaleDescription() : vocation->getFemaleDescription); else s << " has no vocation"; s << getSpecialDescription(); }Enfim isso é só um rascunho. Um grande abraço.
Dá para passar a coisa toda cara? Tipo coloca os negocios dereitinho aí e teste pra ver se dar certo...
Qualquer coisa responde aí... Vê se coloca os scripts nas sources direitinho...
Obrigado, Cara!
info
Grupo: Campones
Registrado: 06/01/12
Posts: 3
Reputação: 0
Char no Tibia: Abarel
Gender Vocation e NPC Dúvida!
Olha, eu já tentei mexer na sources só que não dá certo, eu quero abrir vocations.xml parecido com outfits.xml. Tipo... Ter vocação mago e maga na mesma vocationID, igual no oufits.xml:
e as vocations desse estilo:
e também um método para que quando o npc estiver falando com um jogador ou uma jogadora, ele check e use a palava adequada(ex: aventureiro, aventureira).
Já tentei mexer nas sources só que ta dando erro pra compilar, (tem que ficar nesse padrão do outfits.xml) alguem sabe o código correto para isso?