xXx1 0 #1 Postado 20 Novembro, 2006 Eh eu de novo aqui pra ensinar a vcs criarem o NPC The Oracle!! "Q NPC eh esse??" O The Oracle eh aquele NPC q da a vocação para algun char quando ele chega ao lvl 8 em rook "+ como eu posso fazer ele??" Primeramente vc vai precisar abrir um novo bloco de notas e escrever isso dentro dele: <?xml version="1.0"?><npc name="The Oracle" script="data/npc/scripts/oracle.lua" access="3"> <look type="1448" head="57" body="59" legs="40" feet="76"/></npc>agora clika em "Arquivo" em em seguida "Salvar como... dele: Primeramente abra outro Bloco de Notas e escreva isso dentro dele: focus = 0talk_start = 0target = 0following = falseattacking = falsetalk_state = 0cname = ''vocation = 0mainlevel = 8function onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msg) cname = creatureGetName(cid) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. cname .. '! Are you ready to face your destiny?') talk_state = 0 focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. cname .. '! I talk to you in a minute.') elseif msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. cname .. '!') talk_state = 0 focus = 0 talk_start = 0 elseif focus == cid then talk_start = os.clock() if talk_state == 0 then if msgcontains(msg, 'yes') then -- wanna go to mainland level = getPlayerLevel(cname) if level >= mainlevel then selfSay('Great! Do you want to be a knight, a paladin, a sorcerer or a druid?') talk_state = 1 else selfSay('Sorry, you need level ' .. mainlevel .. ' to go to the mainland.') talk_state = 0 end else selfSay('Come back when you are ready then.') talk_state = 0 end elseif talk_state == 1 then -- telling vocation talk_state = 2 if msgcontains(msg, 'sorcerer') then selfSay('A mighty sorcerer! Are you sure?') vocation = 1 elseif msgcontains(msg, 'druid') then selfSay('A mysterious druid! Are you sure?') vocation = 2 elseif msgcontains(msg, 'paladin') then selfSay('A nimble paladin! Are you sure?') vocation = 3 elseif msgcontains(msg, 'knight') then selfSay('A valorous knight! Are you sure?') vocation = 4 else selfSay('Sorry, there is no such vocation.') vocation = 0 talk_state = 1 end elseif talk_state == 2 then -- confirming vocation if msgcontains(msg, 'yes') then selfSay('Great! I can send you to The City. Where do you want to go?') talk_state = 3 else selfSay('What vocation do you want then?') talk_state = 1 end elseif talk_state == 3 then -- telling city name if msgcontains(msg, 'city') then selfSay('Good luck, young adventurer!') setPlayerVocation(cid,vocation) setPlayerMasterPos(cid,160,54,7) selfSay('/send ' .. cname .. ', 160 54 7') talk_state = 0 focus = 0 talk_start = 0 else selfSay('Sorry, there is no such city.') talk_state = 3 end end endendfunction onCreatureChangeOutfit(creature)endfunction onThink() if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end endendAgora clika em "Arquivo e pronto ele esta pronto. "+ como eu coloko ele no map??" Bom vc tem q abrir o NPC.xml(com o bloco de notas) q deve estar dentro da pasta World entao vamos fingir q vc quer colokar esse NPC na posiçao : <npc name="The Oracle" x="100" y="100" z="7"/> Entao agora fecha e salva as configuraçoes e liga seu OT e pronto ele vai esta la =D!! Qualquer bug fale aqui no forum!! Bom eu nao sei quem fez entao o creditos nao vai pra ngm =/ Compartilhar este post Link para o post
Shinmura 0 #2 Postado 21 Novembro, 2006 Isso ae eh pra 7.6?Plx se for, retira isso pq nao eh necessario.Pq? Pq todos os servidores 7.6 vem com The Oracle, intao o necessario seria o seu tutor que vc postou, o resto seria totalmente desnecessario. Compartilhar este post Link para o post
Tr0p5 0 #3 Postado 21 Novembro, 2006 pelo contrario.. eh mto uitl... mesmo q pra 7.6... alguns vem sem.. e pra qm naum sabe fazer esse script eh de grande ajuda... vlw pipo flw ~Tr0p5 Compartilhar este post Link para o post
Vuhazid__ 0 #4 Postado 22 Novembro, 2006 @Tr0p5Todos ots vem sim! (msm q seja bugado ;p)So nao vem com rook e spawn..=D Compartilhar este post Link para o post
Vuhazid__ 0 #5 Postado 22 Novembro, 2006 @topico agora clika em "Arquivo" em em seguida "Salvar como..." agora salva assim The Oracle.xml.Pronto o NPC esta pronto agora vamos fazer o Script dele: Arruma aquele color blue.. @Topico de novo Muito bom ;p Compartilhar este post Link para o post
xXx1 0 #6 Postado 23 Novembro, 2006 @Vuhazid_Pronto kra arrumei a cor foi mal num vi aquilo =/ Compartilhar este post Link para o post
Convidado Rabico #7 Postado 12 Dezembro, 2006 KKkk Fiko mt Top xD Parabens~ Compartilhar este post Link para o post
Convidado Rabico #8 Postado 12 Dezembro, 2006 KKkk Fiko mt Top xD Parabens~ Compartilhar este post Link para o post
GM Dinhu 0 #9 Postado 3 Novembro, 2007 Po e para 8.0 tbm eu tbm fiz o the oracle e ta funcionando mto bem Vlw lk Compartilhar este post Link para o post
caiOHawk 0 #10 Postado 3 Novembro, 2007 É necessário sim, pois para quem não sabe aprende agora e para os otservers que não vem, você pode implementar Parabéns pelo tuto. Compartilhar este post Link para o post
vuzanluc 0 #11 Postado 23 Novembro, 2007 tipo irmaozinho ateh tentei de tods as formas possiveis mas da erro nos **** tem como vc me mostrar onde posso achar um ot q ja vem com esta $@!@#$! de script ja me matei um monte Compartilhar este post Link para o post
vuzanluc 0 #12 Postado 6 Dezembro, 2007 Po e para 8.0 tbm eu tbm fiz o the oracle e ta funcionando mto bemVlw lk mano assim eu estou atras de um npc the oracle para versao 8.0 mas nao axu testei este aki mas tb nao funfou agora estou pedindo a vc pq vi q vc consegui um soh me diga em qual programa q vc usaou pra dar sertu plz me ajuda aew Compartilhar este post Link para o post