Ir para conteúdo
  • Cadastre-se

Npc Promotion (Nova vocação) Erro


Posts Recomendados

Galera to com um npc promotion aqui porém quando falo com ele:

18:09 Fusion Promote: Hi there, how's it hanging, ADM !

18:09 ADM [206]: promotion

18:09 Fusion Promote: Do you want to be promoted in your vocation for 200000 gold?

18:09 ADM [206]: yes

Quando eu falo Yes para pegar a promotion ele não diz mais nada e nem dá a promotion.

Npc.xml

<?xml version="1.0" encoding="UTF-8"?>

-<npc floorchange="0" walkinterval="2000" script="data/npc/scripts/Sell/promote vip.lua" name="Fusion Promote"> <health max="100" now="100"/> <look addons="0" feet="95" legs="107" body="87" head="21" type="331"/> -<parameters> <parameter value="Hi there, how's it hanging, |PLAYERNAME|!" key="message_greet"/> <parameter value="Good bye, |PLAYERNAME|!" key="message_farewell"/> <parameter value="1" key="module_keywords"/> <parameter value="hail king;job;promotion;" key="keywords"/> <parameter value="I greet thee, my loyal subject |PLAYERNAME|." key="keyword_reply1"/> <parameter value="I am your sovereign, King Tibianus III, and it's my duty to provide justice and guidance for my subjects." key="keyword_reply2"/> <parameter value="Do you want to be promoted in your vocation for 200000 gold?" key="keyword_reply3"/> <parameter value="1" key="module_shop"/> <parameter value="" key="shop_sellable"/> <parameter value="" key="shop_buyable"/> </parameters> </npc>

Script:

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

if(msgcontains(msg, 'vip sorcerer') or msgcontains(msg, 'Fusion sorcerer')) then

