> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rpg-leveling.zuxaw.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Modded Weapons to a Class

> Step-by-step guide to give a class damage and effect bonuses when using weapons from another mod (e.g. lightsaber, plasma rifle).

# Add Modded Weapons to a Class

When you use a **weapon from another mod**, the game still reports an **item id** for that weapon. RPG Leveling matches that id against **weapon kinds** you define. If a kind matches and a **class** lists that kind in its `Weapons` and `Dmg`, the class bonuses (damage per level, innate stats, passives) apply when you use that weapon. This guide shows how to register a modded weapon and attach it to a specific class so the effect is applied.

***

## When does the effect apply?

* **Weapon kind** - You register a weapon kind in `ClassesGlobalConfig.json` with an **IncludedInId** string. The mod checks whether the **current weapon’s item id** (case-insensitive) **contains** that string. You do **not** need the full item id: a **part** is enough. Example: `"Wand"` matches every weapon whose id contains “Wand” (e.g. `Weapon_Wand_Wood`, `Weapon_Wand_Crystal_Flame`). If it matches, the weapon is treated as that kind.
* **Class** - The class you have selected must list that weapon kind in its **Weapons** array and in each tier’s **Dmg** object. Then:
  * **Damage bonus** - You get the class’s damage % per level for that weapon when you hit with it.
  * **Innate bonuses** - All innate stat bonuses for your class and tier apply regardless of weapon; they are not weapon-specific.
  * **Passives** - Class passives (e.g. HighGuard, LifeSteal) trigger in combat as usual when you use that weapon.

So: **register the weapon kind** → **add it to the class’s Weapons and Dmg** → when you use that modded weapon with that class, the effect is applied.

***

## Step 1: Find the modded weapon’s item id

You need the **item id** (or a unique substring) of the weapon from the other mod. Common ways to find it:

* Check the mod’s documentation or config files.
* Use in-game tools or logs if the mod or game prints item ids when you hold or use the item.
* Often the id looks like `ModName_Weapon_WeaponType_Variant` (e.g. `StarWarsMod_Weapon_Lightsaber_Blue`).

Pick a **short substring** that appears in that id and is unique enough (e.g. `Lightsaber`, `PlasmaRifle`). You will use this as **IncludedInId** so the mod can match the weapon.

***

## Step 2: Register the weapon kind

Open:

`mods/Zuxaw_RPGLeveling/Classes/ClassesGlobalConfig.json`

Find the **WeaponKinds** array and add a new entry:

```json theme={null}
{
  "IncludedInId": "Lightsaber",
  "Icon": "StarWarsMod_Weapon_Lightsaber_Blue"
}
```

* **IncludedInId** - A **part of the item id** (not mandatory to use the full id). The mod matches any weapon whose item id **contains** this string (case-insensitive). Example: `"Wand"` matches all wands (`Weapon_Wand_Wood`, `Weapon_Wand_Crystal_Flame`, etc.); `"Lightsaber"` matches modded lightsabers. This value is the **weapon kind id** you use in class configs.
* **Icon** - An item id used in the UI for this weapon kind. Prefer the mod’s actual weapon item id so the icon looks correct; if the mod doesn’t provide one, you can use any existing item id.

Save the file. After a reload (or restart), the mod will recognize this weapon kind and any class that lists it will be able to get bonuses for it.

***

## Step 3: Add the weapon to a class

Pick the **class** that should get bonuses when using this weapon (e.g. Edge for a “Jedi” style). Edit that class file:

`mods/Zuxaw_RPGLeveling/Classes/Class<Name>.json`

(e.g. `ClassEdge.json`).

1. **Weapons array** - Add the weapon kind id (same as **IncludedInId**) to the `Weapons` array.\
   Example: `"Weapons": ["Sword", "Longsword", "Spear", "Lightsaber"]`

2. **Dmg per tier** - In **every** tier (T0–T4), add a **Dmg** entry for this weapon kind with the damage % per level you want.\
   Example for one tier:\
   `"Dmg": { "Sword": 1.0, "Longsword": 0.5, "Spear": 1.0, "Lightsaber": 1.2 }`

Repeat the **Lightsaber** (or your kind id) key in **every** tier’s `Dmg` object; otherwise that tier won’t give a damage bonus for the modded weapon.

Save the file. After reload, when a player has that class and uses a weapon whose item id contains your **IncludedInId**, the class damage bonus and passives apply.

***

## Step 4 (optional): Rename the class or weapon

* **Class name/description** - Use [MessagesLanguageMapping](config-messages). Class keys are the class **Id** in lowercase (e.g. `edge`). You can rename “Edge” to “Jedi” there without changing the class file.
* **Weapon kind name** - If the mod supports custom labels for weapon kinds, check MessagesLanguageMapping or the mod’s docs; RPG Leveling uses the weapon kind for damage matching and can show the **IncludedInId** or a mapped name in the UI depending on implementation.

***

## Checklist

* [ ] You know the modded weapon’s item id (or a unique substring).
* [ ] You added a **WeaponKinds** entry in `ClassesGlobalConfig.json` with **IncludedInId** and **Icon**.
* [ ] You added that **IncludedInId** (e.g. `Lightsaber`) to the class’s **Weapons** array.
* [ ] You added the same key to **every** tier’s **Dmg** object in that class file.
* [ ] You ran `/lvl reload` or restarted the server so configs are reloaded.
* [ ] (Optional) You set the class display name/description in MessagesLanguageMapping.

***

## Example: “Lightsaber” on Edge

1. **ClassesGlobalConfig.json** - In **WeaponKinds**:
   ```json theme={null}
   { "IncludedInId": "Lightsaber", "Icon": "StarWarsMod_Weapon_Lightsaber_Blue" }
   ```

2. **ClassEdge.json** - In **Weapons**:
   ```json theme={null}
   "Weapons": ["Sword", "Longsword", "Spear", "Lightsaber"]
   ```

3. **ClassEdge.json** - In **every** tier’s **Dmg** (example for T0):
   ```json theme={null}
   "Dmg": { "Sword": 1.0, "Longsword": 0.5, "Spear": 1.0, "Lightsaber": 1.2 }
   ```

4. Optional: In **MessagesLanguageMapping**, set the class name for `edge` to “Jedi” and a matching description.

Result: When a player has Edge (or your renamed “Jedi” class) and uses a weapon whose item id contains `Lightsaber`, they get the class’s damage bonus and passives for that weapon.

***

For full class and passive field reference, see [Classes Configuration](classes-config) and [Passives Configuration](passives-config). To replace a class entirely with a custom theme, see [How to Create a Custom Class](guide-custom-class).
