Ir para conteúdo

Featured Replies

Postado

Bom galera preciso de um npc de missão que tenha as seguintes coisas :

Você fala : Hi

Ele : Olá eu sou o husky caçador da academia gennin , há muito tempo tento caçar uma fera que está no topo da montanha ao leste da academia e vive atacando todos.. preciso de "ajuda" !

Você : Ajuda

Ele : Você quer me ajudar ? mate a fera e traga o seu item especial que lhe darei uma recompensa !!

Ai começa a missão se você trazer certo item .. ganha recompensa .. , não precisa botar id dos itens eu boto só me falar onde mexer ,

lembrando que é uma missão e não poderá fazer mais de 1 vez caso tente falar de novo com ele ele diria : Obrigado por me ajudar

Bom galera é isso a script base que meu amigo falou é essa :

-- the id of the creature we are attacking, following, etc.

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)

msg = string.lower(msg)

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

if getPlayerSex(cid) == 19 or getPlayerSex(cid) == 20 or getPlayerSex(cid) == 21 or getPlayerSex(cid) == 22 then

selfSay('Ola, ' .. creatureGetName(cid) .. '! Sou SATO, me passaram uma missão para você sobre "informaçoes".')

focus = cid

talk_start = os.clock()

else

selfSay('O que você está fazendo aqui? Você não é um Ninja de Konoha.')

focus = 0

talk_start = 0

end

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

selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Falo com você jaja.')

elseif focus == cid then

talk_start = os.clock()

end

--=====================================================

if msgcontains(msg, 'informaçoes') and focus == cid then

if getPlayerStorageValue(cid,0012) == -1 then

selfSay('Você deverá me trazer um "pergaminho" que está com um Ninja de suna são informaçoes do nosso inimigo!.')

setPlayerStorageValue(cid,1234,1)

else

selfSay('Desculpe, Missão já realizada...')

end

end

if msgcontains(msg, 'pergaminho') or msgcontains(msg, 'informaçoes') and focus == cid then

talk_start = os.clock()

queststatus = getPlayerStorageValue(cid,0012)

if queststatus == -1 then

itemstatus = doPlayerRemoveItem(cid,1974)

if itemstatus == -1 then

selfSay('...')

else

setPlayerStorageValue(cid,0012,1)

selfSay('Tome uma recompensa pelo seu trabalho!".')

buy(cid,2148,100,0)

buy(cid,2464,1,0)

setPlayerStorageValue(cid,1234,0)

setPlayerStorageValue(cid,1235,level)

selfSay('/makesay ' .. creatureGetName(cid) .. ',/z 41')

end

else

selfSay('Obrigado.')

end

end

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

