WI

Um Papai Noel Meiu Diferente

Por willianbertindemelo, 16 de dez. de 2006 em NPCs, monsters e raids

script
36
7.3k
16 de dezembro de 2006 às 21:46

bom e bem simples vamos começar...

e assim e so abrir a pasta npcs do seu ot copiar um dos arquivos xml

renomeio colokandu issu ...... Papai Noel.xml

editio e cole issu

 

<?xml version="1.0"?><npc name="Papai Noel" script="data/npc/scripts/noel.lua" access="3"><look type="12" head="20" body="30" legs="40" feet="50"/></npc>

 

agora va nos scripts q esta dentro da pasta npc...

copie um arquivo lua q tem la renomeio com issu : noel.lua

agora editeo e cole issu:

 

focus = 0talk_start = 0target = 0following = falseattacking = falsefunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos)if focus == cid thenselfSay('######, nem fala xau.')focus = 0talk_start = 0endendfunction 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)if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 3 thenselfSay('HohOhoOho, Feliz Natal ' .. creatureGetName(cid) .. ', você quer seu presente?')focus = cidtalk_start = os.clock()elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3 thenselfSay('Ja bou dar seu presente se acalma!')elseif focus == cid thentalk_start = os.clock()if msgcontains(msg, 'sim') or msgcontains(msg, 'presente') or msgcontains(msg, 'present') thenpresente = getPlayerStorageValue(cid,7913)present = math.random(1,350)if presente == -1 and present <= 40 thenbuy(cid,2674,15,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 40 and present <= 80 thenbuy(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 thenbuy(cid,2687,30,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 120 and present <= 160 thenbuy(cid,2688,7,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present == 161 thenbuy(cid,2195,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 161 and present <= 201 thenbuy(cid,2678,7,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 201 and present <= 211 thenbuy(cid,2152,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 211 and present <= 221 thenbuy(cid,2152,5,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 221 and present <= 231 thenbuy(cid,2152,12,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 231 and present <= 248 thenbuy(cid,2152,15,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 249 and present <= 250 thenbuy(cid,2152,100,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present == 249 thenbuy(cid,2152,100,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 250 and present <= 260 thenbuy(cid,2183,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 260 and present <= 280 thenbuy(cid,2187,100,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 280 and present <= 320 thenbuy(cid,2352,50,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 320 and present <= 322 thenbuy(cid,2487,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present == 350 thenbuy(cid,2173,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 322 and present <= 349 thenbuy(cid,2669,5,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseselfSay('Voce ja recebeu seu presente! so temos presentes sobe conta!')endelseif msgcontains(msg, '######') thenselfSay('/kick ' .. creatureGetName(cid) .. '')elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 3 thenselfSay('Flw, ' .. creatureGetName(cid) .. '!')focus = 0talk_start = 0endendendfunction onCreatureChangeOutfit(creature)endfunction onThink()if (os.clock() - talk_start) > 30 then	   if focus > 0 then		  selfSay('Proximo plxx...')	   end	  focus = 0	end   if focus ~= 0 then	  if getDistanceToCreature(focus) > 3 then		 selfSay('flw, mal educado.')		 focus = 0	  end   endend

 

agora bota seu ot on i de /s Papai noel

xD

ou se coloka ele no seu map editor!!!

byebye

se gostarem do meu npc estarei postandu mais alguns heheheh!!

poh genti comenta ai né... :confused:

Editado Abril 4 por willianbertindemelo

Gm DuduG
18 de dezembro de 2006 às 10:11

na proxima tenta por isso nun dentro do CODE

pq tem gente que não sabe aonde começa e termina o codigo blz?

ta legal.. eu vou pegar e editar as falas pro ingles pra mim por no meu ot..

 

focus = 0talk_start = 0target = 0following = falseattacking = falsefunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos)if focus == cid thenselfSay('######, nem fala xau.')focus = 0talk_start = 0endendfunction 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)if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 3 thenselfSay('HohOhoOho, Feliz Natal ' .. creatureGetName(cid) .. ', você quer seu presente?')focus = cidtalk_start = os.clock()elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3 thenselfSay('Ja bou dar seu presente se acalma!')elseif focus == cid thentalk_start = os.clock()if msgcontains(msg, 'sim') or msgcontains(msg, 'presente') or msgcontains(msg, 'present') thenpresente = getPlayerStorageValue(cid,7913)present = math.random(1,350)if presente == -1 and present <= 40 thenbuy(cid,2674,15,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 40 and present <= 80 thenbuy(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 thenbuy(cid,2687,30,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 120 and present <= 160 thenbuy(cid,2688,7,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present == 161 thenbuy(cid,2195,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 161 and present <= 201 thenbuy(cid,2678,7,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 201 and present <= 211 thenbuy(cid,2152,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 211 and present <= 221 thenbuy(cid,2152,5,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 221 and present <= 231 thenbuy(cid,2152,12,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 231 and present <= 248 thenbuy(cid,2152,15,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 249 and present <= 250 thenbuy(cid,2152,100,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present == 249 thenbuy(cid,2152,100,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 250 and present <= 260 thenbuy(cid,2183,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 260 and present <= 280 thenbuy(cid,2187,100,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 280 and present <= 320 thenbuy(cid,2352,50,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 320 and present <= 322 thenbuy(cid,2487,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present == 350 thenbuy(cid,2173,1,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseif presente == -1 and present > 322 and present <= 349 thenbuy(cid,2669,5,0)selfSay('Feliz natal, aproveite bem seu presente!! HoHouhohuho')setPlayerStorageValue(cid,7913,1)elseselfSay('Voce ja recebeu seu presente! so temos presentes sobe conta!')endelseif msgcontains(msg, '######') thenselfSay('/kick ' .. creatureGetName(cid) .. '')elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 3 thenselfSay('Flw, ' .. creatureGetName(cid) .. '!')focus = 0talk_start = 0endendendfunction onCreatureChangeOutfit(creature)endfunction onThink()if (os.clock() - talk_start) > 30 thenif focus > 0 thenselfSay('Proximo plxx...')endfocus = 0endif focus ~= 0 thenif getDistanceToCreature(focus) > 3 thenselfSay('flw, mal educado.')focus = 0endendend

 

18 de dezembro de 2006 às 12:16

fmz vlws e q sao meus primeiros posts de scripts e talz ;):bye:

18 de dezembro de 2006 às 12:44

Vlw ae os dois. Coloquei no meu server. xD

PabloLMNP
23 de dezembro de 2006 às 19:46

Aew vlw tava precisando :bigsmile:

:bye::bye::bye:

velokitV
23 de dezembro de 2006 às 20:13

Outift que venho eh muito feia xD..

Mais eu arrumei aqui e axei massa.

bem loko

23 de dezembro de 2006 às 20:21

por issu q eu colokei no nome q era meiu diferente ....é q eu num tinha nda para fazer nu dia ai passei aki no xtibia peguei um dos papais noeis i fiz du meu jeitu o resto

ai aaxei q fico legalzin e resolvi postar aki!!

espero q gostem do demon azul... :icon3: ...ops papai noel uhsauhsauhsa :bye:

danzellD
23 de dezembro de 2006 às 20:30

eu tambem cologuei no meu ot muito fera d+

novatoN
24 de dezembro de 2006 às 17:17

tava presisando o do meu ot so dava corpo pros players ¬¬

24 de dezembro de 2006 às 22:31

bom proveitu mais num entendi a parte q tava dandu corpos.....?? o.O

2 meses depois...
p4rd4lP
12 de fevereiro de 2007 às 23:02

Ae galera, por favor me respondam uma pergunta meio noob mais que vai me ajuda muitooo

 

tpw, aonde eu vo pra saber onde eu quero que meu npc fique...

 

exemplo... eu quero que fique em x 127 y 42 z 7 como faço pra ele ficar la??

 

vlw ^^

2 semanas depois...
ThiachT
26 de fevereiro de 2007 às 18:12

vlw precisavadisso

vobota no meu ot...

fuiz

3 meses depois...
skynagerloasS
24 de maio de 2007 às 21:42

Tópico contendo somente 1 NpC,

essa seção é para DataPacks com 3 ou mais Npcs,

~o{Tópico Movido}o~,

Abraços.

2 meses depois...
ShugoS
09 de julho de 2007 às 22:41

Oo rox d+! vlw aew

3 semanas depois...
lucasmlimaL
28 de julho de 2007 às 15:36

Doidão em... D + MT ROXX