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

Npc System

tibiamo

New Member
Joined
May 30, 2009
Messages
50
Reaction score
1
hi guys, wanted someone to cuddle up this script npc, so that if the player has already spoken with him, he exhort the players already have the storage value can someone help me with this.

Hugs KoJiiRo



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, 'inquisitor') then
selfSay('The churches of the gods entrusted me with the enormous and responsible task to lead the inquisition. I leave the field work to inquisitors who I recruit from fitting people that cross my way. If you wanna {join} in the inquisition, ask me why!' ,cid)
setPlayerStorageValue(cid,15209,1)
talkState[talkUser] = 1

elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'join') then
selfSay('Do you want to join the inquisition?', cid)
talkState[talkUser] = 2
end

elseif msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,15209) == 1 then
selfSay('Your mission is simple,You must enter in the retreat and destruct the Shadow Nexus. Then report to me about your mission.', cid)
end

end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top