Ir para conteúdo

Opção "manager" No Vocations.xml


Posts Recomendados

Nome: bool manager

Tipo: C++

Autor: Oneshot

 


 

Oioioi, como vai?

 

Vi um pedido interessante no seção de suporte, que consistia em fazer um jeito de vocações que não são promotions de outras não aparecerem nas opções do Account Manager.

 

Ou seja são vocações iniciais mas você pode ter a livre opção de bloquear a escolha da vocação no Account Manager pelo jogador.

 


 

Em vocations.h, procure por:

 

bool attackable, needPremium;

 

Substitua:

 

bool attackable, needPremium, manager;

 

Procure por:

 

bool isPremiumNeeded() const {return needPremium;}
void setNeedPremium(bool v) {needPremium = v;}

 

Adicione logo abaixo:

 


bool isManagerOption() const {return manager;}
void setAsManagerOption(bool v) {manager = v;}

 

Agora em vocations.cpp, procure por:

 


if(readXMLString(p, "needpremium", strValue))
voc->setNeedPremium(booleanString(strValue));

 

Logo abaixo adicione:

 


if(readXMLString(p, "accountmanager", strValue) || readXMLString(p, "manager", strValue))
voc->setAsManagerOption(booleanString(strValue));

 

Procure por:

 

needPremium = false;

 

Adicione logo abaixo:

 

manager = true;

 

E finalmente em player.cpp, procure por:

 

if(it->first == it->second->getFromVocation() && it->first != 0)

 

Substitua por:

 

if(it->first == it->second->getFromVocation() && it->first != 0 && it->second->isManagerOption() == true)

 

Logo abaixo, procure por:

 

if(checkText(text, tmp) && it != Vocations::getInstance()->getLastVocation() && it->first == it->second->getFromVocation() && it->first != 0)

 

Substitua por:

 

if(checkText(text, tmp) && it != Vocations::getInstance()->getLastVocation() && it->first == it->second->getFromVocation() && it->first != 0 && it->second->isManagerOption() == true)

 

Compile e teste.

 


 

O modo de uso é bem simples, no seu vocations.xml, escolha a vocação que você quer ou não quer que apareça no Account Manager:

 


<vocation id="9" name="Fighter" description="a fighter" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="9">
	<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.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>

 

E adicione a opção manager com valor 0 ou 1, para não aparecer e aparecer, respectivamente:

 


<vocation id="9" name="Fighter" description="a fighter" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="9" manager="0">
	<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.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>

 

Assim a vocação não poderá ser selecionada pelo Account Manager.

 


 

Um grande abraço.

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

Valeuzão ai Oneshot :)

 

Vou testar aqui e já edito.

 

Mas nessa parte

 

Em vocations.h, procure por:

 

 

bool attackable, needPremium;

 

 

Adicione:

 

 

bool attackable, needPremium, manager;

 

 

Você não quis dizer "Substitua", ao invés de "Adicione"?

 

~~ Edit ~~

 

There is a bug.

22:46 Account Manager: Should your character be a 'male' or a 'female'.
22:46 Account Manager: A male, are you sure?
22:46 Account Manager: 

 

~~ Edit 2 ~~

 

Erro meu. Esqueci de colocar manager="1" nas vocations iniciais. Dica, especifica que tem que adicionar em todas as vocations iniciais o manager="0" ou manager="1".

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

Certo, vou editar isso e na verdade eu esqueci de um passo no vocations.cpp que faz com que não seja preciso colocar manager="1" em todas as vocações inicias.

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 months later...

Desculpa reviver o tópico, é que o sistema n funfo no meu server, e o Oneshot n está aceitando mensagens novas então...

 

Bom.. o problema é que quando eu coloco o 1 ou o 0, n adianta nada, eles aparesem do mesmo jeito no account manager.

 

Vocation.xml

 


<?xml version="1.0" encoding="UTF-8"?>
<vocations>
   <vocation id="0" name="None" description="a None" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="65" gainmanaticks="4" gainmanaamount="60" manamultiplier="1.4" attackspeed="500" soulmax="5" gainsoulticks="120" fromvoc="0">
       <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.1" club="1.1" sword="1.1" axe="1.1" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
   </vocation>
   <vocation id="1" name="Estudante" description="Estudande Ninja" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="1" manager="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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="2" name="Naruto" description="Naruto Uzumaki" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="2" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="3" name="Sasuke" description="Sasuke Uchiha" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="3" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="4" name="Sakura" description="Sakura Haruno" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="4" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="5" name="Shikamaru" description="Shikamaru Nara" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="5" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="6" name="Chouji" description="Chouji Akimichi" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="6" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="7" name="Ino" description="Ino Yamanaka" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="7" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="8" name="Kiba" description="Kiba Inuzuka" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="8" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="9" name="Shino" description="Shino Aburame" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="9" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="10" name="Hinata" description="Hinata Hyuuga" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="10" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="11" name="Neji" description="Neji Hyuuga" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="11" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="12" name="Lee" description="Rock Lee" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="12" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="13" name="Tenten" description="Tenten" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="13" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="14" name="Gaara" description="Gaara" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="14" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="15" name="Kankuro" description="Kankuro" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="15" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
   <vocation id="16" name="Temari" description="Temari" needpremium="0" gaincap="20" gainhp="20" gainmana="20" gainhpticks="5" gainhpamount="50" gainmanaticks="5" gainmanaamount="50" manamultiplier="1.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="16" manager="0">
       <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.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="1.0" experience="1.0"/>
   </vocation>
</vocations>

 

Server usado: The Forgotten Server, version 0.3.6 (Crying Damson)

Compilado com: Compiled with GNU C++ version 4.4.0 at Aug 12 2012, 20:55:56.

 

PS: Não da erro nenhum no console e n deu erro nenhum quando coloquei e compilei o server.

 

PORFAVOR AJUDA , VALENDO +REP

Link para o comentário
Compartilhar em outros sites

OPA' irmão conseguir arruma o sistema aqui, é que eu tinha esquecido de coloca umas das linhas mencionadas acima, mais vlw por ter respondido happy.png

 

Abraços Flaah, +REP pelo sistema mdr.gif

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...