Papai Noel Voltou

Presley
em NPCs, monsters e raids

Presley

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 07/11/05Posts: 20

Creditoz by me plx!

Eh o seguinte, como ta no titulo o npc eh o papail noel. Mais oq ele faix? Ele te da um presente variavel, pode ser dinheiro, pode ser uma laranja (n tinha oq por), pode ser uma bola de neve, etc... Bom, sem mais delongas ta aki o script:

na pasta ***\data\npc\scripts faça um arkivo xamado noel.lua e nele 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('Feliz Natal!')

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)

if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Feliz Natal ' .. creatureGetName(cid) .. '!')

focus = cid

talk_start = os.clock()

end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Por favor aguarde.')

end

if string.find(msg, '(%a*)presente(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then

present = getPlayerStorageValue(cid,1210)

if present == -1 then

buy(cid,item,1,0)

setPlayerStorageValue(cid,1210,1)

end

if ((string.find(msg, '(%a*)dwarfs ganharam(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Hohohoho issu eh muito bom!')

focus = cid

end

if present == 1 then

selfSay('Desculpe, mas nao tenho mais presentes para voce.')

end

end

if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then

selfSay('Hohoho adeus, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

function onCreatureChangeOutfit(creature)

end

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Feliz Natal!')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 3 then

selfSay('Feliz Natal!')

focus = 0

end

end

if focus == 0 then

cx, cy, cz = selfGetPosition()

randmove = math.random(1,25)

if randmove == 1 then

nx = cx + 1

end

if randmove == 2 then

nx = cx - 1

end

if randmove == 3 then

ny = cy + 1

end

if randmove == 4 then

ny = cy - 1

end

if randmove >= 5 then

nx = cx

ny = cy

end

moveToPosition(nx, ny, cz)

--summons = 30

--summons2 = 30

end

if focus > 0 then

rand = math.random(1,6)

if rand == 1 then

item = 2148

elseif rand == 2 then

item = 2973

elseif rand == 3 then

item = 1542

elseif rand == 4 then

item = 2671

elseif rand == 5 then

item = 2111

else

item = 2675

end

end

if focus == 0 then

randsay = math.random(1,75)

if randsay == 1 then

selfSay('Hmmhmm...')

end

if randsay == 2 then

selfSay('Hoho...')

end

end

end

depois na pasta ****\data\npc faça um arkivo chamado Papai Noel e nele coloque:

<?xml version="1.0"?>

<npc name="Santa Claus" script="data/npc/scripts/noel.lua" access="3" lookdir="2">

<mana now="800" max="800"/>

<health now="200" max="200"/>

<look type="160" head="0" body="94" legs="0" feet="94"/>

</npc>

gostaram? n? comentem d qq jeito ok??? flws um abraço

GM Crazy

Banido
avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 27/01/06Posts: 16

é bom para quem gosta do papai noel

^^

[Banido por Ripping]

diogoporra

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 01/07/06Posts: 11

ee ta bom mas ja tenho aki mas ta aprovado!

Noxidy__

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/09/06Posts: 87

vo coloka no meu agora

;DD

maiss

axo

ki vai fika bOmm

=D

flww

noxxxdlm8.jpg

Sou:
64zw4.jpg

NPC MAKER

Contact me:
j.jungblut@hotmail.com

God Tarzan

Banido
avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 25/09/06Posts: 10

ACHEI MEIO SEM GRAÇA BAH

mAS QUE BOM VC FEZ rOx APRABENS

[ASSINATURA REMOVIDA, FORA DAS REGRAS]

SHUMI

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/06/06Posts: 15

Rox meu ot no natal nao vai poder ter pq é desert 1.2 :( se algum tive uma ideia aonde eu coloko fala aew fi!

[Assinatura irregular, consulte as regras]
Addict

MazX

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/10/06Posts: 25

nossa muito legal santa claus xD bom vo ver ser coloca no ot


<span style='color:green'>Voce é Meu Fan?</span>

Meus Fans

Vitinhu_Foda69

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/10/06Posts: 20

um otmo npc pro natal

My Webpag
victor.ravagnani@hotmail.com
Metas
10 Post [x]
20 Post [x]
30 Post [x]
40 Post []
50 Post [ ]
60 post [ ]
70 post [ ]
80 post [ ]
90 post [ ]
100 post [ ] ou + !

lepri

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/10/06Posts: 6

Otimo o meu serv eh de neve fiko mto legal!

Gotcky

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/11/06Posts: 6

A ideia ate que e legal, mais ta mau trabalhada.. esse npc faz muito poquinha coisa... mais pra quem gosta do papai noel.. bota alguma coisa a mais como uma quest para ganhar o item.. ou algo do tipo..

flws

Retired of X tibia... now in other Ot server forum.. helping more Players..

tibiaa4e

Ex amante de Tibia
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 18/12/05Posts: 912Gênero: MasculinoChar no Tibia: Kohzete

rox

ele naum vai ser mto util

+ eu keri saber como fazer randon em npcs

e agr ja sei

flws

Aposentado de OTserver e Tibia

Meus melhores tutoriais
Enciclopédia Pasta Data
Tutorial de quest

Rocksody

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/09/06Posts: 66

deveria identificar esses ids:

if focus > 0 then

rand = math.random(1,6)

if rand == 1 then

item = 2148

elseif rand == 2 then

item = 2973

elseif rand == 3 then

item = 1542

elseif rand == 4 then

item = 2671

elseif rand == 5 then

item = 2111

else

item = 2675

end

end

nao sei porque mas meu ot ja veio com um igual a esse em ingles, vo trocar por esse ai em portugues.

EDIT:

vo esqueceu de traduzir o nome do npc tambem:

<npc name="Santa Claus" script="data/npc/scripts/noel.lua" access="3" lookdir="2">

EDIT2:

Voce coloco ids totalmentes errados para 7.6 e o papai noel ta dando coisa pra quem ja tinha, no meu ots eu puz assim:

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('Feliz Natal!')

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)

if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Feliz Natal ' .. creatureGetName(cid) .. '!')

focus = cid

talk_start = os.clock()

end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Por favor aguarde.')

end

if string.find(msg, '(%a*)present(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then

present = getPlayerStorageValue(cid,2331)

if present == -1 then

buy(cid,2331,1,0)

setPlayerStorageValue(cid,2331,1)

end

if ((string.find(msg, '(%a*)dwarfs ganharam(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Hohohoho issu eh muito bom!')

focus = cid

end

if present == 1 then

selfSay('Desculpe, mas nao tenho mais presentes para voce.')

end

end

if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then

selfSay('Hohoho adeus, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

function onCreatureChangeOutfit(creature)

end

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Feliz Natal!')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 3 then

selfSay('Feliz Natal!')

focus = 0

end

end

if focus == 0 then

cx, cy, cz = selfGetPosition()

randmove = math.random(1,25)

if randmove == 1 then

nx = cx + 1

end

if randmove == 2 then

nx = cx - 1

end

if randmove == 3 then

ny = cy + 1

end

if randmove == 4 then

ny = cy - 1

end

if randmove >= 5 then

nx = cx

ny = cy

end

moveToPosition(nx, ny, cz)

--summons = 30

--summons2 = 30

end

if focus == 0 then

randsay = math.random(1,75)

if randsay == 1 then

selfSay('Feliz Natal A Todos!')

end

if randsay == 2 then

selfSay('Hoho...')

end

end

end

E tem mais, para ots 7.6 tem 2 presentes com diferentes ids, eu usei o id 2331 mas se quiser um presente vazio para por coisa dentro use 1990

abco

Aizen

Retired de tibia nao do xtibia...
Jogando Hero Online,
abco!

skynagerloas

Ex-Moderador
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 13/11/05Posts: 715Char no Tibia: Lord'Skyxt

Tópico contendo somente 1 NpC,

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

~o{Tópico Movido}o~,

Abraços.

Atenciosamente, Sky - Lord'Skyxt;

 

Antes de postar, leia isso:



Regras.

[Lord'SkyXT] [FloGão]