Ir para conteúdo

Npc Q Testa Voce


R@U£

Posts Recomendados

awe esse npc e o npc de test muito rox manow

primeiro va em npc/scripts e fas um assim

focus = 0

contador = 0

talk_start = 0

target = 0

following = false

attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end

function onCreatureAppear(creature)

end

function onCreatureDisappear(id, stackpos)

if id == focus then

focus = 0

contador = 0

selfSay("Ate breve.")

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) < 3 then

selfSay('HeheheHaHaHae ' .. creatureGetName(cid) .. ' Quer testar suas abilidades! Se vc quiser fale ok?')

contador = 1

focus = cid

talk_start = os.clock()

end

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

selfSay('Só tem lugar pra um ' .. creatureGetName(cid) .. '.')

end

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

jogar = getPlayerStorageValue(cid,3333)

if jogar == 1 then

selfSay('Podemos começar?')

contador = 5

setPlayerStorageValue(cid,3333,1)

end

if jogar == -1 then

selfSay('Desculpe, voce ja participou.')

end

end

if msgcontains(msg, 'sim') and focus == cid and contador == 5 then

selfSay('Vamos lá! Primeira Pergunta: Qual é o bixo mais forte? 1-demon, 2-snake, 3-monk, 4-worms')

contador = 2

talk_start = os.clock()

end

if string.find(msg, '(%a*)worms(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)monk(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)snake(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'sim') and focus == cid and contador == 1 then

talk_start = os.clock()

queststatus = getPlayerStorageValue(cid,2563)

if queststatus == -1 then

selfSay('Vamos para a primeira pergunta, esta pronto?')

contador = 3

else

selfSay('Voce ja perdeu...')

end

end

if msgcontains(msg, 'demon') and focus == cid and contador == 2 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 6

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 6 then

selfSay('Vamos lá! Segunda Pergunta: com q se pesca? 1-worms, 2-laranja, 3-pedra, 4-mato.')

contador = 7

talk_start = os.clock()

end

if string.find(msg, '(%a*)laranja(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)mato(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)pedra(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'worms') and focus == cid and contador == 7 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 8

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 8 then

selfSay('Vamos lá! Terceira Pergunta: qual a cidade mais chata de jodar? 1-carlin, 2-thais, 3-Edron, 4-darashia.')

contador = 9

talk_start = os.clock()

end

if string.find(msg, '(%a*)darashia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)edron(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)thais(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'carlin') and focus == cid and contador == 9 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 10

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 10 then

selfSay('Vamos lá! Quarta Pergunta: qual e o estado do brasil? 1-brasilia, 2-sao paulo, 3-itobi, 4-vgs.')

contador = 11

talk_start = os.clock()

end

if string.find(msg, '(%a*)vgs(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)sao paulo(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)itobi(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'brasilia') and focus == cid and contador == 11 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 12

talk_start = os.clock()

end

if msgcontains(msg, 'sim') and focus == cid and contador == 12 then

selfSay('Vamos lá! Última Pergunta!!! qual é o bixo q vc tem mais medo de morre? 1-Orshabaal, 2-ciclop, 3-worms, 4-troll.')

contador = 11

talk_start = os.clock()

end

if string.find(msg, '(%a*)troll(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)ciclop(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)worms(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'orshabaal') and focus == cid and contador == 11 and getDistanceToCreature(cid) < 3 then

selfSay('Certa a Resposta!!!!! Voce ganhou seu premio!')

selfSay('Let\'s go!')

    selfSay('/send ' .. creatureGetName(cid) .. ', 275 86 4')end

if msgcontains(msg, 'nao') or msgcontains(msg, 'não') and focus == cid and getDistanceToCreature(cid) < 3 then

selfSay('OK, mas perdeu uma grande chance!')

focus = 0

talk_start = 0

end

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

selfSay('Adeus, Boa Sorte. HahahaHeheHAhae')

focus = 0

talk_start = 0

end

end

function onCreatureChangeOutfit(creature)

end

function onThink()

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

if focus > 0 then

selfSay('Quem qr testar suas abilidades!?')

end

focus = 0

end

--nothing special has happened

--but perhaps we want to walk around a bit?

if focus == 0 then

cx, cy, cz = selfGetPosition()

randmove = math.random(1,50)

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

end

dpois de ter feito isso va em word/npc e coloke

<npc name="Test" x="145" y="51" z="7" dir="0"/>

Creditos By R@U£

Quarquer duvida ou erro poste

ai vlwsssss

flwsssssss

Link para o comentário
Compartilhar em outros sites

  • Respostas 54
  • Created
  • Última resposta

Top Posters In This Topic

  • 3 weeks later...

aew cara..

não entendi direito o que o NPC faz não cara..

você poderia explicar melhor..

ficar lendo os códigos pra entender o tópico fica ruim :confused:

mas depois de ler os códigos já entendi melhor =P

só isso..explica melhor no inicio do tópico cara =]~

vlws

flws ae

fuiz!!

Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
  • 4 weeks later...
  • 1 month later...

if msgcontains(msg, 'sim') and focus == cid and contador == 10 then

selfSay('Vamos lá! Quarta Pergunta: qual e o estado do brasil? 1-brasilia, 2-sao paulo, 3-itobi, 4-vgs.')

contador = 11

talk_start = os.clock()

end

if string.find(msg, '(%a*)vgs(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)sao paulo(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if string.find(msg, '(%a*)itobi(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then

selfSay('Errado!')

focus = 0

talk_start = 0

end

if msgcontains(msg, 'brasilia') and focus == cid and contador == 11 then

selfSay('Certa a Resposta! Podemos continuar?')

contador = 12

talk_start = os.clock()

end

VOCÊ NUNCA ESTUDO GEOGRFIA??

BRASILIA NON É ESTADO --'

É UM DISTRITO OU SEJA A RESPOSTA SCERTA É SÃO PAULO

Tirando isto VeryGood. Mais acho qe tem um aprecido no [Retirado] u.u

//Kenzo

Link para o comentário
Compartilhar em outros sites

Olá

Tambem não gostei

Umas perguntas nada a ve, e respondendo a de alguns usuários acima,

O npc te pergunta as coisas e tals, quando vc chega na ultima pergunta e diz orshabal ele te teletransporta pra um lugar e que no caso o objetivo seria de ter um orshabaal pra vc morrer...

//Greh

Link para o comentário
Compartilhar em outros sites

Ta maneiro

SO q algumas respostas estao erradas

E se o kra chegou ate a ultima pergunta é pq o kra é burro pq respondeu tudo errado

Se ele for esperto nao morre (quase nao existe inteligentes)

Se ele for burro morre (a maioria é burra msm)

Bricandeira so pra tirar esse clima pesado daki

Mas o tuto esta bom parabens

FLW

Link para o comentário
Compartilhar em outros sites


×
×
  • Criar Novo...