What's new

NPC Full Rl Citizen+Hunter+Knight+Mage+Summoner+Warrior OUTFIT

Status
Not open for further replies.

boytano1

Active User
Joined
Jun 15, 2009
Messages
70
Reaction score
8
Wszystkie skrypty zosta?y napisane przeze mnie oraz testowane na tfs 0.4 pod tibie 8.6, gdyby by?y jakie? b??dy prosz? napisac pod tematem, a oto skrypty :
W SKRYPTACH NIE ZGADZAJ? SI? ID OUTFIT?W CZYLI doPlayerAddOutfit(cid, 136, 1) [136,1] ORAZ MOG? NIE ZGADZAC SI? ID SPRAWDZANYCH ORAZ USUWANYCH ITEM?W Z POSTACI!(po prostu nie mia?em czasu szukac id outfit?w oraz id item?w)​
Citizen
Hanna:
PHP:
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 storage = getPlayerStorageValue(cid, 6648)
	
	if msgcontains(msg, 'hat') then
		if storage == -1 then
			npcHandler:say("Pretty, isn't it? My friend Amber taught me how to make it, but I could help you with one if you like. What do you say?", cid)
			talkState[talkUser] = 1
		end
	elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
		if storage == -1 then
			npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue. That's it, come back to me once you gathered it!", cid)
			setPlayerStorageValue(cid, 6648, 1)
		end
	end
	
	if msgcontains(msg, 'hat') then
		if storage == 1 then
			npcHandler:say("Oh, you're back already? Did you bring a legion helmet, 100 chicken feathers and 50 honeycombs?", cid)
			talkState[talkUser] = 2
		end
	elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
		if storage == 1 then
			if getPlayerItemCount(cid, 6500) >= 100 and getPlayerItemCount(cid, 6500) >= 50 and getPlayerItemCount(cid, 6500) >= 1 then
				doPlayerRemoveItem(cid, 6500, 100)
				doPlayerRemoveItem(cid, 6500, 50)
				doPlayerRemoveItem(cid, 6500, 1)
				if getPlayerSex(cid) == 0 then
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 6648, 2)
					npcHandler:say("Great job! That must have taken a lot of work. Okay, you put it like this... then glue like this... here!", cid)
				else
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 6648, 2)
					npcHandler:say("Great job! That must have taken a lot of work. Okay, you put it like this... then glue like this... here!", cid)
				end
			end
		end
	end
				
			
return true
end

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

Lubo:
PHP:
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 storage = getPlayerStorageValue(cid, 6647)
	local time = 2
	
	if msgcontains(msg, 'addon') then
		if storage == -1 then
			npcHandler:say("Sorry, the backpack I wear is not for sale. It's handmade from rare minotaur leather.", cid)
			talkState[talkUser] = 1
		end
		
		
	elseif msgcontains(msg, 'minotaur leather') and talkState[talkUser] == 1 then
		npcHandler:say("Well, if you really like this backpack, I could make one for you, but minotaur leather is hard to come by these days. Are you willing to put some work into this?", cid)
		talkState[talkUser] = 2
	else
		talkState[talkUser] = 0
	elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
		if storage == -1 then
			npcHandler:say("Alright then, if you bring me 100 pieces of fine minotaur leather I will see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", cid)
			setPlayerStorageValue(cid, 6647, 1)
		end
	else
		talkState[talkUser] = 0
	end
	
	if msgcontains(msg, 'addon') then
		if storage == 1 then
			npcHandler:say("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", cid)
			talkState[talkUser] = 3
		end
	
	elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
		if storage == 1 then
			if getPlayerItemCount(cid, 6500) >= 100 then
				doPlayerRemoveItem(cid, 6500, 100)
				npcHandler:say("Great! Alright, I need a while to finish this backpack for you. Come ask me later, okay?", cid)
				setPlayerStorageValue(cid, 48114, os.time()+time*60*60)
				setPlayerStorageValue(cid, 6647, 2)
			else
			npcHandler:say("You dont have 100 minotaur leather!", cid)
			end
		end
	end
	
	if msgcontains(msg, 'addon') then
		if storage == 2 then
			if getPlayerStorageValue(cid, 48114) - os.time() <= 0 then
				if getPlayerSex(cid) == 0 then
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 6647, 3)
					npcHandler:say("Just in time! Your backpack is finished. Here you go, I hope you like it.", cid)
				else
					doPlayerAddOutfit(cid, 128, 1)
					setPlayerStorageValue(cid, 6647, 3)
					npcHandler:say("Just in time! Your backpack is finished. Here you go, I hope you like it.", cid)
				end
			end
		end
	end
	

return true
end

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

Hunter​

Elane:

