78 lines
3.2 KiB
Lua
78 lines
3.2 KiB
Lua
yl_speak_up = {}
|
|
|
|
local modpath = minetest.get_modpath("yl_speak_up")..DIR_DELIM
|
|
yl_speak_up.worldpath = minetest.get_worldpath()..DIR_DELIM
|
|
yl_speak_up.modpath = modpath
|
|
|
|
yl_speak_up.modstorage = minetest.get_mod_storage()
|
|
|
|
-- status
|
|
-- 0: NPCs may speak
|
|
-- 1: NPCs may not speak
|
|
-- 2: NPCs must selfdestruct on load. Their dialogs remain safed
|
|
|
|
yl_speak_up.status = yl_speak_up.modstorage:get_int("status") or 0
|
|
yl_speak_up.number_of_npcs = yl_speak_up.modstorage:get_int("amount") or 0
|
|
yl_speak_up.speak_to = {}
|
|
|
|
dofile(modpath .. "config.lua")
|
|
dofile(modpath .. "privs.lua")
|
|
-- handle on_player_receive_fields and showing of formspecs
|
|
dofile(modpath .. "show_fs.lua")
|
|
-- ask if the player wants to save, discard or go back in edit mode
|
|
dofile(modpath .. "fs_save_or_discard_or_back.lua")
|
|
-- as the name says: a collection of custom functions that you can
|
|
-- override on your server or in your game to suit your needs;
|
|
-- Note: No special privs are needed to call custom functions. But...
|
|
-- of course you can change them only if you have access to
|
|
-- the server's file system or can execute lua code.
|
|
dofile(modpath .. "custrom_functions_you_can_override.lua")
|
|
-- some helper functions for formatting text for a formspec talbe
|
|
dofile(modpath .. "print_as_table.lua")
|
|
-- create i.e. a dropdown list of player names
|
|
dofile(modpath .. "formspec_helpers.lua")
|
|
-- handle alternate text for dialogs
|
|
dofile(modpath .. "fs_alternate_text.lua")
|
|
-- common functions for editing preconditions and effects
|
|
dofile(modpath .. "fs_edit_general.lua")
|
|
-- edit preconditions (can be reached through edit options dialog)
|
|
dofile(modpath .. "fs_edit_preconditions.lua")
|
|
-- edit actions (can be reached through edit options dialog)
|
|
dofile(modpath .. "fs_edit_actions.lua")
|
|
-- edit effects (can be reached through edit options dialog)
|
|
dofile(modpath .. "fs_edit_effects.lua")
|
|
-- edit options dialog (detailed configuration of options in edit mode)
|
|
dofile(modpath .. "fs_edit_options_dialog.lua")
|
|
-- set name, description and owner (owner only with npc_talk_master priv)
|
|
dofile(modpath .. "fs_initial_config.lua")
|
|
-- inventory management, trading and handling of quest items:
|
|
dofile(modpath .. "inventory.lua")
|
|
-- trade one item(stack) against one other item(stack)
|
|
dofile(modpath .. "trade_simple.lua")
|
|
-- easily accessible list of all trades the NPC offers
|
|
dofile(modpath .. "trade_list.lua")
|
|
-- manage quest variables: add, delete, manage access rights etc.
|
|
dofile(modpath .. "fs_manage_variables.lua")
|
|
-- handle variables for quests for player-owned NPC
|
|
dofile(modpath .. "quest_api.lua")
|
|
-- editing the npc with the staff:
|
|
dofile(modpath .. "staff_based_editing.lua")
|
|
-- setting skin, wielded item etc.
|
|
dofile(modpath .. "fs_fashion.lua")
|
|
-- the main functionality of the mod
|
|
dofile(modpath .. "functions.lua")
|
|
-- a way of determining a node position
|
|
dofile(modpath .. "register_node_punch.lua")
|
|
-- the staffs (requires npc_master priv)
|
|
dofile(modpath .. "tools.lua")
|
|
-- the actual mobs, using mobs_redo
|
|
dofile(modpath .. "mobs.lua")
|
|
--dofile(modpath .. "debug.lua")
|
|
|
|
minetest.mkdir(yl_speak_up.worldpath..yl_speak_up.path)
|
|
minetest.mkdir(yl_speak_up.worldpath..yl_speak_up.inventory_path)
|
|
|
|
yl_speak_up.mob_table = yl_speak_up.init_mob_table() or {}
|
|
|
|
minetest.log("action","[MOD] yl_speak_up loaded")
|