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

[SYSTEM]Quests

PhoOwned

^_^
Joined
Nov 11, 2010
Messages
375
Reaction score
66
I'm writing now new feature for NPCs.

There always was a problem with 'quest' NPCs. Many 'talk_states', cids, item names, item ids...

I try to make it simple ^_^

First version of config file:
PHP:
-- NPCs config
NPC_questsConfig = {}
NPC_questsConfig["any_quest_is_running"] = 15000 -- if player do any quest that request 'kill monster' its set to 1 else empty (-1)

NPC_questsConfig["test_2"] = { -- npc name
	["storage_id"] = 12345, -- start storage for NPC, use this key and key+1
	["texts_notunderstand"] = {"Sorry |PLAYERNAME|, I don't understand you.", "Can you repeat? I can't hear you.", "Speak english!"},
	["missions"] = {
		{-- first mission
			["text_hello"] = "Hello |PLAYERNAME|! Blabla, ask me about {mission}.",
			["text_bye"] = "Bye |PLAYERNAME|! Blabla.",
			["start_words"] = {"mission",  "quest", "fight"},
			["set_storages_when_start"] = {}, -- if player get quest from this NPC other NPC can ignore him (get_storage)
			["set_storages_when_done"] = {},
			["get_storage_to_start"] = {},
			["mission_text_wrong_storages"] = "I got no mission for you, but you can ask NPC Xsss about {help}.",
			["mission_text_quest"] = "|PLAYERNAME|! I got mission for you. Bring me xx, tt gold and kill yy, reward is zz.",
			["mission_player_deny_words"] = {'no', 'fuck you'},
			["mission_player_deny_text"] = "Ok. Come back when you will be ready.",
			["mission_player_agree_words"] = {'yes', 'agree', 'ok', 'i will'},
			["mission_player_agree_text"] = "Ok. Go and kill them now.",
			["mission_can_not_understand_answer"] = "I can't understand what you want |PLAYERNAME|.",
			["mission_text_not_done"] = "Mission is not done |PLAYERNAME|. I told you to bring me xx, tt gold and kill yy.",
			["mission_text_done"] = "Good job |PLAYERNAME|. Your reward is zz. I got another {mission} for you.",
			["requested_items"] =
			{
				{["itemid"] = 123, ["subType"] = -1, ["count"] = 1},
				{["itemid"] = 321, ["subType"] = -1, ["count"] = 5}
			},
			["requested_money"] = 50,
			["requested_monster"] = {"name0", 5, true},
			["reward"] =
			{
				{["type"] = "exp", ["value"] = 5000},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 123, ["subType"] = -1, ["count"] = 1, ["attackSpeed"] = 1500, ["attack"] = 55},
						{["itemid"] = 123, ["subType"] = -1, ["count"] = 1}
					}
				}
			}
		},-- next mission
		{
			-- here mission values like in code above
		}
	}
}

1. Each NPC can have few missions, request many items and 'kills' of monster with X name.
You can specify 'storage values' that can be needed to start quest or must be not equal to X (when player get mission from one NPC [or done mission] other NPC doesn't give him mission).

2. Reward can be exp or/and item (you can set special values, like name, attack and all other set with attributes function) and of course you can start next mission :)

Do you have any ideas what should I add to this system before I post it?

MY IDEAS
* move 'request item' and 'request money' to one table in config
* add more options needed to start mission (not only storage Y value == or != X):

- vocation in {list} or not in list
- promotion level in {list} or not in list
- level >= or < X
- magic level >= or < X
- skill Y >= or < X
- outfit ID/type/head... == X
- sex
- items (to start mission, not only needed to finish mission)
* add more rewards for missions (now only item and exp):
- vocation id
- promotion level
- skill X
- magic level
- outfit / addon
edit:
* npc can ask about something and if answer == X (few answers available) player go to mission X (set storage X = z) [more rpg npcs]
edit 2:
* all answers and questions texts will be arrays and text will be random
 
Last edited:
Moved to Discussion.
 
