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

Djins trade request storage

Cebulka02

New Member
Joined
Jan 5, 2008
Messages
56
Reaction score
0
Hey I need add to this script only request for trade if player got storage only. I want add it to 3 rest djins so remmeber 2 of them got quests. So storage only request in trade.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

-- XVX FORGER START --

function obsidian(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,2195) >= 1 then
        if doPlayerRemoveItem(cid,2195,1) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5891,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
    end
end	

function crude(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,2498) >= 2 then
        if doPlayerRemoveItem(cid,2498,2) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5884,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
    end
end


function hell(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,2392) >= 3 then
        if doPlayerRemoveItem(cid,2392,3) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5904,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
   end   
end

function royal(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,2475) >= 4 then
        if doPlayerRemoveItem(cid,2475,4) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5885,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
   end   
end
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
	if msg:lower() == "cookie" and (getPlayerStorageValue(cid, jes_s.m10) > 0 and getPlayerStorageValue(cid, jes_s.m10) < 12) and getPlayerStorageValue(cid, jes_s.djin) < 0 then
		selfSay("You brought cookies! How nice of you! Can I have one?", cid)
		ts = 1
	elseif msg:lower() == "yes" and ts == 1 then
		if getPlayerItemCount(cid, jes_i.cookie) > 0 then
			doPlayerSetStorageValue(cid, jes_s.djin, 1)----------------------
			doPlayerRemoveItem(cid, jes_i.cookie, 1)
			doPlayerSetStorageValue(cid, jes_s.m10, getPlayerStorageValue(cid, jes_s.m10)+1)
			selfSay("You see, good deeds like this will ... YOU ... YOU SPAWN OF EVIL! I WILL MAKE SURE THE MASTER LEARNS ABOUT THIS!", cid)
			ts = 0
		else
			selfSay("Where is my cookie?", cid)
			ts = 0
		end
	end	
end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addSellableItem({'Dwarven Ring'},2213,100,'Dwarvem Ring')
shopModule:addSellableItem({'Energy Ring'},2167,100,'Energy Ring')
shopModule:addSellableItem({'Life Ring'},2168,50,'Life Ring')
shopModule:addSellableItem({'Might Ring'},2164,250,'Might Ring')
shopModule:addSellableItem({'Ring of Healing'},2214,100,'Ring of Healing')
shopModule:addSellableItem({'Time Ring'},2169,100,'Time Ring')
shopModule:addSellableItem({'Dragon Necklace'},2201,100,'Dragon Necklace')
shopModule:addSellableItem({'Protection Amulet'},2200,100,'Protection Amulet')
shopModule:addSellableItem({'Strange Talisman'},2161,30,'Strange Talisman')
shopModule:addSellableItem({'Silver Amulet'},2170,50,'Silver Amulet')
shopModule:addSellableItem({'Hailstorm Rod'},2183,3000,'Hailstorm Rod')
shopModule:addSellableItem({'Moonlight Rod'},2186,200,'Moonlight Rod')
shopModule:addSellableItem({'Necrotic Rod'},2185,1000,'Necrotic Rod')
shopModule:addSellableItem({'Snakebite Rod'},2182,100,'Snakebite Rod')
shopModule:addSellableItem({'Terra Rod'},2181,2000,'Terra Rod')
shopModule:addSellableItem({'Springsprout Rod'},8912,3600,'Springsprout Rod')
shopModule:addSellableItem({'Northwind Rod'},8911,1500,'Nortwind Rod')
shopModule:addSellableItem({'Underworld Rod'},8910,4400,'Underworld Rod')
shopModule:addSellableItem({'Ankh'},2427,100,'Ankh')
shopModule:addSellableItem({'Mysterious Fetish'},2194,50,'Mysterious Fetish')
shopModule:addSellableItem({'Muck Rod'},18411,6000,'Muck Rod')
shopModule:addSellableItem({'Glacial Rod'},18412,5400,'Glacial Rod')


