Iae galera, eu "projetei" um NPC que vende casas... tipo, como eu n entendo muito, mas vou postar os codigos...
-----------------------------
**Sujiro ke faça isso com o server OFF**
Lá vai:
Primeiro:Voce vai no arkivo de houses do Data! (É o XML ki mostra as coordenadas das casas!!)ai depois vc pega um casa qualquer e bota uma coordenada (por exemplo: uma aonde vc irá botar o NPC)depois vc vai na pasta: data/npc/scripts e da CONTROL+C CONTROL+V em qualquer script e renomeie por: house_seller. Delete tudo oque está lá dentro e bote isto:
focus = 0talk_start = 0target = 0following = falseattacking = falsefunction 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) msg = string.lower(msg) if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 3 then selfSay('Hello, ' .. creatureGetName(cid) .. '! Do you want to buy a house for 50000gps??') focus = cid talk_start = os.clock() elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif msgcontains(msg, 'no') and focus == cid then selfSay('Ok.') talk_start = os.clock() elseif msgcontains(msg, 'yes') and focus == cid then if play(cid, 50000) selfSay('/owner '.. creatureGetName(cid) ..' ') talk_start = os.clock() elseif string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 endendfunction onCreatureChangeOutfit(creature)endfunction onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next Please...') end focus = 0 endend
------------------------------------
Eu tentei testar... mas deu bug!! Keria saber se tem como fazer issu msm?!?!!?!?!
Minha Ideia: fazer um NPC para kada casa, e botar esses NPC em um quadrado ke seja da kasa!! Ai se o kara comprar.. o NPC da /owner!!! Keria saber tbm o codigo de fazer tipow o NPC pesquisar para ver se essa casa jah tem dono...
-----------------------------------
Créditos: Fabricio
Dou suporte via MSn: fabricio_grunge@hotmail.com