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

Prosze o pomoc z NPC

Lolek

New Member
Joined
Sep 29, 2008
Messages
298
Reaction score
0
Witam prosze o pomoc mam problem a mianowicie 2 nawet

Pierwszy to MAm NPC Ktory Daje tam misje przynies mi bohy i tam 20 hydra eggs I Po tym daje mu nowa profke :)

2 problem to tez z npc mianowicie daje misje zeby przynies mu cos tam Obsadian knife a potem mozesz przejsc przez most ale gdy pisze hi on odpisuje ale potem jak pisze misja albo cos to on nie reaguje nic a gdy chce przejsc przez most bez misji pisze najpierw wykonaj misje

@EDIT

Skrypty nie dzialaja na tfs 0.3.5 a dzialaly na 0.3.1 dziwne

Zawartosc tego pierwszego npc

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(npcHandler.focus ~= cid) then
		return false
	end
	msg = string.lower(msg)
	if (talk_state ~= 1) and (msgcontains(msg, 'tak') or msgcontains(msg, 'quest') or msgcontains(msg, 'profesj')) then
		talk_state = 0
		if getPlayerVocation(cid) == 6 then
			if getPlayerStorageValue(cid,91002) < 1 then
				selfSay('Chcialbys zostac zielonym druidem? Tak?')
				talk_state = 1
			elseif getPlayerStorageValue(cid,91002) == 1 then
				selfSay('Masz dla mnie 10 jajek hydry?')
				talk_state = 1
			elseif getPlayerStorageValue(cid,91002) == 2 then
				selfSay('Masz przy sobie wygodne buty w ktorych mozna szybko biegac?')
				talk_state = 1
			elseif getPlayerStorageValue(cid,91002) == 3 then
				selfSay('Masz 20 life crystal na trening wytrzymalosci? Tak?')
				talk_state = 1
			end
		elseif getPlayerVocation(cid) ~= 12 then
			selfSay('Cwicze tylko z swietymi druidami.')
			talk_state = 0
		else
			selfSay('Nie moge juz ciebie nauczyc nic nowego.')
			talk_state = 0
		end
	elseif talk_state == 1 then
		talk_state = 0
		if getPlayerStorageValue(cid,91002) < 1 then
			if msgcontains(msg, 'tak') or msgcontains(msg, 'yes') then
				selfSay('Naszymi najwiekszymi wrogami sa Hydry, wykradni im 10 jajek i mi przynies.')
				setPlayerStorageValue(cid,91002,1)
			else
				selfSay('Zajmuje sie tylko treningiem druidow. Jesli nie chcesz cwiczyc to nie mamy o czym gadac.')
			end
		elseif getPlayerStorageValue(cid,91002) == 1 then
			if msgcontains(msg, 'tak') or msgcontains(msg, 'yes') then
				if getPlayerItemCount(cid,4850) >= 10 then 
					if doPlayerRemoveItem(cid,4850,10) == 1 then
						setPlayerStorageValue(cid,91002,2)
						selfSay('Dzieki za jajka. Przynajmniej bedzie troche mniej tych potworow, a ja zjem porzadne sniadanko. Przyjdz na trening jak bedziesz mial dobre buty do biegania.')
					end
				else
					selfSay('Przyjdz jak bedziesz mial 10 jajek hydry i nie zawracaj mi glowy bez powodu.')
				end
			else
				selfSay('Nie? To na co jeszcze czekasz? Idz zbierac. Inaczej nigdy nie zostaniesz zielonym druidem.')
			end
		elseif getPlayerStorageValue(cid,91002) == 2 then
			if msgcontains(msg, 'tak') or msgcontains(msg, 'yes') then
				if getPlayerItemCount(cid,2195) >= 1 then 
					if doPlayerRemoveItem(cid,2195,1) == 1 then
						setPlayerStorageValue(cid,91002,3)
						selfSay('W takich butach to mozemy pobiegac. Potem przekaze je biednym druida ktorych nie stac na buty. Chyba Ci nie bedzie szkoda? Na nastepny trening przynies mi 20 life crystal.')
					end
				else
					selfSay('Przyjdz jak bedziesz mial wygodne buty do biegania to troche pocwiczymy.')
				end
			else
				selfSay('Nie? Przyjdz kiedy bedziesz mial buty dobre do szybkiego biegania. Musimy pocwiczyc.')
			end
		elseif getPlayerStorageValue(cid,91002) == 3 then
			if msgcontains(msg, 'tak') or msgcontains(msg, 'yes') then
				if getPlayerItemCount(cid,2177) >= 20 then 
					if doPlayerRemoveItem(cid,2177,20) == 1 then
						setPlayerStorageValue(cid,91002,4)
						doPlayerSetVocation(cid, 12)
						doPlayerAddOutfit(cid, 153, 1)
						doPlayerAddOutfit(cid, 157, 1)
						doPlayerAddOutfit(cid, 153, 2)
						doPlayerAddOutfit(cid, 157, 2)
						doPlayerAddOutfit(cid, 143, 1)
                        doPlayerAddOutfit(cid, 147, 1)
						doPlayerAddOutfit(cid, 143, 2)
                        doPlayerAddOutfit(cid, 147, 2)
						selfSay('Z tymi life crystalami naucze Cie jak unikac ciosow i szybko regenerowac zycie. Od teraz jestes jednym z nas. Zielonym Druidem. Masz tez specjalne dodatki do stroju.')
					end
				else
					selfSay('Przyjdz jak bedziesz mial 20 life crystal z hydr.')
				end
			else
				selfSay('To juz prawie koniec treningu. Przynies tylko 20 life crystal z hydr i zostaniesz zielonym druidem.')
			end
		end
	end
