quickwango/ItemRepair — Issue #5: Suggestions for the repair formula
Author: DjBuRnOuT
Created: 2012-03-10 02:27:39+00:00
State: open

I love your plugin, it's working great and everything is repairable.

However, I find you repair formula quite inacurate.
I would suggest you to take a look at the formula used in this plugin :
http://forums.bukkit.org/threads/mech-blacksmith-v1-0-3-repair-your-equipment-1000.11660/

It's the plugin I used before yours and I think that your plugin is better on every point except the formula.
Let me explain.

If we look at your config file :
You have the base cost per damage X the number of use of the tools/armors/weapons

It's creating a large gap between armors and weapons/tools since a diamond armor has 562 use and a diamond tool/weapon has 1562, it doesn't make any sense since you need more diamonds to craft an armor than a weapon/tool but it cost less to repair an armor than a weapon/tool.

So my suggestion is, if you take a look at the config of the blacksmith plugin I linked to you.

iron-base: 1600
wood-base: 250
diamond-base: 5500
stone-base: 600
gold-base: 950
use-boseconomy: false
use-iconomy: true

You can see that the cost is based on the total price for each raw material used in the tool/armor/weapon.
So let's make an exemple of what i'm talking :

We have a diamond pickaxe, it requires 3 diamonds and the base diamond cost is 5500, so the pickaxe would cost 5500x3 for a total of 16500 to repair it when it's fully damaged and the price is scaling down based on the percentage of durability on the pickaxe so basically the formula would be :
( BaseCostOfMaterial * NumberOfRawMaterialUsed ) * PercentageOfDurability = Repair Price

Let's take the same exemple with numbers in it :
The diamond pickaxe is 35% down in durability and you want to repair it.
( 5500 * 3 ) * .35 = 16500 * .35 = 5775 for the reparation.

So yea basically what your config would look like is :

debug: false
price:
iron-base: 1600
wood-base: 250
diamond-base: 5500
stone-base: 600
gold-base: 950
enchantMultiplier:
base: 0.0
factor: 0.0
repairBlocks:
singleRepair:
block: 42
completeRepair:
block: 41
cheapRepair:
block: 57
breakPercentage: 15
costPercentage: 70

I don't know what you could do to fit the enchantment multiplier in it but I think it would be pretty easy to do.

Let me know what you think about this, I think it would be a great addition to your wonderful plugin!!
Thanks for taking the time to read me.