Example with 2 missions config:
01:12 test_2: Hello Lolerek! Ask me about mission.
01:12 Lolerek [10]: mission
01:12 test_2: I got mission for you. Can you kill 10 goblins?
01:12 Lolerek [10]: mission
01:12 Lolerek [10]: yes
01:12 test_2: Ok. Go and kill them now.
01:12 Lolerek [10]: yes
01:12 test_2: Can you repeat? I can't hear you.
01:12 Lolerek [10]: mission
01:12 test_2: Mission is not done Lolerek. I told you to kill 10 goblins.
01:12 Lolerek [10]: hey
01:12 Lolerek [10]: mission
01:12 test_2: Good job Lolerek. Your reward is 500 exp and 5 soul orbs. I got another mission for you.
01:12 Lolerek [10]: bye
01:12 test_2: Bye Lolerek!
01:12 test_2: Hello Lolerek! Ask me about mission.
01:12 Lolerek [10]: mission
01:12 test_2: I got mission for you. Can you bring me Iron Ore?
01:13 Lolerek [10]: no
01:13 test_2: Ok. Come back when you will be interested.
01:13 Lolerek [10]: mission
01:13 test_2: I got mission for you. Can you bring me Iron Ore?
01:13 Lolerek [10]: mission
01:13 Lolerek [10]: no
01:13 test_2: Ok. Come back when you will be interested.
01:13 Lolerek [10]: mission
01:13 test_2: I got mission for you. Can you bring me Iron Ore?
01:13 Lolerek [10]: yes
01:13 test_2: Ok. Go and find Iron Ore.
01:13 Lolerek [10]: mission
01:13 test_2: Mission is not done Lolerek. I told you to bring me Iron Ore.
01:13 Lolerek [10]: /i iron ore
01:13 Lolerek [10]: bye
01:13 test_2: Bye Lolerek!
01:13 Lolerek [10]: hi
01:13 test_2: Hello Lolerek! Ask me about mission.
01:13 Lolerek [10]: mission
01:13 test_2: Good job Lolerek. Your reward is 1000 exp and 10 soul orbs.
01:13 Lolerek [11]: mission
01:13 test_2: I got no mission for you.
01:15 test_2: Bye Lolerek!
01:15 Lolerek [11]: bye
01:15 Lolerek [11]: hi
01:15 test_2: Hello brave Lolerek!
01:15 Lolerek [11]: hi
01:15 Lolerek [11]: ok
01:15 test_2: Speak english!
01:15 Lolerek [11]: mission
01:15 test_2: I got no mission for you.
01:15 Lolerek [11]: quest
01:15 test_2: I got no mission for you.
01:15 Lolerek [11]: quest mission
01:15 test_2: I got no mission for you.
01:15 Lolerek [11]: no?
01:15 test_2: Can you repeat? I can't hear you.

