Ir para conteúdo

Posts Recomendados

Bem vou ensinar a voces a fazerem o Summon Monster

bem nao vamos perde tempo.

 

1º passo:

Abra a pasta data>npc e copie qualquer pasta de la e renomeie para Summon Monster

Abra ela com bloco de notas e apague tudo oque ta escrito la dentro e cole isso:

<?xml version="1.0"?>

 

<npc name="Summon Monster" script="data/npc/scripts/summon.lua" access="3" lookdir="2">

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

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

<look type="129" head="114" body="114" legs="114" feet="114"/>

</npc>

 

2º passo:

Abra a pasta data>npc>scripts copie qualquer pasta de la e renomeie para summon.lua

Abra ela com bloco de notas e apague tudo oque esta escrito la dentro e cole isso:

local focus = 0

local talk_start = 0

local target = 0

local following = false

local 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)

local msg = string.lower(msg)

 

if msgcontains(msg, 'oi') and focus == 0 and getDistanceToCreature(cid) < 4 then

selfSay('Oi ' .. creatureGetName(cid) .. '! Eai to ai p/ ajudar a vc upa. Vai quere q eu summone um morgaroth,um demon ou um dragon?')

focus = cid

talk_start = os.clock()

 

elseif msgcontains(msg, 'hi') and focus ~= cid and getDistanceToCreature(cid) < 4 then

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

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'morgaroth') then

selfSay(/m morgaroth')

elseif msgcontains(msg, 'demon') then

selfSay('/m demon)

elseif msgcontains(msg, 'dragon') then

selfSay('m dragon')

 

 

 

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

selfSay('flw, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

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

if focus > 0 then

selfSay('Seu ### vai embora e nem bye diz!!')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Bem e isso espero que gostem. Comentem deem dicas para eu melhorar.

creditos:

50% by Gui(ideia)

50% by me(por faze o npc)

 

COMENTEM PLEASE

 

vlw galera e FELIZ NATAL E UM PROSPERO ANO NOVO.

flw

Editado por Brasildani
Link para o comentário
https://xtibia.com/forum/topic/103479-meu-primeiro-npc-o-summon-monster/
Compartilhar em outros sites

  • 3 weeks later...
  • 3 months later...
  • 5 weeks later...
×
×
  • Criar Novo...