end
--tu sie koncze skrypt NPCa
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

A tego 2 to

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(npcHandler.focus ~= cid) then
		return false
	end
	msg = string.lower(msg)
	if getPlayerStorageValue(cid,54345) >= 3 then
		selfSay('Musze pilnowac przejscia. Nie przeszkadzaj mi!')
	end
	if (talk_state ~= 1) and (msgcontains(msg, 'misj') or msgcontains(msg, 'ta') or msgcontains(msg, 'yes') or msgcontains(msg, 'przejsc')) then
		talk_state = 0
		if getPlayerStorageValue(cid,54345) < 1 then
			selfSay('Chcialbys przejsc przez most? Tak?')
			talk_state = 1
		elseif getPlayerStorageValue(cid,54345) == 1 then
			selfSay('Wykonales misje? Masz dla mnie 3 knight armor i 5 iron ore?')
			talk_state = 1
		elseif getPlayerStorageValue(cid,54345) == 2 then
			selfSay('Masz dla mnie iron hammer i gold ring? Tak?')
			talk_state = 1
		end
	elseif talk_state == 1 then
		talk_state = 0
		if getPlayerStorageValue(cid,54345) < 1 then
			if msgcontains(msg, 'ta') or msgcontains(msg, 'yes') then
				selfSay('Jest tam duzo silnych potworow. Zanim Cie tam puszcze musisz mi przyniesc 3 knight armory i 5 iron ore.')
				setPlayerStorageValue(cid,54345,1)
			else
				selfSay('Nie to nie. Papa.')
			end
		elseif getPlayerStorageValue(cid,54345) == 1 then
			if msgcontains(msg, 'ta') or msgcontains(msg, 'yes') then
				if getPlayerItemCount(cid,5880) >= 5 and getPlayerItemCount(cid,2476) >= 3 then 
					if doPlayerRemoveItem(cid,5880,5) == 1 and doPlayerRemoveItem(cid,2476,3) == 1 then
						setPlayerStorageValue(cid,54345,2)
						selfSay('Wykazales sie niezlymi umiejetnosciami walki. Wiesz, moglbym Cie juz teraz puscic, ale przynies mi jeszcze iron hammer i gold ring.')
					end
				else
					selfSay('Przyjdz jak bedziesz mial 3 knight armor i 5 iron ore. Nie zawracaj mi glowy bez powodu.')
				end
			else
				selfSay('Nie? To na co jeszcze czekasz? Idz zbierac. Inaczej tedy nie przejdziesz.')
			end
		elseif getPlayerStorageValue(cid,54345) == 2 then
			if msgcontains(msg, 'ta') or msgcontains(msg, 'yes') then
				if getPlayerItemCount(cid,2422) >= 1 and getPlayerItemCount(cid,2179) >= 1 then 
					if doPlayerRemoveItem(cid,2422,1) == 1 and doPlayerRemoveItem(cid,2179,1) == 1 then
						setPlayerStorageValue(cid,54345,3)
						selfSay('Dobra. Teraz mozesz juz przejsc przez most.')
					end
				else
					selfSay('Przyjdz jak bedziesz mial iron hammer i gold ring dla mnie.')
				end
			else
				selfSay('Nie? To na co jeszcze czekasz? Idz zbierac. Inaczej tedy nie przejdziesz.')
			end
		end
	end
end
--tu sie koncze skrypt NPCa
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
A może podasz jakie errory wyjebuje w silniku>??
Czy jakieś pliki odpowiadające za to znajdują sie w movements?? lub actions?
@Edit:
100 post :D
 
W tym pierwszym zadnego bledu nie ma dziwne

18:00 Cezar [8]: hi
18:00 Druidus Zielonius: Witaj Cezar. Chcesz sie nauczyc czegos nowego? Tak?
18:00 Cezar [8]: yes

@edit
pisze tak yes wszystko i nic nie odpisuje ani zadnego bledu w consoli NIC
 
Back
Top