EDIT:
configuration of this NPC:
PHP:
NPC_questsConfig["test_2"] = { -- npc name
	["storage_id"] = 12345, -- start storage for NPC, use this key and key+1
	["texts_notunderstand"] = {"Sorry |PLAYERNAME|, I don't understand you.", "Can you repeat? I can't hear you.", "Speak english!"},
	["missions"] = {
		{-- first mission
			["text_hello"] = "Hello |PLAYERNAME|! Ask me about {mission}.",
			["text_bye"] = "Bye |PLAYERNAME|!",
			["start_words"] = {"mission",  "quest", "fight"},
			["set_storages_when_start"] = {}, -- if player get quest from this NPC other NPC can ignore him (get_storage)
			["set_storages_when_done"] = {},
			["get_storage_to_start"] = {},
			["mission_text_wrong_storages"] = "I got no mission for you, but you can ask NPC Xsss about {help}.",
			["mission_text_quest"] = "I got mission for you. Can you kill 10 goblins?",
			["mission_player_deny_words"] = {'no', 'fuck you'},
			["mission_player_deny_text"] = "Aff.. Come back when you will be interested.",
			["mission_player_agree_words"] = {'yes', 'agree', 'ok', 'i will'},
			["mission_player_agree_text"] = "Ok. Go and kill them now.",
			["mission_can_not_understand_answer"] = "I can't understand what you want |PLAYERNAME|.",
			["mission_text_not_done"] = "Mission is not done |PLAYERNAME|. I told you to kill 10 goblins.",
			["mission_text_done"] = "Good job |PLAYERNAME|. Your reward is 500 exp and 5 soul orbs. I got another {mission} for you.",
			["requested_items"] =
			{
				
			},
			["requested_money"] = 0,
			["requested_monster"] = {"Goblin", 10, true},
			["rewards"] =
			{
				{["type"] = "exp", ["value"] = 500},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 5}
					}
				}
			}
		},-- next mission 2
		{
			["text_hello"] = "Hello |PLAYERNAME|! Ask me about {mission}.",
			["text_bye"] = "Bye |PLAYERNAME|!",
			["start_words"] = {"mission",  "quest", "fight"},
			["set_storages_when_start"] = {}, -- if player get quest from this NPC other NPC can ignore him (get_storage)
			["set_storages_when_done"] = {},
			["get_storage_to_start"] = {},
			["mission_text_wrong_storages"] = "I got no mission for you, but you can ask NPC Xsss about {help}.",
			["mission_text_quest"] = "I got mission for you. Can you bring me Iron Ore?",
			["mission_player_deny_words"] = {'no', 'fuck you'},
			["mission_player_deny_text"] = "Ok. Come back when you will be interested.",
			["mission_player_agree_words"] = {'yes', 'agree', 'ok', 'i will'},
			["mission_player_agree_text"] = "Ok. Go and find Iron Ore.",
			["mission_can_not_understand_answer"] = "I can't understand what you want |PLAYERNAME|.",
			["mission_text_not_done"] = "Mission is not done |PLAYERNAME|. I told you to bring me Iron Ore.",
			["mission_text_done"] = "Good job |PLAYERNAME|. Your reward is 1000 exp and 10 soul orbs.",
			["requested_items"] =
			{
				{["itemid"] = 5880, ["subType"] = -1, ["count"] = 1}
			},
			["requested_money"] = 0,
			["requested_monster"] = {},
			["rewards"] =
			{
				{["type"] = "exp", ["value"] = 1000},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 10}
					}
				}
			}
		},-- next mission 3
		{
			["text_hello"] = "Hello brave |PLAYERNAME|!",
			["text_bye"] = "Bye |PLAYERNAME|!",
			["start_words"] = {"mission",  "quest", "fight"},
			["set_storages_when_start"] = {}, -- if player get quest from this NPC other NPC can ignore him (get_storage)
			["set_storages_when_done"] = {},
			["get_storage_to_start"] = {{12345,5,true}},
			["mission_text_wrong_storages"] = "I got no mission for you.",
			["mission_text_quest"] = "",
			["mission_player_deny_words"] = {},
			["mission_player_deny_text"] = ".",
			["mission_player_agree_words"] = {},
			["mission_player_agree_text"] = "",
			["mission_can_not_understand_answer"] = ".",
			["mission_text_not_done"] = "",
			["mission_text_done"] = "",
			["requested_items"] =
			{
			},
			["requested_money"] = 0,
			["requested_monster"] = {},
			["rewards"] =
			{

			}
		}
	}
}

@down
^_^ good random texts :)



MY IDEAS
* move 'request item' and 'request money' to one table in config
* add more options needed to start mission (not only storage Y value == or != X):
- vocation in {list} or not in list
- promotion level in {list} or not in list
- level >= or < X
- magic level >= or < X
- skill Y >= or < X
* add more rewards for missions (now only item and exp):
- vocation id
- promotion level
- skill X
- magic level
 
Last edited:
The last part is funny hahah ^^
 
New idea:
* delayed texts (NPC say in few lines texts from table of texts and after it player can answer)
 
But how this exactly works.. how to implement on npc system?
You add code to new file data/lib/npc.lua (config and functions) and in NPC .lua paste special code (same code for all npc). I'll post full code when system will be ready.
This system is not part of Jiddo NPC system, but use Jiddo functions in NPC script.
 
I got some new ideas :p
New version of config of ONE mission. It show all possible values for missions type 'mission'. There will be type 'decision' too (few possible answers for one question, few different rewards / next missions) :thumbup:

