Ir para conteúdo
  • 0

Gender Vocation


Magren

Pergunta

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:

 

[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]
[left]<outfit id="1">
	<list gender="0" lookType="136" name="Citizen"/>
	<list gender="1" lookType="128" name="Citizen"/>
</outfit>[/left]

[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]

 



 

 

e as vocations desse estilo:

 

[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]
[left]<vocation id="1">
<list gender="0" name="Sorcerer" description="um sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
	<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
<list gender="1" name="Sorcerer" description="uma sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
	<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>[/left]

[/size][/font]
[font=Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif][size=3]

 

 

 

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?

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

std::string Player::getDescription(int32_t lookDistance) const
{
std::stringstream s;
if(lookDistance == -1)
{
	s &lt;&lt; "yourself.";
	if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
		s &lt;&lt; " You are " &lt;&lt; group-&gt;getName();
	else if(vocationId != 0)
		s &lt;&lt; " You are " &lt;&lt; vocation-&gt;getDescription();
	else
		s &lt;&lt; " You have no vocation";
}
else
{
	s &lt;&lt; nameDescription;
	if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
		s &lt;&lt; " (Level " &lt;&lt; level &lt;&lt; ")";

	s &lt;&lt; ". " &lt;&lt; (sex % 2 ? "He" : "She");
	if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
		s &lt;&lt; " is " &lt;&lt; group-&gt;getName();
	else if(vocationId != 0)
		s &lt;&lt; " is " &lt;&lt; vocation-&gt;getDescription();
	else
		s &lt;&lt; " has no vocation";

	s &lt;&lt; getSpecialDescription();
}

std::string tmp;
if(marriage &amp;&amp; IOLoginData::getInstance()-&gt;getNameByGuid(marriage, tmp))
{
	s &lt;&lt; ", ";
	if(vocationId == 0)
	{
		if(lookDistance == -1)
			s &lt;&lt; "and you are";
		else
			s &lt;&lt; "and is";

		s &lt;&lt; " ";
	}

	s &lt;&lt; (sex % 2 ? "husband" : "wife") &lt;&lt; " of " &lt;&lt; tmp;
}

s &lt;&lt; ".";
if(guildId)
{
	if(lookDistance == -1)
		s &lt;&lt; " You are ";
	else
		s &lt;&lt; " " &lt;&lt; (sex % 2 ? "He" : "She") &lt;&lt; " is ";

	s &lt;&lt; (rankName.empty() ? "a member" : rankName)&lt;&lt; " of the " &lt;&lt; guildName;
	if(!guildNick.empty())
		s &lt;&lt; " (" &lt;&lt; guildNick &lt;&lt; ")";

	s &lt;&lt; ".";
}

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&amp; getDescription() const {return description;}
void setDescription(const std::string&amp; v) {description = v;}

 

Aconselho criar dois const, um para cada sexo.

 

E então editar essa parte da Player::getDescription

 

{
	s &lt;&lt; nameDescription;
	if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
		s &lt;&lt; " (Level " &lt;&lt; level &lt;&lt; ")";

	s &lt;&lt; ". " &lt;&lt; (sex % 2 ? "He" : "She");
	if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
		s &lt;&lt; " is " &lt;&lt; group-&gt;getName();
	else if(vocationId != 0)
		s &lt;&lt; " is " &lt;&lt; vocation-&gt;getDescription();
	else
		s &lt;&lt; " has no vocation";

	s &lt;&lt; getSpecialDescription();
}

 

Por exemplo:

 

{
	s &lt;&lt; nameDescription;
	if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
		s &lt;&lt; " (Level " &lt;&lt; level &lt;&lt; ")";

	s &lt;&lt; ". " &lt;&lt; (sex % 2 ? "He" : "She");
	if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
		s &lt;&lt; " is " &lt;&lt; group-&gt;getName();
	else if(vocationId != 0)
		s &lt;&lt; " is " &lt;&lt; (sex % 2 ? vocation-&gt;getMaleDescription() : vocation-&gt;getFemaleDescription);
	else
		s &lt;&lt; " has no vocation";

	s &lt;&lt; getSpecialDescription();
}

 

Enfim isso é só um rascunho.

 

Um grande abraço.

Editado por Oneshot
Link para o comentário
Compartilhar em outros sites

  • 0
 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!

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...