Ir para conteúdo
  • Cadastre-se

[ajuda] npc guild master


Posts Recomendados

Estou fazendo um server e o ot server que eu baixei é o Crystal Server 9.31 ( baixei aqui no tibiaking mesmo). O problema é que não tem o NPC guildmaster. Alguem poderia me ajudar a botá-lo?

se me ajudarem ou pelo menos tentar é rep+ =)

obrigado!

Link para o post
Compartilhar em outros sites
  • Respostas 8
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Vá em \data\npc e crie um arquivo com o nome Guild Master.xml

e cole isso dentro

<?xml version="1.0"?>


<npc name="Guild Master" script="data/npc/scripts/guild.lua" access="3" lookdir="1">

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

<look type="57" head="20" body="30" legs="40" feet="50" corpse="3128"/>

</npc>
feito isso, vá em \data\npc\scripts e crie outro arquivo com o nome guild.lua e coloque o codigo abaixo dentro
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)

msg = string.lower(msg)


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

selfSay('Hello ' .. getCreatureName(cid) .. '! If you want make a guild, talk info.')

focus = cid

talk_start = os.clock()


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

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


elseif focus == cid then

talk_start = os.clock()


if msgcontains(msg, 'info') then

selfSay('You can create a guild talking "!createguild ...and the name...". When you create go for the Guild-Chat, and talk "!commands" that will go talk the commands for guild.')



	 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

		 selfSay('Bye ' .. creatureGetName(cid) .. ', Come back.')

		 focus = 0

		 talk_start = 0


	 elseif msg ~= "" then

		 selfSay('What?')

		 talk_state = 0

	 end

end

end


function onCreatureChangeOutfit(creature)

end


function onThink()

doNpcSetCreatureFocus(focus)

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

	 if focus > 0 then

		 selfSay('Next...')

	 end

	 focus = 0

	 talk_start = 0

end

if focus ~= 0 then

	 if getDistanceToCreature(focus) > 5 then

		 selfSay('Good Bye')

		 focus = 0

		 talk_start = 0

	 end

end

end

Depois é só ir no RME > File > IMPORT> MOnster/NPC e escolher o NPC que você acabou de criar e colocar ele no mapa :D

Se der algum erro poste aqui :D

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

Te ajudei?
Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta"

 

Skype: JoadsonAion

Link para o post
Compartilhar em outros sites

Dá algum erro no distro?

Te ajudei?
Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta"

 

Skype: JoadsonAion

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96846
    Tópicos
    519599
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo