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

After Quest npc help

Jester753

New Member
Joined
Jun 15, 2012
Messages
30
Reaction score
0
I'm trying to quest a boatman npc that gives you an option after you finish a quest. I'm just not quiet sure how to call the, or what to call. I'm assuming you need to call the storageID from the quest, but I'm not sure how to do that. I can script the travel functions for the boatman I'm just not sure how to do an if then statement to tell if the player has finished the quest or not.
Basically it would act like this:

If player has finished quest 1 then
player has access to Location1 and Location2
Else
player has access to Location1.
End


Dialogue if player has finished quest:
Player: Hi
NPC: Hello |PlayerName| I can take you to main city, or second city!

Dialogue if player has not finished quest:
Player: Hi
NPC: Hello |PlayerName| I can take you to the main city.



Thanks in advance,
Jester

- - - Updated - - -

Would I have to call the quest.lua file to get the storageId or is there a better way?
 
Not sure with what you need help, are you looking for an example how to let the NPC say different things when a person has a storage or don't you know which storage number your quest is using?
 
I'm looking for an example of how to let the npc say different things when a person has a storage. I can figure out which storage number my quest is using. I think lol.

- - - Updated - - -

What i mean is an npc that was not related to the quest though. Let's say that NPC1 was using the script for the quest, but NPC2 is not using the script for the quest. I need NPC2 to recognize if the player has the storage value from the completed quest from NPC1. If that is possible.
 
Use the same storage in both NPCs, after talking to NPC1 add a storage to the player, then when a players talks to NPC2 check for that storage.
Example:
NPC1
Lua:
	local storage = 9105 
 
	if(msgcontains(msg, 'mission')) then
		if(getPlayerStorageValue(cid, storage) == -1) then
			selfSay('Go visit NPC2.', cid)
			setPlayerStorageValue(cid, storage, 1)

		elseif(getPlayerStorageValue(cid, storage) == 1) then
			selfSay('Already visited NPC2? Haven\'t heard anything from him yet, please go visit him.', cid)

		elseif(getPlayerStorageValue(cid, storage) > 1) then
			selfSay('NPC2 told me you were helping him, that is great.', cid)
		end
	end
NPC2
Lua:
	local storage = 9105 

	if(msgcontains(msg, 'NPC2') or msgcontains(msg, 'sent me')) then
		if(getPlayerStorageValue(cid, storage) == -1) then
			selfSay('He didn\'t, don\'t lie to me.', cid)

		elseif(getPlayerStorageValue(cid, storage) == 1) then
			selfSay('Ok, thank you for helping me.', cid)
                        setPlayerStorageValue(cid, storage, 2)
		end
	end
 
Back
Top