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

Quests.xml

Dodekus

Fighters Online
Joined
Jan 20, 2009
Messages
74
Reaction score
0
Location
Sweden
Can someone explain what these things mean like:
startstorageid="30031"
startstoragevalue="1"
storageid="1001"
startvalue="1"
endvalue="2"

And how do I make a NPC start a quest?

:confused:
 
This way, it would not give you the storage value incase you decide to add a new value to it (, 2) for a new part of the quest.
PHP:
if getPlayerStorageValue(cid, 9090) == -1 then
     setPlayerStorageValue(cid, 9090, 1)
end
 
you try it:
Code:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. getCreatureName(cid) .. '! You say {quest} for mission')
focus = cid
talk_start = os.clock()

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk with you in one minute.')


elseif msgcontains(msg, 'quest') then
selfSay('You wanna quest?')
talk_state = 1
talk_start = os.clock()

elseif talk_state == 1 and msgcontains(msg, 'yes') then
queststatus = getPlayerStorageValue(cid,30031)
if queststatus == -1 then
selfSay('Você não fez a quest')
setPlayerStorageValue(cid,30031,1)
else

selfSay('Você já fez a quest')
talk_start = os.clock()
end
end

if msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
            selfSay('Bye ' .. getCreatureName(cid) .. ', Come back.')
            focus = 0
            talk_start = 0

    elseif msgcontains(msg, 'kashfeioyorgheklçguyio') then
            selfSay('What?')
            talk_state = 0
        end
end

function onCreatureChangeOutfit(creature)
end

function onThink()
    doNpcSetCreatureFocus(focus)
    if (os.clock() - talk_start) > 30 then
        if focus > 0 then
            selfSay('Next...')
        end
        focus = 0
        talk_start = 0
    end
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 5 then
            selfSay('Good Bye')
            focus = 0
            talk_start = 0
        end
    end
end

Maybe it can working.
 
Back
Top