PHP:
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 storage = getPlayerStorageValue(cid, 6648)
	local storage2 = getPlayerStorageValue(cid, 6649)
	
	
	if msgcontains(msg, 'tiara') then
		if storage == -1 then
			npcHandler:say("Oh, my winged tiara? Those are traditionally awarded after having completed a difficult task for our guild, only to female aspirants though. Male warriors will receive a hooded cloak.", cid)
			setPlayerStorageValue(cid, 6648, 1)
		end
		
	elseif msgcontains(msg, 'task') then
		if storage == 1 then
			npcHandler:say("So you are saying that you would like to prove that you deserve to wear such a hooded cloak?", cid)
			talkState[talkUser] = 1
		end
		
	elseif msgcontains(msg, 'crossbow') then
		if storage == 2 then
			npcHandler:say("I'm so excited! Have you really found my crossbow?", cid)
			talkState[talkUser] = 3
		end
		
	elseif msgcontains(msg, '100 red dragon leather') then
		if storage == 3 then
			npcHandler:say("Did you bring me 100 pieces of lizard leather and 100 pieces of red dragon leather?", cid)
			talkState[talkUser] = 4
		end
	
	elseif msgcontains(msg, '5 enchanted chicken wings') then
		if storage == 4 then
			npcHandler:say("Were you able to get hold of 5 enchanted chicken wings?", cid)
			talkState[talkUser] = 5
		end
		
	elseif msgcontains(msg, 'steel') then
		if storage == 5 then
			npcHandler:say("Ah, have you brought one piece of royal steel, draconian steel and hell steel each?", cid)
			talkState[talkUser] = 6
		end

	elseif msgcontains(msg, 'sniper gloves') then
		if storage2 == -1 then
			npcHandler:say("You found sniper gloves?! Incredible! Listen, if you give them to me, I will grant you the right to wear the sniper gloves accessory. How about it?", cid)
			talkState[talkUser] = 7
		end
	
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 1 then
			if storage == 1 then
				npcHandler:say({"Alright, I will give you a chance. Pay close attention to what I'm going to tell you now. ...", "Recently, one of our members moved to Liberty Bay out of nowhere, talking about some strange cult. That is not the problem, but he took my favourite crossbow with him. ...", " Please find my crossbow. It has my name engraved on it and is very special to me. ...", "Secondly, we need a lot of leather for new quivers. 100 pieces of lizard leather and 100 pieces of red dragon leather should suffice. ...", "Third, since we are giving out tiaras, we are always in need of enchanted chicken wings. Please bring me 5, that would help us tremendously. ...", "Lastly, for our arrow heads we need a lot of steel. Best would be one piece of royal steel, one piece of draconian steel and one piece of hell steel. ...", "Did you understand everything I told you and are willing to handle this task?"}, cid)
				talkState[talkUser] = 2
			end
			
		elseif talkState[talkUser] == 2 then
			if storage == 1 then
				npcHandler:say("That's the spirit! I hope you will find my crossbow," ..getPlayerName(cid)..".", cid)
				setPlayerStorageValue(cid, 6648, 2)
				talkState[talkUser] = 0
			end
		
		elseif talkState[talkUser] == 3 then
			if storage == 2 then
				if getPlayerItemCount(cid, 8702) >= 1 then
				doPlayerRemoveItem(cid, 8702, 1)
				npcHandler:say("Yeah! I could kiss you right here and there! Besides, you're a handsome one. <giggles> Please bring me 100 pieces of lizard leather and 100 pieces of red dragon leather now!", cid)
				setPlayerStorageValue(cid, 6648, 3)
				talkState[talkUser] = 0
				else
					npcHandler:say("You don't have item!", cid)
				end
			end
		
		elseif talkState[talkUser] == 4 then
			if storage == 3 then
				if getPlayerItemCount(cid, 8702) >= 100 and getPlayerItemCount(cid, 8702) >= 100 then
					doPlayerRemoveItem(cid, 8702, 100)
					doPlayerRemoveItem(cid, 8702, 100)
					npcHandler:say("Good work," ..getPlayerName(cid).."! That is enough leather for a lot of sturdy quivers. Now, please bring me 5 enchanted chicken wings.", cid)
					setPlayerStorageValue(cid, 6648, 4)
					talkState[talkUser] = 0
				else
					npcHandler:say("You don't have item!", cid)
				end
			end
		
		elseif talkState[talkUser] == 5 then
			if storage == 4 then
				if getPlayerItemCount(cid, 8702) >= 5 then
					doPlayerRemoveItem(cid, 8702, 5)
					npcHandler:say("Great! Now we can create a few more Tiaras. If only they weren't that expensive... Well anyway, please obtain one piece of royal steel, draconian steel and hell steel each.", cid)
					setPlayerStorageValue(cid, 6648, 5)
					talkState[talkUser] = 0
				else
					npcHandler:say("You don't have item!", cid)
				end
			end
		
		elseif talkState[talkUser] == 6 then
			if storage == 5 then
				if getPlayerItemCount(cid, 8702) >= 1 and getPlayerItemCount(cid, 8702) >= 1 and getPlayerItemCount(cid, 8702) >= 1 then
					doPlayerRemoveItem(cid, 8702, 1)
					doPlayerRemoveItem(cid, 8702, 1)
					doPlayerRemoveItem(cid, 8702, 1)
					if getPlayerSex(cid) == 0 then
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid, 6648, 6)
						npcHandler:say("Wow, I'm impressed," ..getPlayerName(cid)..". Your really are a valuable member of our paladin guild. I shall grant you your reward now. Wear it proudly!", cid)
						talkState[talkUser] = 0
					else
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid, 6648, 6)
						npcHandler:say("Wow, I'm impressed," ..getPlayerName(cid)..". Your really are a valuable member of our paladin guild. I shall grant you your reward now. Wear it proudly!", cid)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have item!", cid)
				end
			end
			
		elseif talkState[talkUser] == 7 then
			if storage2 == -1 then
				if getPlayerItemCount(cid, 8702) >= 1 then
					doPlayerRemoveItem(cid, 8702, 1)
					if getPlayerSex(cid) == 0 then
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid, 6649, 1)
						npcHandler:say("Great! I hereby grant you the right to wear the sniper gloves as accessory. Congratulations!", cid)
						talkState[talkUser] = 0
					else
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid, 6649, 1)
						npcHandler:say("Great! I hereby grant you the right to wear the sniper gloves as accessory. Congratulations!", cid)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have item!", cid)
				end
			end
		end
	end
	
		
return true
end

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

Knight​