PHP:
	["storage_id"] = 12345, -- start storage for NPC, use this key and key+1
	["missions"] = {
		{-- first mission
			["npc_type"] = "mission",
			["text_hello"] = {"Hello |PLAYERNAME|! Ask me about {mission}.", "Yo!"},
			["text_bye"] = {"Bye |PLAYERNAME|!", "Cya!"},
			["start_words"] = {"mission",  "quest", "fight"},
			["texts_notunderstand"] = {"Sorry |PLAYERNAME|, I don't understand you.", "Can you repeat? I can't hear you."},
			
			["keywords"] = 
				{
					{["words"] = {"trade", "sell", "buy"}, ["answers"] = {"Go to other NPC", "I'm not trader"}},
					{["words"] = {"job", "work", "business"}, ["answers"] = {"I make furnitures.", "I earn 999cc/day!"}},
				}
			
			["mission_text_quest"] = {"I got mission for you. Can you kill 10 goblins?", "Please kill 10 goblins for me. Will you help me?"},
			["mission_player_deny_words"] = {'no', 'fuck you'},
			["mission_player_deny_text"] = {"Aff.. Come back when you will be interested.", "NO?! Go to hell!"},
			["mission_player_agree_words"] = {'yes', 'agree', 'ok', 'i will'},
			["mission_player_agree_text"] = {"Ok. Go and kill them now.", "GOGOGO! Kill gobos!"},
			["mission_can_not_understand_answer"] = {"I can't understand what you want |PLAYERNAME|.", "Say again."},
			["mission_text_not_done"] = {"Mission is not done |PLAYERNAME|. I told you to kill 10 goblins.", "You must kill 10 goblins!"},
			["mission_text_done"] = {"Good job |PLAYERNAME|. Your reward is 500 exp and 5 soul orbs. I got another {mission} for you.", "Thank you. Here is your reward. Ask me about {mission}"},
			
			["mission_text_start_wrong_storages"] = "I got no mission for you, but you can ask NPC Xsss about {help}.",
			["mission_text_start_wrong_level"] = "Get 50 level",
			["mission_text_start_wrong_exp"] = "Get some exp.",
			["mission_text_start_wrong_maglevel"] = "Get 50 level",
			["mission_text_start_wrong_vocation"] = "I talk only with mages.",
			["mission_text_start_wrong_outfit"] = "You look ugly.",
			["mission_text_start_wrong_sex"] = "Go away b***h!",
			["mission_text_start_wrong_items"] = "You are not member of KKK.",
			["mission_text_start_wrong_money"] = "Get some money.",
			["mission_text_start_wrong_promotion"] = "I talk only with promoted players.",
			["mission_text_start_wrong_skill"] = "I expect better trained mages.",
			
			
			["set_storages_when_agree"] = {}, -- if player get quest from this NPC other NPC can ignore him (get_storage)
			["set_storages_when_deny"] = {},
			["set_storages_when_done"] = {},
			
			
			["required_to_start"] =
			{
				{["type"] = "storage", ["method"] = "&", ["storagesList"] =
					{
						{["id"] = 12344, ["value"] = 5, ["valueType"] = "!="},
						{["id"] = 12347, ["value"] = 2, ["valueType"] = ">"}
					}
				},
				{["type"] = "exp", ["method"] = "&", ["expList"] =
					{
						{["value"] = 50000, ["value_type"] = "="}
					}
				},
				{["type"] = "level", ["method"] = "|", ["levelsList"] =
					{
						{["value"] = 500, ["value_type"] = "<"}
					}
				}
				{["type"] = "maglevel", ["method"] = "|", ["maglevelsList"] =
					{
						["value"] = 5, ["value_type"] = ">"}
					}
				},
				{["type"] = "skill", ["method"] = "&", ["skillsList"] =
					{
						{["id"] = 2, ["value"] = 30, ["valueType"] = "<"}
					}
				},
				{["type"] = "money", ["value"] = 50},
				{["type"] = "promotion", ["value"] = {1}},
				{["type"] = "sex", ["value"] = {1,2}},
				{["type"] = "vocation", ["value"] = {1,2}},
				{["type"] = "outfit", ["method"] = "&", ["outfitsList"] = 
					{
						{["type"] = "wearable", ["id"] = 236, ["equal"] = true},
						{["type"] = "wear", ["id"] = 192, ["addons"] = 1, ["equal"] = true}
					}
				},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 5}
					}
				}
			},
			
			["rewards_when_agree"] =
			{
				{["type"] = "exp", ["value"] = 5000},
				{["type"] = "level_change", ["value"] = 5},
				{["type"] = "level_set", ["value"] = 50},
				{["type"] = "manaspent", ["value"] = 500},
				{["type"] = "skill_change", ["id"] = 2, ["value"] = 5},
				{["type"] = "money", ["value"] = 50},
				{["type"] = "promotion_set", ["value"] = 1},
				{["type"] = "promotion_change", ["value"] = -1},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 5, ["attackspeed"] = 1500, ["name"] = "PhoOwnator"}
					}
				}
			},
			["rewards_when_deny"] =
			{
				{["type"] = "exp", ["value"] = 500},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 5}
					}
				}
			},
			
			
			
			-- 301, 538, 473
			["requested"] =
			{
				{["type"] = "storage", ["method"] = "&", ["storagesList"] =
					{
						{["id"] = 12344, ["value"] = 5, ["valueType"] = "!="},
						{["id"] = 12347, ["value"] = 2, ["valueType"] = ">"}
					}
				},
				{["type"] = "exp", ["method"] = "&", ["expList"] =
					{
						{["value"] = 50000, ["value_type"] = "="}
					}
				},
				{["type"] = "level", ["method"] = "|", ["levelsList"] =
					{
						{["value"] = 500, ["value_type"] = "<"}
					}
				}
				{["type"] = "maglevel", ["method"] = "|", ["maglevelsList"] =
					{
						["value"] = 5, ["value_type"] = ">"}
					}
				},
				{["type"] = "skill", ["method"] = "&", ["skillsList"] =
					{
						{["id"] = 2, ["value"] = 30, ["valueType"] = "<"}
					}
				},
				{["type"] = "money", ["value"] = 50},
				{["type"] = "promotion", ["value"] = {1}},
				{["type"] = "sex", ["value"] = {1,2}},
				{["type"] = "vocation", ["value"] = {1,2}},
				{["type"] = "outfit", ["method"] = "&", ["outfitsList"] = 
					{
						{["type"] = "wearable", ["id"] = 236, ["equal"] = true},
						{["type"] = "wear", ["id"] = 192, ["addons"] = 1, ["equal"] = true}
					}
				},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 5}
					}
				}
			},
			["requested_monster"] = {"Goblin", 10, true},
			
			["rewards_when_done"] =
			{
				{["type"] = "exp", ["value"] = 500},
				{["type"] = "item", ["itemsList"] =
					{
						{["itemid"] = 5944, ["count"] = 5}
					}
				}
			}
		}
	}
