> For the complete documentation index, see [llms.txt](https://titans-productions.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titans-productions.gitbook.io/documentation/redm/scripts/grave-robberies.md).

# Grave Robberies

### Creating Reward Packages

Reward Packages are used to define which items a player can receive when robbing a grave.

#### 1. Create a Package

Inside `Config.RewardPackages`, create a new package with a name of your choice:

```lua
Config.RewardPackages = {

    ['RARE'] = {

    },

}
```

The package name in this example is `RARE`.

#### 2. Add Rewards

Inside the package, add the items you want the player to receive:

```lua
Config.RewardPackages = {

    ['RARE'] = {

        {
            item = "goldcoin",
            label = "Gold Coin",
            quantity = { 1, 3 },
            chance = 100
        },

        {
            item = "goldring",
            label = "Gold Ring",
            quantity = { 1, 1 },
            chance = 50
        },

    },

}
```

#### 3. Assign the Package to a Grave

After creating the package, use its name in the grave's `type`:

```lua
[1] = {
    name = "Elsie Feeney",
    coords = vector3(1282.042, -1242.295, 79.989),
    heading = 26.0788,

    type = "RARE", <--------------

    police = true,
},
```

The important part is:

```lua
type = "RARE",
```

This tells the grave to use:

```lua
Config.RewardPackages['RARE']
```

That's it!

#### Example

```lua
Config.RewardPackages = {

    ['RARE'] = {

        {
            item = "goldcoin",
            label = "Gold Coin",
            quantity = { 1, 3 },
            chance = 100
        },

        {
            item = "goldring",
            label = "Gold Ring",
            quantity = { 1, 1 },
            chance = 50
        },

    },

}
```

Then assign it to your grave:

```lua
type = "RARE",
```

You can create as many different packages as you want, and assign different packages to different graves.

### How to add a dug object

1. Use Spooni Spooner, it is the best script for getting the correct object placements.
2. Spawn `p_gravedug03x` object on the desired grave position (To open the placed object information, select the object by pressing \[7] first, click the object and press \[TAB].
3. Get & Add the placed object x,y,z,pitch,roll and yaw positions to the desired grave on the configuration file.

<figure><img src="https://1388375997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2RtqVuE0tQRiqtUiG9D%2Fuploads%2FKcjZ5r987DnNvpa8TnF6%2Fimage.png?alt=media&amp;token=8d85d708-bbb0-426f-a287-cd471177e8ee" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1388375997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2RtqVuE0tQRiqtUiG9D%2Fuploads%2FJGQr9cMQuOHH8FEHJQIJ%2Fimage.png?alt=media&amp;token=35645641-0dfe-4bae-870d-d3c1143a8577" alt=""><figcaption></figcaption></figure>

### How to create your own grave position

### Creating Grave Locations

Each entry inside `Config.Graves` represents a grave that can be robbed.

```lua
Config.Graves = {

    [1] = {
        name = "Elsie Feeney",
        coords = vector3(1282.042, -1242.295, 79.989),
        heading = 26.0788,

        type = "DEFAULT",
        police = true,

        dug = { -- EXPLAINED ABOVE On How to add a dug object
            object = "p_gravedug03x",

            coords = { 
                x = 1280.984130859375, y = -1240.5518798828125, z = 79.14344787597656,
                pitch = 3.42614841461181, roll = -7.82416152954101, yaw = 30.85167503356933
            },

            placeOnGroundProperly = false
        },

        locationName = "Rhodes",

        blip = {
            coords = {x = -306.435, y = 769.1731, z = 123.48},
            color = 0x3F90ADF0,
            title = "Grave Robbery Area",
            radius = 10.0,
        },
    },

}
```

#### Basic Settings

| Setting   | Description                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- |
| `name`    | The name of the person buried at the grave.                                                     |
| `coords`  | The exact coordinates of the grave.                                                             |
| `heading` | The direction the grave is facing.                                                              |
| `type`    | The reward package used for this grave. This must match a package from `Config.RewardPackages`. |
| `police`  | If `true`, the grave requires the configured police requirements to be met.                     |

#### Dug Object

The `dug` section controls the object that appears after the grave has been robbed, making the grave look dug up.

**The `dug` configuration is explained in the section above.**

#### Location Name

```lua
locationName = "Rhodes",
```

The `locationName` is used for the robbery notification when the district/location cannot be detected.

For example:

> A grave robbery was witnessed: Rhodes Location.

#### Blip

The `blip` section controls the area blip that can be displayed for the grave robbery.

```lua
blip = {
    coords = {x = -306.435, y = 769.1731, z = 123.48},
    color = 0x3F90ADF0,
    title = "Grave Robbery Area",
    radius = 10.0,
},
```

| Setting  | Description                                      |
| -------- | ------------------------------------------------ |
| `coords` | The position where the blip should be displayed. |
| `color`  | The blip modifier/color.                         |
| `title`  | The name displayed for the blip.                 |
| `radius` | The radius of the blip area.                     |

The blip coordinates can be different from the actual grave coordinates. This allows you to show the robbery area without revealing the exact grave location.

### How to add webhooks?

For enabling the webhooks, the configuration option is the `Config.Webhooking`.

Click [here](https://titans-productions.gitbook.io/documentation/redm/how-to-add-webhooks) to read all the information related of how webhooks are functional and how to setup.
