Ir para conteúdo

Npc Que Troca Soft Boots


Akatsuki0

Posts Recomendados

um NPC que troca worn soft boots por uma brand-new soft boots

=)

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)			 npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)	 npcHandler:onCreatureSay(cid, type, msg) end
function onThink()						 npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
	return false
end

	if msgcontains(msg, 'specialised') or msgcontains(msg, 'boot') then
		selfSay('Yes, my fathers was a great one blacksmith, it was a wise person , but when he decided to teach me he dies and i just learn about the lovely boots. So, did you bring me some boots? which one?')
	elseif msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') or msgcontains(msg, 'soft boot') or msgcontains(msg, 'worn soft boot') or msgcontains(msg, 'worn') then
		selfSay('Did u like that i fix ur worn soft boots? it will cost 100 platinum coins')
		talk_state = 1

elseif msgcontains(msg, 'yes') and talk_state == 1 then
		if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 or getPlayerItemCount(cid,2160) >= 1 then
		   selfSay('Here is your brand-new soft boots!.')
				   doPlayerTakeItem(cid, 6530, 1)
				doPlayerRemoveMoney(cid,[size="4"][color="#FF0000"]10000[/color][/size])
				doPlayerAddItem(cid,2640,1)
		else
			selfSay('Sorry, you don\'t have the item.')
		end

elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
		selfSay('Ok than.')
		talk_state = 0
	end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

vocês podem mudar quanto custa para trocar a worn soft boots por outro preço (agora ta 10000)

se tiver algo errado, comentem

Link para o comentário
Compartilhar em outros sites

  • 1 month later...
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...