Ir para conteúdo
  • Cadastre-se

(Resolvido)[PEDIDO] Goroma sem missão


Ir para solução Resolvido por Wakon,

Posts Recomendados

Já me passaram as Scripts. VLW WAKON

Editado por arthur122222 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

Script's caso alguém tenha a mesma dúvida:

Em "Data/npc/scripts" troque o Jack Fate.lua por esse:


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
local lastSound = 0
function onThink()
if lastSound < os.time() then
lastSound = (os.time() + 5)
if math.random(100) < 25 then
Npc():say("Passages to Edron, Thais, Venore, Darashia, Ankrahmun, Yalahar, Port Hope and Goroma.", TALKTYPE_SAY)
end
end
npcHandler:onThink()
end

local function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local player = Player(cid)
if msgcontains(msg, 'thais') then
npcHandler:say('Do you seek a passage to Thais?', cid)
npcHandler.topic[cid] = 1
elseif npcHandler.topic[cid] == 1 then
if msgcontains(msg, 'yes') then
npcHandler:say("I have to warn you - we might get into a tropical storm on that route. I'm not sure if my ship will withstand it. Do you really want to travel to Thais?",cid)
npcHandler.topic[cid] = 2
end
elseif msgcontains(msg, 'goroma') then
npcHandler:say('Ugh. You really want to go back to Goroma? I\'ll surely have to repair my ship afterwards, so I won\'t charge. Okay?', cid)
npcHandler.topic[cid] = 3
elseif msgcontains(msg, 'shutdown') then
npcHandler:say('Ugh. You really want to go back to Shutdown? I\'ll surely have to repair my ship afterwards, so I won\'t charge. Okay?', cid)
npcHandler.topic[cid] = 4
elseif msgcontains(msg, 'yes') then
if npcHandler.topic[cid] == 2 then
local player = Player(cid)
if math.random(8) == 1 then
player:teleportTo(Position(32161, 32558, 6), false)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
npcHandler:say('Set the sails!', cid)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
npcHandler.topic[cid] = 0
else
player:teleportTo(Position(32310, 32210, 6), false)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
npcHandler:say('Set the sails!', cid)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
npcHandler.topic[cid] = 0
end
elseif npcHandler.topic[cid] == 3 then
player:teleportTo(Position(32161, 32558, 6), false)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
npcHandler.topic[cid] = 0
elseif npcHandler.topic[cid] == 4 then
npcHandler:say('Noob filho da puta vaza daqui, corno viado.', cid)
npcHandler.topic[cid] = 0
end
end
return true
end

local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Edron?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33173, y=31764, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Venore?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32954, y=32022, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Port Hope?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32527, y=32784, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Darashia?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33289, y=32480, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ankrahmun?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33092, y=32883, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Yalahar?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32816, y=31272, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To Edron, Thais, Venore, Darashia, Ankrahmun, Yalahar, Port Hope or Goroma.?'})
keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To Edron, Thais, Venore, Darashia, Ankrahmun, Yalahar, Port Hope or Goroma.?'})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'My name is Jack Fate from the Royal Tibia Line.'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this sailing ship.'})
keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this sailing ship.'})
keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'That\'s where we are.'})

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, "Welcome on board, Sir |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye. Recommend us if you were satisfied with our service.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye then.")
npcHandler:addModule(FocusModule:new())


Agora ainda em "Data/npc/scripts" troque o Jack FateGoroma.lua por esse:


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(not(npcHandler:isFocused(cid))) then
return false
end

if msgcontains(msg, 'wood') or msgcontains(msg, 'ship') or msgcontains(msg, 'wreck') or msgcontains(msg, 'passage') or msgcontains(msg, 'liberty bay') then
npcHandler:say("Do you want to travel back to Liberty Bay?", cid)
npcHandler.topic[cid] = 4
elseif msgcontains(msg, "yes") then
if npcHandler.topic[cid] == 1 then
selfSay("Thank you. Luckily, the damage my ship has taken looks more severe than it is, so I will only need a few wooden boards. ...", cid)
selfSay("I saw some lousy trolls running away with some parts of the ship. It might be a good idea to follow them and check if they have some more wood. ...", cid)
npcHandler:say("We will need 30 pieces of wood, no more, no less. Did you understand everything?", cid)
npcHandler.topic[cid] = 2
elseif npcHandler.topic[cid] == 2 then
npcHandler:say("Good! Please return once you have gathered 30 pieces of wood.", cid)
setPlayerStorageValue(cid, 55700, 1)
setPlayerStorageValue(cid, 29105, 1) -- Quest Log Default
setPlayerStorageValue(cid, 29109, 1) -- Quest Log
npcHandler.topic[cid] = 0
elseif npcHandler.topic[cid] == 3 then
if(getPlayerItemCount(cid, 5901) >= 30) then
doPlayerRemoveItem(cid, 5901, 30)
npcHandler:say("Excellent! Now we can leave this godforsaken place. Thank you for your help. Should you ever want to return to this island, ask me for a passage to Goroma.", cid)
setPlayerStorageValue(cid, 55700, 2)
setPlayerStorageValue(cid, 29109, 2) -- Quest Log
npcHandler.topic[cid] = 0
else
npcHandler:say("You don't have it...", cid)
end
elseif npcHandler.topic[cid] == 4 then
doTeleportThing(cid, {x=32285, y=32891, z=6})
doSendMagicEffect({x=32285, y=32891, z=6}, CONST_ME_TELEPORT)
npcHandler.topic[cid] = 0
end
end
return true
end

npcHandler:setMessage(MESSAGE_GREET, "Hello, Sir |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye then.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo