Ir para conteúdo
  • Cadastre-se

(Resolvido)Npc's


Ir para solução Resolvido por tetheuscunha,

Posts Recomendados

Bom dia galerinha tk.

Gostaria MT de fazer um pedido a vcs,

Tenho um servidor 8.6 fts 0.4

Queria que todos os player, comecasem com a vocation aluno.

No lvl 20 eles falam com um npc que libera para eles escolher entre 4 vocation.

No decorrer do game eles fazem uma Quest que no final tem mais um npc, que vai liberar a vocation para as 4 vocações inicial. Ou seja:

Todos comecao Alunos

Lvl 20 escolhem um classe 

Ex: lvl 100 ganhão uma promotion.

 

Alguém poderia me iluminar como posso estar fazendo isso? Dês de já um obrigado e um ótimo final de semana a todos

 

-#Edit

Editado por nelsoncoserjunior (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
1 minuto atrás, Jovim disse:

@nelsoncoserjunior Você quer isso pra account manager?

 

 

 

Então no momento estou usando ACC manager para testes e talls para ficar mais fácil e versatil, porém o projeto final e com site.

Link para o post
Compartilhar em outros sites

@nelsoncoserjunior Ta na mão então :)

 

em data/XML, abra o arquivo vocations.xml e substitua o conteúdo dele por este abaixo.

Citar

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <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>
    <vocation id="1" name="Student" description="a student" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1" attackable="no">
        <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>
    
    <!-- Classic's -->
    
    <vocation id="2" name="Sorcerer" description="a 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>
    <vocation id="3" name="Druid" description="a druid" 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="2">
        <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="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3">
        <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.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Knight" description="a knight" 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="4">
        <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>
    
    <!-- Master's -->
    
    <vocation id="6" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <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>
    <vocation id="7" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <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="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <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.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="30">
        <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>
    
    <!-- Epic's -->
    
    <vocation id="10" name="Epic Master Sorcerer" description="an epic master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50">
        <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>
    <vocation id="11" name="Epic Elder Druid" description="an epic elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50">
        <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="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Epic Royal Paladin" description="an epic royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50">
        <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.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="13" name="Epic Elite Knight" description="an epic elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="9" lessloss="50">
        <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>
</vocations>
 

Caso você tenha mais vocações tipo: Legendary Knight... posta seu vocations.xml ai que nóis da um geito de encaixar o aluno junto euheuehe

Link para o post
Compartilhar em outros sites
18 minutos atrás, Jovim disse:

@nelsoncoserjunior Ta na mão então :)

 

em data/XML, abra o arquivo vocations.xml e substitua o conteúdo dele por este abaixo.

Caso você tenha mais vocações tipo: Legendary Knight... posta seu vocations.xml ai que nóis da um geito de encaixar o aluno junto euheuehe

 

Vou te mandar certinho como será as calsse seria assim

 

Aluno inicial tanto no ACC manager quanto site só poderia escolher ele.

 

No lvl 20 ele escolheria uma casa

Aluno de grifinoria

Aluno de Sonserina

Aluno de cornival

Aluno de lufa lufa

 

E depois terá a Quest promotion onde cada um deles se tornaria 

 

Bruxo de Grifinoria

Bruxo de Sonserina 

Bruxo de cornival 

Bruxo de lufa lufa 

 

Seria só estás as vocation uque teria no servidor

 

 

Se possível vc poderia me fornecer os NPCs que fazem isso o que daria a primeira vocation e o que daria a promotion. Seria dois NPCs diferentes.

O primeiro daria as primeiras vocation no lvl 20. E não cobraria nada 

O segundo daria em QQ leves e sem custo tambem

 

