> 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/additem_47f.md).

# npc.additem\_47f

```lua
npc.additem_47f(item, count, log)
```

|                         |                                                                            |
| ----------------------- | -------------------------------------------------------------------------- |
| id                      | `0x047F`                                                                   |
| arguments               | 3: Int, Int, Int                                                           |
| result                  | int: goes to the very next call, or to `npc.lua(npc.additem_47f(...), fn)` |
| in NPC Kit              | yes                                                                        |
| measured from a kit NPC | returns                                                                    |
| vanilla scripts         | 2136 calls in 94 of 1114 scripts                                           |

## What it does

Gives an item at once, with or without the battle-log line. [additem](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/additem.md) is this with `log = 1`.

## Arguments

### `item` (Int)

The id (`data/inv-*.csv`).

### `count` (Int)

How many.

### `log` (Int)

`1` writes the battle-log line, `0` gives silently. Vanilla mostly passes `0`, for key items.

## Result

The new count.

## Timing

Returns at once.

## Used with

* [additem](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/additem.md), [additemmes](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/additemmes.md), [subitem](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/subitem.md).

## Example

A key item handed over silently (`log = 0`, as vanilla does for key items), announced by the line.

```lua
local key = [[
Here, take the key. Guard it well, my friend,
for it opens a door that few have ever passed.
]]

giveKey = function()
    npc.additem_47f(0x8079, 1, 0);
end,

talk = function()
    talkOpen();
    npc.lua(function(handle)
        handle.run("giveKey", function()
            say(handle, key)
        end)
    end);
    talkClose();
end,
```