Gregor:
PHP:
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 storage = getPlayerStorageValue(cid, 6651)
		local voc = getPlayerVocation(cid)
		
	if msgcontains(msg, 'adorned helmet') then
		if storage == -1 then
			npcHandler:say("Only the bravest warriors may wear adorned helmets. They are traditionally awarded after having completed a difficult task for our guild.", cid)
			talkState[talkUser] = 1
		end
		
	elseif msgcontains(msg, 'task') then
		if talkState[talkUser] == 1 then
			npcHandler:say("You mean, you would like to prove that you deserve to wear such a helmet?", cid)
			talkState[talkUser] = 2
		end
		
	elseif msgcontains(msg, 'behemoth fangs') then
		if storage == 1 then
			npcHandler:say("Have you really managed to fulfil the task and brought me 100 perfect behemoth fangs?", cid)
			talkState[talkUser] = 4
		end
		
	elseif msgcontains(msg, 'ramsay the reckless helmet') then
		if storage == 2 then
			npcHandler:say("Did you recover the helmet of Ramsay the Reckless?", cid)
			talkState[talkUser] = 5
		end
		
	elseif msgcontains(msg, "warrior's sweat") then
		if storage == 3 then
			npcHandler:say("Were you able to get hold of a flask with pure warrior's sweat?", cid)
			talkState[talkUser] = 6
		end
		
	elseif msgcontains(msg, "royal steel") then
		if storage == 4 then
			npcHandler:say("Ah, have you brought the royal steel?", cid)
			talkState[talkUser] = 7
		end
		
		
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 2 then
			npcHandler:say({"Well then, listen closely. First, you will have to prove that you are a fierce and restless warrior by bringing me 100 perfect behemoth fangs. ...", "Secondly, please retrieve a helmet for us which has been lost a long time ago. The famous Ramsay the Reckless wore it when exploring an ape settlement. ...", "Third, we need a new flask of warrior's sweat. We've run out of it recently, but we need a small amount for the show battles in our arena. ...", "Lastly, I will have our smith refine your helmet if you bring me royal steel, an especially noble metal. ...", "Did you understand everything I told you and are willing to handle this task?"}, cid)
			talkState[talkUser] = 3
			
		elseif talkState[talkUser] == 3 then
			npcHandler:say("Alright then. Come back to me once you have collected 100 perfect behemoth fangs.", cid)
			setPlayerStorageValue(cid, 6651, 1)
			talkState[talkUser] = 0
			
		elseif talkState[talkUser] == 4 then
			if storage == 1 then
				if getPlayerItemCount(cid, 8702) >= 100 then
					doPlayerRemoveItem(cid, 8702, 100)
					setPlayerStorageValue(cid, 6651, 2)
					if voc == 4 or voc == 8 then
						npcHandler:say("I'm deeply impressed," ..getPlayerName(cid)..". Now, please retrieve Ramsay's helmet.", cid)
						talkState[talkUser] = 0
					else
						npcHandler:say("I'm deeply impressed," ..getPlayerName(cid)..". Even if you are not a knight, you certainly possess knight qualities. Now, please retrieve Ramsay's helmet.", cid)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 5 then
			if storage == 2 then
				if getPlayerItemCount(cid, 8702) >= 1 then
				doPlayerRemoveItem(cid, 8702, 1)
				setPlayerStorageValue(cid, 6651, 3)
					if voc == 4 or voc == 8 then
						npcHandler:say("Brave Knight," ..getPlayerName(cid).."! Even though it is damaged, it has a lot of sentimental value. Now, please bring me warrior's sweat.", cid)
						talkState[talkUser] = 0
					else
						npcHandler:say("Good work," ..getPlayerName(cid).."! Even though it is damaged, it has a lot of sentimental value. Now, please bring me warrior's sweat." , cid)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		
		elseif talkState[talkUser] == 6 then
			if storage == 3 then
				if getPlayerItemCount(cid, 8702) >= 1 then
					doPlayerRemoveItem(cid, 8702, 1)
					setPlayerStorageValue(cid, 6651, 4)
					if voc == 4 or voc == 8 then
						npcHandler:say("Brave Knight," ..getPlayerName(cid).."! There is only one task left now: Obtain royal steel to have your helmet refined.", cid)
						talkState[talkUser] = 0
					else
						npcHandler:say("Now that is a pleasant surprise," ..getPlayerName(cid).."! There is only one task left now: Obtain royal steel to have your helmet refined.", cid)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
				
		elseif talkState[talkUser] == 7 then
			if storage == 4 then
				if getPlayerItemCount(cid, 8702) >= 1 then
					doPlayerRemoveItem(cid, 8702, 1)
					setPlayerStorageValue(cid, 6651, 5)
					if voc == 4 or voc == 8 then
						npcHandler:say("Brave Knight," ..getPlayerName(cid).."! Please talk to Sam and tell him I sent you. I'm sure he will be glad to refine your helmet.", cid)
						talkState[talkUser] = 0
					else
						npcHandler:say("You truly deserve to wear an adorned helmet," ..getPlayerName(cid)..". Please talk to Sam and tell him I sent you. I'm sure he will be glad to refine your helmet.", cid)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
				
		end
	end
		
		
		
return true
end


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

Morgan:

PHP:
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 storage = getPlayerStorageValue(cid, 6650)
		local storage2 = getPlayerStorageValue(cid, 7214)
		
		
	if msgcontains(msg, 'weapons') then
		if storage == -1 or storage2 == -1 then
			npcHandler:say("Would you rather be interested in a knight's sword or in a warrior's sword?", cid)
			talkState[talkUser] = 1
		end
		
	elseif msgcontains(msg, 'addon') then
		if storage == -1 or storage2 == -1 then
			npcHandler:say("I can forge the finest weapons for knights and warriors. They may wear them proudly and visible to everyone.", cid)
		end
	
	elseif msgcontains(msg, 'knights sword') then
		if talkState[talkUser] == 1 then
			npcHandler:say("Great! Simply bring me 100 Iron Ore and one Crude Iron and I will happily forge it for you.", cid)
			talkState[talkUser] = 2
		end
	
	elseif msgcontains(msg, "warrior's sword") then
		if talkState[talkUser] == 1 then
			npcHandler:say("Great! Simply bring me 100 iron ore and one royal steel and I will happily forge it for you.", cid)
			talkState[talkUser] = 0
		end
	end
	
	if msgcontains(msg, 'forge weapon') then
		if storage == -1 then
			npcHandler:say("What would you like me to forge for you? A knight sword's or a warrior's sword?", cid)
			talkState[talkUser] = 3
		end
		
	elseif msgcontains(msg, 'knights sword') then
		if storage == -1 then
			if talkState[talkUser] == 3 then
				if getPlayerItemCount(cid, 8702) >= 100 and getPlayerItemCount(cid, 8702) >= 1 then
					if doPlayerRemoveItem(cid, 8702, 100) and doPlayerRemoveItem(cid, 8702, 1) then
						if getPlayerSex(cid) == 0 then
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 6650, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						else
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 6650, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						end
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end
	
	if msgcontains(msg, 'forge') then
		if storage2 == -1 then
			npcHandler:say("What would you like me to forge for you? A knight's sword or a warrior's sword?", cid)
			talkState[talkUser] = 4
		end
	
	elseif msgcontains(msg, "warrior's sword") then
		if talkState[talkUser] == 4 then
			if storage == -1 then
				if getPlayerItemCount(cid, 8702) >= 100 and getPlayerItemCount(cid, 8702) >= 1 then
					if doPlayerRemoveItem(cid, 8702, 100) and doPlayerRemoveItem(cid, 8702, 1) then
						if getPlayerSex(cid) == 0 then
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 7214, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						else
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 7214, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						end
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end

