Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

fala galera, to com um probleminha, meu npc de barco de kzordoon faz parte da missaoa do Kevin do postman, porém pra viajar pra cormaya eu preciso que apenas os premium account viagem, tentei fazer um keyword mas n consegui. alguem pode me ajudar?

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic = {}
local storage = 100168
 
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

	   
local travelNode = keywordHandler:addKeyword({'Cormaya'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a ride to {Cormaya} for 160 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 160, destination = {x=33312, y=31990, z=15} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then not.'})

        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Yes, I\'m the captain of this ship.'})
		keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Yes, I\'m the captain of this ship.'})
	   
	   
	   
	   
	   
	   
function greetCallback(cid)
	Topic[cid] = 0
	return true
end

local cormaya_cost = 160

function creatureSayCallback(cid, type, msg)
        if (not npcHandler:isFocused(cid)) then return false end
	if (msgcontains(msg, 'no') and Topic[cid] >= 1) then
		npcHandler:say("You shouldn\'t miss the experience.",cid)
		Topic[cid] = 0
	end 						
        	
	if (msgcontains(msg, "cormaya") and getPlayerStorageValue(cid,storage) == 3) then
   		npcHandler:say("Do you seek a ride to Cormaya for "..cormaya_cost.." gold coins?",cid)
		Topic[cid] = 1
	elseif (Topic[cid] == 1) then
	if (msgcontains(msg, 'yes') and doPlayerRemoveMoney(cid,cormaya_cost) and Topic[cid] == 1) then
		doTeleportThing(cid,{x=33311, y=31989, z=15})
		doSendMagicEffect({x=33311, y=31989, z=15},CONST_ME_TELEPORT)
		setPlayerStorageValue(cid,storage, 4)
		setPlayerStorageValue(cid,100171,6)
	else
		npcHandler:say("You dont have enough of gold.",cid)
		end
	end
	if (msgcontains(msg, "cormaya")) and (getPlayerStorageValue(cid,storage) == -1 or getPlayerStorageValue(cid,storage) >= 4) then
   		npcHandler:say("Do you seek a ride to Cormaya for "..cormaya_cost.." gold coins?",cid)
		Topic[cid] = 2
  	elseif (Topic[cid] == 2) then
	if (msgcontains(msg, 'yes') and doPlayerRemoveMoney(cid,cormaya_cost) and Topic[cid] == 2) then
		doTeleportThing(cid,{x=33311, y=31989, z=15})
		doSendMagicEffect({x=33311, y=31989, z=15},CONST_ME_TELEPORT)
	else
		npcHandler:say("You dont have enough of gold.",cid)
		end
	end	
	return true	
end

       

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

 

resolvido

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo