Rafix 4 Postado Março 10, 2007 Share Postado Março 10, 2007 (editado) Pra quem não entendeu no título, é que o nosso amigo Seller, vai vender Bps de cores diferentes em cada cidade, isso mesmo, o MESMO Seller Foi descoberto por acidente, e queria que nao ripassem¬¬ A Versão é Zorzin 1.1 Vamos começar, pegue o seller.xml, dê um ctrl+c e cole umas 4x Agora pegue o primeiro seller, renomeie para seller_karmia Abra-o e ponha isto no lugar do que está escrito: <?xml version="1.0"?> <npc name="Seller" script="data/npc/scripts/seller_karmia.lua" access="3"> <mana now="800" max="800"/> <health now="800" max="800"/> <look type="129" head="0" body="86" legs="61" feet="86" addons="3"/> </npc> Certo, agora vamos direto criar o arquivo script, vá na pasta scripts, pegue o seller.lua, renomeie para seller_karmia e cole isso: -- Npc by Zorzin =), Edited by Rafixlocal focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) 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) -- greeting phrase if string.find(msg, '(%a*)hi(%a*)') and focus == 0 and string.len(msg) == 2 and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (30gp), backpacks (20gp), manafluids (100gp), lifefluids (60gp), fishing rods (100gp) and torches (2gp), obsidian knife (4k).') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() -- Mensages: buy_error = 'Sorry, you dont have enough money.' buy_ok = 'Here you are.' buy_no = 'Ok. Maybe another time.' -- sell_error = 'Sorry, you dont have that item.' sell_ok = 'Thanks for this item.' sell_no = 'Ok. Maybe another time.' -- if msgcontains(msg, 'rope') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2120,getCountNumber(msg),0,50,0,'a','rope','ropes' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'shovel') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2554,getCountNumber(msg),0,30,0,'a','shovel','shovels' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'backpack') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',1988,getCountNumber(msg),0,20,0,'a','backpack','backpacks' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2006,getCountNumber(msg),7,100,0,'a','vial of manafluid','vials of manafluid' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2006,getCountNumber(msg),10,60,0,'a','vial of lifefluid','vials of lifefluid' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'fishing') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2580,getCountNumber(msg),0,100,0,'a','fishing rod','fishing rods' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'torch') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2050,getCountNumber(msg),0,2,0,'a','torch','torches' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 elseif msgcontains(msg, 'obsidian knife') then bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',5908,getCountNumber(msg),0,4000,0,'an','obsidian knife','obsidian knifes' sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs) talk_state = 302 ----------------------- elseif talk_state == 302 then if msgcontains(msg, 'yes') or msgcontains(msg, 'no') then if bs == 'buy' then buyItem(cid,itemid,count,subtype,price,iscountable,name,plural,buy_error,buy_ok, buy_no,msg) else sellItem(cid,itemid,count,subtype,price,iscountable,sell_error,sell_ok,sell_no,m sg) end talk_state = 0 end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() if focus > 0 then x, y, z = creatureGetPosition(focus) myx, myy, myz = selfGetPosition() if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then selfTurn(1) end if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then selfTurn(3) end if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then selfTurn(2) end if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then selfTurn(0) end if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then selfTurn(2) end if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then selfTurn(0) end if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then selfTurn(3) end if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then selfTurn(1) end if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then selfTurn(2) end if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then selfTurn(0) end if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then selfTurn(3) end if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then selfTurn(1) end if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then selfTurn(2) end if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then selfTurn(0) end if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then selfTurn(3) end if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then selfTurn(1) end end if (os.clock() - talk_start) > 30 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 end end Bom, este foi o npc de karmia, agora falta o resto, é só copiar e colar, renomear para as cidades e etc, mas não esqueça, não troque o npc name, deixe como seller mesmo! =] Quanto aos scripts, é só você copiar e mudar o id das bps que você quiser. Não está melhor explicado por falta de tempo, mas se você preferir pode fazer download, mas tem que esperar até amanhã quando farei upload. Editado Março 10, 2007 por Rafix Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/ Compartilhar em outros sites More sharing options...
XPaulo 0 Postado Março 10, 2007 Share Postado Março 10, 2007 (editado) Parabéns, Uma coisa simples mas que eu não tinha notado. Só não entendi uma coisa. Porque não pode mudar o nome do npc? @Edit Entendi é que você o adapto para o Zorzin. Editado Março 10, 2007 por XPaulo Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-265731 Compartilhar em outros sites More sharing options...
Addict 12 Postado Março 13, 2007 Share Postado Março 13, 2007 Movido para Tutoriais relacionados a Scripts. Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-267799 Compartilhar em outros sites More sharing options...
Zorzin 0 Postado Março 15, 2007 Share Postado Março 15, 2007 (editado) hueaSEHUASeh \o/ My buy/sell system \o/ ehsauiehsae =) Bem legal.. =) Mas tem outras formas de fazer isso... Tipo, colocando um Storage Value no player quando ele mudar de cidade, ai dá pra saber em qual cidade que ele está, e assim o Npc Seller usará o mesmo npc script, mas vendendo Bps de cores diferentes dependendo de qual cidade o player estiver.. =D Só é um pouquinho mais complicado.. rsrs Legal o Tuto =) //Zorzin Editado Março 15, 2007 por Zorzin Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-269063 Compartilhar em outros sites More sharing options...
xhoT-BR 0 Postado Março 15, 2007 Share Postado Março 15, 2007 Não cheguei a testar, Más parece estar tudo ok. Parabens, Abraços. Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-269074 Compartilhar em outros sites More sharing options...
Felipe Moraes 151 Postado Março 23, 2007 Share Postado Março 23, 2007 sim,realmente isso é muito bom,principalmente para aqueles ots que querem fazer igual ao tibia rl...parabens pelo tutorial manow,ficou 10! Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-273291 Compartilhar em outros sites More sharing options...
Elite Serv 0 Postado Março 27, 2007 Share Postado Março 27, 2007 carak ajudo abstante vlwss Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-275376 Compartilhar em outros sites More sharing options...
hopugop 0 Postado Abril 1, 2007 Share Postado Abril 1, 2007 Mesmo mantendo o Nome do NPC, vc mudou o Script dele Então vc mudou o NPC Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-277833 Compartilhar em outros sites More sharing options...
Master Mage 0 Postado Abril 20, 2007 Share Postado Abril 20, 2007 Legal!! Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-286706 Compartilhar em outros sites More sharing options...
-LMS- 0 Postado Abril 24, 2007 Share Postado Abril 24, 2007 vc só está copiando os arquivos e mudando para ids de bps diferentes...lol Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-288448 Compartilhar em outros sites More sharing options...
Wenemy 0 Postado Fevereiro 24, 2008 Share Postado Fevereiro 24, 2008 Vou dar up nesse topico, porque esta explicando a fazer uma coisa muito legal, entao nao reclamem //The Wenemy Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-485987 Compartilhar em outros sites More sharing options...
vitiman 1 Postado Julho 27, 2008 Share Postado Julho 27, 2008 isso vai deixar o ot com um pouco mais de variedade xD Link para o comentário https://xtibia.com/forum/topic/44874-bps-de-cores-diferentes-em-cada-cidade-com-o-mesmo-npc/#findComment-590218 Compartilhar em outros sites More sharing options...
Posts Recomendados