3632 lines
73 KiB
JavaScript
3632 lines
73 KiB
JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Characters = db.characters;
|
|
|
|
const AiFriends = db.ai_friends;
|
|
|
|
const Modules = db.modules;
|
|
|
|
const Adventures = db.adventures;
|
|
|
|
const Rules = db.rules;
|
|
|
|
const Sessions = db.sessions;
|
|
|
|
const SessionLogs = db.session_logs;
|
|
|
|
const DiceRolls = db.dice_rolls;
|
|
|
|
const Assets = db.assets;
|
|
|
|
const Npcs = db.npcs;
|
|
|
|
const Enemies = db.enemies;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CharactersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Thalion Windrunner",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Elf scout skilled in stealth and tracking",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"race": "Elf",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"class_name": "Scout",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"level": 6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Prefers ranged combat and reconnaissance",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_npc": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"created_on": new Date('2026-01-10T10:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"updated_on": new Date('2026-01-21T12:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Borin Stonebeard",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Dwarf warrior and reliable frontline fighter",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"race": "Dwarf",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"class_name": "Warrior",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"level": 7,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Heavy armor specialist",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_npc": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"created_on": new Date('2026-01-11T11:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"updated_on": new Date('2026-01-21T12:10:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Eldra the Archivist",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Human mage focused on lore and rituals",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"race": "Human",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"class_name": "Mage",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"level": 8,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Expert in ancient Palladium rituals",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_npc": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"created_on": new Date('2026-01-09T09:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"updated_on": new Date('2026-01-20T16:50:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const AiFriendsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Roderick",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"persona": "Loyal veteran with dry humor and tactical focus",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"voice": "neutral_male_1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"behavior_profile": "assistive tactical suggestions and roleplay",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"model_config": "gemini-standard-v1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"created_on": new Date('2026-01-15T09:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Ilyana",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"persona": "Curious scholar who loves lore and puzzles",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"voice": "soft_female_1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"behavior_profile": "focus on lore, puzzle hints and roleplay",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"model_config": "gemini-creative-v1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"created_on": new Date('2026-01-14T10:30:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Brutus",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"persona": "Brash fighter with blunt speech and loyalty",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"voice": "deep_male_1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"behavior_profile": "aggressive combat tactics and morale boosting",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"model_config": "gemini-standard-v1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"created_on": new Date('2026-01-12T15:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const ModulesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "The Ruins of Eldamar",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"upload_date": new Date('2026-01-05T10:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "raw",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Classic dungeon module with traps and ancient lore",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Forest of Whispering Oaks",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"upload_date": new Date('2026-01-07T11:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "raw",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Wilderness adventure with social encounters",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "The Lost Caravan",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"upload_date": new Date('2026-01-10T09:45:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "raw",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Investigation centered module and NPC drama",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const AdventuresData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Eldamar Expedition",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content": "Adapted adventure from Ruins of Eldamar focusing on exploration and artifact recovery",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Exploration and artifact recovery in ancient ruins",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"difficulty": "deadly",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tags": "ruins,artifact,exploration",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Whispering Oaks Nightfall",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content": "Night time encounters and a ritual subplot",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Forest mystery with ritual elements",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"difficulty": "easy",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tags": "forest,ritual,mystery",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Caravan Rescue",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content": "A short rescue mission with social negotiation scenes",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Rescue mission and negotiation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"difficulty": "hard",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tags": "caravan,rescue,negotiation",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const RulesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Palladium Fantasy Core Rules",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"version": "1.0",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Official core rules interpreted for AI guidance",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "House Rules Pack A",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"version": "1.1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Campaign specific adjustments and clarifications",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Magic Revision Set",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"version": "0.9",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Alternate magic mechanics for tests",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SessionsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Eldamar Session 1",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"start_time": new Date('2026-01-21T19:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"end_time": new Date('2026-01-21T22:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "cancelled",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "private",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Whispering Oaks Night Run",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"start_time": new Date('2026-01-23T20:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"end_time": new Date('2026-01-23T23:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "planned",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "public",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Caravan Rescue Quickplay",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_many" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"start_time": new Date('2026-01-18T18:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"end_time": new Date('2026-01-18T19:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "shared",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SessionLogsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timestamp": new Date('2026-01-21T19:45:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Explored entrance hall and disarmed trap",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content": "Party entered the main hall, found a pressure plate and Sera guided disarming",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source": "player",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timestamp": new Date('2026-01-23T20:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Strange whispers observed near oak circle",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content": "Ilyana detected a lingering ritual trace under the roots",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source": "player",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timestamp": new Date('2026-01-18T18:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"summary": "Negotiation with caravan leader succeeded",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content": "Successful persuasion avoided combat and secured convoy escort",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source": "ai",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const DiceRollsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"expression": "1d20+5",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"result": 17,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Natural roll 12 plus modifier 5",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timestamp": new Date('2026-01-21T19:50:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"expression": "2d6",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"result": 8,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Rolls 3 and 5",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timestamp": new Date('2026-01-23T20:20:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"expression": "1d100",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"result": 42,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Percentile check for perception",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timestamp": new Date('2026-01-18T18:05:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const AssetsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Eldamar Ruins Map",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "effect",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata": "resolution:4096x3072 format:png",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Whispering Oaks Ambient",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata": "loop:yes bpm:60",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Caravan Scene Image",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "animation",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"metadata": "format:jpg license:cc",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const NpcsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "High Priestess Vela",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Leader of the oak cult with calm demeanor",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_hostile": false,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Caravan Master Harun",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Gruff but fair caravan leader",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_hostile": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Serpent Warden",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Territorial guardian of the cavern exit",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_hostile": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const EnemiesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Cave Serpent Alpha",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"challenge_rating": "7",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Bandit Captain",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"challenge_rating": "4",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Cult Acolyte",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"challenge_rating": "2",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateCharacterWithOwner() {
|
|
|
|
const relatedOwner0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Character0 = await Characters.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Character0?.setOwner)
|
|
{
|
|
await
|
|
Character0.
|
|
setOwner(relatedOwner0);
|
|
}
|
|
|
|
const relatedOwner1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Character1 = await Characters.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Character1?.setOwner)
|
|
{
|
|
await
|
|
Character1.
|
|
setOwner(relatedOwner1);
|
|
}
|
|
|
|
const relatedOwner2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Character2 = await Characters.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Character2?.setOwner)
|
|
{
|
|
await
|
|
Character2.
|
|
setOwner(relatedOwner2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateAiFriendWithOwner() {
|
|
|
|
const relatedOwner0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AiFriend0 = await AiFriends.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (AiFriend0?.setOwner)
|
|
{
|
|
await
|
|
AiFriend0.
|
|
setOwner(relatedOwner0);
|
|
}
|
|
|
|
const relatedOwner1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AiFriend1 = await AiFriends.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (AiFriend1?.setOwner)
|
|
{
|
|
await
|
|
AiFriend1.
|
|
setOwner(relatedOwner1);
|
|
}
|
|
|
|
const relatedOwner2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AiFriend2 = await AiFriends.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (AiFriend2?.setOwner)
|
|
{
|
|
await
|
|
AiFriend2.
|
|
setOwner(relatedOwner2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateModuleWithUploaded_by() {
|
|
|
|
const relatedUploaded_by0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Module0 = await Modules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Module0?.setUploaded_by)
|
|
{
|
|
await
|
|
Module0.
|
|
setUploaded_by(relatedUploaded_by0);
|
|
}
|
|
|
|
const relatedUploaded_by1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Module1 = await Modules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Module1?.setUploaded_by)
|
|
{
|
|
await
|
|
Module1.
|
|
setUploaded_by(relatedUploaded_by1);
|
|
}
|
|
|
|
const relatedUploaded_by2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Module2 = await Modules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Module2?.setUploaded_by)
|
|
{
|
|
await
|
|
Module2.
|
|
setUploaded_by(relatedUploaded_by2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateAdventureWithModule() {
|
|
|
|
const relatedModule0 = await Modules.findOne({
|
|
offset: Math.floor(Math.random() * (await Modules.count())),
|
|
});
|
|
const Adventure0 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Adventure0?.setModule)
|
|
{
|
|
await
|
|
Adventure0.
|
|
setModule(relatedModule0);
|
|
}
|
|
|
|
const relatedModule1 = await Modules.findOne({
|
|
offset: Math.floor(Math.random() * (await Modules.count())),
|
|
});
|
|
const Adventure1 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Adventure1?.setModule)
|
|
{
|
|
await
|
|
Adventure1.
|
|
setModule(relatedModule1);
|
|
}
|
|
|
|
const relatedModule2 = await Modules.findOne({
|
|
offset: Math.floor(Math.random() * (await Modules.count())),
|
|
});
|
|
const Adventure2 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Adventure2?.setModule)
|
|
{
|
|
await
|
|
Adventure2.
|
|
setModule(relatedModule2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateAdventureWithRule() {
|
|
|
|
const relatedRule0 = await Rules.findOne({
|
|
offset: Math.floor(Math.random() * (await Rules.count())),
|
|
});
|
|
const Adventure0 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Adventure0?.setRule)
|
|
{
|
|
await
|
|
Adventure0.
|
|
setRule(relatedRule0);
|
|
}
|
|
|
|
const relatedRule1 = await Rules.findOne({
|
|
offset: Math.floor(Math.random() * (await Rules.count())),
|
|
});
|
|
const Adventure1 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Adventure1?.setRule)
|
|
{
|
|
await
|
|
Adventure1.
|
|
setRule(relatedRule1);
|
|
}
|
|
|
|
const relatedRule2 = await Rules.findOne({
|
|
offset: Math.floor(Math.random() * (await Rules.count())),
|
|
});
|
|
const Adventure2 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Adventure2?.setRule)
|
|
{
|
|
await
|
|
Adventure2.
|
|
setRule(relatedRule2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateAdventureWithCreator() {
|
|
|
|
const relatedCreator0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Adventure0 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Adventure0?.setCreator)
|
|
{
|
|
await
|
|
Adventure0.
|
|
setCreator(relatedCreator0);
|
|
}
|
|
|
|
const relatedCreator1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Adventure1 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Adventure1?.setCreator)
|
|
{
|
|
await
|
|
Adventure1.
|
|
setCreator(relatedCreator1);
|
|
}
|
|
|
|
const relatedCreator2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Adventure2 = await Adventures.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Adventure2?.setCreator)
|
|
{
|
|
await
|
|
Adventure2.
|
|
setCreator(relatedCreator2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateRuleWithUploaded_by() {
|
|
|
|
const relatedUploaded_by0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Rule0 = await Rules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Rule0?.setUploaded_by)
|
|
{
|
|
await
|
|
Rule0.
|
|
setUploaded_by(relatedUploaded_by0);
|
|
}
|
|
|
|
const relatedUploaded_by1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Rule1 = await Rules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Rule1?.setUploaded_by)
|
|
{
|
|
await
|
|
Rule1.
|
|
setUploaded_by(relatedUploaded_by1);
|
|
}
|
|
|
|
const relatedUploaded_by2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Rule2 = await Rules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Rule2?.setUploaded_by)
|
|
{
|
|
await
|
|
Rule2.
|
|
setUploaded_by(relatedUploaded_by2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSessionWithAdventure() {
|
|
|
|
const relatedAdventure0 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Session0 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Session0?.setAdventure)
|
|
{
|
|
await
|
|
Session0.
|
|
setAdventure(relatedAdventure0);
|
|
}
|
|
|
|
const relatedAdventure1 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Session1 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Session1?.setAdventure)
|
|
{
|
|
await
|
|
Session1.
|
|
setAdventure(relatedAdventure1);
|
|
}
|
|
|
|
const relatedAdventure2 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Session2 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Session2?.setAdventure)
|
|
{
|
|
await
|
|
Session2.
|
|
setAdventure(relatedAdventure2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateSessionWithGm() {
|
|
|
|
const relatedGm0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Session0 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Session0?.setGm)
|
|
{
|
|
await
|
|
Session0.
|
|
setGm(relatedGm0);
|
|
}
|
|
|
|
const relatedGm1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Session1 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Session1?.setGm)
|
|
{
|
|
await
|
|
Session1.
|
|
setGm(relatedGm1);
|
|
}
|
|
|
|
const relatedGm2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Session2 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Session2?.setGm)
|
|
{
|
|
await
|
|
Session2.
|
|
setGm(relatedGm2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSessionWithMap_asset() {
|
|
|
|
const relatedMap_asset0 = await Assets.findOne({
|
|
offset: Math.floor(Math.random() * (await Assets.count())),
|
|
});
|
|
const Session0 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Session0?.setMap_asset)
|
|
{
|
|
await
|
|
Session0.
|
|
setMap_asset(relatedMap_asset0);
|
|
}
|
|
|
|
const relatedMap_asset1 = await Assets.findOne({
|
|
offset: Math.floor(Math.random() * (await Assets.count())),
|
|
});
|
|
const Session1 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Session1?.setMap_asset)
|
|
{
|
|
await
|
|
Session1.
|
|
setMap_asset(relatedMap_asset1);
|
|
}
|
|
|
|
const relatedMap_asset2 = await Assets.findOne({
|
|
offset: Math.floor(Math.random() * (await Assets.count())),
|
|
});
|
|
const Session2 = await Sessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Session2?.setMap_asset)
|
|
{
|
|
await
|
|
Session2.
|
|
setMap_asset(relatedMap_asset2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSessionLogWithSession() {
|
|
|
|
const relatedSession0 = await Sessions.findOne({
|
|
offset: Math.floor(Math.random() * (await Sessions.count())),
|
|
});
|
|
const SessionLog0 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SessionLog0?.setSession)
|
|
{
|
|
await
|
|
SessionLog0.
|
|
setSession(relatedSession0);
|
|
}
|
|
|
|
const relatedSession1 = await Sessions.findOne({
|
|
offset: Math.floor(Math.random() * (await Sessions.count())),
|
|
});
|
|
const SessionLog1 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SessionLog1?.setSession)
|
|
{
|
|
await
|
|
SessionLog1.
|
|
setSession(relatedSession1);
|
|
}
|
|
|
|
const relatedSession2 = await Sessions.findOne({
|
|
offset: Math.floor(Math.random() * (await Sessions.count())),
|
|
});
|
|
const SessionLog2 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SessionLog2?.setSession)
|
|
{
|
|
await
|
|
SessionLog2.
|
|
setSession(relatedSession2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSessionLogWithActor_user() {
|
|
|
|
const relatedActor_user0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SessionLog0 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SessionLog0?.setActor_user)
|
|
{
|
|
await
|
|
SessionLog0.
|
|
setActor_user(relatedActor_user0);
|
|
}
|
|
|
|
const relatedActor_user1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SessionLog1 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SessionLog1?.setActor_user)
|
|
{
|
|
await
|
|
SessionLog1.
|
|
setActor_user(relatedActor_user1);
|
|
}
|
|
|
|
const relatedActor_user2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SessionLog2 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SessionLog2?.setActor_user)
|
|
{
|
|
await
|
|
SessionLog2.
|
|
setActor_user(relatedActor_user2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateSessionLogWithActor_friend() {
|
|
|
|
const relatedActor_friend0 = await AiFriends.findOne({
|
|
offset: Math.floor(Math.random() * (await AiFriends.count())),
|
|
});
|
|
const SessionLog0 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SessionLog0?.setActor_friend)
|
|
{
|
|
await
|
|
SessionLog0.
|
|
setActor_friend(relatedActor_friend0);
|
|
}
|
|
|
|
const relatedActor_friend1 = await AiFriends.findOne({
|
|
offset: Math.floor(Math.random() * (await AiFriends.count())),
|
|
});
|
|
const SessionLog1 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SessionLog1?.setActor_friend)
|
|
{
|
|
await
|
|
SessionLog1.
|
|
setActor_friend(relatedActor_friend1);
|
|
}
|
|
|
|
const relatedActor_friend2 = await AiFriends.findOne({
|
|
offset: Math.floor(Math.random() * (await AiFriends.count())),
|
|
});
|
|
const SessionLog2 = await SessionLogs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SessionLog2?.setActor_friend)
|
|
{
|
|
await
|
|
SessionLog2.
|
|
setActor_friend(relatedActor_friend2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateDiceRollWithSession() {
|
|
|
|
const relatedSession0 = await Sessions.findOne({
|
|
offset: Math.floor(Math.random() * (await Sessions.count())),
|
|
});
|
|
const DiceRoll0 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (DiceRoll0?.setSession)
|
|
{
|
|
await
|
|
DiceRoll0.
|
|
setSession(relatedSession0);
|
|
}
|
|
|
|
const relatedSession1 = await Sessions.findOne({
|
|
offset: Math.floor(Math.random() * (await Sessions.count())),
|
|
});
|
|
const DiceRoll1 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (DiceRoll1?.setSession)
|
|
{
|
|
await
|
|
DiceRoll1.
|
|
setSession(relatedSession1);
|
|
}
|
|
|
|
const relatedSession2 = await Sessions.findOne({
|
|
offset: Math.floor(Math.random() * (await Sessions.count())),
|
|
});
|
|
const DiceRoll2 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (DiceRoll2?.setSession)
|
|
{
|
|
await
|
|
DiceRoll2.
|
|
setSession(relatedSession2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateDiceRollWithRoller_user() {
|
|
|
|
const relatedRoller_user0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const DiceRoll0 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (DiceRoll0?.setRoller_user)
|
|
{
|
|
await
|
|
DiceRoll0.
|
|
setRoller_user(relatedRoller_user0);
|
|
}
|
|
|
|
const relatedRoller_user1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const DiceRoll1 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (DiceRoll1?.setRoller_user)
|
|
{
|
|
await
|
|
DiceRoll1.
|
|
setRoller_user(relatedRoller_user1);
|
|
}
|
|
|
|
const relatedRoller_user2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const DiceRoll2 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (DiceRoll2?.setRoller_user)
|
|
{
|
|
await
|
|
DiceRoll2.
|
|
setRoller_user(relatedRoller_user2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateDiceRollWithRoller_friend() {
|
|
|
|
const relatedRoller_friend0 = await AiFriends.findOne({
|
|
offset: Math.floor(Math.random() * (await AiFriends.count())),
|
|
});
|
|
const DiceRoll0 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (DiceRoll0?.setRoller_friend)
|
|
{
|
|
await
|
|
DiceRoll0.
|
|
setRoller_friend(relatedRoller_friend0);
|
|
}
|
|
|
|
const relatedRoller_friend1 = await AiFriends.findOne({
|
|
offset: Math.floor(Math.random() * (await AiFriends.count())),
|
|
});
|
|
const DiceRoll1 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (DiceRoll1?.setRoller_friend)
|
|
{
|
|
await
|
|
DiceRoll1.
|
|
setRoller_friend(relatedRoller_friend1);
|
|
}
|
|
|
|
const relatedRoller_friend2 = await AiFriends.findOne({
|
|
offset: Math.floor(Math.random() * (await AiFriends.count())),
|
|
});
|
|
const DiceRoll2 = await DiceRolls.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (DiceRoll2?.setRoller_friend)
|
|
{
|
|
await
|
|
DiceRoll2.
|
|
setRoller_friend(relatedRoller_friend2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateAssetWithUploaded_by() {
|
|
|
|
const relatedUploaded_by0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Asset0 = await Assets.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Asset0?.setUploaded_by)
|
|
{
|
|
await
|
|
Asset0.
|
|
setUploaded_by(relatedUploaded_by0);
|
|
}
|
|
|
|
const relatedUploaded_by1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Asset1 = await Assets.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Asset1?.setUploaded_by)
|
|
{
|
|
await
|
|
Asset1.
|
|
setUploaded_by(relatedUploaded_by1);
|
|
}
|
|
|
|
const relatedUploaded_by2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Asset2 = await Assets.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Asset2?.setUploaded_by)
|
|
{
|
|
await
|
|
Asset2.
|
|
setUploaded_by(relatedUploaded_by2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateNpcWithAdventure() {
|
|
|
|
const relatedAdventure0 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Npc0 = await Npcs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Npc0?.setAdventure)
|
|
{
|
|
await
|
|
Npc0.
|
|
setAdventure(relatedAdventure0);
|
|
}
|
|
|
|
const relatedAdventure1 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Npc1 = await Npcs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Npc1?.setAdventure)
|
|
{
|
|
await
|
|
Npc1.
|
|
setAdventure(relatedAdventure1);
|
|
}
|
|
|
|
const relatedAdventure2 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Npc2 = await Npcs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Npc2?.setAdventure)
|
|
{
|
|
await
|
|
Npc2.
|
|
setAdventure(relatedAdventure2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateEnemyWithNpc_link() {
|
|
|
|
const relatedNpc_link0 = await Npcs.findOne({
|
|
offset: Math.floor(Math.random() * (await Npcs.count())),
|
|
});
|
|
const Enemy0 = await Enemies.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Enemy0?.setNpc_link)
|
|
{
|
|
await
|
|
Enemy0.
|
|
setNpc_link(relatedNpc_link0);
|
|
}
|
|
|
|
const relatedNpc_link1 = await Npcs.findOne({
|
|
offset: Math.floor(Math.random() * (await Npcs.count())),
|
|
});
|
|
const Enemy1 = await Enemies.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Enemy1?.setNpc_link)
|
|
{
|
|
await
|
|
Enemy1.
|
|
setNpc_link(relatedNpc_link1);
|
|
}
|
|
|
|
const relatedNpc_link2 = await Npcs.findOne({
|
|
offset: Math.floor(Math.random() * (await Npcs.count())),
|
|
});
|
|
const Enemy2 = await Enemies.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Enemy2?.setNpc_link)
|
|
{
|
|
await
|
|
Enemy2.
|
|
setNpc_link(relatedNpc_link2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateEnemyWithAdventure() {
|
|
|
|
const relatedAdventure0 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Enemy0 = await Enemies.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Enemy0?.setAdventure)
|
|
{
|
|
await
|
|
Enemy0.
|
|
setAdventure(relatedAdventure0);
|
|
}
|
|
|
|
const relatedAdventure1 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Enemy1 = await Enemies.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Enemy1?.setAdventure)
|
|
{
|
|
await
|
|
Enemy1.
|
|
setAdventure(relatedAdventure1);
|
|
}
|
|
|
|
const relatedAdventure2 = await Adventures.findOne({
|
|
offset: Math.floor(Math.random() * (await Adventures.count())),
|
|
});
|
|
const Enemy2 = await Enemies.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Enemy2?.setAdventure)
|
|
{
|
|
await
|
|
Enemy2.
|
|
setAdventure(relatedAdventure2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Characters.bulkCreate(CharactersData);
|
|
|
|
|
|
|
|
|
|
await AiFriends.bulkCreate(AiFriendsData);
|
|
|
|
|
|
|
|
|
|
await Modules.bulkCreate(ModulesData);
|
|
|
|
|
|
|
|
|
|
await Adventures.bulkCreate(AdventuresData);
|
|
|
|
|
|
|
|
|
|
await Rules.bulkCreate(RulesData);
|
|
|
|
|
|
|
|
|
|
await Sessions.bulkCreate(SessionsData);
|
|
|
|
|
|
|
|
|
|
await SessionLogs.bulkCreate(SessionLogsData);
|
|
|
|
|
|
|
|
|
|
await DiceRolls.bulkCreate(DiceRollsData);
|
|
|
|
|
|
|
|
|
|
await Assets.bulkCreate(AssetsData);
|
|
|
|
|
|
|
|
|
|
await Npcs.bulkCreate(NpcsData);
|
|
|
|
|
|
|
|
|
|
await Enemies.bulkCreate(EnemiesData);
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateCharacterWithOwner(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateAiFriendWithOwner(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateModuleWithUploaded_by(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateAdventureWithModule(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateAdventureWithRule(),
|
|
|
|
|
|
|
|
|
|
await associateAdventureWithCreator(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateRuleWithUploaded_by(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSessionWithAdventure(),
|
|
|
|
|
|
|
|
|
|
await associateSessionWithGm(),
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSessionWithMap_asset(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSessionLogWithSession(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSessionLogWithActor_user(),
|
|
|
|
|
|
|
|
|
|
await associateSessionLogWithActor_friend(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateDiceRollWithSession(),
|
|
|
|
|
|
|
|
|
|
await associateDiceRollWithRoller_user(),
|
|
|
|
|
|
|
|
|
|
await associateDiceRollWithRoller_friend(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateAssetWithUploaded_by(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateNpcWithAdventure(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateEnemyWithNpc_link(),
|
|
|
|
|
|
|
|
|
|
await associateEnemyWithAdventure(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await queryInterface.bulkDelete('characters', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('ai_friends', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('modules', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('adventures', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('rules', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('sessions', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('session_logs', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('dice_rolls', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('assets', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('npcs', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('enemies', null, {});
|
|
|
|
|
|
},
|
|
}; |