TerritoryData files define territory spawns : individual NPC spawn entries within territory areas. Each spawn configures an NPC’s position, behavior, aggro rules, patrol routes, and social animations. Spawns can exist directly under a territory or within a party group.
Version Status v92 Full v90 - v86 -
Entity: territorySpawns
Operations: create, update, delete, upsert, updateWhere, deleteWhere
Key attributes: huntingZoneId, groupId, territoryId, npcInstanceId (composite key)
escapeLocation : [ 0 , 0 , 0 ]
isAggressiveMonster : false
aggroSendToPartyDistance : 0
aggroSendToClanDistance : 0
aggroReceiveOnlyInSight : false
isAggressiveMonster : true
escapeLocation : [ 0 , 0 , 0 ]
isAggressiveMonster : false
aggroSendToPartyDistance : 0
aggroSendToClanDistance : 0
aggroReceiveOnlyInSight : false
Batch-update spawns matching filter criteria across all zone files.
isAggressiveMonster : true
Batch-delete spawns matching filter criteria across all zone files.
Attribute Type Since Description huntingZoneIdintv92 Hunting zone identifier (used for file partitioning) groupIdintv92 Parent territory group identifier territoryIdintv92 Parent territory area identifier npcInstanceIdintv92 Unique NPC instance identifier npcTemplateIdintv92 NPC template reference (from NpcData) memberIdintv92 Member group identifier descstringv92 Spawn description posdecimal[]v92 Spawn position [x, y, z] dirdecimalv92 Facing direction in degrees offsetZintv92 Vertical position offset randomPosboolv92 Use random positioning within territory escapeLocationdecimal[]v92 Escape destination [x, y, z] spawnCountintv92 Number of NPCs to spawn respawnTimeintv92 Respawn interval in seconds conditionalSpawnboolv92 Whether spawn is conditional aiintv92 AI behavior reference isAggressiveMonsterboolv92 Attacks players on sight isReturnboolv92 Returns to spawn area when leaving returnDistanceintv92 Maximum distance before returning moveInTerritoryboolv92 Moves within territory bounds viewRadiusintv92 Line of sight radius viewAngleintv92 Field of view angle in degrees alertRadiusintv92 Alert detection radius alertAngleintv92 Alert detection angle in degrees questPatrolboolv92 Uses quest patrol behavior aggroShareGroupIdintv92 Aggro sharing group (0 for none) aggroSendToPartyDistanceintv92 Aggro propagation distance to party aggroSendToClanDistanceintv92 Aggro propagation distance to clan aggroIgnorePartyIdstringv92 Party IDs to ignore for aggro aggroReceiveOnlyInSightboolv92 Only receive aggro within line of sight
Attribute Type Since Description respawnRandomTimestringv92 Random variance added to respawn time voidSpawnboolv92 Void spawn mode delaySpawnTimeWhenWorldStartintv92 Spawn delay when server starts delaySpawnRandomTimeWhenWorldStartintv92 Random variance on world start delay persistentChannelSpawnboolv92 Persists across channel changes randomSpawnProbintv92 Random spawn probability (percentage)
Attribute Type Since Description canbeattackedboolv92 Whether the NPC can be attacked friendOfPlayerboolv92 Allied to players villagerboolv92 Is a villager NPC battlefieldTeamstringv92 Battlefield team assignment isFlyingboolv92 Flying NPC flyMoveSequenceIdintv92 Flight movement sequence reference canGetBuffboolv92 Can receive buffs excludeAggroLimitboolv92 Bypasses aggro limit restrictions
Attribute Type Since Description peaceStateNoMovingboolv92 No movement in peace state cautionStateNoMovingboolv92 No movement in caution state isReturnMyTerritoryboolv92 Returns to own territory returnToSpawnPosboolv92 Returns to exact spawn position
Attribute Type Since Description aggroCopyFromNpcstringv92 Copy aggro table from another NPC aggroCopyFromNpcDistancestringv92 Distance for aggro copy aggroSendToTerritorystringv92 Propagate aggro to territory aggroTargetIsUserOnlyboolv92 Only target players
Attribute Type Since Description popupMsgstringv92 Popup message on interaction msgBroadcastingChannelboolv92 Broadcast messages to channel msgIntervalintv92 Message broadcast interval msgProbdecimalv92 Message broadcast probability
Attribute Type Since Description interactionRuleIdintv92 Interaction rule reference
Attribute Type Since Description patrolListnestedv92 Patrol route configuration. See PatrolList . socialSetnestedv92 Social animation configuration. See SocialSet .
Defines patrol routes with waypoints and optional social animations.
Attribute Type Since Description typestringv92 Patrol type randomSocialboolv92 Randomize social animations socialDurationintv92 Duration of social animations patrolslist[Patrol]v92 Patrol waypoints
Attribute Type Since Description posdecimal[]v92 Waypoint position [x, y, z] formationIdintv92 Formation at this waypoint socialslist[Social]v92 Social animations at this waypoint
Attribute Type Since Description motionIdintv92 Animation motion reference dirintv92 Facing direction during animation probabilitydecimalv92 Probability of playing this animation
Idle social animations played at configurable intervals.
Attribute Type Since Description checkIntervalintv92 Interval between social checks probSocialdecimalv92 Probability of social animation socialslist[Social]v92 Available social animations
Attribute Type Since Description motionIdintv92 Animation motion reference
TerritoryData_{huntingZoneId}.xml
└── TerritoryData (huntingZoneId)
├── Npc (instanceId, npcTemplateId, ...) [multiple]
│ ├── PatrolList (optional)
│ │ └── Patrol [multiple]
│ │ └── Social [multiple]
│ └── SocialSet (optional)
└── Npc (instanceId, npcTemplateId, ...) [multiple]
Composite key: Spawns are identified by huntingZoneId, groupId, territoryId, AND npcInstanceId. For party-nested spawns, partyId is also part of the key.
Party vs standalone spawns: NPCs can exist directly under a Territory or under a Party within a Territory. The partyId key attribute distinguishes these cases.
updateWhere scope: The updateWhere operation scans all TerritoryData_*.xml files in the base path. Use filters carefully to avoid unintended changes across zones.
deleteWhere scope: Same as updateWhere — operates across all zone files. Filtered elements are removed from wherever they match.
Coordinate format: Position values (pos, escapeLocation) use [x, y, z] array format in YAML, serialized as "x, y, z" string format in XML.
Operation ordering: When combining updateWhere, explicit update, and delete operations in the same spec, updateWhere runs first, then update (which can override), then delete.