Ir para conteúdo
  • Cadastre-se

Criando um NPC de missões, pra melhorar seu OT


Posts Recomendados

Opa, dei uma olhada no tutorial que você fez.

Bem legal, vou ler melhor e qualquer coisa eu edito o post ou comento novamente.

Parabéns, Reputado + !

-=

PlayerLearnInstantSpell

É

doPlayerLearnInstantSpell tem do sim :>

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

 http://baiakuza.com/
IP: baiakuza.com
TIBIA: 10.96
Baiak Custom [ High Exp Rate ]

 

 

 

 

Link para o post
Compartilhar em outros sites

Valeu, vou colocar esse link no tópico, porque nem eu sei todas essas funções!

Renato, cada vez melhor esse fórum em, parabéns a todos que estão admnistrando!

Respostas rápidas, e sempre com algo a dizer haha! Abraço a vocês!

Link para o post
Compartilhar em outros sites

-> JhonatanCWest

Estarei movendo o seu tópico para "Tutorias de Scripting"

qualquer coisa mande me uma pm.

Movido.

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

 http://baiakuza.com/
IP: baiakuza.com
TIBIA: 10.96
Baiak Custom [ High Exp Rate ]

 

 

 

 

Link para o post
Compartilhar em outros sites

Muito Bom Tutorial APROVADO!!

Malvera Otserv

Dedicado-24h

Hospedado In Usa

Utilizando Cliente Proprio Ou Ipchanger

(Pode ser Baixado No Site)

Supporter Execelente

Supporter "In Forum And Game"

Eventos Diariamentes

Muitas Novidades Para a Melhora Do Server

E Muito Mais....

Então? Estar esperando oque? Acesse Já o Malvera Ot , Venha Montar Sua Team , Parar Batalhar Contra Outras Team , Upar Skills ,Leveis,Etc.. Sejá Vip e Ganhe 20% De Exp , Ganhe Vip Set Incluindo Runes , Ganhe Destaque No Nome Ex: [Vip] Malvera ,E Tambem Ganhe Acesso Aos Treiners que Nunca desloga , Entre Muitas Outras Vantagen .. Saiba Mais Sobre as Noticias Do Malvera Já no Site

Forum:

Malvera Forum

Cliente Download:

Malvera Cliente

icontwitterh.png facebookiconel.png icontextoinsideyoutube.png

Link para o post
Compartilhar em outros sites
  • 1 month later...
  • 5 years later...
1 hora atrás, Everson Miranda disse:

Desculpe reviver o topico, mas como faço para adicionar outra quest no msm npc? tipo "mission 2"

 

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 onPlayerEndTrade(cid)				npcHandler:onPlayerEndTrade(cid)			end
function onPlayerCloseChannel(cid)			npcHandler:onPlayerCloseChannel(cid)		end


function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end
		
    local player = Player(cid)
    if msgcontains(msg, 'mission1') or msgcontains(msg, 'mission 1') then
       npcHandler:say('TEXT MISSION 1!',cid)
       npcHandler.topic[cid] = 1
    
    elseif msgcontains(msg, 'mission2') or msgcontains(msg, 'mission 2') then
       npcHandler:say('TEXT MISSION 2!',cid)
       npcHandler.topic[cid] = 2

