Sabe fazer o arquivo XML?
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)
if not npcHandler:isFocused(cid) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local toPos = {x = x, y = y, z = z} --Para onde o jogador será teleportado.
local storage = 8191
if msgcontains(msg:lower(), "tutorial area") or msgcontains(msg:lower(), "tutorial") then
if getPlayerStorageValue(cid, storage) > -1 then
selfSay("You already did the tutorial.", cid)
talkState[talkUser] = 0
return true
else
selfSay("In the tutorial area you'll be shown how to properly use your fishind rod. Do you want to be teleported?", cid)
talkState[talkUser] = 1
return true
end
elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then
selfSay("Good luck.", cid)
doTeleportThing(cid, toPos)
setPlayerStorageValue(cid, storage, 1)
talkState[talkUser] = 0
return true
elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then
selfSay("Ok...", cid)
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())