• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[npc] exchanger addon items

Inteligentny

Im not.
Joined
Aug 2, 2008
Messages
485
Reaction score
0
Anyone have this npc for new system? :////

Code:
local focus = 0 
local talk_start = 0 
local target = 0 
local following = false 
local attacking = false 

function onThingMove(creature, thing, oldpos, oldstackpos) 

end 


function onCreatureAppear(creature) 

end 


function onCreatureDisappear(cid, pos) 
      if focus == cid then 
          selfSay('Good bye then.') 
          focus = 0 
          talk_start = 0 
      end 
end 


function onCreatureTurn(creature) 

end 


function msgcontains(txt, str) 
      return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) 
end 


function onCreatureSay(cid, type, msg) 
      msg = string.lower(msg) 
end 

      if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then 
          selfSay('Great to meet you again, ' .. creatureGetName(cid) .. '! I can exchange mystic turban for 1 blue piece of cloth, red robe for 1 red piece of cloth, green tunics for 1 green piece of cloth. And i can exchange a crown armor for piece of royal steel, devil helmet for piece of hell steel, dragon shield for piece of draconian steel, giant sword for huge chunk of crude iron, soul orb for 10 infernal bolts. Also warrior helmet for 1 flask warrior sweat and 10 giant spider silk for spool of yarn.') 
          focus = cid 
          talk_start = os.clock() 


      elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then 
          selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') 


    elseif focus == cid then 
        talk_start = os.clock() 
end 
        if msgcontains(msg, 'mystic turban') then 
            selfSay('Do you want trade mystic turban for blue piece of cloth?') 
            talk_state = 1     

         
        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2663, 1) 
            doPlayeraddItem(cid, 5912, 1) 
            selfSay('Here you go, blue piece of cloth.') 
                 
                end 
end 
        if msgcontains(msg, 'red robe') then 
            selfSay('Do you want trade red robe for red piece of cloth?') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2655, 1) 
            doPlayeraddItem(cid, 5911, 1) 
            selfSay('Here you go, red piece of cloth.') 
                 
                end 
             end 

        if msgcontains(msg, 'green tunic') then 
            selfSay('Do you want trade green tunic for green piece of cloth?') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2652, 1) 
            doPlayeraddItem(cid, 5910, 1) 
            selfSay('Here you go, green piece of cloth.') 
                 
                end 
             end 
        if msgcontains(msg, 'crown armor') then 
            selfSay('Do you want trade crown armor for royal steel?') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2487, 1) 
            doPlayeraddItem(cid, 5887, 1) 
            selfSay('Here you go, royal steel.') 
                 
                end 
             end 
        if msgcontains(msg, 'devil helmet') then 
            selfSay('Do you want trade devil helmet for hell steel?') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2462, 1) 
            doPlayeraddItem(cid, 5888, 1) 
            selfSay('Here you go, hell steel.') 
                 
                end 
             end 
        if msgcontains(msg, 'dragon shield') then 
            selfSay('Do you want trade dragon shield for draconian steel?') 
            talk_state = 1     
 
        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2516, 1) 
            doPlayeraddItem(cid, 5889, 1) 
            selfSay('Here you go, draconian steel.') 
                 
                end 
             end 
        if msgcontains(msg, 'giant sword') then 
            selfSay('Do you want trade giant sword for huge chunk of iron?') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2393, 1) 
            doPlayeraddItem(cid, 5892, 1) 
            selfSay('Here you go, huge chunk of iron.') 
                 
                end 
             end 
        if msgcontains(msg, 'soul orb') then 
            selfSay('Do you want trade soul orb for 10 infernal bolts') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 5944, 1) 
            doPlayeraddItem(cid, 6529, 10) 
            selfSay('Here you go, 10 infernal bolts.') 
                 
                end 
             end 
        if msgcontains(msg, 'warrior helmet') then 
            selfSay('Do you want trade warrior helemt for warrior sweat?') 
            talk_state = 1     
 
        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 2475, 1) 
            doPlayeraddItem(cid, 5885,1) 
            selfSay('Here you go, warror sweat.') 
                 
                end 
             end 
        if msgcontains(msg, 'giant spider silk') then 
            selfSay('Do you want trade 10 giant spider silk for spool of yarn?') 
            talk_state = 1     

        elseif talk_state == 1 then 
            if msgcontains(msg, 'yes') then 
            doPlayerRemoveItem(cid, 5879, 10) 
            doPlayeraddItem(cid, 5886, 1) 
            selfSay('Here you go, spool of yarn.') 
                 
    talk_state = 0 
             
        elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then 
            selfSay('Good bye, ' .. creatureGetName(cid) .. '!') 
            focus = 0 
            talk_start = 0 
        
  