selfSay('Deseja virar {Vip Sorcerer} por 50 crystal coins?', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if(getPlayerItemCount(cid, 2160) >= 50) then

doPlayerRemoveItem(cid, 2160, 50)

doPlayerSetVocation(cid,9)

selfSay('Vocação trocada com sucesso , Agora você é um Fusion Sorcerer.', cid)

else

selfSay('Você não tem {crystal coins} Suficientes.', cid)

end

talkState[talkUser] = 0

end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Vocations.xml:

<?xml version="1.0" encoding="UTF-8"?>

-<vocations> -<vocation attackable="no" fromvoc="0" gainsoulticks="120" soulmax="500" attackspeed="2000" manamultiplier="4.0" gainmanaamount="1" gainmanaticks="6" gainhpamount="1" gainhpticks="6" gainmana="50" gainhp="5" gaincap="5" needpremium="0" description="none" name="None" id="0"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.5" distance="2.0" axe="2.0" sword="2.0" club="2.0" fist="1.5"/> </vocation> -<vocation fromvoc="1" gainsoulticks="120" soulmax="100" attackspeed="500" manamultiplier="1.1" gainmanaamount="70" gainmanaticks="3" gainhpamount="50" gainhpticks="6" gainmana="50" gainhp="20" gaincap="10" needpremium="0" description="a sorcerer" name="Sorcerer" id="1"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.5" distance="2.0" axe="2.0" sword="2.0" club="2.0" fist="1.5"/> </vocation> -<vocation fromvoc="2" gainsoulticks="120" soulmax="100" attackspeed="500" manamultiplier="1.1" gainmanaamount="70" gainmanaticks="3" gainhpamount="50" gainhpticks="6" gainmana="50" gainhp="20" gaincap="10" needpremium="0" description="a druid" name="Druid" id="2"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.5" distance="1.8" axe="1.8" sword="1.8" club="1.8" fist="1.5"/> </vocation> -<vocation fromvoc="3" gainsoulticks="120" soulmax="100" attackspeed="500" manamultiplier="1.4" gainmanaamount="60" gainmanaticks="4" gainhpamount="65" gainhpticks="4" gainmana="40" gainhp="38" gaincap="20" needpremium="0" description="a paladin" name="Paladin" id="3"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.1" distance="1.1" axe="1.2" sword="1.2" club="1.2" fist="1.2"/> </vocation> -<vocation fromvoc="4" gainsoulticks="120" soulmax="100" attackspeed="500" manamultiplier="3.0" gainmanaamount="40" gainmanaticks="6" gainhpamount="80" gainhpticks="3" gainmana="20" gainhp="15" gaincap="25" needpremium="0" description="a knight" name="Knight" id="4"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.1" distance="1.4" axe="1.1" sword="1.1" club="1.1" fist="1.1"/> </vocation> -<vocation fromvoc="1" gainsoulticks="15" soulmax="200" attackspeed="500" manamultiplier="1.1" gainmanaamount="150" gainmanaticks="2" gainhpamount="100" gainhpticks="4" gainmana="60" gainhp="20" gaincap="50" needpremium="1" description="a master sorcerer" name="Master Sorcerer" id="5" lessloss="30"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.5" distance="2.0" axe="2.0" sword="2.0" club="2.0" fist="1.5"/> </vocation> -<vocation fromvoc="2" gainsoulticks="15" soulmax="500" attackspeed="200" manamultiplier="1.1" gainmanaamount="150" gainmanaticks="2" gainhpamount="100" gainhpticks="4" gainmana="60" gainhp="20" gaincap="50" needpremium="1" description="an elder druid" name="Elder Druid" id="6" lessloss="30"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.5" distance="1.8" axe="1.8" sword="1.8" club="1.8" fist="1.5"/> </vocation> -<vocation fromvoc="3" gainsoulticks="15" soulmax="500" attackspeed="800" manamultiplier="1.4" gainmanaamount="130" gainmanaticks="3" gainhpamount="150" gainhpticks="3" gainmana="40" gainhp="38" gaincap="20" needpremium="1" description="a royal paladin" name="Royal Paladin" id="7" lessloss="30"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.1" distance="1.1" axe="1.2" sword="1.2" club="1.2" fist="1.2"/> </vocation> -<vocation fromvoc="4" gainsoulticks="15" soulmax="500" attackspeed="500" manamultiplier="3.0" gainmanaamount="80" gainmanaticks="4" gainhpamount="170" gainhpticks="2" gainmana="25" gainhp="15" gaincap="25" needpremium="1" description="an elite knight" name="Elite Knight" id="8" lessloss="30"> <formula armor="1.0" magDefense="1.0" defense="1.0" magHealingDamage="1.0" magDamage="1.0" wandDamage="1.0" distDamage="1.0" meleeDamage="1.0"/> <skill experience="1.0" fishing="1.1" shielding="1.1" distance="1.4" axe="1.1" sword="1.1" club="1.1" fist="1.1"/> </vocation>

<!-- <vocation id="9" name="Fusion Sorcerer" description="an epic master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="5" 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="10" name="Fusion Druid" description="an epic elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="1200" soulmax="500" 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="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="Fusion Paladin" description="an epic royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.4" attackspeed="1200" 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.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="Fusion Knight" description="an epic elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="8" gainhpamount="10" gainmanaticks="4" gainmanaamount="10" manamultiplier="3.0" attackspeed="1200" 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.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

tente utilizar assim .


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

if(msgcontains(msg, 'vip sorcerer') or msgcontains(msg, 'Fusion sorcerer')) then

selfSay('Deseja virar {Vip Sorcerer} por 50 crystal coins?', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if(getPlayerItemCount(cid, 2160) >= 50) then

doPlayerRemoveItem(cid, 2160, 50)

doPlayerSetVocation(cid, 5)

selfSay('Vocação trocada com sucesso , Agora você é um Fusion Sorcerer.', cid)

else

selfSay('Você não tem {crystal coins} Suficientes.', cid)

end

talkState[talkUser] = 0

end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

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

Att,

Skyligh

Entrada Como Membro 14 / 08 / 2012

Entrada Como Suporte 05 / 12 / 2012

Saída Como Suporte 06 / 01 / 2013

sem_ta28.png

Contato : [email protected] / [email protected]

Link para o post
Compartilhar em outros sites

editei o script la

nessa function .


doPlayerSetVocation(cid, 5)

ali no 5 poem o id da vocation .

Att,

Skyligh

Entrada Como Membro 14 / 08 / 2012

Entrada Como Suporte 05 / 12 / 2012

Saída Como Suporte 06 / 01 / 2013

sem_ta28.png

Contato : [email protected] / [email protected]

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