return true
end

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

Sam:

PHP:
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 storage = getPlayerStorageValue(cid, 6651)
	local time = 2
	
	if msgcontains(msg, 'adorned helmet') then
		if storage == 5 then
			npcHandler:say("Oh, Gregor sent you? I see. It will be my pleasure to adorn your helmet. Please give me some time to finish it.", cid)
			setPlayerStorageValue(cid, 6651, 6)
			setPlayerStorageValue(cid, 48115, os.time()+time*60*60)
		end
	end
	
	if msgcontains(msg, 'adorned helmet') then
		if storage == 6 then
			if getPlayerStorageValue(cid, 48115) - os.time() <= 0 then
				if getPlayerSex(cid) == 0 then
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 6651, 7)
					npcHandler:say("Just in time, "..getPlayerName(cid)..". Your helmet is finished, I hope you like it.", cid)
				else
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 6651, 7)
					npcHandler:say("Just in time, "..getPlayerName(cid)..". Your helmet is finished, I hope you like it.", cid)
				end
			else
				npcHandler:say("You must wait sorry!", cid)
			end
		end
	end



	return true
end

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

Mage + Summoner(NIE TESTOWA?EM MO?E NIE DZIA?AC!!)​

Angelina:

PHP:
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 storage = getPlayerStorageValue(cid, 6652)
		
		
		if msgcontains(msg, 'yes') then
			if storage == -1 then
				npcHandler:say("I will tell you a small secret now. My friend Lynda in Thais can create a blessed wand. Greet her from me, maybe shewill aid you.", cid)
				setPlayerStorageValue(cid, 6652, 1)
			end
		end
			
			
		
return true
end





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

Lynda:

PHP:
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 storage = getPlayerStorageValue(cid, 6652) -- mage male
		local storage2 = getPlayerStorageValue(cid, 7147) -- summoner female
		local male = getPlayerSex(cid) == 1
		local tablica = {2182, 2191, 2190, 2189, 2187, 2188, 2181, 2183, 2185, 2186}
		local time = 3
		
		if msgcontains(msg, 'angelina') then
				if storage == 1 then
					npcHandler:say({"Angelina had been imprisoned? My, these are horrible news, but I am so glad to hear that she is safe now. ...", "I will happily carry out her wish and reward you, but I fear I need some important ingredients for my blessing spell first....", "Will you gather them for me?"}, cid)
					talkState[talkUser] = 1
				end
			
		elseif msgcontains(msg, 'wands') then
			if storage == 2 then
				npcHandler:say("Did you bring a sample of each wand and each rod with you?", cid)
				talkState[talkUser] = 3
			end
		
		elseif msgcontains(msg, 'magic sulphur') then
			if storage == 3 then
				npcHandler:say("Did you obtain 10 ounces of magic sulphur?", cid)
				talkState[talkUser] = 4
			end
			
		elseif msgcontains(msg, 'soul stone') then
			if storage == 4 then
				npcHandler:say("Were you actually able to retrieve the Necromancer's soul stone?", cid)
				talkState[talkUser] = 5
			end
			
		elseif msgcontains(msg, 'ankhs') then
			if storage == 5 then
				npcHandler:say("Am I sensing enough holy energy from ankhs here?", cid)
				talkState[talkUser] = 6
			end
		
		elseif msgcontains(msg, 'ritual') then
			if storage == 6 then
				if getPlayerStorageValue(cid, 48116) - os.time() <= 0 then
					if male then
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid, 6652, 7)
						npcHandler:say("I'm glad to tell you that I have finished the ritual, "..getPlayerName(cid)..". Here is your new wand. I hope you carry it proudly foreveryone to see.", cid)
					else
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid, 7147, 7)
						npcHandler:say("I'm glad to tell you that I have finished the ritual, "..getPlayerName(cid)..". Here is your new wand. I hope you carry it proudly foreveryone to see.", cid)						
					end
				end
			end

			
		elseif msgcontains(msg, 'yes') then
			if talkState[talkUser] == 1 then
				npcHandler:say({"Thank you, I promise that your efforts won't be in vain! Listen closely now: ...", "First, I need a sample of each druid rod and sorcerer wand there is in Tibia. Please bring them all at once so that their energy will be balanced. ...", "Secondly, I need 10 ounces of magic sulphur. It can absorb the elemental energy of all the wands and rods and bind it tosomething else. ...", "Next, I will need a soul stone. These can be used as a vessel for energy, evil as well as good. They are rarely used nowaday though. ...", "Lastly, I need a lot of holy energy. I can extract it from ankhs, but only a small amount each time. I will need about 20 ankhs. ...", "Did you understand everything I told you and will help me with my blessing?"}, cid)
				talkState[talkUser] = 2
				
			elseif talkState[talkUser] == 2 then
				npcHandler:say("Alright then. Come back to with a sample of all five wands and five rods, please.", cid)
				setPlayerStorageValue(cid, 6652, 2)
				talkState[talkUser] = 0
			
			elseif talkState[talkUser] == 3 then
				if storage == 2 then
					if getPlayerItemCount(cid, 2182) >= 1 and getPlayerItemCount(cid, 2191) >= 1 and getPlayerItemCount(cid, 2190) >= 1 and getPlayerItemCount(cid, 2189) >= 1 and getPlayerItemCount(cid, 2187) >= 1 and getPlayerItemCount(cid, 2188) >= 1 and getPlayerItemCount(cid, 2181) >= 1 and getPlayerItemCount(cid, 2183) >= 1 and getPlayerItemCount(cid, 2185) >= 1 and getPlayerItemCount(cid, 2186) >= 1 then
						for i = 1, #tablica do
							doPlayerRemoveItem(cid, tablica[i], 1)
						end
							npcHandler:say("Thank you, that must have been a lot to carry. Now, please bring me 10 ounces of magic sulphur.", cid)
							setPlayerStorageValue(cid, 6652, 3)
							talkState[talkUser] = 0
					else
						npcHandler:say("You don't have items!", cid)
					end
				end
				
			elseif talkState[talkUser] == 4 then
				if storage == 3 then
					if getPlayerItemCount(cid, 2182) >= 10 then
						if doPlayerRemoveItem(cid, 2182, 10) then
							npcHandler:say("Very good. I will immediately start to prepare the ritual and extract the elemental energy from the wands and rods. Please bring me the Necromancer's soul stone now.", cid)
							setPlayerStorageValue(cid, 6652, 4)
							talkState[talkUser] = 0
						end
					else
						npcHandler:say("You don't have items!", cid)
					end
				end
				
			elseif talkState[talkUser] == 5 then
				if storage == 4 then
					if getPlayerItemCount(cid, 2182) >= 1 then
						if doPlayerRemoveItem(cid, 2182, 1) then
							npcHandler:say("You have found a rarity there, "..getPlayerName(cid)..". This will become the tip of your blessed wand. Please bring me 20 ankhs now to complete the ritual.", cid)
							setPlayerStorageValue(cid, 6652, 5)
							talkState[talkUser] = 0
						end
					else
						npcHandler:say("You don't have items!", cid)
					end
				end
				
			elseif talkState[talkUser] == 6 then
				if storage == 5 then
					if getPlayerItemCount(cid, 2182) >= 20 then
						if doPlayerRemoveItem(cid, 2182, 20) then
							npcHandler:say("The ingredients for the ritual are complete! I will start to prepare your blessed wand, but I have to medidate first. Please come back later to hear how the ritual went.", cid)
							setPlayerStorageValue(cid, 6652, 6)
							setPlayerStorageValue(cid, 48116, os.time()+time*60*60)
							talkState[talkUser] = 0
						end
					else
						npcHandler:say("You don't have items!", cid)
					end
				end
			end
		end
			
			
		
