Postado Agosto 2, 2013 11 anos Galera bom dia! Queria um ajuda de vocês, eu criei uma cidade vip no rme, mas não sei como adicionar para que o captain do meu barco vip leve até a cidade. Me ajudem por favor REP+ PRA QUEM AJUDAR! Npc do barco vip Jack fate.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local Topic = {} -- 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 function greetCallback(cid) Topic[cid] = 1 return true end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false elseif msgcontains(msg, 'yalsadasdahar') then npcHandler:say("Do you seek a passage to Yalahar for " .. (getConfigInfo("freeTravel") and "free?" or "275 gold?"), cid) Topic[cid] = 1 elseif Topic[cid] == 1 and msgcontains(msg, 'yes') then local storage = 88775 if doPlayerRemoveMoney(cid, 275) == true then if getPlayerStorageValue(cid, storage) == 1 then npcHandler:say('And, here we go!', cid) npcHandler:releaseFocus(cid) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) local yalahar = {x = 32816, y = 31272, z = 6} doTeleportThing(cid, yalahar) doSendMagicEffect(yalahar, CONST_ME_TELEPORT) Topic[cid] = 0 else npcHandler:say('You have not helped Wyrdin! Come back when you have done so.', cid) Topic[cid] = 0 end else npcHandler:say('You do not have enough money.', cid) Topic[cid] = 0 end end return true end local travelNode = keywordHandler:addKeyword({'ethno'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ethno for 0 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32048, y=31974, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'Legendary island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Quer viajar para a Lendaria ilha sagrada for 0 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31505, y=31627, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'gengia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Gengia for 0 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32071, y=32182, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'transilvania island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Quer Viajar para terra dos vampiros for 0 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=31092, y=32531, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'dfdf'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ankrahmun for 90 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 90, destination = {x=33092, y=32883, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'masas'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Darashia for 200 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 200, destination = {x=33289, y=32480, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Thais for 180 gold?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 180, destination = {x=32310, y=32210, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) local travelNode = keywordHandler:addKeyword({'gorsdasdoma'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ugh. You really want to go back to Goroma? I\'ll surely have to repair my ship afterwards, so I have to charge 500 gold pieces. Okay?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 500, destination = {x=32161, y=32558, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'}) keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Para onde você quer ir? Para Gengia, Ethno, Transilvania island ou Legendary island'}) keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this sailing ship.'}) keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this sailing ship.'}) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Jack fate.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Jack Fate" script="data/npc/scripts/Jack Fate.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="19" body="69" legs="107" feet="50" addons="0"/> <voices> <voice text="Passages to Ethno,Gengia,Transilvania,legendary island." interval2="100" margin="1" yell="no"/> </voices> <parameters> <parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service." /> <parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service." /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="name;" /> <parameter key="keyword_reply1" value="My name is Jack Fate from the Royal Tibia Line." /> <parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I sail you today?"/> </parameters> </npc> Editado Agosto 2, 2013 11 anos por henriqerocha (veja o histórico de edições)
Postado Agosto 2, 2013 11 anos Autor No caso minha cidade é legendary island, coloquei as coordenas tudo certo, mas nem aparece a opção no captain Editado Agosto 2, 2013 11 anos por henriqerocha (veja o histórico de edições)
Postado Agosto 2, 2013 11 anos O seu script está diferente, vou te enviar o que eu uso normalmente para criar outros npc's de travel ou adicionar locais nos que já tenho, não sei qual é a sua versão ou server mas provavelmente funcionará. vá em data>npc e crie o seu arquivo. ex: Captain Vip.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Captain Vip" script="data/npc/scripts/barcovip.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="132" head="19" body="70" legs="95" feet="115" addons="0"/> </npc> vá em data>npc>scripts e crie o seu aquivo. ex: barcovip.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- 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 -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Deseja navegar para Venore de graça?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=32952, y=32022, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'}) keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Ab\'dendriel, Darashia, Venore, Ankrahmun, Port Hope, Thais, Liberty Bay, Carlin and Yalahar'}) keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu que mando nessa budega de navio..'}) keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Carlin, Ab\'dendriel, Venore, Ankrahmun, Port Hope, Thais, Liberty Bay, Carlin and Yalahar.'}) -- Makes sure the npc reacts when you say hi, bye etc. npcHandler:addModule(FocusModule:new()) Explicando, deixei apenas venore como exemplo. Cinza - O que o npc fala assim que o player diz HI. Azul - Coordenadas para o local que o npc vai enviar o player. (nesse exemplo, barco de venore). Roxo - Se o player precisa ser premium account, ter level e o preço para o travel. Vermelho - O que player precisa falar para poder usar o barco (Ex: Hi, Venore). Verde - A cada bloco de códigos verde desse é um local diferente, você pode copiar todo ele e mudar apenas os dados explicados acima para diferentes locais. Editado Agosto 2, 2013 11 anos por aincrady (veja o histórico de edições) http://aincrady.no-ip.biz:8090 ~> Ot Aincrad, Novos locais, Novos Monstros, Novas Mounts, Warzone Liberada, Quirefang, e muito mais!
Postado Agosto 2, 2013 11 anos Caso se você não souber como Editar correto Utilize esse Pronto ja local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- 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 -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'legendary island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Deseja navegar para Legendary Island?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=32952, y=32022, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Você esta Aqui!'}) keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Ab\'dendriel, Darashia, Venore, Ankrahmun, Port Hope, Thais, Liberty Bay, Carlin and Yalahar'}) keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu que mando nessa budega de navio..'}) keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Carlin, Ab\'dendriel, Venore, Ankrahmun, Port Hope, Thais, Liberty Bay, Carlin and Yalahar.'}) -- Makes sure the npc reacts when you say hi, bye etc. npcHandler:addModule(FocusModule:new()) Traduzi algumas Frases Arrumei o Nome da Cidade e as Coordenadas só Substituir ! Contato : under12451 (Skype) Meus Tutoriais O Que é DDoS ? como se Proteger Por Tony Criando Servidor Poketibia Sistemas de Vips com [VIP] No Nome Cyclops - Mistrock - 100% AFK Como Editar um NPC 8.6 [ Itens e Preços] Editando Swords 8.6 Como Editar um NPC 8.6 [VENDA]
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.