OF COURSE IN YOUR 'EASY' NPC YOU CAN SET ONLY FEW VALUES AND REMOVE REST - IT'S ONLY EXAMPLE
Added:
* requested items, vocations.. to start mission, configurable texts when player can't start quest (doesnt have item, money, level..)
* reward when player accept (start) or deny mission (when he deny mission it can set storage value - player can be moved to other mission)
* new reward types: exp, level, skill, promotion...
* keywords (few keywords
for few answers [random answer])



Got any ideas?
 
Someone's got too much time on their hands...
Would be pretty cool and useful for many beginners, I suppose.
 
is there a posibility to make npc's keyword randomize?

For example what we have now:

player: hey
npc: hellow player, what brings you to me?
player:task
npc: i have a task for such guy like you, would you kill 10 spiders
player: yes
npc: come back when u will kill them

And with randomize option, each npc will roll at the beggining of conversation one of fhew keywords like:

player: hi
npc: hellow dear friend, would you make something for me?
player: yes
npc: you will have to kill fhew monsters for me, will you slain them?
player: kill
npc: nothing happen
player: slain
npc: nothing happen
player: slain monsters
npc: yes yes, slain these trolls.

or:

player: hi
npc: hellow dear friend, would you make something for me?
player: yes
npc: you will have to kill fhew monsters for me, will you slain them?
player: kill
npc: yes yes, kill these trolls.

or

player: hi
npc: hellow dear friend, would you make something for me?
player: yes
npc: you will have to kill fhew monsters for me, will you slain them?
player: slain
npc: yes yes, slain these trolls.

and it will be fully randomized which answer will be accepted, it would provide us, storymakers more happyness from work we made-wrote becouse now many rpg ots's uses one selected keyword and player dont need to read whole story.
 
mission type = 'mission'
- after 'hi' player get random 'hi' message (if more then 1)
- then he must say one of needed commands (if more then 1) like 'quest' 'mission'
- then he get random mission text like 'go kill 10 monsters' 'could you kill 10 monsters? 'can you help me? i have problem with 10 monsters'
- then he accept it or deny by one of words 'yes' 'ok' 'i will' | 'no' 'not' 'never'
and go do mission, all texts and words needed are configurable FOR EACH MISSION IN EACH NPC

mission type='decision' (i think you want that)
hi
- npc 'hello msg' for that mission (it can be: hellow dear friend, would you make something for me?)
- player say keyword (can be 'yes'. not typical 'mission')
- npc ask him about something ('you will have to kill fhew monsters for me, will you slain them?')
- player say answer, few possible 'answers' (each answer is 'table' of keywords) ({'slain}, {'kill'}, {'monsters'})
- npc answer with same 'key' of his table, player use answer from keywords 'id = 1', npc say text =1 and give mission id = x

For both mission types you can set requested items, vocation ect. to start (and to each 'keyword' if mission type 'decision')

I hope you understand. It will be much easier when I'll finish system and post some NPCs examples.
 
Last edited:
Back
Top