• 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 Zalamon Problem

valivan601

New Member
Joined
Apr 13, 2011
Messages
365
Reaction score
1
im getting this erros when say mission to npc Zalamon anyone know how to fix it??

Code:
[Error - NpcScript Interface]
data/npc/scripts/zalamon.lua:onCreatureSay
Description:
data/npc/lib/npcsystem/npchandler.lua:623: attempt to compare boolean with number
stack traceback:
data/npc/lib/npcsystem/npchandler.lua:623: in function 'say'
data/npc/scripts/zalamon.lua:32: in function 'callback'
data/npc/lib/npcsystem/npchandler.lua:423: in function 'onCreatureSay'
data/npc/scripts/zalamon.lua:12: in function <data/npc/scripts/zalamon.lua:11>

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid)
	npcHandler:onCreatureAppear(cid)
end
function onCreatureDisappear(cid)
	npcHandler:onCreatureDisappear(cid)
end
function onCreatureSay(cid, type, msg)
	npcHandler:onCreatureSay(cid, type, msg)
end
function onThink()
	npcHandler:onThink()
end
function creatureSayCallback(cid, type, msg)
	if(not(npcHandler:isFocused(cid))) then
		return false
	end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if(msgcontains(msg, "mission")) then
		if(getPlayerStorageValue(cid, STORAGE_ZALAMON) == 2 and getPlayerStorageValue(cid, STORAGE_CHARTAN) == 3) then
			npcHandler:say("You ezztablished zze connection to zze hideout, good. But zzizz izz no time to rezzt. Your new tazzk will be quite different. ...", cid)
			npcHandler:say("Zze gardenzz are plagued by a creature. Zze former keeper of zzizz garden became an abomination of madnezz zzat needzz to be zztopped. ..." , cid, true)
			npcHandler:say("He hidezz deep underground and it will be dangerouzz to challenge him in hizz lair but I am willing to rizzk it. ..." , cid, true)
			npcHandler:say("Find him, dezztroy him, bring me hizz - I uhm, mean it izz utterly nezzezzary for you to deliver me a proof of hizz deazz. ..." , cid, true)
			npcHandler:say("Now go - what are you waiting for, zzoftzzkin? Ready to finish what needzz to be finished?" , cid, true)
			talkState[talkUser] = 6
		elseif(getPlayerStorageValue(cid, STORAGE_ZALAMON) < 1) then
			npcHandler:say("Zze attackzz have weakened our enemy zzignificantly. Yet, your quezzt continuezz. Bezzidezz zzome tazzkzz you could take, zze zzreat of zze {emperor} izz zztill hanging over our headzz like a rain cloud. ...", cid)
			npcHandler:say("Zzo, are you indeed willing to continue zze fight for our cauzze?", cid, true)
			talkState[talkUser] = 1
		elseif(getPlayerStorageValue(cid, STORAGE_ZALAMON) == 1) then
			npcHandler:say("Ah you have returned. I azzume you already found zzome itemzz to {build} a proper dizzguizze?", cid)
			talkState[talkUser] = 3
		elseif(getPlayerStorageValue(cid, STORAGE_ZALAMON) == 3) then
			npcHandler:say("Zzo... you finished him. Show me hizz head, will you?", cid)
			talkState[talkUser] = 8
		elseif(getPlayerStorageValue(cid, STORAGE_ZALAMON) == 4) then
			npcHandler:say("At zze dawn of time, zze children of zze Great Zznake were numerouzz. Zzey daringly colonizzed many partzz of zze world. But all bravery did not help againzzt zze sheer number of enemiezz zzey encountered. ... ", cid)
			npcHandler:say("And while zze entitiezz zze unbelieverzz call godzz battled for power out of vanity, zze fazze of zze world changed violently. ... ", cid, true)
			npcHandler:say("Many zzentrezz of our magnifizzent zzivilizzation were dezztroyed and only two realmzz zzat we know of remained intact but lozzt contact to each ozzer. ... ", cid, true)
			npcHandler:say("In vizzionzz, zze Great Zznake revealed to Zalamon zze exzzizztenzze of ozzer lizzard people in a vazzt jungle in a far away land. ... ", cid, true)
			npcHandler:say("Zzough zze lizardzz of zze land failed zze Great Zznake and lozzt itzz favour, zzey are zztill in pozzezzion of ancient reliczz of immenzze power, onzze imbued by zze Great Zznake himzzelf. ... ", cid, true)
			npcHandler:say("I had vizzionzz of an - item. Yezz. It may be uzzeful for uzz - I mean you, ezzpecially you. ... ", cid, true)
			npcHandler:say("We need a zzeptre of power zzat can be found in zze underground of an ancient temple. It hazz been overrun by zzavage apezz and you will have to fight zzem and zze ancient guardianzz of zze temple azz well. Get uzz zzat zzeptre wherever it might be. ... ", cid, true)
			npcHandler:say("It wazz revealed zzat it hazz been zzplit into 3 partzz for reazzonzz zzat are of no importanzze anymore. Zzizz powerful devizze could help uzz in our battle againzzt zze emperor. ... ", cid, true)
			npcHandler:say("A shaft, a cuzzp, and an emerald form a zzeptre of zzuch power zzat zze partzz were hidden and are now guarded by vile creaturezz. ... ", cid, true)
			npcHandler:say("Find it. Retrieve it. And bring it back to me. ", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZALAMON, 5)
		elseif(getPlayerStorageValue(cid, STORAGE_ZALAMON) == 5) then
			npcHandler:say("You - azzembled zze zzeptre? Hand it out, give it to me, will you?", cid)
			talkState[talkUser] = 9
		elseif(getPlayerStorageValue(cid, STORAGE_ZALAMON) == 6) then
			npcHandler:say("Now we need to get clozzer to zze emperor himzzelf. A hive of beezz would defend zzeir queen wizz zzeir lives in cazze an enemy gained entranzze. Zzizz makezz a formidable defenzze line, nearly inviolable. ...", cid)
			npcHandler:say("But a zztranger directly in zze midzzt of zze hive will be acczzepted - after all it izz not pozzible to overcome zzuch a formidable defenzze which izz nearly inviolable, or izz it? Ha. ...", cid, true)
			npcHandler:say("Now zzat you overcame zzeir linezz of defenzze at zze great gate, you only need to find a way to enter zzeir home. ...", cid, true)
			npcHandler:say("Head zztraight to zze entranzze of zze zzity. If you can convinzze zze guardzz to let you enter zze zzity, you should be able to reach our contact zzere wizz eazze. ...", cid, true)
			npcHandler:say("We have alzzo forged zome paperzz for you and zzent zzem to zze zzity. Your victory in zze arena iz well known in our land. Wizz zze help of zzezze paperzz you will pretend zzat zzome of zze higher officialzz want to talk to you about your battle. ...", cid, true)
			npcHandler:say("Zzizz way you will be able to enter zze zzity of zze dragon emperor and meet our contact zzere in zze imperial offizze. He will give you zze next inzztructionzz. ", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZALAMON, 7)
		elseif(talkState[talkUser] == 7) then
			npcHandler:say("Go to zze gardenzz formerly maintained by zze keeper. You will probably find him zzomewhere in zze eazzt near hizz former domizzile.", cid)
			talkState[talkUser] = 0
		end
	elseif(msgcontains(msg, "yes")) then
		if(talkState[talkUser] == 1) then
			npcHandler:say("You continue to imprezz, zzoftzzkin. ...", cid)
			npcHandler:say("A contact of zze rezzizztanzze izz located furzzer in zze norzz of Zao. ...", cid, true)
			npcHandler:say("Zze emperor will drag hizz forzzezz to zze great gate now to bolzzter hizz defenzze. Zzinzze we attacked zze gate directly, he will not expect uzz taking a completely different route to reach zze norzzern territoriezz. ...", cid, true)
			npcHandler:say("I azzume you are already geared up and ready to conquer zze norzz?", cid, true)
			talkState[talkUser] = 2
		elseif(talkState[talkUser] == 2) then
			npcHandler:say("Your determination izz highly appreciated. To zzneak pazzt zze eyezz of zze enemy, you will have to uzze a diverzzion. Zzere are zzeveral old tunnelzz beneazz zze zzoil of Zzao. ...", cid)
			npcHandler:say("One of zzem izz uzzed azz a maintenanzze connection by enemy lizardzz. To enter it, you will have to uzze a dizzguizze. Zzomezzing like a crate perhapzz. ...", cid, true)
			npcHandler:say("Mh, if you can find zzome nailzz - 3 should be enough - and 1 piezze of wood, I should be able to create an appropriate cazzing. Return to me if you found zze itemzz and we will talk about zze next zztep.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZALAMON, 1)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 3) then
			npcHandler:say("Very good, I am confident zzizz will zzuffizze. Now I can build and mark a crate large enough for you to fit in - while zztill being able to breazze of courzze - and I will mark it in our tongue zzo it will look lezz zzuzzpizziouzz. ...", cid)
			npcHandler:say("Wizz zzeir eyezz towardzz zze gate, your chanzzezz to zzlip zzrough have never been better. I will keep zze zzpare materialzz here wizz me, we can alwayzz build a new one if you need to.", cid, true)
			talkState[talkUser] = 4
		elseif(talkState[talkUser] == 4) then
			if(getPlayerItemCount(cid, 8309) >= 2 and getPlayerItemCount(cid, 5901) >= 1) then
				setPlayerStorageValue(cid, STORAGE_ZALAMON, 2)
				doPlayerRemoveItem(cid, 8309, 2)
				doPlayerRemoveItem(cid, 5901, 1)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
				doPlayerAddItem(cid, 12245, 1)
				npcHandler:say("Alright. Let uzz create a crate. Hm. Let me zzee. ...", cid)
				npcHandler:say("Good. Zzat will do. ...", cid, true)
				npcHandler:say("Zze maintenanzze tunnelzz are in zze eazzt of zze plainzz, near ze coazt. Here, I will mark zzem on your map. ...", cid, true)
				npcHandler:say("Uzze zze dizzguizze wizzely, try to hide in zze dark and avoid being zzeen at all cozzt. ...", cid, true)
				npcHandler:say("Onzze you have reached zze norzz, you can find zze rezzizztanzze hideout at zze ozzer zzpot I marked on your map. Now hurry. ", cid, true)
			end
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 6) then
			npcHandler:say("Fine. I guezz poizzoning zzome of hizz plantzz will be enough to lure him out of hizz conzzealment. Zzizz plant poizzon here should allow you to do zzome zzignificant damage, take it. ...", cid)
			npcHandler:say("You can find him eazzt of zze corrupted gardenzz. Zzere uzzed to be a zzmall domizzile zzere but it hazz probably been conzzumed by zze corruption zzo beware. And now - go.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZALAMON, 3)
			doPlayerAddItem(cid, 12281, 1)
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 8) then
			if(getPlayerItemCount(cid, 12284) >= 1) then
				doPlayerRemoveItem(cid, 12284, 1)
				npcHandler:say("Zzizz izz not hizz head but clearly belonged to zze keeper. I - I am imprezzed. You can go now. Leave me alone for a zzecond. ", cid)
				setPlayerStorageValue(cid, STORAGE_ZALAMON, 4)
			else
				npcHandler:say("Itzz not hizz head!", cid)
			end
			talkState[talkUser] = 0
		elseif(talkState[talkUser] == 9) then
			if(getPlayerItemCount(cid, 12279) >= 1) then
				npcHandler:say("Finally. At lazzt. Zze zzeptre izz - ourzz. Ourzz of courzze. A weapon we should uzze wizzely for our cauzze. I need a zzecond or two. Do you leave me already?", cid)
				setPlayerStorageValue(cid, STORAGE_ZALAMON, 6)
				doPlayerRemoveItem(cid, 12279, 1)
			else
				npcHandler:say("You don't hazz the zzeptre!", cid)
			end
			talkState[talkUser] = 0
		end
	elseif(msgcontains(msg, "crate") and talkState[talkUser] == 4) then
		npcHandler:say("Ah I zzee. You are ready for your mizzion and waiting for me to create and mark zze crate?", cid)
		talkState[talkUser] = 5
	elseif(msgcontains(msg, "no") and talkState[talkUser] > 0) then
		npcHandler:say("Zzen no.", cid)
		talkState[talkUser] = 0
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top