Action Battle System
Advanced real-time action combat AI system for RPGJS. The AI controller manages behavior only. All stats, HP, SP, skills, items, classes, and states are configured with the standard RPGJS API.Features
- State machine AI with
Idle,Alert,Combat,Flee, andStunned - Multiple enemy types:
Aggressive,Defensive,Ranged,Tank,Berserker - Attack patterns:
Melee,Combo,Charged,Zone,DashAttack - Skill support with standard RPGJS skills
- Dodge and counter-attack behaviors
- Group behavior and waypoint patrols
- Knockback driven by weapon configuration
- Hook system with
onBeforeHitandonAfterHit
Installation
Quick Start
EventDefinition.
The returned object only describes the event behavior. Placement data such as id, x, and y
still belongs to the outer maps[].events wrapper.
Enable the module
Register the module on the server:Configure stats with the standard RPGJS API
The AI uses the event’s existing data.Health and resources
Parameters
Skills
Items and equipment
Classes
States
AI configuration
All AI options are optional:Enemy types
Enemy types affect behavior, not stats:| Type | Attack Speed | Dodge | Behavior |
|---|---|---|---|
| Aggressive | Fast | Low | Rushes player |
| Defensive | Slow | High | Counter-attacks |
| Ranged | Medium | Medium | Keeps distance |
| Tank | Slow | None | Stands ground |
| Berserker | Variable | Low | Faster when hurt |
Attack patterns
| Pattern | Description |
|---|---|
| Melee | Single attack |
| Combo | 2-3 rapid attacks |
| Charged | Wind-up, stronger attack |
| Zone | 360° area attack |
| DashAttack | Rush toward target then attack |
Use skills for attacks
Examples
Basic enemy
Mage with skills
Patrol guard
Player combat
The module handles player attacks via theaction input:
Knockback system
Knockback force is driven by the equipped weapon’sknockbackForce property: