Skip to content

TerritorySpawn

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.

VersionStatus
v92Full
v90-
v86-

Entity: territorySpawns Operations: create, update, delete, upsert, updateWhere, deleteWhere Key attributes: huntingZoneId, groupId, territoryId, npcInstanceId (composite key)


spec:
version: "1.0"
schema: v92
territorySpawns:
create:
- huntingZoneId: 400
groupId: 1
territoryId: 1
npcInstanceId: 5001
npcTemplateId: 42010
memberId: 0
desc: "Guard NPC"
pos: [150.0, 200.0, 0.0]
dir: 180
offsetZ: 0
randomPos: false
escapeLocation: [0, 0, 0]
spawnCount: 1
respawnTime: 30
conditionalSpawn: false
ai: 0
isAggressiveMonster: false
isReturn: true
returnDistance: 2000
moveInTerritory: true
viewRadius: 30
viewAngle: 360
alertRadius: 50
alertAngle: 360
questPatrol: false
aggroShareGroupId: 0
aggroSendToPartyDistance: 0
aggroSendToClanDistance: 0
aggroIgnorePartyId: ""
aggroReceiveOnlyInSight: false
spec:
version: "1.0"
schema: v92
territorySpawns:
update:
- huntingZoneId: 400
groupId: 1
territoryId: 1
npcInstanceId: 5001
changes:
respawnTime: 60
isAggressiveMonster: true
viewRadius: 40
spec:
version: "1.0"
schema: v92
territorySpawns:
delete:
- huntingZoneId: 400
groupId: 1
territoryId: 1
npcInstanceId: 5001
spec:
version: "1.0"
schema: v92
territorySpawns:
upsert:
- huntingZoneId: 400
groupId: 1
territoryId: 1
npcInstanceId: 5001
npcTemplateId: 42010
memberId: 0
desc: "Upserted NPC"
pos: [150.0, 200.0, 0.0]
dir: 180
offsetZ: 0
randomPos: false
escapeLocation: [0, 0, 0]
spawnCount: 1
respawnTime: 30
conditionalSpawn: false
ai: 0
isAggressiveMonster: false
isReturn: true
returnDistance: 2000
moveInTerritory: true
viewRadius: 30
viewAngle: 360
alertRadius: 50
alertAngle: 360
questPatrol: false
aggroShareGroupId: 0
aggroSendToPartyDistance: 0
aggroSendToClanDistance: 0
aggroIgnorePartyId: ""
aggroReceiveOnlyInSight: false

Batch-update spawns matching filter criteria across all zone files.

spec:
version: "1.0"
schema: v92
territorySpawns:
updateWhere:
- filter:
npcTemplateId: 42010
changes:
respawnTime: 15
isAggressiveMonster: true

Batch-delete spawns matching filter criteria across all zone files.

spec:
version: "1.0"
schema: v92
territorySpawns:
deleteWhere:
- filter:
npcTemplateId: 42010