return true
end





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

Myra:

PHP:
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 shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

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 storage = getPlayerStorageValue(cid, 6656)
	
	if msgcontains(msg, 'outfit') then
			if storage == -1 then
				npcHandler:say("This Tiara is an award by the academy of Edron in recognition of my service here.", cid)
				talkState[talkUser] = 1
			end
		
	elseif msgcontains(msg, 'tiara') then
		if talkState[talkUser] == 1 then
			if storage == -1 then
				npcHandler:say("Well... maybe, if you help me a little, I could convince the academy of Edron that you are a valuable help here and deserve an award too. How about it?", cid)
				talkState[talkUser] = 2
			end
		end
	end
		
	if msgcontains(msg, 'bat wings') then
		if storage == 1 then
			npcHandler:say("Oh, did you bring the 70 bat wings for me?", cid)
			talkState[talkUser] = 4
		end
		
	elseif msgcontains(msg, 'red cloth') then
		if storage == 2 then
			npcHandler:say("Have you found 20 pieces of red cloth?", cid)
			talkState[talkUser] = 5
		end
		
	elseif msgcontains(msg, 'ape fur') then
		if storage == 3 then
			npcHandler:say("Were you able to retrieve 40 pieces of ape fur?", cid)
			talkState[talkUser] = 6
		end
		
	elseif msgcontains(msg, 'holy orchids') then
		if storage == 4 then
			npcHandler:say("Did you convince the elves to give you 35 holy orchids?", cid)
			talkState[talkUser] = 7
		end
		
	elseif msgcontains(msg, 'spider silk yarn') then
		if storage == 5 then
			npcHandler:say("Oh, did you bring 10 spools of spider silk yarn for me?", cid)
			talkState[talkUser] = 8
		end
		
	elseif msgcontains(msg, 'lizard scales') then
		if storage == 6 then
			npcHandler:say("Have you found 60 lizard scales?", cid)
			talkState[talkUser] = 9
		end
		
	elseif msgcontains(msg, 'red dragon scales') then
		if storage == 7 then
			npcHandler:say("Were you able to get all 40 red dragon scales?", cid)
			talkState[talkUser] = 10
		end
		
	elseif msgcontains(msg, 'magic sulphur') then
		if storage == 8 then
			npcHandler:say("Have you collected 15 ounces of magic sulphur?", cid)
			talkState[talkUser] = 11
		end
		
	elseif msgcontains(msg, 'vampire dust') then
		if storage == 9 then
			npcHandler:say("Have you gathered 30 ounces of vampire dust?", cid)
			talkState[talkUser] = 12
		end
		
	elseif msgcontains(msg, 'addon') then
		if storage == 10 then
			npcHandler:say("This Tiara is an award by the academy of Edron in recognition of my service here.", cid)
			talkState[talkUser] = 13
		end
		
	elseif msgcontains(msg, 'tiara') then
		if talkState[talkUser] == 13 then
			if storage == 10 then
				npcHandler:say("Go to the academy in Edron and tell Zoltan that I sent you, "..getPlayerName(cid)..".", cid)
				setPlayerStorageValue(cid, 6656, 11)
			end
		end
		
		
		
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 2 then
			if storage == -1 then
				npcHandler:say({"Okay, great! You see, I need a few magical ingredients which I've run out of. First of all, please bring me 70 bat wings. ...", "Then, I urgently need a lot of red cloth. I think 20 pieces should suffice. ...", "Oh, and also, I could use a whole load of ape fur. Please bring me 40 pieces. ...", "After that, um, let me think... I'd like to have some holy orchids. Or no, many holy orchids, to be safe. Like 35. ...", "Then, 10 spools of spider silk yarn, 60 lizard scales and 40 red dragon scales. ...", "I know I'm forgetting something.. wait... ah yes, 15 ounces of magic sulphur and 30 ounces of vampire dust. ...", "That's it already! Easy task, isn't it? I'm sure you could get all of that within a short time. ...", "Did you understand everything I told you and are willing to handle this task?"}, cid)
				talkState[talkUser] = 3
			end
		
		elseif talkState[talkUser] == 3 then
			if storage == -1 then
				npcHandler:say("Fine! Let's start with the 70 bat wings. I really feel uncomfortable out there in the jungle.", cid)
				setPlayerStorageValue(cid, 6656, 1)
				talkState[talkUser] = 0
			end
			
		elseif talkState[talkUser] == 4 then
			if storage == 1 then
				if getPlayerItemCount(cid, 5894) >= 70 then
					if doPlayerRemoveItem(cid, 5894, 70) then
						npcHandler:say("Thank you! I really needed them for my anti-wrinkle lotion. Now, please bring me 20 pieces of red cloth.", cid)
						setPlayerStorageValue(cid, 6656, 2)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 5 then
			if storage == 2 then
				if getPlayerItemCount(cid, 5911) >= 20 then
					if doPlayerRemoveItem(cid, 5911, 20) then
						npcHandler:say("Great! This should be enough for my new dress. Don't forget to bring me 40 pieces of ape fur next!", cid)
						setPlayerStorageValue(cid, 6656, 3)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 6 then
			if storage == 3 then
				if getPlayerItemCount(cid, 5883) >= 40 then
					if doPlayerRemoveItem(cid, 5883, 40) then
						npcHandler:say("Nice job, "..getPlayerName(cid)..". You see, I'm testing a new depilation cream. I guess if it works on ape fur it's good quality. Next, please bring me 35 holy orchids.", cid)
						setPlayerStorageValue(cid, 6656, 4)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 7 then
			if storage == 4 then
				if getPlayerItemCount(cid, 5922) >= 35 then
					if doPlayerRemoveItem(cid, 5922, 35) then
						npcHandler:say("Thank god! The scent of holy orchids is simply the only possible solution against the horrible stench from the tavern latrine. Now, pleasebring me 10 rolls of spider silk yarn!", cid)
						setPlayerStorageValue(cid, 6656, 5)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		
		elseif talkState[talkUser] == 8 then
			if storage == 5 then
				if getPlayerItemCount(cid, 5886) >= 10 then
					if doPlayerRemoveItem(cid, 5886, 10) then
						npcHandler:say("I appreciate it. My pet doggie manages to bite through all sorts of leashes, which is why he is always gone. I'm sure this strong yarn will keep him. Now, go for the 60 lizard scales!", cid)
						setPlayerStorageValue(cid, 6656, 6)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 9 then
			if storage == 6 then
				if getPlayerItemCount(cid, 5881) >= 60 then
					if doPlayerRemoveItem(cid, 5881, 60) then
						npcHandler:say("Good job. They will look almost like sequins on my new dress. Please go for the 40 red dragon scales now.", cid)
						setPlayerStorageValue(cid, 6656, 7)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 10 then
			if storage == 7 then
				if getPlayerItemCount(cid, 5882) >= 40 then
					if doPlayerRemoveItem(cid, 5882, 40) then
						npcHandler:say("Thanks! They make a pretty decoration, don't you think? Please bring me 15 ounces of magic sulphur now!", cid)
						setPlayerStorageValue(cid, 6656, 8)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 11 then
			if storage == 8 then
				if getPlayerItemCount(cid, 5904) >= 15 then
					if doPlayerRemoveItem(cid, 5904, 15) then
						npcHandler:say("Ah, that's enough magic sulphur for my new peeling. You should try it once, your skin gets incredibly smooth. Now, the only thing I need isvampire dust. 30 ounces will suffice.", cid)
						setPlayerStorageValue(cid, 6656, 9)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 12 then
			if storage == 9 then
				if getPlayerItemCount(cid, 5905) >= 30 then
					if doPlayerRemoveItem(cid, 5905, 30) then
						npcHandler:say("Ah, great. Now I can finally finish the potion which the academy of Edron asked me to. I guess, now you want your reward, don't you?", cid)
						setPlayerStorageValue(cid, 6656, 10)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end
	
