Ir para conteúdo
Entre para seguir isso  
MotoBoy

Papai Noel

Recommended Posts

MotoBoy    0
MotoBoy

----------------------------------------

Nome: Papai Noel

.

Versão: acredito que 8.1 +

.

Tipo do script: NPC

.

Servidor Testado: YourOts 8.1 (nem sei se é assim que escreve)

.

Autor: No final do topico

-----------------------------------------

 

 

pessoal.. pra este natal ae.. todos já podem adicionar o papai noel ao seu OT ^^

é sempre legal isso =D

 

porém vamos direto ao script.. não tem muito oque explicar né? ^^

é só um papai noel que te dá presentes ^^

 

testado no Yourots 8.1:fist:

 

copie um arquivo da pastas NPCs/scripts, renomeie para papai.lua, apague tudo que estiver dentro dele e coloque isto:

 

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('Flws...')
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)

cname = creatureGetName(cid)
lvl = getPlayerLevel(cname)
[color=#00ff00]msglvl = 'MSG DE FALTA DE LVL'[/color]
[color=#ff0000]lvlmin = LEVEL_PARA_GANHAR[/color]

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 and lvl >= lvlmin then
[color=#ff0000]msg_inicial = 'COLOQUE A MSG INICIAL AQUI.'[/color]

selfSay(msg_inicial)
focus = cid
talk_start = os.clock()

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 and lvl >= lvlmin then
selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Falo com voce em um minutinho.')

elseif (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 and lvl < lvlmin then
selfSay(msglvl)
focus = 0
talk_start = 0

elseif focus == cid then
talk_start = os.clock()

if msgcontains(msg, 'sim') then
[color=#ff0000]sorte = math.random(1,6)[/color]
[color=#0000ff]jogoid = UNIQUE ID PARA O 'JOGO'[/color]
[color=#00ff00]jogo = getPlayerStorageValue(cid,jogoid)[/color]
[color=#ff0000]id1 = ALGUM ID[/color]
[color=#0000ff]id2 = ALGUM ID[/color]
[color=#00ff00]id3 = ALGUM ID[/color]
[b]msgid1 = 'Voce ganhou alguma coisa!'[/b]
[b]msgid2 = 'Voce ganhou alguma coisa!'[/b]
[b]msgid3 = 'Voce ganhou alguma coisa!'[/b]
[b]msgerro = 'Voce ja ganhou alguma coisa!'[/b]

if sorte == 1 and jogo == -1 or sorte == 2 and jogo == -1 then
selfSay(msgid2)
buy(cid,id2,1,0)
setPlayerStorageValue(cid,jogoid,1)
focus = 0
talk_start = 0

elseif sorte == 3 and jogo == -1 or sorte == 4 and jogo == -1 or sorte == 5 and jogo == -1 then
selfSay(msgid1)
buy(cid,id1,1,0)
setPlayerStorageValue(cid,jogoid,1)
focus = 0
talk_start = 0

elseif sorte == 6 and jogo == -1 then
selfSay(msgid3)
buy(cid,id3,1,0)
setPlayerStorageValue(cid,jogoid,1)
focus = 0
talk_start = 0
elseif jogo == 1 then
selfSay(msgerro)
focus = 0
talk_start = 0
end
end

if string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Flws, ' .. 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(0)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(1)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(3)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(1)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(3)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(2)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(0)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(1)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(3)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(2)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(0)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(1)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(3)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(2)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(0)
end
end

if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Proximo...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Flws...')
focus = 0
end
end
end

 

 

msg_inicial = 'COLOQUE A MSG INICIAL AQUI.'

Coloque a fala inicial (quando o player fala hi) aqui.

Se quiser que o NPC fale o nome da pessoa, coloque ' .. cname .. ' (exatamente como está) na frase.

 

sorte = math.random(1,6)

Código da Sorte. Verifica a sorte da pessoa. O 1,6 é a sequência de sorte que pode acontecer.

Caso você queira adicionar alguns itens, terá que mexer no 1,6.

 

jogoid = UNIQUE ID PARA O 'JOGO'

Unique ID utilizado na 'quest' do 'jogo' do papai noel.

 

jogo = getPlayerStorageValue(cid,jogoid)

Código que verifica se o jogador já fez a quest. Caso queira que o npc fique entregando presentes para a mesma pessoa PERMANENTEMENTE, retire tudo que tiver 'jogo' (exatamente como está escrito) do script

 

id1 = ALGUM ID

ID do item mais fácil de pegar com o NPC

 

id2 = ALGUM ID

ID do 2° item mais fácil de pegar com o NPC

 

id3 = ALGUM ID

ID do item mais difícil de pegar com o NPC

 

msgid1 = 'Voce ganhou alguma coisa!'

Mensagem que aparece quando a pessoa ganha o item mais fácil de achar.

 

msgid2 = 'Voce ganhou alguma coisa!'

Mensagem que aparece quando a pessoa ganha o 2° item mais fácil de achar.

 

msgid3 = 'Voce ganhou alguma coisa!'

Mensagem que aparece quando a pessoa ganha o item mais difícil de achar.

 

msgerro = 'Voce ja ganhou o seu premio!'

Mensagem que aparece quando a pessoa já utilizou o NPC.

 

lvlmin = LEVEL_PARA_GANHAR

Troque o 'level_para_ganhar' pelo número do level que o personagem tem que ter para ganhar o prêmio. Caso ele não tenha o level suficiente, irá aparecer a 'msglvl'

 

msglvl = 'MSG DE FALTA DE LVL'

mensagem que aparece quando o char não tem level suficiente.

 

segunda parte^^

 

 

agora copie um arquivos da pasta NPCs, renomeie para papai e apague tudo que tem dentro..

coloque isto:

 

<?xml version="1.0"?>

<npc name="Papai Noel" script="data/npc/scripts/papai.lua" access="5" lookdir="1">
<health now="1000" max="1000"/>
<look type="160" head="19" body="94" legs="132" feet="95" addon="0" corpse="3128"/>
</npc>

 

 

 

Créditos:

99% By Hokage Chuck (criador)

1% By Alisson Linneker (me apresentou o script)

0% Pra mim.. quem posta não tem crédito.. não faz mais doque a obrigação ^^

 

flws~~

Editado por MotoBoy
colocar o padrão de postagem

Compartilhar este post


Link para o post
Nord    2
Nord

Legal cara, lembro que uma vez tinha um papai noel num OT com mapa SadTeam.

 

Aprovado

Compartilhar este post


Link para o post
MotoBoy    0
MotoBoy

Obrigado pela aprovação^Nord..

eu estava tentando misturar esse script com o do Mock.. que liga a arvore de natal a cada 1 ano ^^

 

@Nord.. eu sou o PG Lanzilotti.. =P

se eu conseguir fazer o outro script ele vem direto pra cá okz? ^^

 

flws~~

Compartilhar este post


Link para o post
dede1    0
dede1

Legal seu papai noel =)

 

oQ fiz era diferente..Sabe pq o meu dava infernal de presente ai os players choraavam...

 

apskoaposkpaoksa...

 

Zuaçao vlws ai belo post

Compartilhar este post


Link para o post
MotoBoy    0
MotoBoy

sauhsuahs =P

vlw ^^

que bomq gostou =P

flws~~

Compartilhar este post


Link para o post
FakLess    0
FakLess

Legal...;D

Assim NGuem vai reclama que não ganho nd de nataal ;P

hehehe

Flw

Compartilhar este post


Link para o post
ivan1993    0
ivan1993

muito bom msm...

Compartilhar este post


Link para o post
Keys    0
Keys

legal, me lembrei do papai noel do tibia hehe

Compartilhar este post


Link para o post
Sethz    0
Sethz

ta bem rox =D

bem util

vlw ae

Compartilhar este post


Link para o post
Dragon45    0
Dragon45

pega no 8.4

Compartilhar este post


Link para o post
Fastzin    0
Fastzin

Pega no 8.50?

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×