Ir para conteúdo

Featured Replies

Postado

boa noite, galera meu ot tem 5 quest, ai eu estou querendo em cada quest coloca um npc no final dela, ai a primeira quest o cara faz a quest e ganha uma vocação nova, exemplo super knight, se eel for kina, super paladin e etc, e na segunda quest outro npc q da vocação, aí for super knight, ele vira hiper knight e por aí vai, ate a 5 quest, cada quest ele vira uma vocação nova, alguém poderia fazer pra mim ?? obrigado

Resolvido por Bolletox

Ir para solução
  • Respostas 14
  • Visualizações 506
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @BilauX Tenta esse <?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="10" gainhp="5" gainmana="5" gainhpti

  • @BilauX    Vamos lá:   1° Passo: Vá na pasta data/npc e crie os 5 npcs: EX do npc que vai dar a Promotion Super   Explicação: Em Verde vai ser o Nome do Npc.

  • como fazer, quando o cara vira a nova vocação enviar uma msg verde pro servidor todo ?? nem testei mais vou da rep, qualquer coia se funfa venho e marco melhor resposta... @Bolletox    

Postado

@BilauX 

 

Vamos lá:

 

1° Passo: Vá na pasta data/npc e crie os 5 npcs:

EX do npc que vai dar a Promotion Super

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Super Vocation" script="data/npc/scripts/vocations.lua" walkinterval="2000" floorchange="0">
    <health now="150" max="150"/>
    <look type="141" head="222" body="278" legs="85" feet="85" addons="2"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Ola |PLAYERNAME|. Eu posso promover para uma nova vocacao diga {super promote}."/>
    </parameters>
</npc>

 

Explicação:

Em Verde vai ser o Nome do Npc.

Em Azul vai ser a palavra-chave que o player vai ter que dizer (Se voce alterar aqui terá que alterar no Script lá).

 

2° Passo: Depois de Criado os 5 NPC's vá para a pasta data/XML e abra o vocations.xml:

Aqui voce tera que criar as 5 promotions vou deixar um exemplo.

Spoiler

<vocation id="9" name="Super Sorcerer" description="a Super Sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="9" 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="10" name="Super Druid" description="an Super Druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="10" 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="11" name="Super Paladin" description="a Super Paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="11" 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="12" name="Super Knight" description="an Super Knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="50" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="12" 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>

 

Explicando:

Em Roxo será os ID's das vocações em ordem crescente. Veja qual é o ID da ultima vocação do seu server e vá seguindo em ordem (1,2,3,4,5,6,7,8..).

Em Vermelho você coloca o mesmo ID da vocação. Ex O Super Paladin tem o ID 11 então o fromvoc será o ID 11 também.

Em Laranja será o nome que ira aparecer quando o player der Look.

O resto é meio que auto explicativo o que faz. Se nao souber da uma pesquisada no forum.

 

3° Passo

Depois de criar os NPC's e as vocações vai na pasta data/npc/scripts e crie um arquivo chamado vocations.lua e cole isso dentro.

Spoiler

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

local vocStage1 = {   

--[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}
--EX: [99] = {promo = 102}
    [1] = {prom = 9},
    [2] = {prom = 10},
    [3] = {prom = 11},
    [4] = {prom = 12},
          
}

local vocStage2 = {
    
    [9] = {prom = 13},
    [10] = {prom = 14},
    [11] = {prom = 15},
    [12] = {prom = 16},

}

local vocStage3 = {
    
    [13] = {prom = 17},
    [14] = {prom = 18},
    [15] = {prom = 19},
    [16] = {prom = 20},

}

local vocStage4 = {
    
    [17] = {prom = 21},
    [18] = {prom = 22},
    [19] = {prom = 23},
    [20] = {prom = 24},

}

local vocStage5 = {
    
    [21] = {prom = 25},
    [22] = {prom = 26},
    [23] = {prom = 27},
    [24] = {prom = 28},

}

