Ir para conteúdo

Posts Recomendados

Eu criei uma quest de npc que pede uns itens de drop em troca uma rod melhor, eu fiz uma bag de fishing tipo PBRO e coloquei as rods melhores "travadas" então precisa das quests para usá-las. Aí quando você completa a quest eu queria que ele removesse a great rod bloqueada e trocasse pela great rod pra usar, só que quando completa a quest ele fica na pokebag ao invés de ficar na bag de fishing, o npc:

 

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 stg = 15333 -- storage para falar com o npc
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'mission') then
if getPlayerStorageValue(cid, stg) >= 1 then
selfSay("Sorry, you already completed this mission!!", cid)
talkState[talkUser] = 0
else
selfSay("Ooooh good! I'm looking for some rare items... They are: 50 ruby, 50 water pendant e 150 water gem. Do you have these items?", cid)
talkState[talkUser] = 1
end
end
---------------------------------------------------------
if (msgcontains(msg, "yes") or msgcontains(msg, "sim")) and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, 12188, 50) and doPlayerRemoveItem(cid, 12170, 50) and doPlayerRemoveItem(cid, 12161, 150) and doPlayerRemoveItem(cid, 8261, 1) == TRUE then
selfSay("Thank you!", cid)
setPlayerStorageValue(cid, 102, 1) -- storage para liberar outfit
setPlayerStorageValue(cid, stg, 1) -- para ele nao fazer a missao novamente
doPlayerAddExperience(cid,12000) -- experiencia
local bags = getPlayerSlotItem(cid, 3)
doAddContainerItem(bags.uid, 12247, 1)
else
selfSay("Sorry, but you don't have one of these items.", cid)
talkState[talkUser] = 0
end
elseif (msgcontains(msg, "no") or msgcontains(msg, "nao")) and talkState[talkUser] == 1 then
selfSay("Good bye '..getCreatureName(cid)..'.", cid)
talkState[talkUser] = 0
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Alguém poderia me ajudar? o id 8261 é a vara bloqueada e a 12247 a great rod

Link para o comentário
https://xtibia.com/forum/topic/208159-encerrado-ajuda-quest-great-rod/
Compartilhar em outros sites

Sim cara, mas ela fica em que lugar? Dentro da backpack? No lugar do helmet, do ring, aonde fica a boots? Aonde essa bag fishing fica?

 

Finja que é tibia, tem o slot do helmet, armor, legs. Me diga qual é :)

Link para o comentário
https://xtibia.com/forum/topic/208159-encerrado-ajuda-quest-great-rod/#findComment-1473307
Compartilhar em outros sites

Troque o script do NPC por esse:

 

 

 

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 stg = 15333 -- storage para falar com o npc

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'mission') then

if getPlayerStorageValue(cid, stg) >= 1 then

selfSay("Sorry, you already completed this mission!!", cid)

talkState[talkUser] = 0

else

selfSay("Ooooh good! I'm looking for some rare items... They are: 50 ruby, 50 water pendant e 150 water gem. Do you have these items?", cid)

talkState[talkUser] = 1

end

end

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

if (msgcontains(msg, "yes") or msgcontains(msg, "sim")) and talkState[talkUser] == 1 then

if doPlayerRemoveItem(cid, 12188, 50) and doPlayerRemoveItem(cid, 12170, 50) and doPlayerRemoveItem(cid, 12161, 150) and doPlayerRemoveItem(cid, 8261, 1) == TRUE then

selfSay("Thank you!", cid)

setPlayerStorageValue(cid, 102, 1) -- storage para liberar outfit

setPlayerStorageValue(cid, stg, 1) -- para ele nao fazer a missao novamente

doPlayerAddExperience(cid,12000) -- experiencia

local bags = getPlayerSlotItem(cid, 10)

doAddContainerItem(bags.uid, 12247, 1)

else

selfSay("Sorry, but you don't have one of these items.", cid)

talkState[talkUser] = 0

end

elseif (msgcontains(msg, "no") or msgcontains(msg, "nao")) and talkState[talkUser] == 1 then

selfSay("Good bye '..getCreatureName(cid)..'.", cid)

talkState[talkUser] = 0

end

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

Link para o comentário
https://xtibia.com/forum/topic/208159-encerrado-ajuda-quest-great-rod/#findComment-1473323
Compartilhar em outros sites

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
https://xtibia.com/forum/topic/208159-encerrado-ajuda-quest-great-rod/#findComment-1733871
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...