end
end


function onCreatureChangeOutfit(creature) 

end 


function onThink() 
    doNpcSetCreatureFocus(focus) 
    if (os.clock() - talk_start) > 30 then 
          if focus > 0 then 
              selfSay('Next Please...') 
          end 
              focus = 0 
      end 
     if focus ~= 0 then 
         if getDistanceToCreature(focus) > 5 then 
             selfSay('Good bye then.') 
             focus = 0 
         end 
     end 
end
 
Ye

what do you mean in "new system"?

NPC Channel??

just add ", cid" after every Npc's text ;]
Stupid/\:D

Inteligentny use me script, 100% My work:D
If i help give rep++ PLX:D
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

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
		if msgcontains(msg, 'help') then
		selfSay('You can here change some items for "spider silk yarn", "chunk of crude iron", "draconian steel", "warrior sweat", "magic sulpher", "enchanted chicken wing", "royal steel", "hell steel", "engraved crossbow", "fighting spirit", "infernal bolt", "blue piece of cloth", "green piece of cloth", "red piece of cloth", "lottery ticket".')

			elseif msgcontains(msg, 'spider silk yarn') then
			if getPlayerItemCount(cid,5879) >= 10 then
				selfSay('Did you bring me the 10 Giant Silks ?')
				talk_state = 1
			else
				selfSay('I need a 10 Giant Spider Silks, to give you the spider silk yarn. Come back when you have them.')
				talk_state = 0
			end

			elseif msgcontains(msg, 'yes') and talk_state == 1 then
			talk_state = 0
			if getPlayerItemCount(cid,5879) >= 10 then
			if doPlayerRemoveItem(cid,5879, 10) == TRUE then
			doPlayerAddItem(cid, 5886, 1)
                        selfSay('Here u are.')
			end
			else
				selfSay(havent_item)
			end

