> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-duel-arena-system/npc-outlaws.md).

# NPC Outlaw Duels

Practise RedM duels against NPC outlaws. Four difficulty levels with reaction times, accuracy, false starts and bounty rewards.

The **NPC Duels** tab lets a player call out an outlaw instead of another player. It is the place to learn the timing before stepping into a ranked duel.

## The four outlaws

| Level     | Outlaw           | Reaction | Accuracy | False start chance | Bounty |
| --------- | ---------------- | -------- | -------- | ------------------ | ------ |
| Greenhorn | Drunk Drifter    | 0.640 s  | 42%      | 12%                | $5     |
| Gunhand   | Cattle Rustler   | 0.470 s  | 60%      | 7%                 | $12    |
| Deadshot  | Bounty Hunter    | 0.355 s  | 76%      | 3%                 | $25    |
| Legend    | The Man in Black | 0.265 s  | 88%      | 1%                 | $50    |

* **Reaction** is the average time the outlaw takes to draw after the signal. Every round it varies by up to the level's `jitter` either way, so the outlaw is never perfectly predictable.
* **Accuracy** is the outlaw's shooting accuracy once it has drawn.
* **False start chance** is how often the outlaw draws early. The false start rules of the duel apply to it like to a player.
* **Bounty** is paid when the player wins the match.

The player picks the mode, weapon and arena. Everything else works exactly like a duel against a player: the walk out, the countdown, the signal and the rounds.

## Bounties

A level pays its bounty once every 10 minutes per player. Winning again inside that time counts the win but pays nothing, and the menu shows when the bounty is available again.

```lua
Config.Npc = {
    rewardCooldown = 600,   -- seconds before the same level pays a reward again
    ...
}
```

## What an outlaw duel counts for

* NPC duels are **never ranked** and never carry a wager.
* They do not count as wins or losses on the leaderboard.
* They do count for draw times, accuracy, headshots and most achievements. Beating the Legend unlocks **Legend Slayer**.
* The menu shows how many times the player has beaten each level.

## Adding or changing an outlaw

```lua
{ id = 'gunhand', model = 'g_m_m_unibanditos_01', portrait = 'javier',
  stars = 2, reaction = 470, jitter = 90, accuracy = 0.60, foul = 0.07, reward = 12, rating = 1300 },
```

The texts on the card come from the [language file](/script-documentation/cas-duel-arena-system/languages.md), by the level's id:

```lua
npc_gunhand_name  = 'Gunhand',
npc_gunhand_foe   = 'Cattle Rustler',
npc_gunhand_blurb = 'Knows which end of the gun to hold. Steady enough.',
```

| Field      | Meaning                                                                                                            |
| ---------- | ------------------------------------------------------------------------------------------------------------------ |
| `id`       | Unique id. Do not change it once players have fought the level.                                                    |
| `name`     | Optional. Difficulty name shown on the card. Without it: `npc_<id>_name` from the language file.                   |
| `foe`      | Optional. The outlaw's name. Without it: `npc_<id>_foe`.                                                           |
| `model`    | Any RDR3 ped model name.                                                                                           |
| `portrait` | Portrait shown in the menu: `arthur`, `john`, `sadie`, `micah`, `charles`, `javier`, `dutch`, `bill` or `unknown`. |
| `stars`    | Difficulty stars from 1 to 4.                                                                                      |
| `reaction` | Average draw time in milliseconds.                                                                                 |
| `jitter`   | Random variation of the draw time in milliseconds.                                                                 |
| `accuracy` | Shooting accuracy from 0 to 1.                                                                                     |
| `foul`     | Chance of a false start from 0 to 1.                                                                               |
| `reward`   | Bounty in dollars.                                                                                                 |
| `rating`   | Rating shown for the outlaw and used for spectator odds.                                                           |
| `blurb`    | Optional. One line shown on the card. Without it: `npc_<id>_blurb`.                                                |

## Who can see the outlaw

The outlaw is spawned by the challenger's game and shared with everyone in the match's routing bucket, so spectators see it too. If your server uses entity lockdown to stop clients creating entities, the outlaw falls back to a local ped that only the challenger can see. The duel still works; spectators just will not see the outlaw.
