Overview
Item Repair allows players to restore equipment durability at NPCs. The cost is dynamically calculated based on:- Item base purchase price
- Current damage amount
- Episode version (EP5 vs EP6.4)
Repair Cost Formulas
The repair cost calculation varies depending on the episode version.Episode 5 Formula
EP5 Repair Cost Calculation
The base purchase price of the item from the item database
The current damage value of the item (lost durability)
Episode 6.4 Formula
EP6.4 Repair Cost Calculation
EP6.4 repair costs are twice as expensive as EP5 due to the divisor changing from 30.0 to 15.0.
Calculation Examples
Example 1: EP5 Repair Cost
| Parameter | Value |
|---|---|
| Item.Buy | 120,000 |
| Damage | 200 |
| Formula | (120,000 / 30.0) * (200 / 400.0) |
| Result | 2,000 gold |
Example 2: EP6.4 Repair Cost
| Parameter | Value |
|---|---|
| Item.Buy | 120,000 |
| Damage | 200 |
| Formula | (120,000 / 15.0) * (200 / 400.0) |
| Result | 4,000 gold |
Client Synchronization
Technical Details
Damage Calculation
Damage represents the loss of durability:Cost Scaling
The repair cost scales linearly with:- Item value: More expensive items cost more to repair
- Damage amount: Greater damage results in higher repair costs
Formula Breakdown
Why divide by 30.0 or 15.0?
Why divide by 30.0 or 15.0?
These divisors control the overall repair cost scaling. A smaller divisor (15.0 in EP6.4) results in higher repair costs, making equipment maintenance more expensive and serving as a gold sink.
Why divide damage by 400.0?
Why divide damage by 400.0?
This normalizes the damage value to a percentage-like scale, ensuring repair costs remain proportional regardless of the maximum durability value.
Comparison Table
| Aspect | EP5 | EP6.4 |
|---|---|---|
| Divisor | 30.0 | 15.0 |
| Relative Cost | 1x | 2x |
| Economy Impact | Lower | Higher |
| Gold Sink | Moderate | Strong |
Known Limitations
- Client Display Desync: The client endurance display doesn’t update in real-time
- Relog Required: Players must relog to see accurate repair costs
- No Client Prediction: The client cannot accurately predict repair costs before talking to an NPC
Configuration
The repair formula is hardcoded in the game service. To change between EP5 and EP6.4:- Recompile the game service with the desired formula
- The formula is located in the item repair handler
- No configuration file changes are needed
Related Features
- Item Effects: Safety charms and item protection items
- Economy: Repair costs serve as a gold sink mechanism