Ir para conteúdo

Featured Replies

Postado
-- Storage IDs --
config = {
		
		Fassassino  = 22115;
		Sassassino  = 22116;
		
}


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

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 not npcHandler:isFocused(cid) then
		return false
	end
	
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	
	if msgcontains(msg:lower(), 'addon1') then
		if getPlayerStorageValue(cid, config.Fassassino) < 1 then
			selfSay('Tem certeza ?', cid);
			talkState[talkUser] = 1;
		else
			selfSay('Parece que voce ja tem este addon, nao tente me zombar filho!', cid);
			talkState[talkUser] = 0;
		end
	
	elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 1 then
		if getPlayerItemCount(cid,2160) >= 1 then
			if doPlayerRemoveItem(cid,2160,1) then
				selfSay('Ah, certo! Aqui esta o seu addon, volte sempre.', cid);
				doSendMagicEffect(getCreaturePosition(cid), 13);
				doPlayerAddOutfit(cid, 152, 1);
				doPlayerAddOutfit(cid, 156, 1);
				setPlayerStorageValue(cid, config.Fassassino, 1);
				talkState[talkUser] = 0;
			end
		else
			selfSay('Voce nao tem todos os itens necessarios.', cid);
			talkState[talkUser] = 0;
		end
	end
	
	if msgcontains(msg:lower(), 'addon2') then
		if getPlayerStorageValue(cid, config.Sassassino) < 1 then
			selfSay('Tem certeza ?', cid);
			talkState[talkUser] = 2;
		else
			selfSay('Parece que voce ja tem este addon, nao tente me zombar filho!', cid);
			talkState[talkUser] = 0;
		end
		
	elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 2 then
		if getPlayerItemCount(cid, 2160) >= 1 then
			if doPlayerRemoveItem(cid, 2160, 1) then
				selfSay('Ah, certo! Aqui esta o seu addon, volte sempre.', cid);
				doSendMagicEffect(getCreaturePosition(cid), 13);
				doPlayerAddOutfit(cid, 152, 2);
				doPlayerAddOutfit(cid, 156, 2);
				setPlayerStorageValue(cid, config.Sassassino, 1);
				talkState[talkUser] = 0;
			end
		else
			selfSay('Voce nao tem todos os itens necessarios.', cid);
			talkState[talkUser] = 0;
		end
	end
	
	if msgcontains(msg:lower(), 'no') and talkState[talkUser] == 1 or talkState[talkUser] == 2 then
		selfSay('Tudo bem entao. Volte quando voce tem todos os itens necessarios.', cid);
		talkState[talkUser] = 0;
	end
	
return true
end

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

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

EQD4Qy4.gif

  • Respostas 6
  • Visualizações 441
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureApp

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureApp

  • -- Storage IDs -- config = { Fassassino = 22115; Sassassino = 22116; } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParame

Postado
  • Autor
-- Storage IDs --
config = {
		
		Fassassino  = 22115;
		Sassassino  = 22116;
		
}


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

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 not npcHandler:isFocused(cid) then
		return false
	end
	
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	
	if msgcontains(msg:lower(), 'addon1') then
		if getPlayerStorageValue(cid, config.Fassassino) < 1 then
			selfSay('Tem certeza ?', cid);
			talkState[talkUser] = 1;
		else
			selfSay('Parece que voce ja tem este addon, nao tente me zombar filho!', cid);
			talkState[talkUser] = 0;
		end
	
	elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 1 then
		if getPlayerItemCount(cid,2160) >= 1 then
			if doPlayerRemoveItem(cid,2160,1) then
				selfSay('Ah, certo! Aqui esta o seu addon, volte sempre.', cid);
				doSendMagicEffect(getCreaturePosition(cid), 13);
				doPlayerAddOutfit(cid, 152, 1);
				doPlayerAddOutfit(cid, 156, 1);
				setPlayerStorageValue(cid, config.Fassassino, 1);
				talkState[talkUser] = 0;
			end
		else
			selfSay('Voce nao tem todos os itens necessarios.', cid);
			talkState[talkUser] = 0;
		end
	end
	
	if msgcontains(msg:lower(), 'addon2') then
		if getPlayerStorageValue(cid, config.Sassassino) < 1 then
			selfSay('Tem certeza ?', cid);
			talkState[talkUser] = 2;
		else
			selfSay('Parece que voce ja tem este addon, nao tente me zombar filho!', cid);
			talkState[talkUser] = 0;
		end
		
	elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 2 then
		if getPlayerItemCount(cid, 2160) >= 1 then
			if doPlayerRemoveItem(cid, 2160, 1) then
				selfSay('Ah, certo! Aqui esta o seu addon, volte sempre.', cid);
				doSendMagicEffect(getCreaturePosition(cid), 13);
				doPlayerAddOutfit(cid, 152, 2);
				doPlayerAddOutfit(cid, 156, 2);
				setPlayerStorageValue(cid, config.Sassassino, 1);
				talkState[talkUser] = 0;
			end
		else
			selfSay('Voce nao tem todos os itens necessarios.', cid);
			talkState[talkUser] = 0;
		end
	end
	
	if msgcontains(msg:lower(), 'no') and talkState[talkUser] == 1 or talkState[talkUser] == 2 then
		selfSay('Tudo bem entao. Volte quando voce tem todos os itens necessarios.', cid);
		talkState[talkUser] = 0;
	end
	
return true
end

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

Ainda não deu. '-'

Deixa pra lá mano, você pelo menos tentou, vou deixar addon só pra premium mesmo, não tem jeito.

Valeu por tentar, rep+ msm assim

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