• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Npc mission help

szajker123

New Member
Joined
May 12, 2012
Messages
195
Reaction score
0
Hi, I have a script for 8, but the mission We versions 7.92 and I request that my remade by someone under the tibia 8.54? and does not work it so that writes to the NPC and he told me hi amortized> missjoner 11:09: Welcome, trans! I have been expecting you. <And I wrote him a mission or something like that and he's already written down
FOR ASSISTANCE REP + +! (PLEASE HELP)






PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
-- OTServ event handling functions start
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
-- OTServ event handling functions end
 
function creatureSayCallback(cid, type, msg)
    if(npcHandler.focus ~= cid) then
        return false
    end
 
	misja1 = getPlayerStorageValue(cid,12001)
	misja2 = getPlayerStorageValue(cid,12002)
	misja3 = getPlayerStorageValue(cid,12003)
 	misja4 = getPlayerStorageValue(cid,12004)
 	misja5 = getPlayerStorageValue(cid,12005)
 	misja6 = getPlayerStorageValue(cid,12006)
 	misja7 = getPlayerStorageValue(cid,12007)
 	misja8 = getPlayerStorageValue(cid,12008)
 
    misja1status = 12001
	misja2status = 12002
	misja3status = 12003
	misja4status = 12004
	misja5status = 12005
	misja6status = 12006
	misja7status = 12007
	misja8status = 12008
 
	item1 = 2671			-- id itemu, ktory masz przyniesc w pierwszej misji
	item2 = 5890			-- id itemu, który masz przyniesc w drugiej misji
	item3 = 5876			-- id itemu, który masz przyniesc w trzeciej misji
 	item4 = 5945			-- id itemu, który masz przyniesc w 4 misji
 	item5 = 5925			-- id itemu, który masz przyniesc w 5 misji
 	item6 = 5883			-- id itemu, który masz przyniesc w 6 misji
 	item7 = 5921			-- id itemu, który masz przyniesc w 7 misji
 	item8 = 5906			-- id itemu, który masz przyniesc w 8 misji
 
	ilosc1 = 10					-- ilosc itemów w pierwszej misji
	ilosc2 = 30					-- ilosc itemów w drugiej misji
	ilosc3 = 50					-- ilosc itemów w trzeciej misji
	ilosc4 = 1					-- ilosc itemów w 4 misji
	ilosc5 = 200					-- ilosc itemów w 5 misji
	ilosc6 = 45					-- ilosc itemów w 6 misji
	ilosc7 = 400					-- ilosc itemów w 7 misji
	ilosc8 = 300					-- ilosc itemów w 8 misji
 
		if msgcontains(msg,'mission') then
			if misja1 == -1 then
				selfSay('Przynies mi 10 Ramens (Mission 1)')		-- zmień tutaj... Niech NPC powie, co ma przyniesc i ile tego ma być.
				setPlayerStorageValue(cid,misja1status,2)
			elseif misja1 == 1 then
				if misja2 == -1 then
					selfSay('Przynies mi 30 Bird Feathers (Mission 2)')		-- zmień tutaj... Niech NPC powie, co ma przyniesc i ile tego ma być.
					setPlayerStorageValue(cid,misja2status,2)
				elseif misja1 == 1 then
					if misja2 == 1 then
						if misja3 == -1 then
							selfSay('Przynies mi 50 Pharao Cobra Leathers (Mission 3)')		-- zmień tutaj... Niech NPC powie, co ma przyniesc i ile tego ma być.
							setPlayerStorageValue(cid,misja3status,2)
							elseif misja1 == 1 then
								if misja2 == 1 then
									if misja3 == 1 then
										if misja4 == -1 then
											selfSay('Przynies mi moj Comb z Banditosa (Mission 4) ')
											setPlayerStorageValue(cid,misja4status,2)	
											elseif misja1 == 1 then
												if misja2 == 1 then
													if misja3 == 1 then
														if misja4 == 1 then
															if misja5 == -1 then
																selfSay('Przynies mi 200 Purple Wolf Bones (Mission 5)')
																setPlayerStorageValue(cid,misja5status,2)
																elseif misja1 == 1 then
																	if misja2 == 1 then
																		if misja3 == 1 then
																			if misja4 == 1 then
																				if misja5 == 1 then
																					if misja6 == -1 then
																						selfSay('Przynies mi 45 Dosu Furs (Mission 6)')
																						setPlayerStorageValue(cid,misja6status,2)
																						elseif misja1 == 1 then
																							if misja2 == 1 then
																								if misja3 == 1 then
																									if misja4 == 1 then
																										if misja5 == 1 then
																											if misja6 == 1 then
																												if misja7 == -1 then
																													selfSay('Przynies mi 400 Oros Blossom (Mission 7)')
																													setPlayerStorageValue(cid,misja7status,2)
																													elseif misja1 == 1 then
																														if misja2 == 1 then
																															if misja3 == 1 then
																																if misja4 == 1 then
																																	if misja5 == 1 then
																																		if misja6 == 1 then
																																			if misja7 == 1 then
																																				if misja8 == -1 then
																																					selfSay('Przynies mi 300 Satan Dusts (Mission Ostatnia, przerabial misje Bakushi.)')
																																					setPlayerStorageValue(cid,misja8status,2)
																																					elseif misja1 == 1 then
																																						if misja2 == 1 then
																																							if misja3 == 1 then
																																								if misja4 == 1 then
																																									if misja5 == 1 then
																																										if misja6 == 1 then
																																											if misja7 == 1 then
																																												if misja8 == -1 then
																																													selfSay('You have done all missions')		-- NPC mowi, ze zrobiles juz wszystkie misje u niego
																																												end
																																											end
																																										end
																																									end
																																								end
																																							end
																																						end
																																					end
																																				end
																																			end
																																		end
																																	end
																																end
																															end
																														end
																													end
																												end
																											end
																										end
																									end
																								end
																							end
																						end
																					end
																				end
																			end
																		end
																	end
																end
															end
														end
													end
												end
											end
										end
									end



		elseif msgcontains(msg,'ramen') then	
			if misja1 == 2 then
				selfSay('Przyniosles mi 10 Ramens ...?')		-- NPC pyta, czy na pewno je ma
				talk_state = 1
			end
		elseif msgcontains(msg,'yes') and talk_state == 1 then
					if getPlayerItemCount(cid,item1) >= ilosc1 then
						if doPlayerRemoveItem(cid,item1,ilosc1) == TRUE then
							selfSay('Dzieki! Zdobyles 15500 expa!')		-- jeśli ma, to sprawdza ich ilosc
							doPlayerAddExp(cid,15500)									-- daje 300 expa
							setPlayerStorageValue(cid,12001,1)						-- ustawia status misji na wykonana
							talk_state = 0											-- 'zeruje' rozmowe
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
		elseif msgcontains(msg,'feather') then
			if misja2 == 2 then
				selfSay('Przyniosles mi 30 Bird Feathers .?')
				talk_state = 2
			end
		elseif msgcontains(msg,'yes') and talk_state == 2 then
					if getPlayerItemCount(cid,item2) >= ilosc2 then
						if doPlayerRemoveItem(cid,item2,ilosc2) == TRUE then
							selfSay('Dzieki! Zdobyles 61500 expa i 0,1cc!')
							doPlayerAddExp(cid,61500)
							doPlayerAddItem(cid,2152,10)
							setPlayerStorageValue(cid,12002,1)
							talk_state = 0
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
		elseif msgcontains(msg,'leather') or msgcontains(msg, 'pharao') then
			if misja3 == 2 then
				selfSay('Przyniosles mi 50 Pharao Cobra Leathers ...?')
				talk_state = 3
			end
		elseif msgcontains(msg,'yes') and talk_state == 3 then
					if getPlayerItemCount(cid,item3) >= ilosc3 then
						if doPlayerRemoveItem(cid,item3,ilosc3) == TRUE then
							selfSay('Dzieki! Zdobyles 205000 expa i 0,5cc!')
							doPlayerAddExp(cid,200500)
							doPlayerAddItem(cid,2152,50)
							setPlayerStorageValue(cid,12003,1)
							talk_state = 0
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
				elseif msgcontains(msg,'comb') then		-- to gracz musi powiedzieć, jak przyniesie itemy do pierwszej misji
			if misja4 == 2 then
				selfSay('Masz dla mnie moj Comb?')		-- NPC pyta, czy na pewno je ma
				talk_state = 4
			end
		elseif msgcontains(msg,'yes') and talk_state == 4 then
					if getPlayerItemCount(cid,item4) >= ilosc4 then
						if doPlayerRemoveItem(cid,item4,ilosc4) == TRUE then
							selfSay('Dzieki! Zdobyles 600tys expa i 20 first aids!')		-- jeśli ma, to sprawdza ich ilosc
							doPlayerAddExp(cid,600000)									-- daje 300 expa
							doPlayerAddItem(cid,2273,20)
							setPlayerStorageValue(cid,12004,1)						-- ustawia status misji na wykonana
							talk_state = 0											-- 'zeruje' rozmowe
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
			elseif msgcontains(msg,'bone') or msgcontains(msg, 'wolf') then		-- to gracz musi powiedzieć, jak przyniesie itemy do pierwszej misji
			if misja5 == 2 then
				selfSay('Przynioles mi 200 Purple Wolf Bones?')		-- NPC pyta, czy na pewno je ma
				talk_state = 5
			end
		elseif msgcontains(msg,'yes') and talk_state == 5 then
					if getPlayerItemCount(cid,item5) >= ilosc5 then
						if doPlayerRemoveItem(cid,item5,ilosc5) == TRUE then
							selfSay('Dzieki! Zdobyles 5,2 mln expa i 4 cc!')		-- jeśli ma, to sprawdza ich ilosc
							doPlayerAddExp(cid,5200000)									-- daje 300 expa
							doPlayerAddItem(cid,2160,4)
							setPlayerStorageValue(cid,12005,1)						-- ustawia status misji na wykonana
							talk_state = 0											-- 'zeruje' rozmowe
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
			elseif msgcontains(msg,'fur') or msgcontains(msg,'dosu') then		-- to gracz musi powiedzieć, jak przyniesie itemy do pierwszej misji
			if misja6 == 2 then
				selfSay('Masz dla mnie 45 Dosu Furs ?')		-- NPC pyta, czy na pewno je ma
				talk_state = 6
			end
		elseif msgcontains(msg,'yes') and talk_state == 6 then
					if getPlayerItemCount(cid,item6) >= ilosc6 then
						if doPlayerRemoveItem(cid,item6,ilosc6) == TRUE then
							selfSay('Dzieki! Zdobyles 8,5 mln expa, 5cc i 50 First Aids!')		-- jeśli ma, to sprawdza ich ilosc
							doPlayerAddExp(cid,8500000)									-- daje 300 expa
							doPlayerAddItem(cid,2160,5)
							doPlayerAddItem(cid,2273,50)
							setPlayerStorageValue(cid,12006,1)						-- ustawia status misji na wykonana
							talk_state = 0											-- 'zeruje' rozmowe
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
			elseif msgcontains(msg,'blossom') then		-- to gracz musi powiedzieć, jak przyniesie itemy do pierwszej misji
			if misja7 == 2 then
				selfSay('Masz dla mnie 400 Oros Fighter Blossoms?')		-- NPC pyta, czy na pewno je ma
				talk_state = 7
			end
		elseif msgcontains(msg,'yes') and talk_state == 7 then
					if getPlayerItemCount(cid,item7) >= ilosc7 then
						if doPlayerRemoveItem(cid,item7,ilosc7) == TRUE then
							selfSay('Dzieki! Zdobyles 19,5mln expa i 10 cc')		-- jeśli ma, to sprawdza ich ilosc
							doPlayerAddExp(cid,19500000)									-- daje 300 expa
							doPlayerAddItem(cid,2160,10)
							setPlayerStorageValue(cid,12007,1)						-- ustawia status misji na wykonana
							talk_state = 0											-- 'zeruje' rozmowe
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
			elseif msgcontains(msg,'dust') or msgcontains(msg,'satan') then		-- to gracz musi powiedzieć, jak przyniesie itemy do pierwszej misji
			if misja8 == 2 then
				selfSay('Przyniosles mi 300 Satan Dusts...?')		-- NPC pyta, czy na pewno je ma
				talk_state = 8
			end
		elseif msgcontains(msg,'yes') and talk_state == 8 then
					if getPlayerItemCount(cid,item8) >= ilosc8 then
						if doPlayerRemoveItem(cid,item8,ilosc8) == TRUE then
							selfSay('Dzieki! Zdobyles 32mln expa i Baku Hat')		-- jeśli ma, to sprawdza ich ilosc
							doPlayerAddExp(cid,32000000)									-- daje 300 expa
							doPlayerAddItem(cid,2481,1)
							setPlayerStorageValue(cid,12008,1)						-- ustawia status misji na wykonana
							talk_state = 0											-- 'zeruje' rozmowe
						end
					else
						selfSay('Nie masz itemow by zakonczyc misje')
						talk_state = 0
					end
	end
		
 
 
 
 
 
 
 
 
 
end
 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top