Editado por nelsoncoserjunior (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@nelsoncoserjunior Não mexo com npc kk , vou postar seu tópico no discord pra alguém que sabe criar npc's te ajudar com isso. Mas ta ai suas vocations. Só substituir e ver se era assim que você queria, caso de erro só postar.

 

Citar

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <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>
    <vocation id="1" name="Student" description="a student" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1" attackable="no">
        <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>
    
    <!-- Student's -->
    
    <vocation id="2" name="Grifinoria" description="a grifinoria student" 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>
    <vocation id="3" name="Sonserina" description="a sonserina student" 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="2">
        <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="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Cornival" description="a cornival student" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3">
        <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.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Lufa Lufa" description="a lufa lufa student" 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="4">
        <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>
    
    <!-- Wizard's -->
    
    <vocation id="6" name="Grifinoria Wizard" description="a grifinorias wizard" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <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>
    <vocation id="7" name="Sonserina Wizard" description="a sonserina wizard" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <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="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Cornival Wizard" description="a cornival wizard" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <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.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Lufa Lufa Wizard" description="a lufa lufa wizard" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="30">
        <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>
</vocations>
 

 

Link para o post
Compartilhar em outros sites
2 horas atrás, Jovim disse:

@nelsoncoserjunior Não mexo com npc kk , vou postar seu tópico no discord pra alguém que sabe criar npc's te ajudar com isso. Mas ta ai suas vocations. Só substituir e ver se era assim que você queria, caso de erro só postar.

 

 

 

Muito top mesmo mais tarde irei estar testando elas obg mesmo!! De grande ajuda ja

Link para o post
Compartilhar em outros sites
  • Solução

 

Você pode usar o NPC Oracle.

use este vocations.xml

 

 

<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="1" name="Estudante" description="Estudante" needpremium="0" gaincap="5" gainhp="8" gainmana="5" gainhpticks="6" gainhpamount="10" gainmanaticks="6" gainmanaamount="10" manamultiplier="4.0" attackspeed="1600" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="2.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="2" name="Aluno de Grifinoria" description="a Aluno de Grifinoria" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="1350" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="3" name="Aluno de Sonserina" description="a Aluno de Sonserina" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="1350" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="4" name="Aluno de Corvinal" description="a Aluno de Corvinal" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2.5" gainhpamount="35" gainmanaticks="3" gainmanaamount="35" manamultiplier="1.4" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="4">
        <formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="5" name="Aluno de Lufa-Lufa" description="a Aluno de Lufa-Lufa" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="25" manamultiplier="3.0" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="5">
        <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    
    <!-- Promotion -->
    <vocation id="6" name="Bruxo de Grifinoria" description="a Bruxo de Grifinoria" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="7" name="Bruxo de Sonserina" description="an Bruxo de Sonserina" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="8" name="Bruxo de Corvinal" description="a Bruxo de Corvinal" needpremium="1" gaincap="20" gainhp="12" gainmana="18" gainhpticks="2.5" gainhpamount="40" gainmanaticks="2.5" gainmanaamount="50" manamultiplier="1.4" attackspeed="1700" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="9" name="Bruxo de Lufa-Lufa" description="an Bruxo de Lufa-Lufa" needpremium="1" gaincap="25" gainhp="20" gainmana="7" gainhpticks="2" gainhpamount="50" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="1700" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <!-- Segunda Promotion -->
    <vocation id="10" name="Animago" description="an Animago" needpremium="0" gaincap="10" gainhp="10" gainmana="35" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="6" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="11" name=" Maledictus" description="an  Maledictus" needpremium="0" gaincap="10" gainhp="10" gainmana="35" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="7" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="12" name="Bixo Papao" description="an Bixo Papao" needpremium="0" gaincap="20" gainhp="15" gainmana="20" gainhpticks="3" gainhpamount="60" gainmanaticks="3" gainmanaamount="60" manamultiplier="1.4" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="13" name="Lobisomen" description="an Lobisomen" needpremium="0" gaincap="25" gainhp="22" gainmana="8" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="9" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
        <vocation id="14" name="Albus Dumbledore" description="an Albus Dumbledore" needpremium="1" gaincap="25" gainhp="22" gainmana="8" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
</vocations>

 

data/npc/scripts/oracle.lua

- Tem que mudar o DESTINATION (onde o player vai ser transportado assim que virar aquela vocation) (TOWN e a cidade em que ele nasce)

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)             npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                     npcHandler:onThink()                    end

