• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Quest log problem

Qbee

Open Tibia Fan
Joined
Mar 9, 2009
Messages
174
Reaction score
4
Check it out.

Quests.xml :
Code:
<quest name="Eduardo's task" startstorageid="20003" startstoragevalue="1">
	<mission name="Coconut shoes" storageid="20003" startvalue="1" endvalue="2">
		<missionstate id="1" description="[U]Quest is not done now![/U]"/>
		<missionstate id="2" description="Quest is done now!"/>
	</mission>
</quest>

npc.lua :
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}
local storage = 20003

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
    if msgcontains(msg, "hi") or msgcontains(msg, "hello") and (not npcHandler:isFocused(cid)) then
        if getPlayerStorageValue(cid, storage) < 1 then
            npcHandler:say("Please {help} me!", cid, TRUE)
            Topic[talkUser] = 0
        elseif getPlayerStorageValue(cid, storage) == 1 then
            npcHandler:say("Have you brought a coconut shoes for me?", cid, TRUE)
            Topic[talkUser] = 1
        elseif getPlayerStorageValue(cid, storage) == 1 then
            npcHandler:say("Oh hello, i\'m still working on that coconut shoes.", cid, TRUE)
            Topic[talkUser] = 0
        end
        npcHandler:addFocus(cid)
        return true
    end
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    if msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
        npcHandler:say("Good bye.", cid, TRUE)
        Topic[talkUser] = 0
        npcHandler:releaseFocus(cid)
    elseif msgcontains(msg, "quest") or msgcontains(msg, "mission") or msgcontains(msg, "task") or msgcontains(msg, "help") or (msgcontains(msg, "shoes") and getPlayerStorageValue(cid, storage) > 0) then
        if getPlayerStorageValue(cid, storage) < 1 then
            npcHandler:say("I need you to bring me a coconut shoes. I need them to my experiments. I want to make them working same as soft boots, but to start my job I need to have theese shoes. Find them for me!", cid)
            [U]setPlayerStorageValue(cid, storage, 1)[/U]
            Topic[talkUser] = 0
        elseif getPlayerStorageValue(cid, storage) == 1 then
            npcHandler:say("Have you brought a coconut shoes for me?", cid, TRUE)
            Topic[talkUser] = 1
        elseif getPlayerStorageValue(cid, storage) == 1 then
            npcHandler:say("Thank you again, im still working with thoose shoes!", cid, TRUE)
            Topic[talkUser] = 0
        end
    elseif Topic[talkUser] == 1 then
        if msgcontains(msg, "yes") then
            if getPlayerItemCount(cid, 9931) >= 1 then
                doPlayerRemoveItem(cid, 9931, 1)
                npcHandler:say("Oh please take this shield as a reward.", cid)
                doPlayerAddItem(cid, 2520, 1)
                setPlayerStorageValue(cid, storage, 2)
            else
                npcHandler:say("You don\'t have them!", cid)
            end
        else
            npcHandler:say("Still haven\'t found them? Keep looking in apes land.", cid)
        end
        Topic[talkUser] = 0
    end
    return TRUE
end

npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

And when storage = 1 then Quest log look like this :
15878822.jpg


And there is no text that i underlined in the "Quests.xml". What is wrong with the script/ with me?

And when storage = 2 then quest log look like this :
12440535.jpg


Thanks in advance.
@edit
Im using TFS 0.3.6
 
Last edited:
Back
Top