elseif msgcontains(msg, 'chunk of crude iron') then
if getPlayerItemCount(cid,2393) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
selfSay('Did you bring me the 3 Bast Skirts and Giant Sword ?')
talk_state = 2
else
selfSay('I need a 3 Bast Skirts and Giant Sword, to give you the chunk of crude iron. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,2393) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
if doPlayerRemoveItem(cid,2393,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
selfSay(addon_give)
doPlayerAddItem(cid,5892,1)
end
else
selfSay(havent_item)
end
elseif msgcontains(msg, 'ticket') or msgcontains(msg, 'lottery') or msgcontains(msg, 'lottery ticket') or msgcontains(msg, 'lotery ticket') then
if getPlayerItemCount(cid,2160) >= 5 then
selfSay('Did you bring me the 5cc?')
talk_state = 9
else
selfSay('I need a 5cc, to give you a lottery ticket. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 9 then
talk_state = 0
if getPlayerItemCount(cid,2160) >= 5 then
if doPlayerRemoveItem(cid,2160,5) == 1 then
selfSay(addon_give)
doPlayerAddItem(cid,5957,1)
end

else
selfSay(havent_item)
end


elseif msgcontains(msg, 'draconian steel') then
if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
selfSay('Did you bring me 3 Bast Skirts and Dragon Shield ?')
talk_state = 3
else
selfSay('I need 3 Bast Skirts and Dragon Shield, to give you the draconian steel. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
if doPlayerRemoveItem(cid,2516,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
doPlayerAddItem(cid,5889,1)
selfSay('Here u are.')
end
else
selfSay(havent_item)
end

		elseif msgcontains(msg, 'warrior sweat') then
				if getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 then
					selfSay('Did you bring me 4 warrior helmets?')
					talk_state = 4
				else
					selfSay('I need 4 warrior helmets, to give you the warrior sweat. Come back when you have them.')
					talk_state = 0
				end
		elseif msgcontains(msg, 'yes') and talk_state == 4 then
			talk_state = 0
			if getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 then
					if doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 then
						doPlayerAddItem(cid,5885,1)
						selfSay(addon_give)
					end
				else
				selfSay(havent_item)
				end

elseif msgcontains(msg, 'magic sulpher') then
if getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 then
selfSay('Did you bring me 3 fire swords?')
talk_state = 5
else
selfSay('I need 3 fire swords, to give you the magic sulpher. Come back when you have them.')
talk_state = 0
end

		elseif msgcontains(msg, 'yes') and talk_state == 5 then
			talk_state = 0
			if getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 then
					if doPlayerRemoveItem(cid,2392,1) == 1 and doPlayerRemoveItem(cid,2392,1) == 1 and doPlayerRemoveItem(cid,2392,1) == 1 then
						doPlayerAddItem(cid,5904,1)
						selfSay(addon_give)
				end
			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'enchanted chicken wing') then
			if getPlayerItemCount(cid,2195) >= 1 then
				selfSay('Did you bring me boots of haste?')
				talk_state = 6
			else
				selfSay('I need boots of haste, to give you the enchanted chicken wing. Come back when you have them.')
				talk_state = 0
			end

		elseif msgcontains(msg, 'yes') and talk_state == 6 then
			talk_state = 0
			if getPlayerItemCount(cid,2195) >= 1 then
					if doPlayerRemoveItem(cid,2195,1) == 1 then
						doPlayerAddItem(cid,5891,1)
						selfSay(addon_give)
					end
			else
				selfSay(havent_item)
			end



		elseif msgcontains(msg, 'royal steel') then
			if getPlayerItemCount(cid,2487) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
				selfSay('Did you bring me the 3 Bast Skirts and Crown Armor ?')
				talk_state = 7
			else
				selfSay('I need 3 Bast Skirts and Crown Armor, to give you the royal steel. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 7 then
			talk_state = 0
			if getPlayerItemCount(cid,2487) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
					if doPlayerRemoveItem(cid,2487,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5887,1)
					end
			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'hell steel') then
			if getPlayerItemCount(cid,2462) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
				selfSay('Did you bring me the 3 Bast Skirts and Devil Helmet ?')
				talk_state = 8
			else
				selfSay('I need a 3 Bast Skirts and Devil Helmet, to give you the hell steel. Come back when you have them.')
				talk_state = 0
			end

		elseif msgcontains(msg, 'yes') and talk_state == 8 then
			talk_state = 0
			if getPlayerItemCount(cid,2462) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then

					if doPlayerRemoveItem(cid,2462,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5888,1)
					end
			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'engraved crossbow') then
			if getPlayerItemCount(cid,5954) >= 15 then
				selfSay('Did you bring me the 15 demon horns?')
				talk_state = 9
			else
				selfSay('I need a 15 demon horns, to give you the engraved crossbow. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 9 then
			talk_state = 0
			if getPlayerItemCount(cid,5954) >= 15 then
					if doPlayerRemoveItem(cid,5954,15) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5947,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'fighting spirit') then
			if getPlayerItemCount(cid,2498) >= 1 and getPlayerItemCount(cid,2498) >= 1 then
				selfSay('Did you bring me the 2 Royal Helmets?')
				talk_state = 10
			else
				selfSay('I need a 2 Royal Helmets, to give you the Fighting Spirit. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 10 then
			talk_state = 0
			if getPlayerItemCount(cid,2498) >= 1 and getPlayerItemCount(cid,2498) >= 1 then
					if doPlayerRemoveItem(cid,2498,1) == 1 and doPlayerRemoveItem(cid,2498,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5884,1)
					end

			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'infernal bolt') then
			if getPlayerItemCount(cid,5944) >= 1 then
				selfSay('Did you bring me the Soul Orb?')
				talk_state = 11
			else
				selfSay('I need a Soul Orb, to give you the 2 Infernal Bolts. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 11 then
			talk_state = 0
			if getPlayerItemCount(cid,5944) >= 1 then
					if doPlayerRemoveItem(cid,5944,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,6529,2)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'blue piece of cloth') then
			if getPlayerItemCount(cid,2663) >= 1 then
				selfSay('Did you bring me the Mystic Turban ?')
				talk_state = 12
			else
				selfSay('I need a Mystic Turban, to give you the Blue Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 12 then
			talk_state = 0
			if getPlayerItemCount(cid,2663) >= 1 then
					if doPlayerRemoveItem(cid,2663,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5912,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'green piece of cloth') then
			if getPlayerItemCount(cid,2652) >= 1 then
				selfSay('Did you bring me the Green Tunic ?')
				talk_state = 13
			else
				selfSay('I need a Green Tunic, to give you the Green Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 13 then
			talk_state = 0
			if getPlayerItemCount(cid,2652) >= 1 then
					if doPlayerRemoveItem(cid,2652,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5910,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'red piece of cloth') then
			if getPlayerItemCount(cid,2655) >= 1 then
				selfSay('Did you bring me the Red Robe ?')
				talk_state = 14
			else
				selfSay('I need a Red Robe, to give you the Red Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 14 then
			talk_state = 0
			if getPlayerItemCount(cid,2655) >= 1 then
					if doPlayerRemoveItem(cid,2655,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5911,1)
					end

			else
				selfSay(havent_item)
			end


        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.')
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Stupid/\:D

Inteligentny use me script, 100% My work:D
If i help give rep++ PLX:D
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

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
		if msgcontains(msg, 'help') then
		selfSay('You can here change some items for "spider silk yarn", "chunk of crude iron", "draconian steel", "warrior sweat", "magic sulpher", "enchanted chicken wing", "royal steel", "hell steel", "engraved crossbow", "fighting spirit", "infernal bolt", "blue piece of cloth", "green piece of cloth", "red piece of cloth", "lottery ticket".')

			elseif msgcontains(msg, 'spider silk yarn') then
			if getPlayerItemCount(cid,5879) >= 10 then
				selfSay('Did you bring me the 10 Giant Silks ?')
				talk_state = 1
			else
				selfSay('I need a 10 Giant Spider Silks, to give you the spider silk yarn. Come back when you have them.')
				talk_state = 0
			end

			elseif msgcontains(msg, 'yes') and talk_state == 1 then
			talk_state = 0
			if getPlayerItemCount(cid,5879) >= 10 then
			if doPlayerRemoveItem(cid,5879, 10) == TRUE then
			doPlayerAddItem(cid, 5886, 1)
                        selfSay('Here u are.')
			end
			else
				selfSay(havent_item)
			end

elseif msgcontains(msg, 'chunk of crude iron') then
if getPlayerItemCount(cid,2393) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
selfSay('Did you bring me the 3 Bast Skirts and Giant Sword ?')
talk_state = 2
else
selfSay('I need a 3 Bast Skirts and Giant Sword, to give you the chunk of crude iron. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,2393) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
if doPlayerRemoveItem(cid,2393,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
selfSay(addon_give)
doPlayerAddItem(cid,5892,1)
end
else
selfSay(havent_item)
end
elseif msgcontains(msg, 'ticket') or msgcontains(msg, 'lottery') or msgcontains(msg, 'lottery ticket') or msgcontains(msg, 'lotery ticket') then
if getPlayerItemCount(cid,2160) >= 5 then
selfSay('Did you bring me the 5cc?')
talk_state = 9
else
selfSay('I need a 5cc, to give you a lottery ticket. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 9 then
talk_state = 0
if getPlayerItemCount(cid,2160) >= 5 then
if doPlayerRemoveItem(cid,2160,5) == 1 then
selfSay(addon_give)
doPlayerAddItem(cid,5957,1)
end

else
selfSay(havent_item)
end


elseif msgcontains(msg, 'draconian steel') then
if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
selfSay('Did you bring me 3 Bast Skirts and Dragon Shield ?')
talk_state = 3
else
selfSay('I need 3 Bast Skirts and Dragon Shield, to give you the draconian steel. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
if doPlayerRemoveItem(cid,2516,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
doPlayerAddItem(cid,5889,1)
selfSay('Here u are.')
end
else
selfSay(havent_item)
end

		elseif msgcontains(msg, 'warrior sweat') then
				if getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 then
					selfSay('Did you bring me 4 warrior helmets?')
					talk_state = 4
				else
					selfSay('I need 4 warrior helmets, to give you the warrior sweat. Come back when you have them.')
					talk_state = 0
				end
		elseif msgcontains(msg, 'yes') and talk_state == 4 then
			talk_state = 0
			if getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 and getPlayerItemCount(cid,2475) >= 1 then
					if doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 and doPlayerRemoveItem(cid,2475,1) == 1 then
						doPlayerAddItem(cid,5885,1)
						selfSay(addon_give)
					end
				else
				selfSay(havent_item)
				end

elseif msgcontains(msg, 'magic sulpher') then
if getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 then
selfSay('Did you bring me 3 fire swords?')
talk_state = 5
else
selfSay('I need 3 fire swords, to give you the magic sulpher. Come back when you have them.')
talk_state = 0
end

		elseif msgcontains(msg, 'yes') and talk_state == 5 then
			talk_state = 0
			if getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 and getPlayerItemCount(cid,2392) >= 1 then
					if doPlayerRemoveItem(cid,2392,1) == 1 and doPlayerRemoveItem(cid,2392,1) == 1 and doPlayerRemoveItem(cid,2392,1) == 1 then
						doPlayerAddItem(cid,5904,1)
						selfSay(addon_give)
				end
			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'enchanted chicken wing') then
			if getPlayerItemCount(cid,2195) >= 1 then
				selfSay('Did you bring me boots of haste?')
				talk_state = 6
			else
				selfSay('I need boots of haste, to give you the enchanted chicken wing. Come back when you have them.')
				talk_state = 0
			end

		elseif msgcontains(msg, 'yes') and talk_state == 6 then
			talk_state = 0
			if getPlayerItemCount(cid,2195) >= 1 then
					if doPlayerRemoveItem(cid,2195,1) == 1 then
						doPlayerAddItem(cid,5891,1)
						selfSay(addon_give)
					end
			else
				selfSay(havent_item)
			end



		elseif msgcontains(msg, 'royal steel') then
			if getPlayerItemCount(cid,2487) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
				selfSay('Did you bring me the 3 Bast Skirts and Crown Armor ?')
				talk_state = 7
			else
				selfSay('I need 3 Bast Skirts and Crown Armor, to give you the royal steel. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 7 then
			talk_state = 0
			if getPlayerItemCount(cid,2487) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
					if doPlayerRemoveItem(cid,2487,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5887,1)
					end
			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'hell steel') then
			if getPlayerItemCount(cid,2462) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then
				selfSay('Did you bring me the 3 Bast Skirts and Devil Helmet ?')
				talk_state = 8
			else
				selfSay('I need a 3 Bast Skirts and Devil Helmet, to give you the hell steel. Come back when you have them.')
				talk_state = 0
			end

		elseif msgcontains(msg, 'yes') and talk_state == 8 then
			talk_state = 0
			if getPlayerItemCount(cid,2462) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 and getPlayerItemCount(cid,3983) >= 1 then

					if doPlayerRemoveItem(cid,2462,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 and doPlayerRemoveItem(cid,3983,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5888,1)
					end
			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'engraved crossbow') then
			if getPlayerItemCount(cid,5954) >= 15 then
				selfSay('Did you bring me the 15 demon horns?')
				talk_state = 9
			else
				selfSay('I need a 15 demon horns, to give you the engraved crossbow. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 9 then
			talk_state = 0
			if getPlayerItemCount(cid,5954) >= 15 then
					if doPlayerRemoveItem(cid,5954,15) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5947,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'fighting spirit') then
			if getPlayerItemCount(cid,2498) >= 1 and getPlayerItemCount(cid,2498) >= 1 then
				selfSay('Did you bring me the 2 Royal Helmets?')
				talk_state = 10
			else
				selfSay('I need a 2 Royal Helmets, to give you the Fighting Spirit. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 10 then
			talk_state = 0
			if getPlayerItemCount(cid,2498) >= 1 and getPlayerItemCount(cid,2498) >= 1 then
					if doPlayerRemoveItem(cid,2498,1) == 1 and doPlayerRemoveItem(cid,2498,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5884,1)
					end

			else
				selfSay(havent_item)
			end


		elseif msgcontains(msg, 'infernal bolt') then
			if getPlayerItemCount(cid,5944) >= 1 then
				selfSay('Did you bring me the Soul Orb?')
				talk_state = 11
			else
				selfSay('I need a Soul Orb, to give you the 2 Infernal Bolts. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 11 then
			talk_state = 0
			if getPlayerItemCount(cid,5944) >= 1 then
					if doPlayerRemoveItem(cid,5944,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,6529,2)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'blue piece of cloth') then
			if getPlayerItemCount(cid,2663) >= 1 then
				selfSay('Did you bring me the Mystic Turban ?')
				talk_state = 12
			else
				selfSay('I need a Mystic Turban, to give you the Blue Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 12 then
			talk_state = 0
			if getPlayerItemCount(cid,2663) >= 1 then
					if doPlayerRemoveItem(cid,2663,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5912,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'green piece of cloth') then
			if getPlayerItemCount(cid,2652) >= 1 then
				selfSay('Did you bring me the Green Tunic ?')
				talk_state = 13
			else
				selfSay('I need a Green Tunic, to give you the Green Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 13 then
			talk_state = 0
			if getPlayerItemCount(cid,2652) >= 1 then
					if doPlayerRemoveItem(cid,2652,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5910,1)
					end

			else
				selfSay(havent_item)
			end

		elseif msgcontains(msg, 'red piece of cloth') then
			if getPlayerItemCount(cid,2655) >= 1 then
				selfSay('Did you bring me the Red Robe ?')
				talk_state = 14
			else
				selfSay('I need a Red Robe, to give you the Red Piece of Cloth. Come back when you have them.')
				talk_state = 0
			end
		elseif msgcontains(msg, 'yes') and talk_state == 14 then
			talk_state = 0
			if getPlayerItemCount(cid,2655) >= 1 then
					if doPlayerRemoveItem(cid,2655,1) == 1 then
						selfSay(addon_give)
						doPlayerAddItem(cid,5911,1)
					end

			else
				selfSay(havent_item)
			end


        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.')
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end

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

haha! stupid?! so why your script doesn't use npc channel hmm??

add "cid" after every line and then it will use channel -,-

don't say someone is stupid if you're not giving right thing
 
Back
Top