TerritoryGroup
Overview
Section titled “Overview”TerritoryData files define territory groups: top-level containers that hold territory areas and AI behaviors. Each hunting zone has its own file using the naming convention TerritoryData_{huntingZoneId}.xml.
Version Support
Section titled “Version Support”| Version | Status |
|---|---|
| v92 | Full |
| v90 | - |
| v86 | - |
DSL Support
Section titled “DSL Support”Entity: territoryGroups
Operations: create, update, delete, upsert
Key attributes: huntingZoneId, groupId (composite key)
Quick Recipes
Section titled “Quick Recipes”Create
Section titled “Create”spec: version: "1.0" schema: v92
territoryGroups: create: - huntingZoneId: 400 groupId: 1 desc: "Field Boss Group" berserkAi: working: true berserkRate: 0.3 combatRatioDiffToBerserk: 0.5 duration: 60Update
Section titled “Update”spec: version: "1.0" schema: v92
territoryGroups: update: - huntingZoneId: 400 groupId: 1 changes: desc: "Updated Boss Group" respawnTimeAi: working: true combatRateToReduceRespawnTime: 0.8 respawnReduceTime: 10.0 duration: 120Delete
Section titled “Delete”spec: version: "1.0" schema: v92
territoryGroups: delete: - huntingZoneId: 400 groupId: 1Upsert
Section titled “Upsert”spec: version: "1.0" schema: v92
territoryGroups: upsert: - huntingZoneId: 400 groupId: 1 desc: "Upserted Group"Properties Reference
Section titled “Properties Reference”Required Attributes
Section titled “Required Attributes”| Attribute | Type | Since | Description |
|---|---|---|---|
huntingZoneId | int | v92 | Hunting zone identifier (used for file partitioning) |
groupId | int | v92 | Unique group identifier within the zone |
desc | string | v92 | Group description |
Optional Attributes (AI Behaviors)
Section titled “Optional Attributes (AI Behaviors)”| Attribute | Type | Since | Description |
|---|---|---|---|
berserkAi | nested | v92 | Berserk AI behavior configuration. See BerserkAi. |
blastRegenAi | nested | v92 | Blast regen AI behavior configuration. See BlastRegenAi. |
doorAiList | nested | v92 | Door AI behavior configuration. See DoorAiList. |
respawnTimeAi | nested | v92 | Respawn time AI behavior configuration. See RespawnTimeAi. |
spawnNewNpcAi | nested | v92 | Spawn new NPC AI behavior configuration. See SpawnNewNpcAi. |
Nested Elements
Section titled “Nested Elements”BerserkAi
Section titled “BerserkAi”Triggers berserk mode when combat conditions are met.
| Attribute | Type | Since | Description |
|---|---|---|---|
working | bool | v92 | Whether the AI behavior is active |
berserkRate | decimal | v92 | Berserk activation threshold rate |
combatRatioDiffToBerserk | decimal | v92 | Combat ratio difference that triggers berserk |
duration | int | v92 | Berserk duration in seconds |
BlastRegenAi
Section titled “BlastRegenAi”Controls blast regeneration based on spawn ratios.
| Attribute | Type | Since | Description |
|---|---|---|---|
working | bool | v92 | Whether the AI behavior is active |
checkType | string | v92 | Type of check to perform |
intervalToBlastRegen | int | v92 | Interval between regeneration checks |
spawnedRatioToBlastRegen | decimal | v92 | Spawn ratio threshold for regeneration |
DoorAiList
Section titled “DoorAiList”Manages door opening mechanics based on NPC death conditions.
| Attribute | Type | Since | Description |
|---|---|---|---|
doorAis | list[DoorAi] | v92 | List of door AI entries |
DoorAi
Section titled “DoorAi”| Attribute | Type | Since | Description |
|---|---|---|---|
working | bool | v92 | Whether the AI behavior is active |
allNpcDied | bool | v92 | Triggers when all NPCs have died |
deadNpcInstanceId | int | v92 | Specific NPC instance whose death triggers the door |
openDoorId | int | v92 | Door ID to open |
RespawnTimeAi
Section titled “RespawnTimeAi”Dynamically adjusts respawn timers based on combat activity.
| Attribute | Type | Since | Description |
|---|---|---|---|
working | bool | v92 | Whether the AI behavior is active |
combatRateToReduceRespawnTime | decimal | v92 | Combat rate threshold for respawn reduction |
respawnReduceTime | decimal | v92 | Amount of time to reduce from respawn |
duration | int | v92 | Duration of the effect |
SpawnNewNpcAi
Section titled “SpawnNewNpcAi”Spawns additional NPCs when death count thresholds are reached.
| Attribute | Type | Since | Description |
|---|---|---|---|
working | bool | v92 | Whether the AI behavior is active |
npcDeadCount | int | v92 | NPC death count threshold |
duration | int | v92 | Duration of the effect |
XML Structure
Section titled “XML Structure”TerritoryData files use a zone-partitioned structure:
TerritoryData_{huntingZoneId}.xml└── TerritoryData (huntingZoneId) └── TerritoryGroup (id, desc) [multiple] ├── BerserkAi (optional) ├── BlastRegenAi (optional) ├── DoorAiList (optional) │ └── DoorAi [multiple] ├── RespawnTimeAi (optional) ├── SpawnNewNpcAi (optional) └── TerritoryList └── Territory [multiple] → see TerritoryAreaCommon Pitfalls
Section titled “Common Pitfalls”-
Zone partitioning: Territory groups are stored in zone-specific files. The
huntingZoneIddetermines which file is modified. -
Composite key: Groups are identified by both
huntingZoneIdANDgroupId. -
AI element replacement: When updating AI behaviors via
changes, the entire nested element is replaced, not merged. Include all fields of the AI element.