• 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] Sweaty Cyc that makes players wait 24 hours for amulet

kessykins

Intermediate OT User
Joined
Mar 15, 2010
Messages
297
Reaction score
105
Hey,

I'm looking for the Sweaty Cyc LUA that makes players wait 24 hours before giving them the 'mended' amulet for the blue legs quest. If possible I need the npc to give the player a countdown on when their amulet will be ready.

IE: "Your amulet will be ready in xx hr, xx minutes, xx seconds."

++ REP!
 
Hey,

I'm looking for the Sweaty Cyc LUA that makes players wait 24 hours before giving them the 'mended' amulet for the blue legs quest.

++ REP!

use exhaust.set :P

Code:
exhaustion.set(cid, storage, time)

if(not exhaustion.get(cid, storage)) then

if u got a sweaty cyclops script post it here and ill try edit it xd
xd
 
This is a script that was posted on http://otland.net/f81/blue-legs-quest-0-2-a-56717/
This could work but I need the npc to say"hey man i need time to fix this amulet! give me 24 hours" and "why are you so impatient!? come back in xx hours xx minutes!"

Code:
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 tokenid = 8265
        local storage = 6555
        local getstorage = getPlayerStorageValue(cid, storage)
        local sorrymessage = "Sorry, are you sure you got all 4 piece's  of broken amulets?."
        local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
        if msgcontains(msg, 'piece of broken amulet') then
                if getstorage == 1 then
                        npcHandler:say("You are now finished.", cid)
                elseif getstorage < 1 then
                        npcHandler:say("Would ye' like to give me 4 piece's of broken amulets.?", cid)
                        talkState[talkUser] = 1
                end
        elseif msgcontains(msg, 'Remove This shit if you want!') then
                if getstorage < 1 then
                        npcHandler:say("You have not give me 4 pice's of broken amulets.", cid)
                elseif getstorage == 1 then
                        npcHandler:say("I have aledry give you {koshei's ancient amulet} !!.", cid)
                end
        elseif msgcontains(msg, 'yes') then
                if talkState[talkUser] == 1 then
                        if getstorage < 0 then
                                if doPlayerRemoveItem(cid, tokenid, 1) == TRUE then
                                        npcHandler:say("Ye' brought the 4 piece's of broken amulets. needed to complete blue legs quest'.", cid)
                                        setPlayerStorageValue(cid, storage, 1)
                                                                                doPlayerAddItem(cid, 8266, 1)
                                                                                doPlayerRemoveItem(cid, 8264, 1)
                                                                                doPlayerRemoveItem(cid, 8263, 1)
                                                                                doPlayerRemoveItem(cid, 8262, 1)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, tokenid, 1) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        end
                end
        elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
                npcHandler:say("Sure, come back when you have 4 piece's of broken amulets..", cid)
                talkState[talkUser] = 0
        end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
The npc gives the amulet right away :/ he doesn't make you wait 24 hours.

15:13 Kes [321]: amulet
15:13 Sweaty Cyc: Do you want me to forge all the amulet pieces?
15:13 Kes [321]: yes
15:13 Sweaty Cyc: Great, come back in 24 hours and ill have the amulet forged.
15:14 Kes [321]: bye
15:14 Sweaty Cyc: Good bye, Kes!

15:14 Kes [321]: hi
15:14 Sweaty Cyc: Hello Kes.
15:14 Kes [321]: amulet
15:14 Sweaty Cyc: Just in time! Your amulet is forged and ready.
 
i think you should use this barker to check for exhaust
LUA:
exhaustion.check(cid, storage) == false then
Edit : nvm seems both are the same
 
Last edited:
The npc gives the amulet right away :/ he doesn't make you wait 24 hours.

15:13 Kes [321]: amulet
15:13 Sweaty Cyc: Do you want me to forge all the amulet pieces?
15:13 Kes [321]: yes
15:13 Sweaty Cyc: Great, come back in 24 hours and ill have the amulet forged.
15:14 Kes [321]: bye
15:14 Sweaty Cyc: Good bye, Kes!

15:14 Kes [321]: hi
15:14 Sweaty Cyc: Hello Kes.
15:14 Kes [321]: amulet
15:14 Sweaty Cyc: Just in time! Your amulet is forged and ready.

It only works on normal players, not GM/ CM chars :p
 
Code:
selfSay('Your amulet will be ready in ' .. table.concat(string.timediff(exhaustion.get(cid, storage))) .. ' seconds.', cid)
 
?! ?!
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}

local storage = 12000
local wait = {
	storage = 12001,
	time = 24 * 3600
}
 
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
	elseif msgcontains(msg, 'amulet') then
		local v = getPlayerStorageValue(cid, storage)
		if v < 1 then
			selfSay('Do you want me to forge all the amulet pieces?', cid)
			Topic[cid] = 1
		elseif v == 1 then
			if not exhaustion.get(cid, wait.storage) then
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
				doCreatureSetStorage(cid, storage, 2)
				doPlayerAddItem(cid, 8266, 1)
				selfSay('Just in time! Your amulet is forged and ready.', cid)
			else
				selfSay('Your amulet will be ready in ' .. table.concat(string.timediff(exhaustion.get(cid, wait.storage))) .. ' seconds.', cid)
			end
		end
	elseif msgcontains(msg, 'yes') and Topic[cid] == 1 then
		for i = 8262, 8265 do
			if getPlayerItemCount(cid, i) < 1 then
				return selfSay('You don\'t have required items.', cid)
			end
		end
		for i = 8262, 8265 do
			doPlayerRemoveItem(cid, i, 1)
		end
		exhaustion.set(cid, wait.storage, wait.time)
		setPlayerStorageValue(cid, storage, 1)
		selfSay('Great, come back in ' .. wait.time / 3600 .. ' hours and I\'ll have the amulet forged.', cid)
		Topic[cid] = nil
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
;/
 
Last edited:
Cykotitan I tried what you posted but...

[23/08/2010 16:21:08] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/sweaty cyc.xml).
[23/08/2010 16:21:08] Info: failed to load external entity "data/npc/sweaty cyc.xml"
 
lmao I'm a dork - I forgot to get the last line of your lua

When a player gives the NPC the amulet pieces she says to wait 24 hours but... when the player says amulet again I get an error in the server log:
Code:
[23/08/2010 16:25:49] [Error - Npc interface] 
[23/08/2010 16:25:49] data/npc/scripts/sweaty cyc.lua:onCreatureSay
[23/08/2010 16:25:49] Description: 
[23/08/2010 16:25:49] data/lib/011-string.lua:38: attempt to perform arithmetic on local 'diff' (a boolean value)
[23/08/2010 16:25:49] stack traceback:
[23/08/2010 16:25:49] 	data/lib/011-string.lua:38: in function 'timediff'
[23/08/2010 16:25:49] 	data/npc/scripts/sweaty cyc.lua:33: in function 'callback'
[23/08/2010 16:25:49] 	data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[23/08/2010 16:25:49] 	data/npc/scripts/sweaty cyc.lua:15: in function <data/npc/scripts/sweaty cyc.lua:15>
 
Back
Top