return true
end


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

Sandra:

PHP:
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 shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

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 storage = getPlayerStorageValue(cid, 6654)
	local storage2 = getPlayerStorageValue(cid, 6655) -- female mage
	local storage3 = getPlayerStorageValue(cid, 5481) -- male summoner
	local female = getPlayerSex(cid) == 0
	
	if msgcontains(msg, 'vial') then
			if storage == -1 then
				npcHandler:say("We have a special offer right now for depositing vials. Are you interested in hearing it?", cid)
				talkState[talkUser] = 1
			end
		
		
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 1 then
			if storage == -1 then
				npcHandler:say({" The Edron academy has introduced a bonus system. Each time you deposit 100 vials without claiming the money for it, you will receive a lottery ticket. ...", "Some of these lottery tickets will grant you a special potion belt accessory, if you bring the ticket to me. ...", "If you join the bonus system now, I will ask you each time you are bringing back 100 or more vials to me whether you claim your deposit or rather want a lottery ticket. ...", "Of course, you can leave or join the bonus system at any time by just asking me for the 'bonus'. ...", "Sandra: Would you like to join the bonus system now?", "Would you like to join the bonus system now?"}, cid)
				talkState[talkUser] = 2
			end
			
		elseif talkState[talkUser] == 2 then
			if storage == -1 then
				npcHandler:say("Great! I've signed you up for our bonus system. From now on, you will have the chance to win the potion belt addon!", cid)
				setPlayerStorageValue(cid, 6654, 1)
			end
		end
	end
	
	if msgcontains(msg, 'vial') then
		if storage == 1 then
			npcHandler:say("Would you like to get a lottery ticket instead of the deposit for your vials?", cid)
			talkState[talkUser] = 3
		end
		
	elseif msgcontains(msg, 'lottery') then
			if storage2 == -1 and storage3 == -1 then
				if getPlayerItemCount(cid, 5958) >= 1 then
					if doPlayerRemoveItem(cid, 5958, 1) then
						if female then
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 6655, 1)
							npcHandler:say("Please, this is your outfit.", cid)
						else
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 5481, 1)
							npcHandler:say("Please, this is your outfit.", cid)
						end
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
						
		
	
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 3 then
			if storage == 1 then
				if getPlayerItemCount(cid, 7634) >= 100 or getPlayerItemCount(cid, 7635) >= 100 or getPlayerItemCount(cid, 7636) >= 100 or getPlayerItemCount(cid, 2006) >= 100 then
					if doPlayerRemoveItem(cid, 7634, 100) or doPlayerRemoveItem(cid, 7635, 100) or doPlayerRemoveItem(cid, 7636, 100) or doPlayerRemoveItem(cid, 2006, 100) then
						doPlayerAddItem(cid, 5957, 1)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end
			