function oracle(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local cityNode = node:getParent():getParent()
    local vocNode = node:getParent()

    local destination = cityNode:getParameters().destination
    local town = cityNode:getParameters().town
    local vocation = vocNode:getParameters().vocation

    if(destination ~= nil and vocation ~= nil and town ~= nil) then
        if(getPlayerLevel(cid) < parameters.level) then
            npcHandler:say('You must first reach level ' .. parameters.level .. '!', cid)
            npcHandler:resetNpc()
        else
            if(getPlayerVocation(cid) > 1) then
                npcHandler:say('Sorry, You already have a vocation!')
                npcHandler:resetNpc()
            else
                doPlayerSetVocation(cid, vocation)
                doPlayerSetTown(cid, town)
                npcHandler:resetNpc()

                local tmp = getCreaturePosition(cid)
                doTeleportThing(cid, destination)
                doSendMagicEffect(tmp, CONST_ME_POFF)
                doSendMagicEffect(destination, CONST_ME_TELEPORT)
            end
        end
    end

    return true
end

function greetCallback(cid)
    if(getPlayerLevel(cid) < ? then
        npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
        return false
    else
        return true
    end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny? {yes} or {no}')

local yesNode = KeywordNode:new({'yes'}, oracle, {level = 8})
local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'})

local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce realmente quer virar um aluno? {sim}'})
    local node2 = node1:addChildKeyword({'sim'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=242, y=429, z=12}, text = 'So what vocation do you wish to become? {grifinoria}, {sonserina}, {corvinal} or {lufalufa}?'})
        local node3 = node2:addChildKeyword({'grifinoria'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'sonserina'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'corvinal'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'lufalufa'}, StdModule.say, {npcHandler = npcHandler, vocation = 5, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'})

npcHandler:addModule(FocusModule:new())

 

data/npc/The Oracle.xml

 


<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="oracle.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look typeex="1448" corpse="3128"/>
</npc>

 

Editado por tetheuscunha (veja o histórico de edições)

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
1 hora atrás, tetheuscunha disse:

 

Você pode usar o NPC Oracle.

use este vocations.xml

  Mostrar conteúdo oculto

 


<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="Estudante" description="Estudante" needpremium="0" gaincap="5" gainhp="8" gainmana="5" gainhpticks="6" gainhpamount="10" gainmanaticks="6" gainmanaamount="10" manamultiplier="4.0" attackspeed="1600" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="2.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="1" name="Aluno de Grifinoria" description="a Aluno de Grifinoria" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="1350" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="2" name="Aluno de Sonserina" description="a Aluno de Sonserina" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="1350" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="3" name="Aluno de Corvinal" description="a Aluno de Corvinal" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2.5" gainhpamount="35" gainmanaticks="3" gainmanaamount="35" manamultiplier="1.4" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="4" name="Aluno de Lufa-Lufa" description="a Aluno de Lufa-Lufa" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="25" manamultiplier="3.0" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="4">
        <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    
    <!-- Promotion -->
    <vocation id="5" name="Bruxo de Grifinoria" description="a Bruxo de Grifinoria" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="6" name="Bruxo de Sonserina" description="an Bruxo de Sonserina" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="7" name="Bruxo de Corvinal" description="a Bruxo de Corvinal" needpremium="1" gaincap="20" gainhp="12" gainmana="18" gainhpticks="2.5" gainhpamount="40" gainmanaticks="2.5" gainmanaamount="50" manamultiplier="1.4" attackspeed="1700" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="8" name="Bruxo de Lufa-Lufa" description="an Bruxo de Lufa-Lufa" needpremium="1" gaincap="25" gainhp="20" gainmana="7" gainhpticks="2" gainhpamount="50" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="1700" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <!-- Segunda Promotion -->
    <vocation id="9" name="Ordem Da Fenix" description="an Animago" needpremium="0" gaincap="10" gainhp="10" gainmana="35" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="5" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="10" name=" Maledictus" description="an  Maledictus" needpremium="0" gaincap="10" gainhp="10" gainmana="35" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="6" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="11" name="Bixo Papao" description="an Bixo Papao" needpremium="0" gaincap="20" gainhp="15" gainmana="20" gainhpticks="3" gainhpamount="60" gainmanaticks="3" gainmanaamount="60" manamultiplier="1.4" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="7" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="12" name="Lobisomen" description="an Lobisomen" needpremium="0" gaincap="25" gainhp="22" gainmana="8" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
        <vocation id="13" name="Albus Dumbledore" description="an Albus Dumbledore" needpremium="1" gaincap="25" gainhp="22" gainmana="8" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
</vocations>

 

data/npc/scripts/oracle.lua

- Tem que mudar o DESTINATION (onde o player vai ser transportado assim que virar aquela vocation) (TOWN e a cidade em que ele nasce)

  Mostrar conteúdo oculto

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)             npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                     npcHandler:onThink()                    end

function oracle(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local cityNode = node:getParent():getParent()
    local vocNode = node:getParent()

    local destination = cityNode:getParameters().destination
    local town = cityNode:getParameters().town
    local vocation = vocNode:getParameters().vocation

    if(destination ~= nil and vocation ~= nil and town ~= nil) then
        if(getPlayerLevel(cid) < parameters.level) then
            npcHandler:say('You must first reach level ' .. parameters.level .. '!', cid)
            npcHandler:resetNpc()
        else
            if(getPlayerVocation(cid) > 0) then
                npcHandler:say('Sorry, You already have a vocation!')
                npcHandler:resetNpc()
            else
                doPlayerSetVocation(cid, vocation)
                doPlayerSetTown(cid, town)
                npcHandler:resetNpc()

                local tmp = getCreaturePosition(cid)
                doTeleportThing(cid, destination)
                doSendMagicEffect(tmp, CONST_ME_POFF)
                doSendMagicEffect(destination, CONST_ME_TELEPORT)
            end
        end
    end

    return true
end

function greetCallback(cid)
    if(getPlayerLevel(cid) < 8 then
        npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
        return false
    else
        return true
    end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny?')

local yesNode = KeywordNode:new({'yes'}, oracle, {level = 8})
local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'})

local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce realmente quer virar um aluno? {'sim'}})
    local node2 = node1:addChildKeyword({'sim'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=242, y=429, z=12}, text = So what vocation do you wish to become? {grifinoria}, {sonserina}, {corvinal} or {lufa-lufa}?'})
        local node3 = node2:addChildKeyword({'grifinoria'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'sonserina'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'corvinal'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'lufa-lufa'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'})

npcHandler:addModule(FocusModule:new())

 

data/npc/The Oracle.xml

  Mostrar conteúdo oculto


<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="oracle.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look typeex="1448" corpse="3128"/>
</npc>

 

 

 

1 hora atrás, tetheuscunha disse:

 

Você pode usar o NPC Oracle.

use este vocations.xml

  Mostrar conteúdo oculto

 


<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="Estudante" description="Estudante" needpremium="0" gaincap="5" gainhp="8" gainmana="5" gainhpticks="6" gainhpamount="10" gainmanaticks="6" gainmanaamount="10" manamultiplier="4.0" attackspeed="1600" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="2.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="1" name="Aluno de Grifinoria" description="a Aluno de Grifinoria" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="1350" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="2" name="Aluno de Sonserina" description="a Aluno de Sonserina" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="15" gainmanaticks="2.5" gainmanaamount="45" manamultiplier="1.1" attackspeed="1350" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="3" name="Aluno de Corvinal" description="a Aluno de Corvinal" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2.5" gainhpamount="35" gainmanaticks="3" gainmanaamount="35" manamultiplier="1.4" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="4" name="Aluno de Lufa-Lufa" description="a Aluno de Lufa-Lufa" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="25" manamultiplier="3.0" attackspeed="1300" soulmax="100" gainsoulticks="120" fromvoc="4">
        <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    
    <!-- Promotion -->
    <vocation id="5" name="Bruxo de Grifinoria" description="a Bruxo de Grifinoria" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="6" name="Bruxo de Sonserina" description="an Bruxo de Sonserina" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="7" name="Bruxo de Corvinal" description="a Bruxo de Corvinal" needpremium="1" gaincap="20" gainhp="12" gainmana="18" gainhpticks="2.5" gainhpamount="40" gainmanaticks="2.5" gainmanaamount="50" manamultiplier="1.4" attackspeed="1700" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="8" name="Bruxo de Lufa-Lufa" description="an Bruxo de Lufa-Lufa" needpremium="1" gaincap="25" gainhp="20" gainmana="7" gainhpticks="2" gainhpamount="50" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="1700" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <!-- Segunda Promotion -->
    <vocation id="9" name="Ordem Da Fenix" description="an Animago" needpremium="0" gaincap="10" gainhp="10" gainmana="35" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="5" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="2.0"/>
        <skill id="2" multiplier="2.0"/>
        <skill id="3" multiplier="2.0"/>
        <skill id="4" multiplier="2.0"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="10" name=" Maledictus" description="an  Maledictus" needpremium="0" gaincap="10" gainhp="10" gainmana="35" gainhpticks="4" gainhpamount="40" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="6" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="2.0" magDamage="1.2" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.5"/>
        <skill id="1" multiplier="1.8"/>
        <skill id="2" multiplier="1.8"/>
        <skill id="3" multiplier="1.8"/>
        <skill id="4" multiplier="1.8"/>
        <skill id="5" multiplier="1.5"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="11" name="Bixo Papao" description="an Bixo Papao" needpremium="0" gaincap="20" gainhp="15" gainmana="20" gainhpticks="3" gainhpamount="60" gainmanaticks="3" gainmanaamount="60" manamultiplier="1.4" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="7" lessloss="30">
        <formula meleeDamage="1.1" distDamage="1.1" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.2"/>
        <skill id="1" multiplier="1.2"/>
        <skill id="2" multiplier="1.2"/>
        <skill id="3" multiplier="1.2"/>
        <skill id="4" multiplier="1.1"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
    <vocation id="12" name="Lobisomen" description="an Lobisomen" needpremium="0" gaincap="25" gainhp="22" gainmana="8" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
        <vocation id="13" name="Albus Dumbledore" description="an Albus Dumbledore" needpremium="1" gaincap="25" gainhp="22" gainmana="8" gainhpticks="8" gainhpamount="70" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="1700" soulmax="299" gainsoulticks="15" fromvoc="8" lessloss="30">
        <formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.1" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.1"/>
        <skill id="1" multiplier="1.1"/>
        <skill id="2" multiplier="1.1"/>
        <skill id="3" multiplier="1.1"/>
        <skill id="4" multiplier="1.4"/>
        <skill id="5" multiplier="1.1"/>
        <skill id="6" multiplier="1.1"/>
    </vocation>
</vocations>

 

data/npc/scripts/oracle.lua

- Tem que mudar o DESTINATION (onde o player vai ser transportado assim que virar aquela vocation) (TOWN e a cidade em que ele nasce)

  Mostrar conteúdo oculto

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)             npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                     npcHandler:onThink()                    end

function oracle(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local cityNode = node:getParent():getParent()
    local vocNode = node:getParent()

    local destination = cityNode:getParameters().destination
    local town = cityNode:getParameters().town
    local vocation = vocNode:getParameters().vocation

    if(destination ~= nil and vocation ~= nil and town ~= nil) then
        if(getPlayerLevel(cid) < parameters.level) then
            npcHandler:say('You must first reach level ' .. parameters.level .. '!', cid)
            npcHandler:resetNpc()
        else
            if(getPlayerVocation(cid) > 0) then
                npcHandler:say('Sorry, You already have a vocation!')
                npcHandler:resetNpc()
            else
                doPlayerSetVocation(cid, vocation)
                doPlayerSetTown(cid, town)
                npcHandler:resetNpc()

                local tmp = getCreaturePosition(cid)
                doTeleportThing(cid, destination)
                doSendMagicEffect(tmp, CONST_ME_POFF)
                doSendMagicEffect(destination, CONST_ME_TELEPORT)
            end
        end
    end

    return true
end

function greetCallback(cid)
    if(getPlayerLevel(cid) < 8 then
        npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
        return false
    else
        return true
    end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny?')

local yesNode = KeywordNode:new({'yes'}, oracle, {level = 8})
local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'})

local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce realmente quer virar um aluno? {'sim'}})
    local node2 = node1:addChildKeyword({'sim'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=242, y=429, z=12}, text = So what vocation do you wish to become? {grifinoria}, {sonserina}, {corvinal} or {lufa-lufa}?'})
        local node3 = node2:addChildKeyword({'grifinoria'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'sonserina'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'corvinal'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'lufa-lufa'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'})

npcHandler:addModule(FocusModule:new())

 

data/npc/The Oracle.xml

  Mostrar conteúdo oculto


<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="oracle.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look typeex="1448" corpse="3128"/>
</npc>

 

 

Muito obrigado pelo NPC hj estarei testando eles, será de grande ajuda obg mesmo pelo apoio.

5 horas atrás, nelsoncoserjunior disse:

 

Muito obrigado pelo NPC hj estarei testando eles, será de grande ajuda obg mesmo pelo apoio.

 

Galera testei ambos os xml vocation, e ambos deu um erro de ip vocation 14 not fond como resolver isso

Link para o post
Compartilhar em outros sites

@nelsoncoserjunior Sobre o vocations.xml, o meu ta rodando certinho. Mas posta uma imagem do erro ai, se possível.

 

Agora cara, sobre os npc's, eu vou deixar um aqui q eu tava testando, mas não manjo mt deles n :)

 

Em data/npc, crie um arquivo.xml com o nome que desejar e coloque o xml abaixo dentro.

Citar

<?xml version="1.0" encoding="UTF-8"?>
<npc name="NOME DO NPC" script="SEU ARQUIVO.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="100" max="100"/>
<look type="368" head="19" body="113" legs="95" feet="115" addons="0"/>
  <parameters>
    <parameter key="message_greet" value="Ola |PLAYERNAME|. Entao voce quer escolher sua primeira {classe}?" />
  </parameters>
</npc>

Em data/npc/scripts, crie um arquivo .lua com o nome que desejar e coloque o código abaixo dentro.

Citar

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
 return false
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

local t = {

    student = 1,
    grifinoria = 2,
    sonserina = 3,
    cornival = 4,
    lufa_lufa = 5
}

if msgcontains(msg, "classe") then
if getPlayerLevel(cid) < 20 then
selfSay("Voce precisa ser level 20+ para escolher uma classe.", cid)
else
if getPlayerVocation(cid) == t.student then
selfSay("Muito bem, escolha uma classe: {grifinoria}, {sonserina}, {cornival}, {lufa lufa}.", cid)
talkState[talkUser] = 1
else
selfSay("Voce ja possui uma classe.", cid)
end
end
end

if talkState[talkUser] == 1 and msgcontains(msg, "grifinoria") then
    selfSay("Agora voce e um aluno de Grifinoria.", cid)
    doPlayerSetVocation(cid, t.grifinoria)
end
if talkState[talkUser] == 1 and msgcontains(msg, "sonserina") then
    selfSay("Agora voce e um aluno de Sonserina.", cid)
    doPlayerSetVocation(cid, t.sonserina)
end
if talkState[talkUser] == 1 and msgcontains(msg, "cornival") then
    selfSay("Agora voce e um aluno de Cornival.", cid)
    doPlayerSetVocation(cid, t.cornival)
end
if talkState[talkUser] == 1 and msgcontains(msg, "lufa lufa") then
    selfSay("Agora voce e um aluno de Lufa Lufa.", cid)
    doPlayerSetVocation(cid, t.lufa_lufa)
end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Testa ae vai q funfa kk

Link para o post
Compartilhar em outros sites
13 horas atrás, nelsoncoserjunior disse:

 

Muito obrigado pelo NPC hj estarei testando eles, será de grande ajuda obg mesmo pelo apoio.

Galera testei ambos os xml vocation, e ambos deu um erro de ip vocation 14 not fond como resolver isso

 

Posta o erro que aparece na distro por gentileza. Mas me parece e que algum char teu, tem a vocation 14. Por isso aparece que a vocation 14 not found, da uma revisada nos teus chares pra ser se não esta com a vocation 14.

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
4 horas atrás, Jovim disse:

@nelsoncoserjunior Sobre o vocations.xml, o meu ta rodando certinho. Mas posta uma imagem do erro ai, se possível.

 

Agora cara, sobre os npc's, eu vou deixar um aqui q eu tava testando, mas não manjo mt deles n :)

 

Em data/npc, crie um arquivo.xml com o nome que desejar e coloque o xml abaixo dentro.

Em data/npc/scripts, crie um arquivo .lua com o nome que desejar e coloque o código abaixo dentro.

Testa ae vai q funfa kk

 

Poh vou testar essa tô desesperado para arrumar esse NPC testei vários até abri outro tópico específico para ele pois nem um funcionou irei testar estarei avisando 

3 horas atrás, tetheuscunha disse:

Posta o erro que aparece na distro por gentileza. Mas me parece e que algum char teu, tem a vocation 14. Por isso aparece que a vocation 14 not found, da uma revisada nos teus chares pra ser se não esta com a vocation 14.

 

A questão das vocation tive que refazer elas realmente tinha uma 13 e um 14 e se tirar elas da erro então não pode mexer nelas 

Link para o post
Compartilhar em outros sites
2 minutos atrás, nelsoncoserjunior disse:

Poh vou testar essa tô desesperado para arrumar esse NPC testei vários até abri outro tópico específico para ele pois nem um funcionou irei testar estarei avisando 

A questão das vocation tive que refazer elas realmente tinha uma 13 e um 14 e se tirar elas da erro então não pode mexer nelas 

 

O Npc que eu lhe mandei não esta funcionando não? Eu estou utilizando ele no meu server.

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
1 minuto atrás, tetheuscunha disse:

O Npc que eu lhe mandei não esta funcionando não? Eu estou utilizando ele no meu server.

 

Não configurei ele tudo certo, ele tinha 2 erros de parâmetros que levei 3h para achar kkkkkk. Aí consegui sumonar o NPC porém ao falar com ele, o mesmo não responde nada

Link para o post
Compartilhar em outros sites
Agora, nelsoncoserjunior disse:

Não configurei ele tudo certo, ele tinha 2 erros de parâmetros que levei 3h para achar kkkkkk. Aí consegui sumonar o NPC porém ao falar com ele, o mesmo não responde nada

 

Me manda a foto dos erros pra mim da uma olhada. Quando fala com ele aparece algum erro na distro?

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
1 minuto atrás, tetheuscunha disse:

Me manda a foto dos erros pra mim da uma olhada. Quando fala com ele aparece algum erro na distro?

 

Não aparece nada, simplesmente ele não responde nada aí testei com outros XML bem doido tentei de tudo aí com uma lá ele até funciono falo certinho mais quando fala yes para escolher a vocation ele não dá a vocation

Link para o post
Compartilhar em outros sites

O char tem que estar com a vocation 0

Tenta esse 

 

 


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)             npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                     npcHandler:onThink()                    end

function oracle(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local cityNode = node:getParent():getParent()
    local vocNode = node:getParent()

    local destination = cityNode:getParameters().destination
    local town = cityNode:getParameters().town
    local vocation = vocNode:getParameters().vocation

    if(destination ~= nil and vocation ~= nil and town ~= nil) then
        if(getPlayerLevel(cid) < parameters.level) then
            npcHandler:say('You must first reach level ' .. parameters.level .. '!', cid)
            npcHandler:resetNpc()
        else
            if(getPlayerVocation(cid) > 0) then
                npcHandler:say('Sorry, You already have a vocation!')
                npcHandler:resetNpc()
            else
                doPlayerSetVocation(cid, vocation)
                doPlayerSetTown(cid, town)
                npcHandler:resetNpc()

                local tmp = getCreaturePosition(cid)
                doTeleportThing(cid, destination)
                doSendMagicEffect(tmp, CONST_ME_POFF)
                doSendMagicEffect(destination, CONST_ME_TELEPORT)
            end
        end
    end

    return true
end

function greetCallback(cid)
    if(getPlayerLevel(cid) < ? then
        npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
        return false
    else
        return true
    end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Are you prepared to face your destiny? {yes} or {no}')

local yesNode = KeywordNode:new({'yes'}, oracle, {level = 8})
local noNode = KeywordNode:new({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then what vocation do you want to become?'})

local node1 = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce realmente quer virar um aluno? {sim}'})
    local node2 = node1:addChildKeyword({'sim'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, town = 1, destination = {x=242, y=429, z=12}, text = 'So what vocation do you wish to become? {grifinoria}, {sonserina}, {corvinal} or {lufalufa}?'})
        local node3 = node2:addChildKeyword({'grifinoria'}, StdModule.say, {npcHandler = npcHandler, vocation = 1, onlyFocus = true, text = 'So, you wish to be a powerful magician? Are you sure about that? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'sonserina'}, StdModule.say, {npcHandler = npcHandler, vocation = 2, onlyFocus = true, text = 'Are you sure that a druid is what you wish to become? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'corvinal'}, StdModule.say, {npcHandler = npcHandler, vocation = 3, onlyFocus = true, text = 'A ranged marksman. Are you sure? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
        node3 = node2:addChildKeyword({'lufalufa'}, StdModule.say, {npcHandler = npcHandler, vocation = 4, onlyFocus = true, text = 'A mighty warrior. Is that your final decision? This decision is irreversible!'})
            node3:addChildKeywordNode(yesNode)
            node3:addChildKeywordNode(noNode)
keywordHandler:addKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then come back when you are ready.'})

npcHandler:addModule(FocusModule:new())
 

 

Editado por tetheuscunha (veja o histórico de edições)

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
5 horas atrás, Jovim disse:

@nelsoncoserjunior Sobre o vocations.xml, o meu ta rodando certinho. Mas posta uma imagem do erro ai, se possível.

 

Agora cara, sobre os npc's, eu vou deixar um aqui q eu tava testando, mas não manjo mt deles n :)

 

Em data/npc, crie um arquivo.xml com o nome que desejar e coloque o xml abaixo dentro.

Em data/npc/scripts, crie um arquivo .lua com o nome que desejar e coloque o código abaixo dentro.

Testa ae vai q funfa kk

 

ta funcionado esse amigo pore quando desloga nao salva a classe

13 minutos atrás, tetheuscunha disse:

O char tem que estar com a vocation 0

Tenta esse 

nao entendi isso como assim

 

testei o script do amigo la em cima porem nao esta salvando as classes o npc da a classe porem quando reloga elas nao sao salvas

Link para o post
Compartilhar em outros sites
2 minutos atrás, nelsoncoserjunior disse:

ta funcionado esse amigo pore quando desloga nao salva a classe

nao entendi isso como assim

 

testei o script do amigo la em cima porem nao esta salvando as classes o npc da a classe porem quando reloga elas nao sao salvas

 

Vai no SQLITE e colocar a vocation do Player = 0, e testar o meu npc.

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo