• 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!

Solved Quest storyline

deryzeen

New Member
Joined
Jan 20, 2013
Messages
25
Reaction score
1
Location
Sweden
Hello there idont know what the problem with this storyline ((useing forgotten client 0.8.6)((v7))
Here the lines.
F:\Pangea\data\npc

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Mission" script="mission.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="325" head="29" body="4" legs="20" feet="96" addons="3" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. What brings you to me? You want start the {quest}?"/>
</parameters>

</npc>

F:\Pangea\data\npc\scripts
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'quest')) then
selfSay('To start this quest tell {mission}', cid) --This is just an example, In this script added 4 mission for you ;)
end
if(msgcontains(msg, 'mission')) then
if(getPlayerStorageValue(cid,700) < 1) then
selfSay('Your first mission will be to get 100 {tarantula egg}.', cid)
talkState[talkUser] = 1
elseif (getPlayerStorageValue(cid,701) < 1) then
selfSay('Your next mission will be to get 150 {strands of medusa hair}.', cid)
talkState[talkUser] = 1
elseif (getPlayerStorageValue(cid,702) < 0) then
selfSay('Your next mission will be to get 300 {red dragon scales}.', cid)
talkState[talkUser] = 1
elseif (getPlayerStorageValue(cid,703) < 0) then
selfSay('Your next mission will be to get 400 {green dragon scales}.', cid)
talkState[talkUser] = 1




elseif (getPlayerStorageValue(cid,703) == 1) then --zmieniac w zaleznosci od ostatniego storage!!
selfSay('You have done all missions.', cid)
talkState[talkUser] = 1




end
---------------------------------------
elseif(msgcontains(msg, 'tarantula egg') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,700) < 1)) then
if(doPlayerRemoveItem(cid, 11198, 100) == TRUE) then
setPlayerStorageValue(cid,700,1)
doPlayerAddPercentLevel(cid, 5)
selfSay('Thank you.', cid)
talkState[talkUser] = 0
else
selfSay('To end mission you need have 100 {tarantula egg}.', cid)
end
---------------------------------------
elseif(msgcontains(msg, 'strands of medusa hair') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,701) < 1) and (getPlayerStorageValue(cid,700) == 1)) then
if(doPlayerRemoveItem(cid, 11226, 150) == TRUE) then
setPlayerStorageValue(cid,701,1)
doPlayerAddPercentLevel(cid, 7)
selfSay('Thank you.', cid)
talkState[talkUser] = 0
else
selfSay('To end mission you need have 150 {strands of medusa hair}.', cid)
end
---------------------------------------
elseif(msgcontains(msg, 'red dragon scales') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,702) < 1) and (getPlayerStorageValue(cid,701) == 1)) then
if(doPlayerRemoveItem(cid, 5882, 300) == TRUE) then
setPlayerStorageValue(cid,702,1)
doPlayerAddPercentLevel(cid, 6)
selfSay('Thank you.', cid)
talkState[talkUser] = 0
else
selfSay('To end mission you need have 300 {red dragon scales}.', cid)
end
---------------------------------------
elseif(msgcontains(msg, 'green dragon scales') and talkState[talkUser] == 1 and (getPlayerStorageValue(cid,703) < 1) and (getPlayerStorageValue(cid,702) == 1)) then
if(doPlayerRemoveItem(cid, 5920, 400) == TRUE) then
setPlayerStorageValue(cid,703,1)
doPlayerAddPercentLevel(cid, 5)
selfSay('Thank you.', cid)
talkState[talkUser] = 0
else
selfSay('To end mission you need have 400 {green dragon scales}.', cid)
end
------------------------------------------

end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
-----------------------------------------------------------------------------------------------------

when i try say for example the frist line for the talatulas egss and wont give me my next quest and dosent get done. qutie new what do i need to change ??
 
Code:
if(doPlayerRemoveItem(cid, 11198, 100) == TRUE) then
You need to have 100 of item 11198 on your character in order to do the quest.

Step 1 -> Get items required.
Step 2 -> Say hi
Step 3 -> Say mission
Step 4 -> Say tarantula egg

The way this is designed, it indicates that 'mission' must be said first in order to obtain talkstate.
If you simply say tarantula egg, you will get no response.
 
Code:
if(doPlayerRemoveItem(cid, 11198, 100) == TRUE) then
You need to have 100 of item 11198 on your character in order to do the quest.

Step 1 -> Get items required.
Step 2 -> Say hi
Step 3 -> Say mission
Step 4 -> Say tarantula egg

The way this is designed, it indicates that 'mission' must be said first in order to obtain talkstate.
If you simply say tarantula egg, you will get no response.
---------------------------------------------------------------------------------------
Yeah thanks alot :) REp ++
 
Back
Top