selfSay('Até breve, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

if getPlayerStorageValue(cid,0009) >= 1 then

if msgcontains(msg, 'lolramen') and focus == cid then

talk_start = os.clock()

queststatus = getPlayerStorageValue(cid,0003)

queststatus2 = getPlayerStorageValue(cid,0015)

if queststatus2 == -1 then

itemstatus = doPlayerRemoveItem(cid,2625)

if itemstatus == -1 then

selfSay('Where is my ramen??')

else

setPlayerStorageValue(cid,0003,queststatus+1)

setPlayerStorageValue(cid,0015,1)

selfSay('Oh! Thanks!')

selfSay('/makesay ' .. creatureGetName(cid) .. ',/z 41')

end

else

selfSay('...')

end

end

else

selfSay('....')

end

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

selfSay('Até Breve, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

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 focus == 0 then

randmove = math.random(1,50)

if randmove == 1 then

selfMove(0)

end

if randmove == 2 then

selfMove(1)

end

if randmove == 3 then

selfMove(2)

end

if randmove == 4 then

selfMove(3)

end

end

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

if focus > 0 then

selfSay(' tchau...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Até breve.')

focus = 0

end

end

end

end

Quem ajudar rep + se funfar + rep + uhahuauha

Agradeço.

PS : A recompensa seria um item ( dinheiro ) e + 1000 de exp ( Não obrigatorio se não conseguirem )

Usem essa base porque o server é 7.81 , outras não deverão funcionar

Editado por Desnecessario (veja o histórico de edições)

  • Respostas 5
  • Visualizações 555
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Ae cara, tava com um pouco de tempo aqui no serviço ae baixei um server 7.6 e vi as funções dele... fiz esse script em 7.6, provavelmente funcione em 7.81... Tutorial do script, meio por cima:

  • Ae cara, tipo arrumei alguns erros que encontrei no script e testei ele abrindo o distro do OT... bem ele nao apresentou mais nenhum erro e abriu a distro normalmente!! agora teste ele dentro do

  • Descobri o motivo do erro.. quando vc copiou aqui do forum ele copiou as sintax de código html do site, fazendo com que o distro nao entenda... então tem um modo de eu mandar private o script para vc?

Posted Images

Postado

Ae cara, tava com um pouco de tempo aqui no serviço ae baixei um server 7.6 e vi as funções dele... fiz esse script em 7.6, provavelmente funcione em 7.81...

Tutorial do script, meio por cima:

quando vc falar ajuda ele verificara se vc tem o storagevalue '60000' se vc tiver ele agradecera falando q nao precisa mais de vc, se vc não tiver ele pedira a ajuda e vc começara a missão

quando vc retornar, vc falara 'item', ele verificara se vc tem o storagevalue '60001' se vc tiver ele falara q nao precisa mais de vc, se vc nao tiver ele removera o item rare da criatura que eu coloquei como '2493' e acrescentara o item '2494' como recompensa e falara 'Muito Obrigado, Tome sua Recompensa!' e acrescentara a storagevalue para vc nao trocar mais o item rare com ele!


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)

  msg = string.lower(msg)

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

   selfSay('Hello, ' .. creatureGetName(cid) .. 'Sou o husky hunter da academia gennin , há muito tempo tento cacar uma fera que esta no topo da montanha ao leste da academia e vive atacando todos.. preciso de "ajuda" !')

   focus = cid

   talk_start = os.clock()

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

   selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

  elseif msgcontains(msg, 'ajuda') and focus == cid then

   queststatus = getPlayerStorageValue(cid,60000)

	 if queststatus == -1 then

	  setPlayerStorageValue(cid,60000,1)

	  selfSay('Você quer me ajudar ? mate a fera e traga o seu item especial que lhe darei uma recompensa !!')

	 else

	  selfSay('Voce ja me ajudou!, nao preciso mais de sua ajuda!')

	 end   


    elseif msgcontains(msg, 'item') and focus == cid then

	  valuestatus = getPlayerStorageValue(cid, 60001)

	  if valuestatus == -1 then

	   if getPlayerItem(cid, 2493)then

	    doPlayerRemoveItem(cid, 2493, 1)

	    selfSay('Muito Obrigado, Tome sua Recompensa!')

	    doPlayerAddItem(cid,2494,1)

	    setPlayerStorageValue(cid,60001,1)

	   end

	  elseif

	   selfSay('Voce ja me ajudou!, nao preciso mais de sua ajuda!')

	  end

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

   selfSay('Good bye, ' .. 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('Next Please...')

   end

    focus = 0

  end

if focus ~= 0 then

  if getDistanceToCreature(focus) > 5 then

   selfSay('Good bye then.')

   focus = 0

  end

end

end

fiz meio por cima e não tive a chance de testar pois estou no trabalho... teste ele e ve se funciona... quando eu chegar em minha residencia poderei aprimorar o script para vc... se ajudei pelo menos um pouco de um REP++ ae :P

Editado por Carinhah (veja o histórico de edições)

Postado

Ae cara, tipo arrumei alguns erros que encontrei no script e testei ele abrindo o distro do OT... bem ele nao apresentou mais nenhum erro e abriu a distro normalmente!!

agora teste ele dentro do jogo para ver como ele via se comportar perante a seus requisitos...

script corrigido:



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[/b]

[b]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[/b]

[b]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('Hello, ' .. creatureGetName(cid) .. 'Sou o husky hunter da academia gennin , há muito tempo tento cacar uma fera que esta no topo da montanha ao leste da academia e vive atacando todos.. preciso de "ajuda" !')

   focus = cid

   talk_start = os.clock()

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

   selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

  elseif msgcontains(msg, 'ajuda') and focus == cid then

   queststatus = getPlayerStorageValue(cid,60000)

		 if queststatus == -1 then

		  setPlayerStorageValue(cid,60000,1)

		  selfSay('Você quer me ajudar ? mate a fera e traga o seu item especial que lhe darei uma recompensa !!')

		 else

		  selfSay('Voce ja me ajudou!, nao preciso mais de sua ajuda!')

		 end  


	    elseif msgcontains(msg, 'item') and focus == cid then

		  valuestatus = getPlayerStorageValue(cid, 60001)

		  if valuestatus == -1 then

		    if getPlayerItem(cid, 2493) then

				 doPlayerRemoveItem(cid, 2493, 1)

				 selfSay('Muito Obrigado, Tome sua Recompensa!')

				 doPlayerAddItem(cid,2494,1)

				 setPlayerStorageValue(cid,60001,1)

		    end

		  else

		    selfSay('Voce ja me ajudou!, nao preciso mais de sua ajuda!')

		  end

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

   selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

   focus = 0

   talk_start = 0

  end

end[/b]

[b]function onCreatureChangeOutfit(creature)

end[/b]

[b]function onThink()

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

   if focus > 0 then

	    selfSay('Next Please...')

   end

	    focus = 0

  end

if focus ~= 0 then

  if getDistanceToCreature(focus) > 5 then

   selfSay('Good bye then.')

   focus = 0

  end

end

end

Editado por Carinhah (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo