CIAKILLES 0 #1 Posted December 19, 2008 (edited) Quero aproveitar para falar que este script foi copiado do ot do meu amigo, e aprimorado por min. Não tinha nenhum crédito nele, a partir de hoje, encontra-se proibida a reprodução do mesmo arquivo, por questões éticas e morais. Este arquivo é único e exclusivo desta postagem! [ OtNet ] Titulo: [8.1] Santa Claus by CIAkilles ------------------------------- Nome: Santa Claus Versão: 8.1 Tipo do script: NPC Servidor Testado: Aries 3.0a by Felipe Muniz Autor: CIAkilles ------------------------------- Este é Um Npc de Natal, parecido com o do tibia real Vá na pasta C:\OT\Ot\data\npc, abra ela, copie um arquivo presente La e renome-i esse para Santa Claus.xml, abra-o e apague tudo que tem dentro, substituindo por isto: <?xml version="1.0"?> <npc name="Santa Claus" script="data/npc/scripts/santa claus.lua" access="3" speed="60"> <look type="128" head="24" body="77" legs="10" feet="20"/> </npc> Depois de feito isso, vá na pasta scripts que fica ali no mesmo diretório, e copie um arquivo, após copiado, renome-i esse arquivo para Santa Claus.lua, abra-o e substitua o conteúdo por isso: focus = 0 talk_start = 0 target = 0 following = false 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) if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 3 then selfSay('HohOhoOho, Merry Christmas ' .. creatureGetName(cid) .. ', if you behaved well this year?') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute!') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'yes') or msgcontains(msg, 'present') or msgcontains(msg, 'merry christmas') then presente = getPlayerStorageValue(cid,7913) present = math.random(1,350) if presente == -1 and present <= 40 then buy(cid,2674,1,0) selfSay('Merry Christmas, enjoy your well this!! HoHouhohuho') setPlayerStorageValue(cid,7913,1) elseif presente == -1 and present > 40 and present <= 80 then buy(cid,2675,10,0) selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho') setPlayerStorageValue(cid,7913,1) elseif presente == -1 and present > 80 and present <= 120 then buy(cid,2687,30,0) selfSay('Merry Christmas, enjoy your well this!! HoHouhohuho') setPlayerStorageValue(cid,7913,1) elseif presente == -1 and present > 120 and present <= 160 then buy(cid,2688,10,0) selfSay('Merry Christmas, enjoy your well this!! HoHouhohuho') setPlayerStorageValue(cid,7913,1) elseif presente == -1 and present > 322 and present <= 349 then buy(cid,2669,5,0) selfSay('Merry Christmas, enjoy your well this!! HoHouhohuho') setPlayerStorageValue(cid,7913,1) else selfSay('Have you ever received your gift! so we have to present rises!') end elseif msgcontains(msg, 'fuck') then selfSay('/kick ' .. creatureGetName(cid) .. '') elseif string.find(msg, '(%a)bye(%a)') and getDistanceToCreature(cid) < 3 then selfSay('Good bye then, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 3 then selfSay('Good bye then.') focus = 0 end end end O que esta em Vermelho é a Id do item, e em amarelo é a quantidade do item que será dado ao player, nada terá muito valor, no formulado por min. Mais se quiser editar para seu ot, e mudar os itens ou os valores vai de sua conta, ^^ mais não edite o resto para não dar erro nenhum. Se acharem algum debug, por favor me contatar para que eu possa editar a postagem e arrumá-lo, espero que gostem... :fun: Espero ter ajudado, e feliz natal a todos Edited December 20, 2008 by CIAKILLES colocar como o Mock solicitou Share this post Link to post
Mock 32 #2 Posted December 20, 2008 (edited) Apesar do script ja existir ele é para 8.2 e nao funciona em areies essa e a versao p aries e funciona apesar de ja existir como a versao é para 8.1 irei aprovar... Aprovado Edited December 20, 2008 by Mock Share this post Link to post
CIAKILLES 0 #3 Posted December 20, 2008 Valeu por aprovar, mais mesmo asim nao achei o script pra 8.2 .... :fist: e feliz natal a todos! Créditos : 98% pra min por fazer, 1% para o meu amigo, por ceder o script errado e testar e 1% pro mock que avalio o script! Share this post Link to post