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

Storage problems!!!!

valivan601

New Member
Joined
Apr 13, 2011
Messages
365
Reaction score
1
Hello im having problems with these 2 npcs scripts it works good when set storage value = 2 but when set storage value = 3 it dont work and reset storage to 0

the first script works fine but when i say hi mission zalamon in the second sript i go problem dont add a corrctly storage and i think is wright the problem is in this line

setPlayerStorageValue(cid,storageWrath,3)

adding 0

Code:
if (getPlayerStorageValue(cid,storageWrath) == 0) then
	
			if(msgcontains(msg, 'mission')) 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. ...Zzo, are you indeed willing to continue zze fight for our cauzze?', cid)
				talkState[cid] = 1
		
			elseif(msgcontains(msg, 'yes') and talkState[cid] == 1) then
				npcHandler:say('You continue to imprezz, zzoftzzkin ...A contact of zze rezzizztanzze izz located furzzer in zze norzz of Zao ...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. ...I azzume you are already geared up and ready to conquer zze norzz?', cid)
				talkState[cid] = 2
		
			elseif(msgcontains(msg, 'yes') and talkState[cid] == 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}h beneazz zze zzoil of Zzao. ...One of zzem izz uzzed azz a maintenanzze connection by enemy lizardzz. To enter it, you will have to uzze a dizzguizze.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)
				talkState[cid] = 0
				setPlayerStorageValue(cid,storageWrath,1)
		
			end
		
		elseif (getPlayerStorageValue(cid,storageWrath) == 1) then
		
			if(msgcontains(msg, 'mission')) then
				npcHandler:say('Ah you have returned. I azzume you already found zzome itemzz to {build} a proper dizzguizze?', cid)
				talkState[cid] = 1
			
			elseif(msgcontains(msg, 'yes') and talkState[cid] == 1) then
				if(getPlayerItemCount(cid, 5901) >= 1 and getPlayerItemCount(cid, 8309) >= 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. ...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)
					talkState[cid] = 2
				else	
					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)
				end
			elseif(msgcontains(msg, 'crate') and talkState[cid] == 2) then		
				npcHandler:say('Ah I zzee. You are ready for your mizzion and waiting for me to create and mark zze crate?', cid)
				talkState[cid] = 3
			
			elseif(msgcontains(msg, 'yes') and talkState[cid] == 3) then		
				npcHandler:say('Alright. Let uzz create a crate. Hm. Let me zzee.Good. Zzat will do. ...Zze maintenanzze tunnelzz are in zze eazzt of zze plainzz, near ze coazt. Here, I will mark zzem on your map.Uzze zze dizzguizze wizzely, try to hide in zze dark and avoid being zzeen at all cozzt. ...Onzze you have reached zze norzz, you can find zze rezzizztanzze hideout at zze ozzer zzpot I marked on your map. Now hurry.', cid)
				if doPlayerRemoveItem(cid,5901,1) and doPlayerRemoveItem(cid,8309,3) then
					doPlayerAddItem(cid,12245,1)
					setPlayerStorageValue(cid,storageWrath,2)
					doPlayerAddMapMark(cid, mark1, MAPMARK_CROSS, 'Maintenance Tunnel Entry')
					doPlayerAddMapMark(cid, mark2, MAPMARK_CROSS, 'Resistance Hideout')
					talkState[cid] = 0
				end
			end

Code:
if (getPlayerStorageValue(cid,storageWrath) == 2) then
				--------------------------------------------------
			if (msgcontains(msg, 'mission') and talkState[talkUser] < 1) then
				npcHandler:say('Hrhrhrhr Me no fear of human Me Chief Grarkharok', cid)
				talkState[talkUser] = 1
				--------------------------------------------------
			elseif(msgcontains(msg, 'zalamon') and talkState[talkUser] == 1) then
				npcHandler:say('I zee. Zalamon zent word of ze arrival of a zoftzkin quite zome time ago. Zat muzt be you zen. ...Well, I exzpected zomeone more imprezzive. However, we will zee how far you can get. Youve got newz from ze zouz? ...Hm, I underztand. ...Oh you did. ...I zee. Interezting. ...You being here meanz we have eztablished connectionz to ze zouz. Finally. And you are going to help uz. Well, zere iz zertainly a lot for you to do. Zo better get ztarted.', cid)
				talkState[talkUser] = 0
				setPlayerStorageValue(cid,storageWrath,3)
				--------------------------------------------------
				--------------------------------------------------
			elseif(msgcontains(msg, 'mission') and getPlayerStorageValue(cid,storageWrath) == 3) then
				npcHandler:say('Zo are you ready to get zomezing done?', cid)
				talkState[talkUser] = 3	

			elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
				npcHandler:say('Alright. Well, az you might not be aware of it yet we are on top of an old temple complex. It haz been abandoned and it haz crumbled over time. ...Ze teleporter over zere uzed to work juzt fine to get uz back to ze zouz. But it haz ztopped operating for quite zome time. ...My men believe it iz a dizturbanze cauzed by ze corruption zat zpreadz everywhere. Zey are too zcared to go down zere. And zatz where you come in. ...Zere were meanz to activate teleporterz zomewhere in ze complex. But zinze you cannot reach all ze roomz, I guezz you will have to improvize.Here iz ze key to ze entranze to ze complex. Figure zomezing out, reztore ze teleporter zo we can get back to ze plainz in ze zouz.', cid)
				talkState[talkUser] = 0
				setPlayerStorageValue(cid,storageWrath,4)
				
				--------------------------------------------------
				--------------------------------------------------
			elseif(msgcontains(msg, 'mission') and getPlayerStorageValue(cid,42324) == 4) then
				npcHandler:say('Zo? Did you find a way to reztore ze teleporter?', cid)	
				talkState[talkUser] = 5	
				
			elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5 and getPlayerStorageValue(cid,42830) == 1) then
				npcHandler:say('You did it! Zere waz zome kind of zparkle and I zink it iz working again oh pleaze feel free to try it, I uhm, I will wait here and be ready juzt in caze zomezing uhm happenz to you. ...And if you head to Zalamon, be zure to inform him about our zituation. Food rationz are running low and we are ztill not well equipped. We need to eztablish a working zupply line.', cid)
				talkState[talkUser] = 0
				setPlayerStorageValue(cid,42830,2)
				else
				npcHandler:say('Zo you didnt fix it...', cid)
				end
				--------------------------------------------------
				--------------------------------------------------
		end
 
Back
Top