From 46e3d2543b5bfe56aea0010c9e8889b2dbf83b5e Mon Sep 17 00:00:00 2001 From: zorman2000 Date: Thu, 1 Dec 2016 14:01:47 -0500 Subject: [PATCH] Added random data store: helps on generating random NPCs --- init.lua | 1 + random_data.lua | 102 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 random_data.lua diff --git a/init.lua b/init.lua index 8ef5e4d..fd18368 100755 --- a/init.lua +++ b/init.lua @@ -26,6 +26,7 @@ mobs.intllib = S -- NPC dofile(path .. "/npc.lua") dofile(path .. "/chat.lua") +dofile(path .. "/random_data.lua") --dofile(path .. "/trader.lua") print (S("[MOD] Advanced NPC loaded")) diff --git a/random_data.lua b/random_data.lua new file mode 100644 index 0000000..f95667e --- /dev/null +++ b/random_data.lua @@ -0,0 +1,102 @@ +-- Random data provider to create random NPCs by Zorman2000 + + +npc.data = {} + +npc.data.DIALOGUES = { + female = {} + male = {} +} + +-- Female dialogue options defined by phase +-- Phase 1 +npc.data.DIALOGUES.female["phase1"] = { + { + text = "Hello there!" + }, + { + text = "How are you doing?" + }, + { + text = "Hey, I haven't seen you before!" + }, + { + text = "Just another day..." + }, + { + text = "The weather is nice today" + }, + { + text = "Hello! Have you been to the sea?", + responses = { + { + text = "No, never before", + action_type = "function", + action = function(player_name, item) + minetest.chat_send_player(player_name, "Oh, never? How come! You should. + \nHere, take this. It will guide you to the sea...") + end + }, + { + text = "Yes, sure", + action_type = "dialogue", + action = { + text = "It's so beautiful, and big, and large, and infinite, and..." + } + }, + { + text = "Of course! And to all the seas in the world!", + action_type = "dialogue", + action = { + text = "Awww you are no fun then! Go on then know-it-all!" + } + } + } + } +} + +-- Male dialogue options defined by phase +-- Phase 1 +npc.data.DIALOGUES.male["phase1"] = { + { + text = "Hello!" + }, + { + text = "Welcome to our village, stranger." + }, + { + text = "Just a great day to go to the woods..." + }, + { + text = "Bah, stone! Useless stuff." + }, + { + text = "What do you think of this weather?" + }, + { + text = "Hello! Have you been to the sea?", + responses = { + { + text = "No, never before", + action_type = "function", + action = function(player_name, item) + minetest.chat_send_player(player_name, "Then you are not worth my time.") + end + }, + { + text = "Yes, sure", + action_type = "dialogue", + action = { + text = "Then you should appreciate it as a great pirate of the seven seas do!" + } + }, + { + text = "Of course! And to all the seas in the world!", + action_type = "dialogue", + action = { + text = "No my friend, I don't think so! I have been to all the seas!" + } + } + } + } +} \ No newline at end of file