return true

end
-------------------------------------------------SHOP---------------------------------------------------------
shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion')
shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion')
shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion')
shopModule:addBuyableItem({'vial of oil'}, 2006, 15, 11, 'vial of oil')
shopModule:addBuyableItem({'vial of oil'}, 2006, 15, 2, 'vial of blood')
shopModule:addBuyableItem({'vial of water'}, 2006, 15, 9, 'vial of water')
shopModule:addBuyableItem({'vial of water'}, 2006, 15, 13, 'vial of urine')
shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion')
shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion')
shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion')
shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion')
shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion')

shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask')
shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask')
shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask')


shopModule:addBuyableItemContainer({'bp hp'}, 2000, 7618, 900, 1, 'backpack of health potions')
shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions')
shopModule:addBuyableItemContainer({'bp shp'}, 2000, 7588, 2000, 1, 'backpack of strong health potions')
shopModule:addBuyableItemContainer({'bp smp'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions')
shopModule:addBuyableItemContainer({'bp ghp'}, 2000, 7591, 3800, 1, 'backpack of great health potions')
shopModule:addBuyableItemContainer({'bp gmp'}, 2001, 7590, 2400, 1, 'backpack of great mana potions')
shopModule:addBuyableItemContainer({'bp gsp'}, 1999, 8472, 3820, 1, 'backpack of great spirit potions')
shopModule:addBuyableItemContainer({'bp uhp'}, 2000, 8473, 6200, 1, 'backpack of ultimate health potions')

--------


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

Zoltan:

PHP:
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 storage = getPlayerStorageValue(cid, 6653) -- male mage
	local storage2 = getPlayerStorageValue(cid, 6656) -- male mage
	local storage3 = getPlayerStorageValue(cid, 7956) -- summoner female
	local storage4 = getPlayerStorageValue(cid, 7966) -- summoner female
	local female = getPlayerSex(cid) == 0
	
	if msgcontains(msg, 'proof') then
			if storage == -1 then
				npcHandler:say("... I cannot believe my eyes. You retrieved this hat from Ferumbras' remains? That is incredible. If you give it to me, I will grant you the right to wear this hat as addon. What do you say?", cid)
				talkState[talkUser] = 1
			end
	
	elseif msgcontains(msg, 'myra') then
			if storage2 == 11 and storage3 == -1 then
				if female then
					npcHandler:say({"Bah, I know. I received some sort of nomination from our outpost in Port Hope. ...", "Usually it takes a little more than that for an award though. However, I honour Myra's word. ...", "I hereby grant you the right to wear a special sign of honour, acknowledged by the academy of Edron. Since you are a woman, I guess you like pretty sparkling stuff. There you go."}, cid)
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 7956, 12)
				else
					npcHandler:say({"Bah, I know. I received some sort of nomination from our outpost in Port Hope. ...", "Usually it takes a little more than that for an award though. However, I honour Myra's word. ...", "I hereby grant you the right to wear a special sign of honour, acknowledged by the academy of Edron. Since you are a woman, I guess you like pretty sparkling stuff. There you go."}, cid)
					doPlayerAddOutfit(cid, 136, 1)
					setPlayerStorageValue(cid, 6656, 1)
				end
			end
					
				
		
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 1 then
			if storage == -1 and storage4 == -1 then
				if getPlayerItemCount(cid, 5903) >= 1 then
					if doPlayerRemoveItem(cid, 5903, 1) then
						if female then
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 7966, 1)
							npcHandler:say("I bow to you, "..getPlayerName(cid)..", and hereby grant you the right to wear Ferumbras' hat as accessory. Congratulations!", cid)
						else
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 6653, 1)
							npcHandler:say("I bow to you, "..getPlayerName(cid)..", and hereby grant you the right to wear Ferumbras' hat as accessory. Congratulations!", cid)
						end
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end
				
	
	return true
end

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

Warrior​

Morgan:

PHP:
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 storage = getPlayerStorageValue(cid, 6650)
		local storage2 = getPlayerStorageValue(cid, 7214)
		
		
	if msgcontains(msg, 'weapons') then
		if storage == -1 or storage2 == -1 then
			npcHandler:say("Would you rather be interested in a knight's sword or in a warrior's sword?", cid)
			talkState[talkUser] = 1
		end
		
	elseif msgcontains(msg, 'addon') then
		if storage == -1 or storage2 == -1 then
			npcHandler:say("I can forge the finest weapons for knights and warriors. They may wear them proudly and visible to everyone.", cid)
		end
	
	elseif msgcontains(msg, 'knights sword') then
		if talkState[talkUser] == 1 then
			npcHandler:say("Great! Simply bring me 100 Iron Ore and one Crude Iron and I will happily forge it for you.", cid)
			talkState[talkUser] = 2
		end
	
	elseif msgcontains(msg, "warrior's sword") then
		if talkState[talkUser] == 1 then
			npcHandler:say("Great! Simply bring me 100 iron ore and one royal steel and I will happily forge it for you.", cid)
			talkState[talkUser] = 0
		end
	end
	
	if msgcontains(msg, 'forge weapon') then
		if storage == -1 then
			npcHandler:say("What would you like me to forge for you? A knight sword's or a warrior's sword?", cid)
			talkState[talkUser] = 3
		end
		
	elseif msgcontains(msg, 'knights sword') then
		if storage == -1 then
			if talkState[talkUser] == 3 then
				if getPlayerItemCount(cid, 8702) >= 100 and getPlayerItemCount(cid, 8702) >= 1 then
					if doPlayerRemoveItem(cid, 8702, 100) and doPlayerRemoveItem(cid, 8702, 1) then
						if getPlayerSex(cid) == 0 then
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 6650, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						else
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 6650, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						end
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end
	
	if msgcontains(msg, 'forge') then
		if storage2 == -1 then
			npcHandler:say("What would you like me to forge for you? A knight's sword or a warrior's sword?", cid)
			talkState[talkUser] = 4
		end
	
	elseif msgcontains(msg, "warrior's sword") then
		if talkState[talkUser] == 4 then
			if storage == -1 then
				if getPlayerItemCount(cid, 8702) >= 100 and getPlayerItemCount(cid, 8702) >= 1 then
					if doPlayerRemoveItem(cid, 8702, 100) and doPlayerRemoveItem(cid, 8702, 1) then
						if getPlayerSex(cid) == 0 then
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 7214, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						else
							doPlayerAddOutfit(cid, 136, 1)
							setPlayerStorageValue(cid, 7214, 1)
							npcHandler:say("Alright! As a matter of fact, I have one in store. Here you go!", cid)
							talkState[talkUser] = 0
						end
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end
	end