shopModule:addBuyableItem({'Dwarven Ring'},2213,2000,'Dwarven Ring')
shopModule:addBuyableItem({'Life Ring'},2168,900,'Life Ring')
shopModule:addBuyableItem({'Energy Ring'},2167,2000,'Energy Ring')
shopModule:addBuyableItem({'Ring of Healing'},2214,2000,'Ring of Healing')
shopModule:addBuyableItem({'Time Ring'},2169,2000,'Time Ring')
shopModule:addBuyableItem({'Dwarven Ring'},2164,5000,'Might Ring')
shopModule:addBuyableItem({'Silver Amulet'},2170,100,'Silver Amulet')
shopModule:addBuyableItem({'Strange Amulet'},2161,100,'Strange Talisman')
shopModule:addBuyableItem({'Protection Amulet'},2200,700,'Protection Amulet')
shopModule:addBuyableItem({'Dragon Neckle'},2201,1000,'Dragon Neckle')

-- XVX FORGER END --

keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can exchange with you for enchanted chicken wing, fighting spirit, magic sulphur and warrior sweat"})


local node2 = keywordHandler:addKeyword({'enchanted chicken wing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a boots of haste for enchanted chicken wing?'})
    node2:addChildKeyword({'yes'}, obsidian, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})

local node3 = keywordHandler:addKeyword({'fighting spirit'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a 2 royal helmets for fighting spirit?'})
    node3:addChildKeyword({'yes'}, crude, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})
	
	local node5 = keywordHandler:addKeyword({'magic sulphur'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a 3 fire swords for magic sulphur?'})
    node5:addChildKeyword({'yes'}, hell, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})
	
	local node6 = keywordHandler:addKeyword({'flask of warrior/s sweat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a 4 warrior helmets for warrior sweat?'})
    node6:addChildKeyword({'yes'}, royal, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})
	

	

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
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

local sellList = 
{
	{itemId = 7414, price = 20000},
	{itemId = 7426, price = 8000},
	{itemId = 2142, price = 200},
	{itemId = 7404, price = 20000},
	{itemId = 5917, price = 150},
	{itemId = 3962, price = 1500},
	{itemId = 11374, price = 1500},
	{itemId = 7403, price = 40000},
	{itemId = 7406, price = 6000},
	{itemId = 7429, price = 40000},
	{itemId = 2541, price = 80},
	{itemId = 3972, price = 7500},
	{itemId = 7379, price = 1500},
	{itemId = 20109, price = 7000},
	{itemId = 2535, price = 5000},
	{itemId = 8850, price = 40000},
	{itemId = 7427, price = 9000},
	{itemId = 12630, price = 50000},
	{itemId = 9931, price = 500},
	{itemId = 8855, price = 25000},
	{itemId = 7415, price = 30000},
	{itemId = 3982, price = 1000},
	{itemId = 18453, price = 35000},
	{itemId = 2445, price = 12000},
	{itemId = 2125, price = 400},
	{itemId = 6093, price = 250},
	{itemId = 7449, price = 600},
	{itemId = 8878, price = 16000},
	{itemId = 2521, price = 400},
	{itemId = 6301, price = 1000},
	{itemId = 2520, price = 30000},
	{itemId = 14333, price = 32000},
	{itemId = 7382, price = 36000},
	{itemId = 2462, price = 1000},
	{itemId = 7387, price = 3000},
	{itemId = 8885, price = 55000},
	{itemId = 2451, price = 15000},
	{itemId = 2110, price = 200},
	{itemId = 2492, price = 40000},
	{itemId = 7402, price = 15000},
	{itemId = 7430, price = 3000},
	{itemId = 7419, price = 10000},
	{itemId = 2503, price = 30000},
	{itemId = 7866, price = 30000},
	{itemId = 7858, price = 15000},
	{itemId = 7862, price = 6000},
	{itemId = 7861, price = 30000},
	{itemId = 7856, price = 30000},
	{itemId = 7867, price = 6000},
	{itemId = 7855, price = 25000},
	{itemId = 7863, price = 12000},
	{itemId = 7438, price = 2000},
	{itemId = 2127, price = 800},
	{itemId = 7881, price = 30000},
	{itemId = 7873, price = 15000},
	{itemId = 7877, price = 6000},
	{itemId = 7876, price = 30000},
	{itemId = 7871, price = 30000},
	{itemId = 7882, price = 6000},
	{itemId = 7870, price = 25000},
	{itemId = 7878, price = 12000},
	{itemId = 2438, price = 8000},
	{itemId = 7756, price = 30000},
	{itemId = 7748, price = 15000},
	{itemId = 7752, price = 6000},
	{itemId = 7751, price = 30000},
	{itemId = 7746, price = 30000},
	{itemId = 7757, price = 6000},
	{itemId = 7745, price = 25000},
	{itemId = 7753, price = 12000},
	{itemId = 9929, price = 1000},
	{itemId = 9927, price = 500},
	{itemId = 7457, price = 2000},
	{itemId = 7432, price = 1000},
	{itemId = 7888, price = 1500},
	{itemId = 7896, price = 11000},
	{itemId = 7902, price = 2500},
	{itemId = 7897, price = 11000},
	{itemId = 7892, price = 2500},
	{itemId = 2179, price = 8000},
	{itemId = 2466, price = 20000},
	{itemId = 2470, price = 30000},
	{itemId = 2427, price = 11000},
	{itemId = 2444, price = 30000},
	{itemId = 7380, price = 6000},
	{itemId = 2452, price = 50000},
	{itemId = 2442, price = 90},
	{itemId = 13838, price = 2000},
	{itemId = 20132, price = 2000},
	{itemId = 7389, price = 30000},
	{itemId = 8873, price = 3000},
	{itemId = 7766, price = 6000},
	{itemId = 7775, price = 30000},
	{itemId = 7767, price = 15000},
	{itemId = 7771, price = 6000},
	{itemId = 7770, price = 30000},
	{itemId = 7765, price = 30000},
	{itemId = 7776, price = 6000},
	{itemId = 7764, price = 25000},
}

function onTradeRequest(cid)
	if(getPlayerStorageValue(cid, 85) >= 20) then
		npcHandler:say("Feel free to offer me your wares!", cid)
		return true
	else
		npcHandler:say("I don't trade with not recognized traders.", cid)
		return false
	end
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, "mission")) then
		if(os.date("%A") == "Monday") then
			if(getPlayerStorageValue(cid, 85) < 1) then
				npcHandler:say("Well, you could attempt the mission to become a recognised trader, but it requires a lot of travelling. Are you willing to try?", cid)
				talkState[talkUser] = 1
			elseif(getPlayerStorageValue(cid, 85) == 1) then
				npcHandler:say("Have you managed to obtain a rare deer trophy for my customer?", cid)
				talkState[talkUser] = 3
			end
		end

		elseif(os.date("%A") == "Tuesday") then
			if(getPlayerStorageValue(cid, 85) == 2) then
				npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
				talkState[talkUser] = 4
			elseif(getPlayerStorageValue(cid, 85) == 6) then
				npcHandler:say("Did you bring me the package?", cid)
				talkState[talkUser] = 6
			end
		end

		elseif(os.date("%A") == "Wednesday") then
			if(getPlayerStorageValue(cid, 85) == 7) then
				npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
				talkState[talkUser] = 7
			elseif(getPlayerStorageValue(cid, 85) == 9) then
				npcHandler:say("Have you brought the cheese?", cid)
				talkState[talkUser] = 9
			end
		end

		elseif(os.date("%A") == "Thursday") then
			if(getPlayerStorageValue(cid, 85) == 10) then
				npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
				talkState[talkUser] = 10
			elseif(getPlayerStorageValue(cid, 85) == 12) then
				npcHandler:say("Have you brought the vase?", cid)
				talkState[talkUser] = 12
			end
		end

		elseif(os.date("%A") == "Friday") then
			if(getPlayerStorageValue(cid, 85) == 13) then
				npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
				talkState[talkUser] = 13
			elseif(getPlayerStorageValue(cid, 85) == 15) then
				npcHandler:say("Have you brought a cheap but good crimson sword?", cid)
				talkState[talkUser] = 15
			end
		end

		elseif(os.date("%A") == "Saturday") then
			if(getPlayerStorageValue(cid, 85) == 17) then
				npcHandler:say("So, my friend, are you willing to proceed to the next mission to become a recognised trader?", cid)
				talkState[talkUser] = 16
			elseif(getPlayerStorageValue(cid, 85) == 18) then
				npcHandler:say("Have you brought me a gold fish??", cid)
				talkState[talkUser] = 18
			end
		end

		elseif(os.date("%A") == "Sunday") then
			if(getPlayerStorageValue(cid, 85) == 19) then
				npcHandler:say("Ah, right. <ahem> I hereby declare you - one of my recognised traders! Feel free to offer me your wares!", cid)
				setPlayerStorageValue(cid, 85, 20)
				doPlayerAddAchievement(cid, 139)
				talkState[talkUser] = 0
			end
		end
	elseif(msgcontains(msg, "yes")) then
		if(talkState[talkUser] == 1) then
			npcHandler:say("Very good! I need talented people who are able to handle my wares with care, find good offers and the like, so I'm going to test you. ...", cid)
			npcHandler:say("First, I'd like to see if you can dig up rare wares. Something like a ... mastermind shield! ...", cid)
			npcHandler:say("Haha, just kidding, fooled you there, didn't I? Always control your nerves, that's quite important during bargaining. ...", cid)
			npcHandler:say("Okay, all I want from you is one of these rare deer trophies. I have a customer here in Svargrond who ordered one, so I'd like you to deliver it tome while I'm in Svargrond. ...", cid)
			npcHandler:say("Everything clear and understood?", cid)
			talkState[talkUser] = 2
		elseif(talkState[talkUser] == 2) then
			npcHandler:say("Fine. Then get a hold of that deer trophy and bring it to me while I'm in Svargrond. Just ask me about your mission.", cid)
			setPlayerStorageValue(cid, 85, 1)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 3) then
			if(getPlayerItemCount(cid, 7397) >= 1) then
				doPlayerRemoveItem(cid, 7397, 1)
				npcHandler:say("Well done! I'll take that from you. <snags it> Come see me another day, I'll be busy for a while now. ", cid)
				setPlayerStorageValue(cid, 85, 2)
				talkState[talkUser] = 0
			end
		elseif(talkState[talkUser] == 4) then
			npcHandler:say("Alright, that's good to hear. From you as my trader and deliveryman, I expect more than finding rare items. ...", cid)
			npcHandler:say("You also need to be able to transport heavy wares, weaklings won't get far here. I have ordered a special package from Edron. ...", cid)
			npcHandler:say("Pick it up from Willard and bring it back to me while I'm in Liberty Bay. Everything clear and understood?", cid)
			talkState[talkUser] = 5
		elseif(talkState[talkUser] == 5) then
			npcHandler:say("Fine. Then off you go, just ask Willard about the 'package for Rashid'.", cid)
			setPlayerStorageValue(cid, 85, 3)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 6) then
			if(getPlayerItemCount(cid, 7503) >= 1) then
				doPlayerRemoveItem(cid, 7503, 1)
				npcHandler:say("Great. Just place it over there - yes, thanks, that's it. Come see me another day, I'll be busy for a while now. ", cid)
				setPlayerStorageValue(cid, 85, 7)
				talkState[talkUser] = 0
			end
		elseif(talkState[talkUser] == 7) then
			npcHandler:say("Well, that's good to hear. From you as my trader and deliveryman, I expect more than carrying heavy packages. ...", cid)
			npcHandler:say("You also need to be fast and deliver wares in time. I have ordered a very special cheese wheel made from Darashian milk. ...", cid)
			npcHandler:say("Unfortunately, the high temperature in the desert makes it rot really fast, so it must not stay in the sun for too long. ...", cid)
			npcHandler:say("I'm also afraid that you might not be able to use ships because of the smell of the cheese. ...", cid)
			npcHandler:say("Please get the cheese from Miraia and bring it to me while I'm in Port Hope. Everything clear and understood?", cid)
			talkState[talkUser] = 8
		elseif(talkState[talkUser] == 8) then
			npcHandler:say("Okay, then please find Miraia in Darashia and ask her about the {'scarab cheese'}.", cid)
			setPlayerStorageValue(cid, 85, 8)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 9) then
			if(getPlayerItemCount(cid, 8112) >= 1) then
				doPlayerRemoveItem(cid, 8112, 1)
				npcHandler:say("Mmmhh, the lovely odeur of scarab cheese! I really can't understand why most people can't stand it. Thanks, well done! ", cid)
				setPlayerStorageValue(cid, 85, 10)
				talkState[talkUser] = 0
			end
		elseif(talkState[talkUser] == 10) then
			npcHandler:say("Well, that's good to hear. From you as my trader and deliveryman, I expect more than bringing stinky cheese. ...", cid)
			npcHandler:say("I wonder if you are able to deliver goods so fragile they almost break when looked at. ...", cid)
			npcHandler:say("I have ordered a special elven vase from Briasol in Ab'Dendriel. Get it from him and don't even touch it, just bring it to me while I'm in Ankrahmun. Everything clear and understood?", cid)
			talkState[talkUser] = 11
		elseif(talkState[talkUser] == 11) then
			npcHandler:say("Okay, then please find {Briasol} in {Ab'Dendriel} and ask for a {'fine vase'}.", cid)
			setPlayerStorageValue(cid, 85, 11)
			doPlayerAddMoney(cid, 1000)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 12) then
			if(getPlayerItemCount(cid, 8760) >= 1) then
				doPlayerRemoveItem(cid, 8760, 1)
				npcHandler:say("I'm surprised that you managed to bring this vase without a single crack. That was what I needed to know, thank you. ", cid)
				setPlayerStorageValue(cid, 85, 13)
				talkState[talkUser] = 0
			end
		elseif(talkState[talkUser] == 13) then
			npcHandler:say("Fine! There's one more skill that I need to test and which is cruicial for a successful trader. ...", cid)
			npcHandler:say("Of course you must be able to haggle, else you won't survive long in this business. To make things as hard as possible for you, I have the perfect trade partner for you. ...", cid)
			npcHandler:say("Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ...", cid)
			npcHandler:say("Of course, it has to be cheap. Don't come back with anything more expensive than 400 gold. ...", cid)
			npcHandler:say("And the quality must not suffer, of course! Everything clear and understood?", cid)
			npcHandler:say("Dwarves are said to be the most stubborn of all traders. Travel to Kazordoon and try to get the smith Uzgod to sell a crimson sword to you. ...", cid)
			talkState[talkUser] = 14
		elseif(talkState[talkUser] == 14) then
			npcHandler:say("Okay, I'm curious how you will do with {Uzgod}. Good luck!", cid)
			setPlayerStorageValue(cid, 85, 14)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 15) then
			if(getPlayerItemCount(cid, 7385) >= 1) then
				doPlayerRemoveItem(cid, 7385, 1)
				npcHandler:say("Ha! You are clever indeed, well done! I'll take this from you. Come see me tomorrow, I think we two might get into business after all.", cid)
				setPlayerStorageValue(cid, 85, 16)
				talkState[talkUser] = 0
			end
		elseif(talkState[talkUser] == 16) then
			npcHandler:say("My friend, it seems you have already learnt a lot about the art of trading. I think you are more than worthy to become a recognised trader. ...", cid)
			npcHandler:say("There is just one little favour that I would ask from you... something personal, actually, forgive my boldness. ...", cid)
			npcHandler:say("I have always dreamed to have a small pet, one that I could take with me and which wouldn't cause problems. ...", cid)
			npcHandler:say("Could you - just maybe - bring me a small goldfish in a bowl? I know that you would be able to get one, wouldn't you?", cid)
			talkState[talkUser] = 17
		elseif(talkState[talkUser] == 17) then
			npcHandler:say("Thanks so much! I'll be waiting eagerly for your return then.", cid)
			setPlayerStorageValue(cid, 85, 17)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 18) then
			if(getPlayerItemCount(cid, 8766) >= 1) then
				doPlayerRemoveItem(cid, 8766, 1)
				npcHandler:say("Thank you!! Ah, this makes my day! I'll take the rest of the day off to get to know this little guy. Come see me tomorrow, if you like.", cid)
				setPlayerStorageValue(cid, 85, 19)
				talkState[talkUser] = 0
			end
		end
	end
	return true
