Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Lua by Dejav ( 15 years ago )
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
if(msgcontains(msg, 'job')) then
selfSay('I am a priest in this temple. I have for you some {mission}, too.', cid)
end
-- sceptre --
if(msgcontains(msg, 'mission') or msgcontains(msg, 'missions')) then
if(getPlayerStorageValue(cid, 3002) == -1) then
selfSay('Once on the island were not so many people. Arrived here some ruler - Herold.', cid)
selfSay('He came to this temple, which once was much more impressive.', cid)
selfSay('He left with me his sceptre as a token of appreciation.', cid)
selfSay('But one night, someone stole it ... I want you to find the sceptre to me.', cid)
selfSay('I know that you can buy three parts of this sceptre... Want to help me?', cid)
talkState[talkUser] = 2
elseif(getPlayerStorageValue(cid, 3002) == 1) then
selfSay("You've done this mission.", cid)
talkState[talkUser] = 22
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
selfSay("So find these parts for me.", cid)
setPlayerStorageValue(cid, 3002, 1)
elseif(msgcontains(msg, 'no') and talkState[talkUser] == 2) then
selfSay("Your loss...", cid)
talkState[talkUser] = 1
--//--
-- xxx2 --
elseif(msgcontains(msg, 'mission') and getPlayerStorageValue(cid, 3002)==1) then
if(getPlayerStorageValue(cid, 3004) == -1) then
if(getPlayerItemCount(cid, 12324) >= 1 and getPlayerItemCount(cid, 12325) >= 1 and getPlayerItemCount(cid, 12326) >= 1) then
selfSay("All right, now you have to combine these three pieces in the Dalle forge.", cid)
setPlayerStorageValue(cid, 3004, 1)
talkState[talkUser] = 1
else
talkState[talkUser] = 1
selfSay('You don\'t have three parts of sceptre.', cid)
end
end
--//--
-- xxx3 --
elseif(msgcontains(msg, 'mission') and getPlayerStorageValue(cid, 3004)==1 and getPlayerStorageValue(cid, 3005) == -1) then
if(getPlayerStorageValue(cid, 3004) == 1) then
if(getPlayerStorageValue(cid, 3005) == -1) then
selfSay("So? Do you have Harold\'s Sceptre?", cid)
talkState[talkUser] = 3
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
if(getPlayerItemCount(cid, 12327) >= 1) then
doPlayerRemoveItem(cid, 12327, 1)
selfSay("Thank you so much. Now you\'re able to talk with Hermes.", cid)
setPlayerStorageValue(cid, 3005, 1)
talkState[talkUser] = 1
else
talkState[talkUser] = 1
selfSay('Sorry, but you don\'t have the Harold\s Sceptre.', cid)
end
end
else
selfSay('I don\'t have mission for you now.', cid)
end
--//--
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Revise this Paste