------------------------------------------------------------------------------------

    elseif msgcontains(msg, 'yes') then
        if npcHandler.topic[cid] == 1 then
			if getPlayerItemCount(cid, 2559) >= 1 then -- small axe
				if doPlayerRemoveItem(cid, 2559, 1) then -- small axe
					doPlayerAddItem(cid, 2553, 1) -- pick
					npcHandler:say('Splendid! Here, take your pick.', cid)
					npcHandler.topic[cid] = 0
				else
					doPlayerSendTextMessage(cid,25,"ERROR! Please contact the administrator.")
					npcHandler.topic[cid] = 0
				end
			else
				npcHandler:say('Sorry, I am looking for a small axe.', cid)
				npcHandler.topic[cid] = 0
			end
      
     	 elseif npcHandler.topic[cid] == 2 then
			if getPlayerItemCount(cid, 2559) >= 1 then -- small axe
				if doPlayerRemoveItem(cid, 2559, 1) then -- small axe
					doPlayerAddItem(cid, 2553, 1) -- pick
					npcHandler:say('Splendid! Here, take your pick.', cid)
					npcHandler.topic[cid] = 0
				else
					doPlayerSendTextMessage(cid,25,"ERROR! Please contact the administrator.")
					npcHandler.topic[cid] = 0
				end
			else
				npcHandler:say('Sorry, I am looking for a small axe.', cid)
				npcHandler.topic[cid] = 0
			end
		end
			
	elseif(msgcontains(msg, "no") and isInArray({1,2}, npcHandler.topic[cid])) then
			npcHandler:say("Ok then.", cid)
			npcHandler.topic[cid] = 0	
	end
	return true
end

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

Eu uso dessa maneira em meu servidor.
Aproveita e dá uma conferida lá :) 

 

OBS: O script foi feito para versão 0.3.7, porém funciona em tfs 1.x

Link para o post
Compartilhar em outros sites
22 horas atrás, Weslley Kiyo disse:

 


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 onPlayerEndTrade(cid)				npcHandler:onPlayerEndTrade(cid)			end
function onPlayerCloseChannel(cid)			npcHandler:onPlayerCloseChannel(cid)		end


function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end
		
    local player = Player(cid)
    if msgcontains(msg, 'mission1') or msgcontains(msg, 'mission 1') then
       npcHandler:say('TEXT MISSION 1!',cid)
       npcHandler.topic[cid] = 1
    
    elseif msgcontains(msg, 'mission2') or msgcontains(msg, 'mission 2') then
       npcHandler:say('TEXT MISSION 2!',cid)
       npcHandler.topic[cid] = 2

------------------------------------------------------------------------------------

    elseif msgcontains(msg, 'yes') then
        if npcHandler.topic[cid] == 1 then
			if getPlayerItemCount(cid, 2559) >= 1 then -- small axe
				if doPlayerRemoveItem(cid, 2559, 1) then -- small axe
					doPlayerAddItem(cid, 2553, 1) -- pick
					npcHandler:say('Splendid! Here, take your pick.', cid)
					npcHandler.topic[cid] = 0
				else
					doPlayerSendTextMessage(cid,25,"ERROR! Please contact the administrator.")
					npcHandler.topic[cid] = 0
				end
			else
				npcHandler:say('Sorry, I am looking for a small axe.', cid)
				npcHandler.topic[cid] = 0
			end
      
     	 elseif npcHandler.topic[cid] == 2 then
			if getPlayerItemCount(cid, 2559) >= 1 then -- small axe
				if doPlayerRemoveItem(cid, 2559, 1) then -- small axe
					doPlayerAddItem(cid, 2553, 1) -- pick
					npcHandler:say('Splendid! Here, take your pick.', cid)
					npcHandler.topic[cid] = 0
				else
					doPlayerSendTextMessage(cid,25,"ERROR! Please contact the administrator.")
					npcHandler.topic[cid] = 0
				end
			else
				npcHandler:say('Sorry, I am looking for a small axe.', cid)
				npcHandler.topic[cid] = 0
			end
		end
			
	elseif(msgcontains(msg, "no") and isInArray({1,2}, npcHandler.topic[cid])) then
			npcHandler:say("Ok then.", cid)
			npcHandler.topic[cid] = 0	
	end
	return true
end

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

Eu uso dessa maneira em meu servidor.
Aproveita e dá uma conferida lá :) 

 

OBS: O script foi feito para versão 0.3.7, porém funciona em tfs 1.x

 

 Otimo, vou testar aqui... caso eu queira adicionar mais e so fazer elseif?

 

e tipo pode me dar uma explicação rapida desta quest que vc postou ai?

 

 

Editado por Everson Miranda (veja o histórico de edições)
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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo