Stats Entity
Stats Entity
The stats entity defines custom statistics for players and NPCs beyond traditional HP/MP, enabling fully customizable attribute systems.
Key Properties
- key: Unique stat identifier (e.g., 'attack', 'defense', 'speed')
- label: Display name
- description: Stat description
- base_value: Default starting value
- customData: JSON custom configuration
Custom Stats System
Reldens is not limited to traditional RPG stats. Create any stat you need:
- Combat: attack, defense, aim, dodge, critChance
- Resources: hp, mp, stamina, energy
- Attributes: strength, dexterity, intelligence, vitality
- Skills: mining, fishing, crafting, cooking
- Resistances: fireRes, iceRes, poisonRes
- Custom: Any stat your game requires
Stat Values
Stats can be modified through:
- Base Value: Initial value from stats entity
- Level Modifiers: Applied on level up
- Equipment: Bonuses from equipped items
- Skills: Temporary or permanent effects
- Buffs/Debuffs: Time-limited modifications
Property Path Support
Stats support nested property paths using '/' separator:
stats/combat/attackstats/combat/defensestats/resources/hpstats/attributes/strength
Common Stat Examples
- hp: Health points (base_value: 100)
- mp: Magic/mana points (base_value: 50)
- stamina: Stamina/energy (base_value: 100)
- atk: Attack power (base_value: 10)
- def: Defense power (base_value: 5)
- mgAtk: Magic attack (base_value: 10)
- mgDef: Magic defense (base_value: 5)
- aim: Accuracy/aim (base_value: 50)
- dodge: Dodge chance (base_value: 30)
- speed: Movement/attack speed (base_value: 100)
Modifier Integration
Stats work seamlessly with the @reldens/modifiers system:
- Modifiers target stats by key or property path
- Operations: INC, DEC, MUL, DIV, INC_P, DEC_P, SET
- Conditional modifiers based on stat values
- Revertible operations for temporary effects
Database Relations
- players_stats: Player stat values
- objects_stats: NPC stat values
Implementation
Configure stats in the admin panel under Stats. Define all stats your game needs, set base values, and modifiers will reference them by key.
Package
Stat system integrated with @reldens/modifiers and @reldens/skills packages.
reldens