> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/suspendbattle.md).

# npc.suspendbattle

```lua
npc.suspendbattle()
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0069`                          |
| arguments               | 0                                 |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 1490 calls in 532 of 1114 scripts |

## What it does

Pauses the battle in progress: a running action is cancelled and the field's fight holds.

## Timing

Returns at once.

## In NPC Kit

A talk doesn't stop a fight. Vanilla pauses it only away from towns (`if (!istownmap())`) and only in 27 talks besides the save crystals: `suspendbattle()` at the start of the talk, [resumebattle](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/resumebattle.md) at the end. The kit can't test `istownmap` in the script: decide in Lua or by the map you place the NPC on.

## Used with

* [resumebattle](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/resumebattle.md): always paired.

## Example

A hunter in a field area, where foes may be fighting the party. Vanilla's order: the battle is paused before the HUD goes and control is taken, and resumed before control comes back, so it goes ahead of `talkOpen` and of `talkClose` (which holds the `ucon`).

```lua
local packs = [[
Careful, friend, the wolves here hunt in packs.
Never fight them alone, and never after dark.
]]

npc.add {
    id = "npckit_0040",
    map = 132,             -- The Yoma, a field map: decide it here, the script can't test istownmap
    name = "NPCKit 0040",
    init = function() placeNpc(0x006E0019, 10.0, 0.0, 20.0, 0.0); end,
    main = function() npc.wait(90); end,

    talk = function()
        npc.suspendbattle();
        talkOpen();
        npc.lua(function(handle)
            say(handle, packs)
        end);
        npc.resumebattle();
        talkClose();
    end,
}
```

On a town map leave both calls out: there is no battle to pause.

## Pitfalls

* `resumebattle` must run on every way out: record it after the `npc.lua`, where it runs whichever way the talk's Lua finishes.
* Not tested on a kit NPC.
