# ItemMove

This configuration file defines movement restrictions for items, controlling what actions players can perform with specific items.

## File Location

```
GameServer/Data/Item/ItemMove.xml
```

## Dependencies

| Depends On | Purpose                   |
| ---------- | ------------------------- |
| Item.xml   | Item definitions by Index |

## How It Works

1. When player attempts an action (drop, sell, trade, vault), server checks ItemMove
2. If item is listed, uses the Allow flags from config
3. If item is NOT listed, ALL actions are allowed (default = 1)
4. Only add items here to RESTRICT certain actions

## Structure

```xml
<Item Index="7181" AllowDrop="0" AllowSell="1" AllowTrade="1"
      AllowVault="1" AllowStore="1" AllowGuildVault="1"
      Name="Jewel of Bless"/>
```

## Attributes

| Attribute         | Type   | Default | Description                                                    |
| ----------------- | ------ | ------- | -------------------------------------------------------------- |
| `Index`           | int    | -       | Item index (Category \* 512 + Type)                            |
| `AllowDrop`       | int    | 1       | 1 = can drop on ground, 0 = cannot drop ✅ WORKING              |
| `AllowSell`       | int    | 1       | 1 = can sell to NPC, 0 = cannot sell ✅ WORKING                 |
| `AllowTrade`      | int    | 1       | 1 = can trade with players, 0 = cannot trade ✅ WORKING         |
| `AllowVault`      | int    | 1       | 1 = can store in personal vault, 0 = cannot ✅ WORKING          |
| `AllowStore`      | int    | 1       | 1 = can place in personal store, 0 = cannot ⚠️ NOT IMPLEMENTED |
| `AllowGuildVault` | int    | 1       | 1 = can store in guild vault, 0 = cannot ⚠️ NOT IMPLEMENTED    |
| `Name`            | string | -       | Item name (optional, for reference)                            |

## Examples

{% tabs %}
{% tab title="Prevent Dropping" %}

```xml
<!-- Jewels cannot be dropped (prevent accidental loss) -->
<Item Index="7181" AllowDrop="0" AllowSell="1" AllowTrade="1"
      AllowVault="1" AllowStore="1" AllowGuildVault="1"
      Name="Jewel of Bless"/>
<Item Index="7182" AllowDrop="0" AllowSell="1" AllowTrade="1"
      AllowVault="1" AllowStore="1" AllowGuildVault="1"
      Name="Jewel of Soul"/>
```

Players can trade/sell/store, but cannot drop on ground.
{% endtab %}

{% tab title="Prevent Trading" %}

```xml
<!-- Wizard's Ring cannot be traded or vaulted -->
<Item Index="6676" AllowDrop="1" AllowSell="1" AllowTrade="0"
      AllowVault="0" AllowStore="1" AllowGuildVault="1"
      Name="Wizards Ring"/>

<!-- Moonstone Pendant cannot be traded -->
<Item Index="6694" AllowDrop="1" AllowSell="1" AllowTrade="0"
      AllowVault="1" AllowStore="1" AllowGuildVault="1"
      Name="Moonstone Pendant"/>
```

Bind-on-pickup style restrictions.
{% endtab %}

{% tab title="Event Item" %}

```xml
<!-- Event item - cannot trade or vault -->
<Item Index="7232" AllowDrop="1" AllowSell="0" AllowTrade="0"
      AllowVault="0" AllowStore="1" AllowGuildVault="1"
      Name="Cursed Castle Water"/>
```

Event items often have strict restrictions to prevent exploitation.
{% endtab %}

{% tab title="Fully Restricted" %}

```xml
<!-- Archangel Weapon - very restricted -->
<Item Index="6675" AllowDrop="1" AllowSell="0" AllowTrade="0"
      AllowVault="0" AllowStore="1" AllowGuildVault="1"
      Name="Absolute Weapon of Archangel"/>
```

Cannot sell, trade, or vault - only can drop or store.
{% endtab %}
{% endtabs %}

## Common Restriction Patterns

### Prevent Accidental Loss

```xml
<!-- High-value items: prevent dropping -->
AllowDrop="0" AllowSell="1" AllowTrade="1" AllowVault="1" AllowStore="1" AllowGuildVault="1"
```

### Account Bound

```xml
<!-- Character-bound: prevent trading (NOTE: AllowStore/AllowGuildVault not enforced) -->
AllowDrop="1" AllowSell="1" AllowTrade="0" AllowVault="1" AllowStore="0" AllowGuildVault="0"
```

### Event Item

```xml
<!-- Event item: prevent most actions (only Store/GuildVault not enforced) -->
AllowDrop="0" AllowSell="0" AllowTrade="0" AllowVault="0" AllowStore="0" AllowGuildVault="0"
```

### Vendor Only

```xml
<!-- Can only sell to NPC and vault (Store/GuildVault not enforced) -->
AllowDrop="0" AllowSell="1" AllowTrade="0" AllowVault="0" AllowStore="0" AllowGuildVault="0"
```

## Important Behavior

{% hint style="danger" %}
**AllowStore and AllowGuildVault NOT IMPLEMENTED**: These attributes exist in the config but are NOT enforced by the server. Players can always place items in personal stores and guild vaults regardless of these settings. Only AllowDrop, AllowSell, AllowTrade, and AllowVault are functional.
{% endhint %}

{% hint style="info" %}
**Default Allowed**: Items NOT in this file have ALL actions allowed. Only add items to this file to RESTRICT actions.
{% endhint %}

{% hint style="info" %}
**Check Functions**: Server uses CheckItemMoveAllowDrop(), CheckItemMoveAllowSell(), CheckItemMoveAllowTrade(), and CheckItemMoveAllowVault() to validate actions. CheckItemMoveAllowStore() and CheckItemMoveAllowGuildVault() exist but are never called.
{% endhint %}

{% hint style="info" %}
**Index Required**: Each entry must have a valid Index matching an item in Item.xml.
{% endhint %}

{% hint style="warning" %}
**No Default Values**: If you omit an attribute, it defaults to 1 (allowed). Be explicit about restrictions.
{% endhint %}

{% hint style="warning" %}
**Per-Item Not Per-Category**: Each item index must be listed separately. There's no wildcard support.
{% endhint %}

## Common Issues

{% hint style="danger" %}
**Store/GuildVault Restrictions Don't Work**: AllowStore and AllowGuildVault are NOT enforced by the server code. These settings are ignored and items can always be placed in personal stores and guild vaults. This is a known limitation.
{% endhint %}

{% hint style="warning" %}
**Restriction Not Working**: Verify the Index calculation matches the exact item. Check for typos in attribute names. Remember only AllowDrop, AllowSell, AllowTrade, and AllowVault are implemented.
{% endhint %}

{% hint style="warning" %}
**Action Still Allowed**: Remember omitted attributes default to 1. Explicitly set AllowX="0" for each restriction.
{% endhint %}

{% hint style="danger" %}
**Wrong Index**: Double-check Index = Category \* 512 + Type. A wrong index means the restriction applies to the wrong item (or no item).
{% endhint %}
