Postado Janeiro 23, 2016 9 anos Autor OK Mano vlw :'D Obstaculo Impossível? Impossível é existir algo Impossível Confira os Meus Conteúdos ! Te ajudei ? REP + E Ficamos KIT
Postado Janeiro 23, 2016 9 anos Diretor Solução capitao.xml add \/ <npc name="Capitao" script="data/npc/scripts/viajante.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. ! Eu posso te levar para { NOMEDACIDADE1}, { NOMEDACIDADE2}, { NOMEDACIDADE3}, { NOMEDACIDADE4}, { NOMEDACIDADE5}, { NOMEDACIDADE6}, { NOMEDACIDADE7}, { NOMEDACIDADE8}, { NOMEDACIDADE9}.. Onde deseja ir?" /> <parameter key="message_decline" value="Vai viajar? Voce pode ir em outras cidades indo ao tapete do meu primo!"/> </parameters> </npc> npc/scrpts cria um arquivo com o nome viajante.lua e add \/ 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 travelNode = keywordHandler:addKeyword({'NOMEDACIDADE1'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE1 por 210 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 210, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te levar para {NOMEDACIDADE1}, {NOMEDACIDADE2}, {NOMEDACIDADE3}, {NOMEDACIDADE4}, {NOMEDACIDADE5} {NOMEDACIDADE6} {NOMEDACIDADE7} {NOMEDACIDADE8} {NOMEDACIDADE9} por um pequeno custo.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE2 por 110 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 110, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'dorion\' for just a small fee.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE3}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE3 por 115 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 115, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Alfon\' for just a small fee.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE4'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE4 por 100 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'venohn\' for just a small fee.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE6'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE6 por 175 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 175, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Anknor\' for just a small fee.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE7}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE7 por 100 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'anknor\' for just a small fee.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE8'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE8 por 190 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 190, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'smallville\' for just a small fee.'}) local travelNode = keywordHandler:addKeyword({'NOMEDACIDADE9}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para NOMEDACIDADE9 por 55 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 55, destination = {x=XXX, y=XXX, z=X} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'goroma\' for just a small fee.'}) npcHandler:addModule(FocusModule:new()) --Editando a seu gosto-- Cor Vemelha: Nome da cidades... Cor Azul: pra onde o npc vai lever ? Cor amarela: precisa ser vip ? true = yes e false = no Cor verde: Quantos gold vai precisar ? Editado Janeiro 23, 2016 9 anos por Alexy Brocanello (veja o histórico de edições) Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Janeiro 23, 2016 9 anos Autor Tipo alexy, queria que o NPC Não cobrasse custo. e se eu botar 0 ali ele ainda assim vai falar Você deseja viajar pra "..." por 0 gps @edit eu queria que ele então não falasse o preço " 0 " Ai quando o player vip falar o tal lugar, ele teletranporta. Ou ele pergunta " Deseja realmente ir ? " Obstaculo Impossível? Impossível é existir algo Impossível Confira os Meus Conteúdos ! Te ajudei ? REP + E Ficamos KIT
Postado Janeiro 23, 2016 9 anos Diretor 11 minutos atrás, SkyFrozer disse: Tipo alexy, queria que o NPC Não cobrasse custo. e se eu botar 0 ali ele ainda assim vai falar Você deseja viajar pra "..." por 0 gps @edit eu queria que ele então não falasse o preço " 0 " Ai quando o player vip falar o tal lugar, ele teletranporta. Ou ele pergunta " Deseja realmente ir ? " lá em cima <parameter key="message_decline" value="Vai viajar? Voce pode ir em outras cidades indo ao tapete do meu primo!"/> já até alterei Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Janeiro 23, 2016 9 anos Autor Como prometido, os REP+ E também dei a melhor resposta vlw :D Obstaculo Impossível? Impossível é existir algo Impossível Confira os Meus Conteúdos ! Te ajudei ? REP + E Ficamos KIT
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.