end

npcHandler:setCallback(CALLBACK_ONTRADEREQUEST, onTradeRequest)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Ok i got new request Npc with 100% items price and 50% but only for player not global shop storage. I mean if player without quest wont change shop for player 100%. Because for now it happens for us

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
if msg:lower() == "cookie" and (getPlayerStorageValue(cid, jes_s.m10) > 0 and getPlayerStorageValue(cid, jes_s.m10) < 12) and getPlayerStorageValue(cid, jes_s.djin) < 0 then
selfSay("You brought cookies! How nice of you! Can I have one?", cid)
ts = 1
elseif msg:lower() == "yes" and ts == 1 then
if getPlayerItemCount(cid, jes_i.cookie) > 0 then
doPlayerSetStorageValue(cid, jes_s.djin, 1)----------------------
doPlayerRemoveItem(cid, jes_i.cookie, 1)
doPlayerSetStorageValue(cid, jes_s.m10, getPlayerStorageValue(cid, jes_s.m10)+1)
selfSay("You see, good deeds like this will ... YOU ... YOU SPAWN OF EVIL! I WILL MAKE SURE THE MASTER LEARNS ABOUT THIS!", cid)
ts = 0
else
selfSay("Where is my cookie?", cid)
ts = 0
end
end
end
function greetCallback(cid)
if getPlayerStorageValue(cid, 76416) == 1 then
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'Crown Shield'},2519,8000,'Crown Shield')
shopModule:addSellableItem({'Dragon Shield'},2516,4000,'Dragon Shield')
shopModule:addSellableItem({'Guardian Shield'},2515,2000,'Guardian Shield')
shopModule:addSellableItem({'Phoenix Shield'},2539,16000,'Phoenix Shield')
shopModule:addSellableItem({'Blue Robe'},2656,10000,'Blue Robe')
shopModule:addSellableItem({'Crown Armor'},2487,12000,'Crown Armor')
shopModule:addSellableItem({'Boots of Haste'},2195,30000,'Boots of Haste')
shopModule:addSellableItem({'Broad Sword'},2413,500,'Broad Sword')
shopModule:addSellableItem({'Dragon Lance'},2414,9000,'Dragon Lance')
shopModule:addSellableItem({'Fire Axe'},2432,8000,'Fire Axe')
shopModule:addSellableItem({'Ice Rapier'},2396,1000,'Ice Rapier')
shopModule:addSellableItem({'Obsidian Lance'},2425,500,'Obsidian Lance')
shopModule:addSellableItem({'War Hammer'},2391,1200,'War Hammer')
shopModule:addSellableItem({'Crown Helmet'},2491,2500,'Crown Helmet')
shopModule:addSellableItem({'Crusader Helmet'},2497,6000,'Crusader Helmet')
shopModule:addSellableItem({'Royal Helmet'},2498,30000,'Royal Helmet')
shopModule:addSellableItem({'Crown Legs'},2488,12000,'Crown Legs')
shopModule:addSellableItem({'Glorious Axe'},7454,3000,'Glorious Axe')
shopModule:addSellableItem({'Thaian Sword'},7391,16000,'Thaian Sword')
shopModule:addSellableItem({'Angelic Axe'},7436,5000,'Angelic Axe')
shopModule:addSellableItem({'Fire Sword'},2392,4000,'Fire Sword')
shopModule:addSellableItem({'Spike Sword'},2383,1000,'Spike Sword')
shopModule:addSellableItem({'Shadow Sceptre'},7451,10000,'Shadow Sceptre')
shopModule:addSellableItem({'Queens sceptre'},7410,20000,'Queens sceptre')
shopModule:addBuyableItem({'Beholder Shield'},2518,7000,'Beholder Shield')
shopModule:addBuyableItem({'Noble Armor'},2486,8000,'Noble Armor')
shopModule:addBuyableItem({'Spike Sword'},2383,8000,'Spike Sword')
shopModule:addBuyableItem({'War Hammer'},2391,10000,'War Hammer')
shopModule:addBuyableItem({'Obsidian Lance'},2425,3000,'Obsidian Lance')
shopModule:addSellableItem({'Butchers Axe'},7412,18000,'Butchers Axe')
else------------------------ /\ NORMALNE CENY /\ |||||||||||| \/ połowa ceny \/
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'Crown Shield'},2519,4000,'Crown Shield')
shopModule:addSellableItem({'Dragon Shield'},2516,2000,'Dragon Shield')
shopModule:addSellableItem({'Guardian Shield'},2515,1000,'Guardian Shield')
shopModule:addSellableItem({'Phoenix Shield'},2539,8000,'Phoenix Shield')
shopModule:addSellableItem({'Blue Robe'},2656,5000,'Blue Robe')
shopModule:addSellableItem({'Crown Armor'},2487,6000,'Crown Armor')
shopModule:addSellableItem({'Boots of Haste'},2195,15000,'Boots of Haste')
shopModule:addSellableItem({'Broad Sword'},2413,250,'Broad Sword')
shopModule:addSellableItem({'Dragon Lance'},2414,4500,'Dragon Lance')
shopModule:addSellableItem({'Fire Axe'},2432,4000,'Fire Axe')
shopModule:addSellableItem({'Ice Rapier'},2396,500,'Ice Rapier')
shopModule:addSellableItem({'Obsidian Lance'},2425,250,'Obsidian Lance')
shopModule:addSellableItem({'War Hammer'},2391,600,'War Hammer')
shopModule:addSellableItem({'Crown Helmet'},2491,1250,'Crown Helmet')
shopModule:addSellableItem({'Crusader Helmet'},2497,3000,'Crusader Helmet')
shopModule:addSellableItem({'Royal Helmet'},2498,15000,'Royal Helmet')
shopModule:addSellableItem({'Crown Legs'},2488,6000,'Crown Legs')
shopModule:addSellableItem({'Glorious Axe'},7454,1500,'Glorious Axe')
shopModule:addSellableItem({'Thaian Sword'},7391,8000,'Thaian Sword')
shopModule:addSellableItem({'Angelic Axe'},7436,2500,'Angelic Axe')
shopModule:addSellableItem({'Fire Sword'},2392,2000,'Fire Sword')
shopModule:addSellableItem({'Fire Sword'},2392,2000,'Fire Sword')
shopModule:addSellableItem({'Spike Sword'},2383,500,'Spike Sword')
shopModule:addSellableItem({'Butchers Axe'},7412,9000,'Butchers Axe')
shopModule:addSellableItem({'Shadow Sceptre'},7451,5000,'Shadow Sceptre')
shopModule:addSellableItem({'Queens sceptre'},7410,10000,'Queens sceptre')
shopModule:addBuyableItem({'Beholder Shield'},2518,7000,'Beholder Shield')
shopModule:addBuyableItem({'Noble Armor'},2486,8000,'Noble Armor')
shopModule:addBuyableItem({'Spike Sword'},2383,8000,'Spike Sword')
shopModule:addBuyableItem({'War Hammer'},2391,10000,'War Hammer')
shopModule:addBuyableItem({'Obsidian Lance'},2425,3000,'Obsidian Lance')
end
return true
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

its our npc
 
Back
Top