return true
end

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

Trisha:

PHP:
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 storage = getPlayerStorageValue(cid, 4514)
	local time = math.random(1, 24)
	
	
	if msgcontains(msg, 'addon') then
		if storage == -1 then
			npcHandler:say("Are you talking about my spiky shoulder pad? You can't buy one of these. They have to be earned.", cid)
			talkState[talkUser] = 1
		end
		
	elseif msgcontains(msg, 'earn') then
		if talkState[talkUser] == 1 then
			if storage == -1 then
				npcHandler:say("I'm not sure if you are enough of a hero to earn them. You could try, though. What do you think?", cid)
				talkState[talkUser] = 2
			end
		end
	end
		
	if msgcontains(msg, '100 hardened bones') then
		if storage == 1 then
			npcHandler:say("How are you faring with your mission? Have you collected all 100 hardened bones?", cid)
			talkState[talkUser] = 4
		end
	end
		
	if msgcontains(msg, '100 turtle shells') then
		if storage == 2 then
			npcHandler:say("Did you get us 100 turtle shells so we can make new shields?", cid)
			talkState[talkUser] = 5
		end
	end
		
	if msgcontains(msg, 'fighting spirit') then
		if storage == 3 then
			npcHandler:say("So, can you show me your fighting spirit?", cid)
			talkState[talkUser] = 6
		end
		
	elseif msgcontains(msg, 'dragon claw') then
		if storage == 4 then
			npcHandler:say("Have you actually managed to obtain the dragon claw I asked for?", cid)
			talkState[talkUser] = 7
		end
		
	elseif msgcontains(msg, 'trisha') then
		if storage == 5 then
			npcHandler:say("Ah, you must be the hero Trisha talked about. I will prepare the shoulder spikes for you. Please give me some time to finish it.", cid)
			setPlayerStorageValue(cid, 48814, os.time()+time*60*60)
			setPlayerStorageValue(cid, 4514, 6)
		end
	end
		
	if storage == 6 then
		if getPlayerStorageValue(cid, 48814) - os.time() <= 0 then
			if getPlayerSex(cid) == 0 then
				doPlayerAddOutfit(cid, 136, 1)
				setPlayerStorageValue(cid, 4514, 7)
				npcHandler:say("Take your outfit, good job!.", cid)
			else
				doPlayerAddOutfit(cid, 136, 1)
				setPlayerStorageValue(cid, 4514, 7)
				npcHandler:say("Take your outfit, good job!.", cid)
			end
		end
			

		
		
	elseif msgcontains(msg, 'yes') then
		if talkState[talkUser] == 2 then
			if storage == -1 then
				npcHandler:say({"Okay, who knows, maybe you have a chance. A really small one though. Listen up: ...", "First, you have to prove your guts by bringing me 100 hardened bones. ...", "Next, if you actually managed to collect that many, please complete a small task for our guild and bring us 100 turtle shells. ...", "It is said that excellent shields can be created from these. ...", "Alright, um, afterwards show me that you have fighting spirit. Any true hero needs plenty of that. ...", "The last task is the hardest. You will need to bring me a claw from a mighty dragon king. ...", "Did you understand everything I told you and are willing to handle this task?"}, cid)
				talkState[talkUser] = 3
			end
		
		elseif talkState[talkUser] == 3 then
			if storage == -1 then
				npcHandler:say("Ok go!", cid)
				setPlayerStorageValue(cid, 4514, 1)
				talkState[talkUser] = 0
			end
			
		elseif talkState[talkUser] == 4 then
			if storage == 1 then
				if getPlayerItemCount(cid, 5925) >= 100 then
					if doPlayerRemoveItem(cid, 5925, 100) then
						npcHandler:say("I'm surprised. That's pretty good for a man. Now, bring us the 100 turtle shells.", cid)
						setPlayerStorageValue(cid, 4514, 2)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 5 then
			if storage == 2 then
				if getPlayerItemCount(cid, 5899) >= 100 then
					if doPlayerRemoveItem(cid, 5899, 100) then
						npcHandler:say("Well done. These shells are enough to build many strong new shields. Thank you! Now - show me fighting spirit.", cid)
						setPlayerStorageValue(cid, 4514, 3)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 6 then
			if storage == 3 then
				if getPlayerItemCount(cid, 8182) >= 1 then
					if doPlayerRemoveItem(cid, 8182, 1) then
						npcHandler:say("Correct - pretty smart for a man. But the hardest task is yet to come: the claw from a lord among the dragon lords.", cid)
						setPlayerStorageValue(cid, 4514, 4)
						talkSate[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
			
		elseif talkState[talkUser] == 7 then
			if storage == 4 then
				if getPlayerItemCount(cid, 10020) >= 1 then
					if doPlayerRemoveItem(cid, 10020, 1) then
						npcHandler:say("You did it! I have seldom seen a man as courageous as you. I really have to say that you deserve to wear a spike. Go ask Cornelia to adorn your armour.", cid)
						setPlayerStorageValue(cid, 4514, 5)
						talkState[talkUser] = 0
					end
				else
					npcHandler:say("You don't have items!", cid)
				end
			end
		end			
	end	
return true
end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Status
Not open for further replies.
Top