Weapon-aligned class perks
Weapon perks reward players for using class-aligned weapons without preventing experimentation with other equipment. Unlike class passives, perks require a matching weapon and can unlock at specific levels, activate by chance, and have individual cooldowns.
Equipment restrictions
Set Enable_Class_Item_Restrictions to false in ClassesCore config and restart to allow all equipment. This also disables armor restrictions. To retain armor restrictions while allowing all weapons, leave restrictions enabled and set each class's equipmentRules.allowedWeapons to [].
Weapon perks work independently of equipment restrictions. Existing unconditional passives still apply, so remove or rebalance an old passive if replacing it with a perk.
Example configuration
Add the optional weaponPerks field to a class JSON. Existing classes without this field are unchanged.
"weaponPerks": [
{
"id": "sword_mastery",
"type": "damage_multiplier",
"weapons": ["Weapon_Sword_*"],
"minLevel": 1,
"value": 1.15
},
{
"id": "poison_strike",
"type": "target_effect",
"weapons": ["Weapon_Sword_*"],
"minLevel": 10,
"damageCauses": ["Physical"],
"effectId": "Poison",
"chance": 0.25,
"cooldownSeconds": 12
},
{
"id": "impervious",
"type": "damage_reduction",
"weapons": ["Weapon_Sword_*"],
"minLevel": 20,
"value": 0.75,
"cooldownSeconds": 25
},
{
"id": "battle_focus",
"type": "self_effect",
"weapons": ["Weapon_Sword_*"],
"minLevel": 30,
"damageCauses": ["Physical"],
"effectId": "BattleFocus",
"chance": 0.15,
"cooldownSeconds": 30
}
]This example grants sword mastery at level 1, a chance to poison enemies at level 10, periodic damage reduction at level 20, and a chance to gain a self-buff at level 30.
Note: Physical, Poison, and BattleFocus are illustrative asset IDs. Verify or replace them with exact IDs from your installed server assets before enabling these effect perks. Custom effect assets are supported.
Perk types
| Type | Description | Example |
|---|---|---|
damage_multiplier | Multiplies outgoing damage. | value: 1.15 grants 15% additional damage. |
damage_reduction | Reduces incoming damage. | value: 0.75 prevents 75% of damage on that hit. |
target_effect | Applies an EntityEffect to the NPC victim after a qualifying hit. | Poison strike. |
self_effect | Applies an EntityEffect to the attacking player after a qualifying hit. | Battle focus or regeneration. |
Multiple eligible multipliers stack multiplicatively. Effects use the duration and overlap behavior configured by the referenced EntityEffect asset.
Configuration properties
| Property | Default | Description |
|---|---|---|
id | Required | Unique perk identifier within the class. |
type | Required | One of the four supported perk types. |
weapons | Required | Item IDs, wildcard patterns, or TagCore references. |
minLevel | 1 | Minimum LevelingCore player level required. |
value | Type-dependent | Damage multiplier or fraction of incoming damage prevented. |
chance | 1.0 | Activation probability from 0 to 1; 0.25 means 25%. |
cooldownSeconds | 0 | Seconds between activations. Zero means no cooldown. |
damageCauses | Empty | Exact, case-sensitive damage cause asset IDs. |
effectId | Required for effect perks | EntityEffect asset ID to apply. |
Both effect perk types require a positive cooldown and explicit damageCauses to limit damage-over-time re-procs. Damage cause filtering is optional for damage modifiers.
Weapon matching
The current main-hand item must match at least one entry in weapons. Supported matching formats include:
- Exact item IDs, such as
Weapon_Sword_Adamantite. - Wildcard patterns, such as
Weapon_Sword_*orWeapon_*. - TagCore references.
Nonmatching weapons remain usable when permitted by equipment restrictions, but do not grant the associated perks.
Activation and cooldowns
Perks become eligible when the player meets the level requirement and holds a matching weapon. Each perk is evaluated independently during qualifying combat.
Cooldowns use monotonic wall time and are tracked per player, class, and perk ID. They survive weapon swaps, class swaps, world changes, and reconnects within the same server process, but reset on restart. Expired entries are swept opportunistically.
Failed chance rolls and missing effect assets do not consume cooldown. Damage modifiers consume cooldown in the filter phase, so a later filter could still cancel the hit. Effects run in the inspect phase after filters.
Already applied timed effects retain their asset-defined duration even if the player switches weapons or classes.
Current limitations
- Only player-to-NPC and NPC-to-player entity-source damage is eligible. PvP and environmental damage are excluded.
- Weapon matching uses the held weapon at damage processing time, not the original projectile launch weapon. Projectiles qualify only when their source resolves to a player.
- Effect application does not explicitly attribute subsequent damage to the player. Damage-over-time kill credit requires in-game verification.
- No custom perk UI or persistent equipped attribute modifiers are included in this revision.
In-game acceptance checks
- Disable restrictions and confirm class selection, existing passives, and unrestricted weapons still work.
- Select a class with the example and compare damage while holding matching and nonmatching weapons at level 1.
- At level 9 verify poison cannot proc. At level 10 temporarily set chance to 1 and verify a matching hit applies the effect once per cooldown, including multiple targets.
- At level 20 verify the first qualifying incoming NPC hit is reduced, subsequent hits during cooldown are normal, and swapping weapons or reconnecting does not reset it.
- At level 29 verify Battle Focus cannot proc. At level 30 temporarily set chance to 1 and verify a matching hit applies the effect to the attacker, not the target, once per cooldown. Confirm the effect retains its configured duration after swapping weapons.
- Verify another class, PvP, and environmental damage do not activate the example perks. Verify effect IDs, kill credit, projectiles, and interactions with LevelingCore damage filters.
- Reload class definitions and confirm new eligibility rules take effect. Verify old JSON without perks still loads and duplicate IDs or invalid ranges are rejected.
