Zone Squads - torilmud/docs GitHub Wiki

Squads

Squads are a simple way to load groups of ranked mobs. They have several advantages over loading individual mobs, including:

  • Standard sizes: Squads are loaded with preset sizes that determine the number of mobs of each rank.
  • No max load: Each squad is tracked independently and refreshed as needed at zone reset.
  • Resize: Squads can be resized via zone commands, allowing you to grow or shrink the number of mobs in each squad.
  • Re-follow: Squads members will automatically follow a new leader when their leader is killed.

The Squad file

Squads are defined in a JSON file with the naming convention zonename.squad, and bundled alongside the other area files. Here's an example file, followed by explanations of each field:

{
  "squads": [
    {
      "id": 91100,
      "name": "BG Militia",
      "npcs": [
        91552,
        91553,
        91554,
        91555
      ],
      "weapons": [
        91131,
        91132,
        91133,
        91134
      ],
      "equipment": [
        91118,
        91119,
        91120
      ],
      "flags": [
        "sentinel"
      ],
      "affects": [
        "fly"
      ],
      "templates": [
        "undead"
      ],
      "options": [
        "fixed ranks"
      ]
    }
  ]
}

Fields

  • id: The id of the squad. This should follow the vnum convention of area files. Start at your first available vnum and increment. This field will be used to load the squad in the .zon file. [Required]

  • name: The name of this squad. This will show up on stat and may be used for more things in the future. [Required]

  • npcs: List the vnums of the mobs that are a part of the squad here. The order is unimportant. [Required]

  • weapons: List the vnums of weapons here to be loaded for the squad. Each mob will randomly pick one of these weapons to wield at load time. [Optional]

  • equipment: List vnums of equipment for each mob to wear. At load time, each item here will be loaded and worn by every mob in the squad. [Optional]

  • flags: A list of NPCACT flags that will be applied to each mob in the squad at load time. Useful for making an entire squad hunters or sentinels. [Optional]

  • affects: A list of AFF flags that will be applied to each mob in the squad at load time. Useful for making an entire squad fly, breathe water, etc. [Optional]

  • templates: A list of racial templates to apply to each mob in the squad at load time. [Optional]

Ranks

Squads are composed of a pre-set number of mobs of each rank. These squad sizes are designed to deliver standardized, escalating challenges for players. The ranks of each mob are an important part of the scaling, as it allows us to increase the challenge without having to load an unwieldy number of mobs.

The available squad ranks are, in order:

  • Minion: A standard enemy.
  • Veteran: A tougher foe, with moderately increased damage output and hitpoints.
  • Elite: A tough enemy and a natural squad leader, elites have heavily boosted stats.

There are higher mob ranks, but they are reserved for non-squad mobs, like zone bosses. To set the rank on a mob, put a RANK: <rank name> line at the end of their mob file entry, like this:

#91555
watchman guard captain~
&+Lthe elite captain of the watch&N~
{{base grey}}The {{skyblue}}elite captain of the watch{{/}} stands here, keeping an eye out for trouble.&N
~
A bold black Captain's insignia decorates this watchman's uniform,
indicating his status as a leader of the city watch.  Years of battle
experience are evident through a tremendous amount of scars and burn
marks along his face, and his hardened, stony stare.
~
71305282 24 0 0 S
PH 0 0 US.U.UV
50 25 -80 50d100+2500 6d6+25
0.5.31.10 75000
131 131 1
RANK: Elite

Squad sizes

Each squad size each contain a pre-defined number of each mob rank. The table below shows the available sizes and the rank distribution of each.

Size Minions Veterans Elites
[1] Mini 1 1 0
[2] Tiny 2 1 0
[3] Small 3 1 0
[4] Medium 3 2 1
[5] Large 5 3 1
[6] Huge 6 3 2

Example: A medium sized squad will contain 3 minions, 2 veterans, and 1 elite.

Squad Formation

When loading a squad, the game will randomly choose from the npc vnums you supplied to fill out each rank. At a minimum, you'll need to define one mob of each rank for a squad. But you can also add as many minions, veterans, and elites as you like, and the game will select from them to create a random squad each time.

For example, you could define a squad with just one minion, one veteran, and three different elites, each with a different power. Each time a squad is loaded that needs an elite, a random one would be selected. This lets you create squads with a consistent theme but varying challenges.

By default, the highest ranking mob in a squad is the leader. If that leader dies, the next highest rank mobs will become the leader, and so on.

Zone commands

Squads are loaded in the .zon file with the Q command, which follows this format:

Q <if flag> <squad id> <room> <squad size>

For example, this command will load a medium sized squad 91100 in room 21:

Q 0 91100 21 4

You can also resize an existing squad with the U command, which follows this format:

U <if flag> <squad id> <room> <new size>

This one is a little more complex. Only the new size argument is required here, because this command can resize either: all squads in the zone, all squads matching the squad id in the zone, all squads in a particular room, or all squads matching the squad id in a room. Here's a few examples:

Resize all squads in zone to be large:

U 0 0 0 5

Resize all 91100 id squads to be large:

U 0 91100 0 5

Resize all 91100 id squads in room 21 to be large:

U 0 91100 21 5

Squad refresh and zone resets

Note that no max load is required for the squad loading zone command. The game will automatically keep track of the squads in your zone and will refresh them when the zone resets and your load commands are processed again. If the entire squad has been eliminated, the squad will be reloaded in its original load room.

For example. let's say you loaded a medium squad in room 21. That squad wandered around until it made to room 50, where a vengeful player killed two of the minions in the squad and then ran away. On the next zone reset, your original squad load command is processed again, and the two missing minions are reloaded and placed in the squad in its current room.

Squad options

Squads have a single special option at the moment, that can be specified in the options field.

  • Fixed ranks: When set, this will choose just one mob vnum for each rank. This creates more uniform looking squads, and can be helpful if you'd like to have a lot of different options for minions or veterans, but you only want one type for each squad.
⚠️ **GitHub.com Fallback** ⚠️