function vocationStage1(cid, message, keywords, parameters, node)

        if vocStage1[getPlayerVocation(cid)] ~= vocStage1[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage1[getPlayerVocation(cid)].prom)
            selfSay("Voce foi promovido para a classe Super de Promotion!", cid)
            doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage2(cid, message, keywords, parameters, node)

        if vocStage2[getPlayerVocation(cid)] ~= vocStage2[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage2[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Hyper de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage3(cid, message, keywords, parameters, node)

        if vocStage3[getPlayerVocation(cid)] ~= vocStage3[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage3[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Stronger de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage4(cid, message, keywords, parameters, node)

        if vocStage4[getPlayerVocation(cid)] ~= vocStage4[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage4[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe OverPower de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage5(cid, message, keywords, parameters, node)

        if vocStage5[getPlayerVocation(cid)] ~= vocStage5[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage5[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Supreme de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


local node1 = keywordHandler:addKeyword({'super promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supers?'})
    node1:addChildKeyword({'yes'}, vocationStage1, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node2 = keywordHandler:addKeyword({'hyper promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Hypers?'})
    node2:addChildKeyword({'yes'}, vocationStage2, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node3 = keywordHandler:addKeyword({'stronger promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Strongers?'})
    node3:addChildKeyword({'yes'}, vocationStage3, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node4 = keywordHandler:addKeyword({'overpower promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes OverPowers?'})
    node4:addChildKeyword({'yes'}, vocationStage4, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node5 = keywordHandler:addKeyword({'supreme promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supremes?'})
    node5:addChildKeyword({'yes'}, vocationStage5, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

npcHandler:addModule(FocusModule:new())

 

Explicando:

[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}

Em Verde serão os  ID da Vocação ATUAL que o Player. Ex: O player é Druid então será o ID 2, veja no XML vocations. (Eu deixei com a vocação normal 1-Sorcerer, 2-Druid,3- Paladin, 4-Knight).

Em Azul é o ID da Vocação que o Player irá ganhar. 

Em Vermelho é aquela palavra-chave de quando foi criado os NPC's. (Se você mudou a palavra-chave quando criou o Npc então você terá que mudar aqui também, porque isso sera o que o player terá que dizer para ganhar a promotion).

 

Postado
  • Autor

como fazer, quando o cara vira a nova vocação enviar uma msg verde pro servidor todo ?? nem testei mais vou da rep, qualquer coia se funfa venho e marco melhor resposta... @Bolletox

 

22 minutos atrás, Bolletox disse:

@BilauX 

 

Vamos lá:

 

1° Passo: Vá na pasta data/npc e crie os 5 npcs:

EX do npc que vai dar a Promotion Super

  Mostrar conteúdo oculto

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Super Vocation" script="data/npc/scripts/vocations.lua" walkinterval="2000" floorchange="0">
    <health now="150" max="150"/>
    <look type="141" head="222" body="278" legs="85" feet="85" addons="2"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Ola |PLAYERNAME|. Eu posso promover para uma nova vocacao diga {super promote}."/>
    </parameters>
</npc>

 

Explicação:

Em Verde vai ser o Nome do Npc.

Em Azul vai ser a palavra-chave que o player vai ter que dizer (Se voce alterar aqui terá que alterar no Script lá).

 

2° Passo: Depois de Criado os 5 NPC's vá para a pasta data/XML e abra o vocations.xml:

Aqui voce tera que criar as 5 promotions vou deixar um exemplo.

  Mostrar conteúdo oculto

<vocation id="9" name="Super Sorcerer" description="a Super Sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="9" 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="10" name="Super Druid" description="an Super Druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="50" gainmanaticks="2" gainmanaamount="60" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="10" 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="11" name="Super Paladin" description="a Super Paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="50" manamultiplier="1.4" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="11" 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="12" name="Super Knight" description="an Super Knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="50" gainmanaticks="4" gainmanaamount="50" manamultiplier="3.0" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="12" 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>

 

Explicando:

Em Roxo será os ID's das vocações em ordem crescente. Veja qual é o ID da ultima vocação do seu server e vá seguindo em ordem (1,2,3,4,5,6,7,8..).

Em Vermelho você coloca o mesmo ID da vocação. Ex O Super Paladin tem o ID 11 então o fromvoc será o ID 11 também.

Em Laranja será o nome que ira aparecer quando o player der Look.

O resto é meio que auto explicativo o que faz. Se nao souber da uma pesquisada no forum.

 

3° Passo

Depois de criar os NPC's e as vocações vai na pasta data/npc/scripts e crie um arquivo chamado vocations.lua e cole isso dentro.

  Ocultar conteúdo

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

local vocStage1 = {   

--[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}
--EX: [99] = {promo = 102}
    [1] = {prom = 9},
    [2] = {prom = 10},
    [3] = {prom = 11},
    [4] = {prom = 12},
          
}

local vocStage2 = {
    
    [9] = {prom = 13},
    [10] = {prom = 14},
    [11] = {prom = 15},
    [12] = {prom = 16},

}

local vocStage3 = {
    
    [13] = {prom = 17},
    [14] = {prom = 18},
    [15] = {prom = 19},
    [16] = {prom = 20},

}

local vocStage4 = {
    
    [17] = {prom = 21},
    [18] = {prom = 22},
    [19] = {prom = 23},
    [20] = {prom = 24},

}

local vocStage5 = {
    
    [21] = {prom = 25},
    [22] = {prom = 26},
    [23] = {prom = 27},
    [24] = {prom = 28},

}

function vocationStage1(cid, message, keywords, parameters, node)

        if vocStage1[getPlayerVocation(cid)] ~= vocStage1[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage1[getPlayerVocation(cid)].prom)
            selfSay("Voce foi promovido para a classe Super de Promotion!", cid)
            doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage2(cid, message, keywords, parameters, node)

        if vocStage2[getPlayerVocation(cid)] ~= vocStage2[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage2[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Hyper de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage3(cid, message, keywords, parameters, node)

        if vocStage3[getPlayerVocation(cid)] ~= vocStage3[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage3[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Stronger de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage4(cid, message, keywords, parameters, node)

        if vocStage4[getPlayerVocation(cid)] ~= vocStage4[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage4[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe OverPower de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage5(cid, message, keywords, parameters, node)

        if vocStage5[getPlayerVocation(cid)] ~= vocStage5[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage5[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Supreme de Promotion!", cid)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


local node1 = keywordHandler:addKeyword({'super promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supers?'})
    node1:addChildKeyword({'yes'}, vocationStage1, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node2 = keywordHandler:addKeyword({'hyper promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Hypers?'})
    node2:addChildKeyword({'yes'}, vocationStage2, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node3 = keywordHandler:addKeyword({'stronger promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Strongers?'})
    node3:addChildKeyword({'yes'}, vocationStage3, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node4 = keywordHandler:addKeyword({'overpower promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes OverPowers?'})
    node4:addChildKeyword({'yes'}, vocationStage4, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node5 = keywordHandler:addKeyword({'supreme promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supremes?'})
    node5:addChildKeyword({'yes'}, vocationStage5, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

npcHandler:addModule(FocusModule:new())

 

Explicando:

[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}

Em Verde serão os  ID da Vocação ATUAL que o Player. Ex: O player é Druid então será o ID 2, veja no XML vocations. (Eu deixei com a vocação normal 1-Sorcerer, 2-Druid,3- Paladin, 4-Knight).

Em Azul é o ID da Vocação que o Player irá ganhar. 

Em Vermelho é aquela palavra-chave de quando foi criado os NPC's. (Se você mudou a palavra-chave quando criou o Npc então você terá que mudar aqui também, porque isso sera o que o player terá que dizer para ganhar a promotion).

 

 

 

Postado

@BilauX 

Substitua o que esta no arquivo vocations.lua por 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 changeVocation(cid)

    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 9 or getPlayerVocation(cid) == 13 or getPlayerVocation(cid) == 17 or getPlayerVocation(cid) == 21 or getPlayerVocation(cid) == 25 then
        return "Sorcerer"
    end
     if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 10 or getPlayerVocation(cid) == 14 or getPlayerVocation(cid) == 18 or getPlayerVocation(cid) == 22 or getPlayerVocation(cid) == 26 then
        return "Druid"
    end
    if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 11 or getPlayerVocation(cid) == 15 or getPlayerVocation(cid) == 19 or getPlayerVocation(cid) == 23 or getPlayerVocation(cid) == 27 then
        return "Paladin"
    end
     if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 12 or getPlayerVocation(cid) == 16 or getPlayerVocation(cid) == 20 or getPlayerVocation(cid) == 24 or getPlayerVocation(cid) == 28 then
        return "Knight"
    end

end

local vocStage1 = {   
--[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}
--EX: [99] = {promo = 102}
    [1] = {prom = 9},
    [2] = {prom = 10},
    [3] = {prom = 11},
    [4] = {prom = 12},   
}

local vocStage2 = {
    
    [9] = {prom = 13},
    [10] = {prom = 14},
    [11] = {prom = 15},
    [12] = {prom = 16},
}

local vocStage3 = {
    
    [13] = {prom = 17},
    [14] = {prom = 18},
    [15] = {prom = 19},
    [16] = {prom = 20},
}

local vocStage4 = {
    
    [17] = {prom = 21},
    [18] = {prom = 22},
    [19] = {prom = 23},
    [20] = {prom = 24},
}

local vocStage5 = {
    
    [21] = {prom = 25},
    [22] = {prom = 26},
    [23] = {prom = 27},
    [24] = {prom = 28}
}   

function vocationStage1(cid, message, keywords, parameters, node)

        if vocStage1[getPlayerVocation(cid)] ~= vocStage1[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage1[getPlayerVocation(cid)].prom)
            selfSay("Voce foi promovido para a classe Super de Promotion!", cid)
            doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Super " ..changeVocation(cid), MESSAGE_INFO_DESCR)
            doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage2(cid, message, keywords, parameters, node)

        if vocStage2[getPlayerVocation(cid)] ~= vocStage2[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage2[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Hyper de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Hyper " ..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage3(cid, message, keywords, parameters, node)

        if vocStage3[getPlayerVocation(cid)] ~= vocStage3[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage3[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Stronger de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Stronger " ..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage4(cid, message, keywords, parameters, node)

        if vocStage4[getPlayerVocation(cid)] ~= vocStage4[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage4[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe OverPower de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para OverPower " ..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage5(cid, message, keywords, parameters, node)

        if vocStage5[getPlayerVocation(cid)] ~= vocStage5[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage5[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Supreme de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Supreme "..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

    
local node1 = keywordHandler:addKeyword({'super promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supers?'})
    node1:addChildKeyword({'yes'}, vocationStage1, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node2 = keywordHandler:addKeyword({'hyper promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Hypers?'})
    node2:addChildKeyword({'yes'}, vocationStage2, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node3 = keywordHandler:addKeyword({'stronger promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Strongers?'})
    node3:addChildKeyword({'yes'}, vocationStage3, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node4 = keywordHandler:addKeyword({'overpower promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes OverPowers?'})
    node4:addChildKeyword({'yes'}, vocationStage4, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node5 = keywordHandler:addKeyword({'supreme promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supremes?'})
    node5:addChildKeyword({'yes'}, vocationStage5, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

npcHandler:addModule(FocusModule:new())

 

Postado
  • Autor

@Bolletox funciono, mais quando reloga a vocação some....

 

 

 

6 horas atrás, Bolletox disse:

@BilauX 

Substitua o que esta no arquivo vocations.lua por 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 changeVocation(cid)

    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 9 or getPlayerVocation(cid) == 13 or getPlayerVocation(cid) == 17 or getPlayerVocation(cid) == 21 or getPlayerVocation(cid) == 25 then
        return "Sorcerer"
    end
     if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 10 or getPlayerVocation(cid) == 14 or getPlayerVocation(cid) == 18 or getPlayerVocation(cid) == 22 or getPlayerVocation(cid) == 26 then
        return "Druid"
    end
    if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 11 or getPlayerVocation(cid) == 15 or getPlayerVocation(cid) == 19 or getPlayerVocation(cid) == 23 or getPlayerVocation(cid) == 27 then
        return "Paladin"
    end
     if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 12 or getPlayerVocation(cid) == 16 or getPlayerVocation(cid) == 20 or getPlayerVocation(cid) == 24 or getPlayerVocation(cid) == 28 then
        return "Knight"
    end

end

local vocStage1 = {   
--[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}
--EX: [99] = {promo = 102}
    [1] = {prom = 9},
    [2] = {prom = 10},
    [3] = {prom = 11},
    [4] = {prom = 12},   
}

local vocStage2 = {
    
    [9] = {prom = 13},
    [10] = {prom = 14},
    [11] = {prom = 15},
    [12] = {prom = 16},
}

local vocStage3 = {
    
    [13] = {prom = 17},
    [14] = {prom = 18},
    [15] = {prom = 19},
    [16] = {prom = 20},
}

local vocStage4 = {
    
    [17] = {prom = 21},
    [18] = {prom = 22},
    [19] = {prom = 23},
    [20] = {prom = 24},
}

local vocStage5 = {
    
    [21] = {prom = 25},
    [22] = {prom = 26},
    [23] = {prom = 27},
    [24] = {prom = 28}
}   

function vocationStage1(cid, message, keywords, parameters, node)

        if vocStage1[getPlayerVocation(cid)] ~= vocStage1[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage1[getPlayerVocation(cid)].prom)
            selfSay("Voce foi promovido para a classe Super de Promotion!", cid)
            doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Super " ..changeVocation(cid), MESSAGE_INFO_DESCR)
            doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage2(cid, message, keywords, parameters, node)

        if vocStage2[getPlayerVocation(cid)] ~= vocStage2[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage2[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Hyper de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Hyper " ..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

function vocationStage3(cid, message, keywords, parameters, node)

        if vocStage3[getPlayerVocation(cid)] ~= vocStage3[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage3[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Stronger de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Stronger " ..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage4(cid, message, keywords, parameters, node)

        if vocStage4[getPlayerVocation(cid)] ~= vocStage4[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage4[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe OverPower de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para OverPower " ..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end


function vocationStage5(cid, message, keywords, parameters, node)

        if vocStage5[getPlayerVocation(cid)] ~= vocStage5[getPlayerVocation(cid)].prom then
            doPlayerSetVocation(cid, vocStage5[getPlayerVocation(cid)].prom)
             selfSay("Voce foi promovido para a classe Supreme de Promotion!", cid)
             doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Supreme "..changeVocation(cid), MESSAGE_INFO_DESCR)
             doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN)
        end
end

    
local node1 = keywordHandler:addKeyword({'super promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supers?'})
    node1:addChildKeyword({'yes'}, vocationStage1, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node2 = keywordHandler:addKeyword({'hyper promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Hypers?'})
    node2:addChildKeyword({'yes'}, vocationStage2, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node3 = keywordHandler:addKeyword({'stronger promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Strongers?'})
    node3:addChildKeyword({'yes'}, vocationStage3, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node4 = keywordHandler:addKeyword({'overpower promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes OverPowers?'})
    node4:addChildKeyword({'yes'}, vocationStage4, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

local node5 = keywordHandler:addKeyword({'supreme promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supremes?'})
    node5:addChildKeyword({'yes'}, vocationStage5, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true})

npcHandler:addModule(FocusModule:new())

 

 

 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo