Postado Setembro 10, 2014 10 anos Queria um NPC que teleporta um player pra uma determinada posição(AVAH, JURA?) eu até tenho um NPC assim mais ele só teleporta pra um lugar só, eu queria um NPC que desse pra escolher qual lugar o player quer, mais ou menos assim: Player: Hi Npc: Aonde voce quer ir, Saffron , Cerulean, Celadon , Vermilion ou Lavender ? Player: Saffron Npc: Tem certeza que quer ir pra Saffron? Player: Yes Npc: Pronto voce esta em Saffron. _____________________________________ Só isso, quem puder ajudar dou Rep+ e pra quem tentar ajudar também dou Rep+ por que oque vale é a intensão e.e Agradeço a todos;;;; Atensiosamente, Gabriel L.
Postado Setembro 10, 2014 10 anos Cara é só pegar algum NPC do Global (aqueles que fica nos navios) e você vai trocando os nomes da cidades no arquivo .xml e tal. Não vai cair sua mão. Conlheça o projeto:
Postado Setembro 10, 2014 10 anos Autor Cara é só pegar algum NPC do Global (aqueles que fica nos navios) e você vai trocando os nomes da cidades no arquivo .xml e tal. Não vai cair sua mão. Pode me mandar um NPC desse? ;-; Atensiosamente, Gabriel L.
Postado Setembro 10, 2014 10 anos toma o lua para o npc. mystic = {x=1447, y=1504, z=7} enigma = {x=942, y=980, z=6} liberty = {x=495, y=1669, z=7} folda = {x=267, y=349, z=6} premmy = {x=1150, y=1478, z=7} tiquanda = x=1081, y=1291, z=7} local price = 100 -- preço da viagem para qualquer cidade local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hiho ' .. getCreatureName(cid) .. '! Can I take you to, enigma city, mystic island, liberty bay, premmy city, folda, tiquanda. To go where they want?. Pointing out that travel costs 50 gps.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'mystic island') then if(doPlayerRemoveMoney(cid, price) == TRUE) then doTeleportThing(cid,mystic) doSendMagicEffect(mystic,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'enigma') then if(doPlayerRemoveMoney(cid, price) == TRUE) then doTeleportThing(cid,enigma) doSendMagicEffect(enigma,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'liberty bay') then if(doPlayerRemoveMoney(cid, price) == TRUE) then doTeleportThing(cid,liberty) doSendMagicEffect(liberty,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'folda') then if(doPlayerRemoveMoney(cid, price) == TRUE) then doTeleportThing(cid,folda) doSendMagicEffect(folda,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'premmy city') then if(doPlayerRemoveMoney(cid, price) == TRUE) then doTeleportThing(cid,premmy) doSendMagicEffect(premmy,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'tiquanda') then if(doPlayerRemoveMoney(cid, price) == TRUE) then doTeleportThing(cid,tiquanda) doSendMagicEffect(tiquanda,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. creatureGetName(cid) .. ', go back.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('how? I do not understand!') talk_state = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next please!!...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end Editado Setembro 10, 2014 10 anos por kbpaulo (veja o histórico de edições) Meus topicos.[Gesior]Layout pokemon vrs1.0[854]OtServer Digimon Vrs.1.1 Spoiler http://free.timeanddate.com/countdown/i48ub0vi/n213/cf11/cm0/cu4/ct0/cs0/ca0/cr0/ss0/cac009/cpc000/pcf90/tcfff/fs100/szw448/szh189/tatTempo%20Para%20Resetar/tac000/tptDigimon%20World%20Cerberus%20Online/tpc000/matDigimon%20World%20Cerberus%20Online/mac000/mptEstá%20Online%20à/mpc000/iso2014-07-19T00:01:00/bas3/bat8/bac00f/pa3 Meu Servidor Digimon World Cerberus OnlineDigimon World Cerberus Online Agradecer sempre a todos que ajudaram, o server a ficar pronto deis de Sprites que não conheço,scripts, etc....como o jogo esta na internet e para todos usarem vlw a todos bjus...
Postado Setembro 10, 2014 10 anos Solução NPC.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Alakazam" script="data/npc/scripts/viajar.lua" walkinterval="1000" speed="0" floorchange="0"> <health now="100" max="100"/> <look type="135" head="19" body="113" legs="95" feet="115" addons="0"/> <parameters> <parameter key="message_greet" value="Aonde voce quer ir, Saffron, Cerulean, Cleadon, Vermilion ou Lavender?" /> </parameters> </npc> NPC/script/viajar.lua 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({'Saffron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voçê deseja ir a Saffron?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=564, y=1145, z=7} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye.'}) local travelNode = keywordHandler:addKeyword({'Cerulean'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voçê deseja ir a Cerulean?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=1149, y=1218, z=7} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye.'}) local travelNode = keywordHandler:addKeyword({'Celadon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voçê deseja ir a Celadon?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=1015, y=906, z=7} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye.'}) local travelNode = keywordHandler:addKeyword({'Vermilion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voçê deseja ir a Vermilion?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, cost = 0, destination = {x=972, y=1430, z=7} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye.'}) local travelNode = keywordHandler:addKeyword({'Lavender'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voçê deseja ir a lavender?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 1, cost = 0, destination = {x=912, y=1179, z=7} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye.'}) -- Makes sure the npc reacts when you say hi, bye etc. 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.