generated from your-land/yl_template
66 lines
2.6 KiB
Lua
66 lines
2.6 KiB
Lua
-- data structure city
|
|
|
|
local schema_city = {
|
|
id = "number", -- Example: 1
|
|
name = "string", -- Example: "Haven"
|
|
short_description = "string", -- Example: "City where schnitzels are on the near-extinct-species list"
|
|
areas = "table", -- Example: {1, 2} -- table of areaIDs
|
|
mayor = "player", -- Example: "AliasAlreadyTaken" -- player
|
|
comayors = "table", -- Example: {"daydream", "AliasAlreadyTaken"} -- table of players
|
|
citizens = "table", -- Example: {"Ernesto", "AliasAlreadyTaken"} -- table of players
|
|
services = "table", -- Example: {"church", "tavern"} -- table of strings
|
|
spawnpoint = "position", -- Example: {x= "number", y = "number", z = "number"} -- indexed table of numbers
|
|
crownpoint = "position", -- Example: {x= "number", y = "number", z = "number"} -- indexed table of numbers
|
|
creationdate = "timestamp", -- Example: 17000000
|
|
modificationdate = "timestamp", -- Example: 17000000
|
|
status = "enum", -- Example: "alive, dead, quest, conquered, ... "
|
|
rules = "text", -- Example: "Every wednesday, you are only allowed to walk backwards in this city!"
|
|
gate = "table", -- Example: {pos1, pos2, pos3, ... } -- table of positions
|
|
_xp = "number", -- Example: 34534
|
|
_last_successful_crown_check = "timestamp",
|
|
map = "enum", -- Example: "1x2", "3x3", ...
|
|
coat_of_arms = "table", --Example: {"red", "green", "pike"} -- Must reflect the table of castle_shields
|
|
economy_item = "string", --Example: "yl_cities:myecoitem"
|
|
npcs = "table", -- Example: {"n_234","n_99","n_123"} All NPCs, including those on plots and city services
|
|
level = "number",
|
|
xp_for_next_level = "number",
|
|
skills = "table"
|
|
|
|
}
|
|
|
|
local schema_player = {
|
|
id = "number", -- Example: 105
|
|
name = "string", -- Example: "AliasAlreadyTaken"
|
|
title = "string", -- Example: "First Jester of the King"
|
|
city = "number", -- Example: 1
|
|
privs = "table", -- Example: {"can_change_description", "can_start_caravans"} -- table of strings
|
|
}
|
|
|
|
local schema_service = {
|
|
id = "number", -- Example: 105
|
|
name = "string", -- Example: "AliasAlreadyTaken"
|
|
type = "string", -- Example: "church"
|
|
payload = "a lot of data"
|
|
}
|
|
|
|
local schema_road = {
|
|
id = "number", -- Example: 3
|
|
name = "string", -- Example: "North Road"
|
|
_weight = "number", -- Cached added value of roadparts
|
|
waypoints = "table", -- Example: {1 = roadpart_id, 2 = roadpart_id, 3 = roadpart_id, 4 = roadpart_id}
|
|
}
|
|
|
|
local schema_roadpart = {
|
|
id = "number",
|
|
weight = "number",
|
|
pos1 = "table", -- list of road part ID
|
|
pos2 = "table", -- list of road part ID
|
|
}
|
|
|
|
--[[
|
|
|
|
external:
|
|
|
|
- per player: own spawn?
|
|
|
|
]]-- |