i need that npc A Father's Burden Quest/Spoiler - Tibia Wiki
i made this script but dont work!
Help PLX!!!
i made this script but dont work!
PHP:
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)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local storage1 = 3001 --[[mission]]--
local storage2 = 3002--[[strong sinew]]--
local storage3 = 3003--[[exquisite wood]]--
local itemid1 = 12465--[[strong sinew]]--
local itemid2 = 12464--[[exquisite wood]]--
if msgcontains(msg, 'mission') then
if(getPlayerStorageValue(cid, storage1) < 1) then
npcHandler:say('I have four sons which are very dear to me. Though they were born on the same day and even in the same hour, they took quite different paths in life. ...', cid)
npcHandler:say('Each of them chose a different vocation, one will become a knight, one a sorcerer, one a druid, and the other a paladin. In a few weeks they will reach adulthood and I am holding a birthday party for them. ...', cid)
npcHandler:say('It should become a day to remember and so I want to give them something special as a present. I searched the land for the finest craftsmen so they could create suitable presents for my sons. ...', cid)
npcHandler:say('But something of fine craftsmanship will just not cut it. So I asked them what they would need to create something special. They all came up with lists of rare and expensive items necessary for the task ahead. ...', cid)
npcHandler:say('I spent a small fortune to buy most of the materials but in the end the key components are that rare that they cannot be simply bought somewhere. ...', cid)
npcHandler:say('As far as I understood it, the places where you can get these items are quite dangerous and so it would take some adventurer to get them. ...', cid)
npcHandler:say('That would be your mission if you are interested. Uhm, so are you interested?', cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'strong sinew') and getPlayerStorageValue(cid, storage2) == 1 then
npcHandler:say('Do you have the required sinew?', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'exquisite wood') and getPlayerStorageValue(cid, storage3) == 1 then
npcHandler:say('Could you find the wood we were talking about?', cid)
talkState[talkUser] = 3
--[[resto do script aki]]--
elseif msgcontains(msg, 'missions') and getPlayerStorageValue(cid, storage1) == 1 and getPlayerStorageValue(cid, storage2) == 1 and getPlayerStorageValue(cid, storage3) == 1 then
npcHandler:say('I\'m so glad I finally have all the parts for the presents. Your reward is my eternal gratitude. Well, that and some gold of course. ...', cid)
npcHandler:say('Take this sachet over there, I wrapped the coins into this old cape I had still lying around here from a barter with a stranger, it is of no use for me anyway. Farewell and thank you once again. ', cid)
talkState[talkUser] = 10
end
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'yes') then
if(getPlayerStorageValue(cid, storage1) == 1) then
setPlayerStorageValue(cid, storage1, 1)
npcHandler:say('I am relieved someone as capable as you will handle the task. Well, I need the parts of a sorcerer\'s robe, a paladin\'s bow, a knight\'s shield, and a druid\'s wand.', cid)
talkState[talkUser] = 2
end
elseif talkState[talkUser] == 2 then
if msgcontains(msg, 'yess') then
if(getPlayerStorageValue(cid, storage1) < 1) then
setPlayerStorageValue(cid, storage2, 2)
npcHandler:say('Ah, not only did you bring some sinew to me, you also made the world a safer place by killing Heoni. ', cid)
talkState[talkUser] = 3
end
elseif talkState[talkUser] == 3 then
if msgcontains(msg, 'yesss') then
if(getPlayerStorageValue(cid, storage3) < 1) then
setPlayerStorageValue(cid, storage3, 1)
npcHandler:say('Thank you. I feel somewhat embarrassed to put you into such a danger for some birthday present but I am sure you can handle it. ', cid)
talkState[talkUser] = 0
end
end
end
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Help PLX!!!
Last edited: