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

Lua Bug In Npc of WOTE

rodrilois

New Member
Joined
Jun 9, 2009
Messages
94
Reaction score
1
:( I have a problem in that the NPC wote, I talk to him picked up the mission to kill the monsters then I report to him and the mission is complete but he is not adding to the player
* "setPlayerStorageValue (cid, STORAGE_ZLAK, 4)"

if someone can help me I would be very grateful! :)



LUA:
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") and getPlayerStorageValue(cid, STORAGE_GATE) == 1) then
		if(getPlayerStorageValue(cid, STORAGE_ZLAK) < 1) then
		    selfSay("Ze rumour mill iz quite fazt. Ezpecially when zomeone unuzual az you enterz ze zity. Zoon zey will learn zat you have no reazon to be here and our raze will be buzted. ...", cid)
			addEvent(selfSay, 3000, "Zo we have to ztrike fazt and quickly. You will have to eliminate zome high ranking key officialz. I zink killing four of zem should be enough. ...", cid, true)
			addEvent(selfSay, 7000, "Ziz will dizrupt ze order in ze zity zignificantly zinze zo much dependz on bureaucracy and ze chain of command. Only chaoz and dizorganization will enable me to help you with ze next ztep in ze plan.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 1)
		elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 1 and getPlayerStorageValue(cid, STORAGE_MAGISTRATUS) == 4) then
			selfSay("Chaoz and panic are already zpreading. Your barbaric brutality iz frightening effectively. I could acquire a key zat we need to get you into ze palaze itzelf. But zere are ztill too many guardz and elite zquadz even for you to fight. ...", cid)
			addEvent(selfSay, 3000, "I need you to enter ze zity and zlay at leazt zix noblez. Ze otherz will feel zreatened and call guardz to zemzelvez, and ze dragon kingz will accuze each ozer to be rezponzible for zlaying zeir pet noblez. ...", cid, true)
			addEvent(selfSay, 7000, "Zat should enable uz to give you at leazt a chanze to attack ze palaze.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 2)
		elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 2 and getPlayerStorageValue(cid, STORAGE_NOBLE) == 6) then
			selfSay ("Word of your deedz iz already zpreading like a wildfire. Zalamon'z plan to unleash zome murderouz beaztz in ze zity workz almozt too well. You are already becoming zome kind of legend with which motherz frighten zeir unruly hatchlingz. ...", cid)
			addEvent(selfSay, 3000, "Your next {mizzion} will be a ztrike into ze heart of ze empire.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 3)
		elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 3) then
			selfSay("Your eagernezz for killing and bloodshed iz frightening, but your next mizzion will zuit your tazte. Wiz ze zity in chaoz and defenzez diverted, ze ztage iz zet for our final ztrike. ...", cid)
			addEvent(selfSay, 3000, "A large number of rebelz have arrived undercover in ze zity. Zey will attack ze palaze and zome loyal palaze guardz will let zem in. ...", cid, true)
			addEvent(selfSay, 7000, "Meanwhile, you will take ze old ezcape tunnel zat leadz from ze abandoned bazement in ze norz of ze miniztry to a lift zat endz zomewhere in ze palaze. ...", cid, true)
			addEvent(selfSay, 10000, "When everyzing workz according to ze plan, you will meet Zalamon zomewhere in the underground part of ze palaze.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 4)
		end
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
try to define var and storage key STORAGE_ZLAK first, I doubt your tfs will store a null value as key
Code:
[COLOR=#333333]local STORAGE_ZLAK = 20201[/COLOR]
 
It looks like you are using teckman's beta version of the quest. If this is the case, be sure to have the libs from this system installed or none of it will work.
 
:( I have a problem in that the NPC wote, I talk to him picked up the mission to kill the monsters then I report to him and the mission is complete but he is not adding to the player
* "setPlayerStorageValue (cid, STORAGE_ZLAK, 4)"

LUA:
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") and getPlayerStorageValue(cid, STORAGE_GATE) == 1) then
		if(getPlayerStorageValue(cid, STORAGE_ZLAK) < 1) then
		    selfSay("Ze rumour mill iz quite fazt. Ezpecially when zomeone unuzual az you enterz ze zity. Zoon zey will learn zat you have no reazon to be here and our raze will be buzted. ...", cid)
			addEvent(selfSay, 3000, "Zo we have to ztrike fazt and quickly. You will have to eliminate zome high ranking key officialz. I zink killing four of zem should be enough. ...", cid, true)
			addEvent(selfSay, 7000, "Ziz will dizrupt ze order in ze zity zignificantly zinze zo much dependz on bureaucracy and ze chain of command. Only chaoz and dizorganization will enable me to help you with ze next ztep in ze plan.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 1)
		elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 1 and getPlayerStorageValue(cid, STORAGE_MAGISTRATUS) == 4) then
			selfSay("Chaoz and panic are already zpreading. Your barbaric brutality iz frightening effectively. I could acquire a key zat we need to get you into ze palaze itzelf. But zere are ztill too many guardz and elite zquadz even for you to fight. ...", cid)
			addEvent(selfSay, 3000, "I need you to enter ze zity and zlay at leazt zix noblez. Ze otherz will feel zreatened and call guardz to zemzelvez, and ze dragon kingz will accuze each ozer to be rezponzible for zlaying zeir pet noblez. ...", cid, true)
			addEvent(selfSay, 7000, "Zat should enable uz to give you at leazt a chanze to attack ze palaze.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 2)
		elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 2 and getPlayerStorageValue(cid, STORAGE_NOBLE) == 6) then
			selfSay ("Word of your deedz iz already zpreading like a wildfire. Zalamon'z plan to unleash zome murderouz beaztz in ze zity workz almozt too well. You are already becoming zome kind of legend with which motherz frighten zeir unruly hatchlingz. ...", cid)
			addEvent(selfSay, 3000, "Your next {mizzion} will be a ztrike into ze heart of ze empire.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 3)
		elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 3) then
			selfSay("Your eagernezz for killing and bloodshed iz frightening, but your next mizzion will zuit your tazte. Wiz ze zity in chaoz and defenzez diverted, ze ztage iz zet for our final ztrike. ...", cid)
			addEvent(selfSay, 3000, "A large number of rebelz have arrived undercover in ze zity. Zey will attack ze palaze and zome loyal palaze guardz will let zem in. ...", cid, true)
			addEvent(selfSay, 7000, "Meanwhile, you will take ze old ezcape tunnel zat leadz from ze abandoned bazement in ze norz of ze miniztry to a lift zat endz zomewhere in ze palaze. ...", cid, true)
			addEvent(selfSay, 10000, "When everyzing workz according to ze plan, you will meet Zalamon zomewhere in the underground part of ze palaze.", cid, true)
			setPlayerStorageValue(cid, STORAGE_ZLAK, 4)
		end
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

if someone can help me I would be very grateful! :)

Coloca isso...

Code:
elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 1 and getPlayerStorageValue(cid, STORAGE_MAGISTRATUS) == 3) then

Code:
elseif(getPlayerStorageValue(cid, STORAGE_ZLAK) == 2 and getPlayerStorageValue(cid, STORAGE_NOBLE) == 5) then

as storages começam em -1 e se vc mata 6 vai ser 5, pq conta o 0 =/, kkkkkkk
 
Back
Top