Qbee
Open Tibia Fan
- Joined
- Mar 9, 2009
- Messages
- 174
- Reaction score
- 4
Check it out.
Quests.xml :
npc.lua :
And when storage = 1 then Quest log look like this :
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 :
Thanks in advance.
@edit
Im using TFS 0.3.6
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](/proxy.php?image=http%3A%2F%2Fimg205.imageshack.us%2Fimg205%2F2894%2F15878822.jpg&hash=983961fef7571e1fb78a0ed61559529f)
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](/proxy.php?image=http%3A%2F%2Fimg341.imageshack.us%2Fimg341%2F8639%2F12440535.jpg&hash=899520a1083935a0f57ab1ecc023c7f0)
Thanks in advance.
@edit
Im using TFS 0.3.6
Last edited: