wyrt_resources

v1.0.0World

Resource node system with HP tracking, depletion, respawn timers, and loot tables

Features

  • Node HP tracking and depletion mechanics
  • Configurable respawn timers per node type
  • Loot table rolling for resource yields
  • Event-based integration (node:depleted, node:respawned)
  • Node type registration with custom configs
  • Gathering skill integration hooks
  • Multiple resource types (ore, wood, herbs, fish)

Quick Start

const resourcesModule = context.getModule('wyrt_resources');
const resourceManager = resourcesModule.createResourceManager('my_game');

// Register a node type
resourceManager.registerNodeType('copper_ore', {
  hp: 3,
  respawnTime: 30000,
  lootTable: [
    { itemId: 'copper_ore', chance: 1.0, quantity: [1, 3] }
  ]
});

// Spawn a node instance
resourceManager.spawnNode('copper_ore', { x: 100, y: 200, zoneId: 'mines' });

// Handle gathering
resourceManager.on('node:depleted', (node, playerId) => {
  const loot = resourceManager.rollLoot(node);
  // Grant items and XP to player
});

Exports

ResourceManager

Manages resource nodes and gathering