AttributeTypeSinceDescription
huntingZoneIdintv92Hunting zone identifier (used for file partitioning)
groupIdintv92Parent territory group identifier
territoryIdintv92Parent territory area identifier
npcInstanceIdintv92Unique NPC instance identifier
npcTemplateIdintv92NPC template reference (from NpcData)
memberIdintv92Member group identifier
descstringv92Spawn description
posdecimal[]v92Spawn position [x, y, z]
dirdecimalv92Facing direction in degrees
offsetZintv92Vertical position offset
randomPosboolv92Use random positioning within territory
escapeLocationdecimal[]v92Escape destination [x, y, z]
spawnCountintv92Number of NPCs to spawn
respawnTimeintv92Respawn interval in seconds
conditionalSpawnboolv92Whether spawn is conditional
aiintv92AI behavior reference
isAggressiveMonsterboolv92Attacks players on sight
isReturnboolv92Returns to spawn area when leaving
returnDistanceintv92Maximum distance before returning
moveInTerritoryboolv92Moves within territory bounds
viewRadiusintv92Line of sight radius
viewAngleintv92Field of view angle in degrees
alertRadiusintv92Alert detection radius
alertAngleintv92Alert detection angle in degrees
questPatrolboolv92Uses quest patrol behavior
aggroShareGroupIdintv92Aggro sharing group (0 for none)
aggroSendToPartyDistanceintv92Aggro propagation distance to party
aggroSendToClanDistanceintv92Aggro propagation distance to clan
aggroIgnorePartyIdstringv92Party IDs to ignore for aggro
aggroReceiveOnlyInSightboolv92Only receive aggro within line of sight
AttributeTypeSinceDescription
respawnRandomTimestringv92Random variance added to respawn time
voidSpawnboolv92Void spawn mode
delaySpawnTimeWhenWorldStartintv92Spawn delay when server starts
delaySpawnRandomTimeWhenWorldStartintv92Random variance on world start delay
persistentChannelSpawnboolv92Persists across channel changes
randomSpawnProbintv92Random spawn probability (percentage)
AttributeTypeSinceDescription
canbeattackedboolv92Whether the NPC can be attacked
friendOfPlayerboolv92Allied to players
villagerboolv92Is a villager NPC
battlefieldTeamstringv92Battlefield team assignment
isFlyingboolv92Flying NPC
flyMoveSequenceIdintv92Flight movement sequence reference
canGetBuffboolv92Can receive buffs
excludeAggroLimitboolv92Bypasses aggro limit restrictions
AttributeTypeSinceDescription
peaceStateNoMovingboolv92No movement in peace state
cautionStateNoMovingboolv92No movement in caution state
isReturnMyTerritoryboolv92Returns to own territory
returnToSpawnPosboolv92Returns to exact spawn position
AttributeTypeSinceDescription
aggroCopyFromNpcstringv92Copy aggro table from another NPC
aggroCopyFromNpcDistancestringv92Distance for aggro copy
aggroSendToTerritorystringv92Propagate aggro to territory
aggroTargetIsUserOnlyboolv92Only target players
AttributeTypeSinceDescription
popupMsgstringv92Popup message on interaction
msgBroadcastingChannelboolv92Broadcast messages to channel
msgIntervalintv92Message broadcast interval
msgProbdecimalv92Message broadcast probability
AttributeTypeSinceDescription
interactionRuleIdintv92Interaction rule reference
AttributeTypeSinceDescription
patrolListnestedv92Patrol route configuration. See PatrolList.
socialSetnestedv92Social animation configuration. See SocialSet.

Defines patrol routes with waypoints and optional social animations.

AttributeTypeSinceDescription
typestringv92Patrol type
randomSocialboolv92Randomize social animations
socialDurationintv92Duration of social animations
patrolslist[Patrol]v92Patrol waypoints
AttributeTypeSinceDescription
posdecimal[]v92Waypoint position [x, y, z]
formationIdintv92Formation at this waypoint
socialslist[Social]v92Social animations at this waypoint
AttributeTypeSinceDescription
motionIdintv92Animation motion reference
dirintv92Facing direction during animation
probabilitydecimalv92Probability of playing this animation

Idle social animations played at configurable intervals.

AttributeTypeSinceDescription
checkIntervalintv92Interval between social checks
probSocialdecimalv92Probability of social animation
socialslist[Social]v92Available social animations
AttributeTypeSinceDescription
motionIdintv92Animation motion reference

TerritoryData_{huntingZoneId}.xml
└── TerritoryData (huntingZoneId)
└── TerritoryGroup (id)
└── TerritoryList
└── Territory (id)
├── Npc (instanceId, npcTemplateId, ...) [multiple]
│ ├── PatrolList (optional)
│ │ └── Patrol [multiple]
│ │ └── Social [multiple]
│ └── SocialSet (optional)
│ └── Social [multiple]
└── Party (id)
└── 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.