Ir para conteúdo
  • 0

NPC


Lumus

Pergunta

3 respostass a esta questão

Posts Recomendados

Nossa, toma ai cara, amanha te mando o xml do npc

 

 

function onCreatureDisappear(cid, pos)
if focus == cid then
	selfSay('Good bye then.')
	focus = 0
	talk_start = 0
end
end
local days = 3
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
	selfSay('Olá' .. getCreatureName(cid) .. ' eu sou morador daqui, gosto deste lugar, me sinto protegido.')
	focus = cid
	talk_start = os.clock()

	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 6 then
	selfSay('Hey ' .. getCreatureName(cid) .. 'chegue mais perto.')
	elseif msgcontains(msg, 'espada') then
	selfSay('Para fazer a espada eu precisarei de 30 pieces of iron, 30 silver brochs, 10 golden mugs, 1 demonic finger e 80k, OK?')
	elseif msgcontains(msg, 'sim') or  msgcontains(msg, 'yes') then
	selfSay('ótimo, volte dia "..os.date()+ 3*86400" "..os.clock()+ 3*86400"')
	exhaustion.set(cid, 9854, 3*86400)
	return true
	elseif exhaustion.check(cid, 9854) == FALSE then
	elseif msgcontains(msg, 'espada') and not getPlayerItemCount(cid, iddopiece) >= 30 and not getPlayerItemCount(cid, iddobroch) >= 30 and not getPlayerItemCount(cid, iddomugs) >= 10 and not getPlayerItemCount(cid, iddofinger) >= 1 and not getPlayerItemCount(cid, iddagrana) >= 8000 then
	return doPlayerSendCancel(cid, "Você não tem os itens para concluir a espada.")
	else
	doAddContainerItem(cid, iddasword, 1)
	return true
end
end

Link para o comentário
https://xtibia.com/forum/topic/213086-npc/#findComment-1517588
Compartilhar em outros sites

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

×
×
  • Criar Novo...