Postado Janeiro 5, 2013 12 anos Pessoal eu estou motando um ot e fazendo mapa próprio mais eu não consigo por um capitão de navio para ir nas cidades que eu quero quais parameters tenho que usar?? se alguem entende de XML. como faço por favor não acho na internet exemplo eu falo hi pro npc e ele fala ola pra onde quer ir (cidade tal) ou cidade (tal). você escolhe como faço isso?? ajudem eu pesso
Postado Janeiro 5, 2013 12 anos Administrador Faz o seguinte se vc vai la em npc, e não tem nem um você vai ir em: File -importar-npc/monster vai até a pasta que o npc esta click 2 vezes nele e de um refresh no rme. @Edit -Scripts de como fazer um npc de barco ou que teleporta. Crie um arquivo em Data/Npc com o nome que desejar. Dentro cole: <?xml version="1.0"?> -<npc maglevel="1" level="1" access="5" floorchange="0" walkinterval="3" script="data/npc/scripts/teleportador.lua" name="Teleportador"> <health max="150" now="150"/> <look corpse="2212" feet="111" legs="15" body="19" head="96" type="146"/> -<parameters> <parameter value="Ola |PLAYERNAME|. ! Eu posso te levar para {kunlun}, {skin}, {deserto}, {geffen}, {lutie}, {ank} e {izlud}.. Onde deseja ir?" key="message_greet"/> <parameter value="Vai custar |TOTALCOST| gold coins. Vai viajar? Voce pode ir em outras cidades indo ao tapete do meu primo!" key="message_decline"/> </parameters> </npc> Aqui você coloca os nomes das cidades que o npc vai: Eu posso te levar para {kunlun}, {skin}, {deserto}, {geffen}, {lutie}, {ank} e {izlud}.. Onde deseja ir? Agora em Data/Npc/Scripts: Crie um arquivo com o nome de "teleportador.lua E cole isso dentro local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler)[/b] [b]-- OTServ event handling functions start 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 -- OTServ event handling functions end[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'kunlun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para kunlun por 210 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 210, destination = {x=825, y=1686, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te levar para {kunlun}, {skin}, {deserto}, {geffen}, {lutie} e {ank} por um pequeno custo.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'skin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para skin por 210 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 210, destination = {x=303, y=1865, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'skin\' for just a small fee.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'deserto'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para deserto por 210 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 210, destination = {x=922, y=1446, z=5} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'deserto\' for just a small fee.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'geffen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para geffen por 100 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=991, y=1000, z=7} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'geffen\' for just a small fee.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'anknor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para anknor por 175 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 175, destination = {x=487, y=261, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Anknor\' for just a small fee.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'anknor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para anknor por 100 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=487, y=261, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'anknor\' for just a small fee.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'smallville'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para smallville por 190 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 190, destination = {x=1995, y=2394, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'smallville\' for just a small fee.'})[/b] [b]-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'goroma'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Goroma por 55 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 55, destination = {x=1367, y=195, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})[/b] [b]keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'goroma\' for just a small fee.'})[/b] [b]-- Makes sure the npc reacts when you say hi, bye etc. npcHandler:addModule(FocusModule:new()) essa parte você coloca as coordenadas pra onde o npc vai levar: -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'kunlun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para kunlun "aqui vem o nome da cidade" por 210 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 210, destination = {x=825, y=1686, z=6} "COORDENADAS DA CIDADE" }) 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\'"aqui o nome da cidade denovo" for just a small fee.'}) Editado Janeiro 5, 2013 12 anos por Erimyth (veja o histórico de edições) TibiaKing Team- KingTópicos www.tibiaking.com
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.