private ItemInstance CalcEnhancement(ItemInstance itemInstance) { //Temporary ItemLibrary.CSV lookup until Item_decrypted.csv and Table are fully mapped/ populated //server.settingRepository.itemLibrary.TryGetValue(itemInstance.baseId, out ItemLibrarySetting itemLibrarySetting); //if (itemLibrarySetting != null) { //itemInstance.maximumDurability = itemLibrarySetting.durability; //Temporary until we get durability in itemLibrary if (itemInstance.currentDurability > itemInstance.maximumDurability) { itemInstance.currentDurability = itemInstance.maximumDurability; } if (itemInstance.weight == 0) { itemInstance.weight += 1234; } if (itemInstance.type == ItemType.SHIELD_LARGE || itemInstance.type == ItemType.SHIELD_MEDIUM || itemInstance.type == ItemType.SHIELD_SMALL) { if (itemInstance.gp == 0) { itemInstance.gp += 50; } if (itemInstance.maximumDurability <= 0) { itemInstance.maximumDurability = 55; } } } //update items base stats per enchantment level. ForgeMultiplier forgeMultiplier = LoginLoadMultiplier(itemInstance.enhancementLevel); itemInstance.physical = (short)(itemInstance.physical * forgeMultiplier.factor); itemInstance.magical = (short)(itemInstance.magical * forgeMultiplier.factor); itemInstance.maximumDurability = (short)(itemInstance.maximumDurability * forgeMultiplier.durability); itemInstance.hardness = (byte)(itemInstance.hardness + forgeMultiplier.hardness); itemInstance.weight = (short)(itemInstance.weight - forgeMultiplier.weight); if (itemInstance.weight < 0) { itemInstance.weight = 0; } return(itemInstance); }
//also exists in itemservice. needs to match public ForgeMultiplier LoginLoadMultiplier(int level) { double factor = 1; double durability = 1; int hardness = 0; switch (level) { case 0: factor = 1.00; durability = 1.0; hardness = 0; break; case 1: factor = 1.05; durability = 1.1; hardness = 0; break; case 2: factor = 1.16; durability = 1.2; hardness = 0; break; case 3: factor = 1.29; durability = 1.3; hardness = 0; break; case 4: factor = 1.45; durability = 1.4; hardness = 0; break; case 5: factor = 1.67; durability = 1.5; hardness = 1; break; case 6: factor = 1.92; durability = 1.6; hardness = 0; break; case 7: factor = 2.20; durability = 1.7; hardness = 0; break; case 8: factor = 2.54; durability = 1.8; hardness = 0; break; case 9: factor = 2.91; durability = 1.9; hardness = 0; break; case 10: factor = 3.35; durability = 2.0; hardness = 2; break; } ForgeMultiplier forgeMultiplier = new ForgeMultiplier(); forgeMultiplier.factor = factor; forgeMultiplier.durability = durability; forgeMultiplier.hardness = hardness; forgeMultiplier.weight = 100; //toDo return(forgeMultiplier); }
public ForgeMultiplier ForgeMultiplier(int level) { double factor = 1; double durability = 1; int hardness = 0; switch (level) { case 0: factor = 1.00; durability = 1.0; hardness = 0; break; case 1: factor = 1.05; durability = 1.1; hardness = 0; break; case 2: factor = 1.10; durability = 1.1; hardness = 0; break; case 3: factor = 1.12; durability = 1.1; hardness = 0; break; case 4: factor = 1.12; durability = 1.1; hardness = 0; break; case 5: factor = 1.15; durability = 1.1; hardness = 1; break; case 6: factor = 1.15; durability = 1.1; hardness = 0; break; case 7: factor = 1.15; durability = 1.1; hardness = 0; break; case 8: factor = 1.15; durability = 1.1; hardness = 0; break; case 9: factor = 1.15; durability = 1.1; hardness = 0; break; case 10: factor = 1.15; durability = 1.1; hardness = 1; break; default: factor = 1.00; durability = 1.0; hardness = 0; break; } ForgeMultiplier forgeMultiplier = new ForgeMultiplier(); forgeMultiplier.factor = factor; forgeMultiplier.durability = durability; forgeMultiplier.hardness = hardness; forgeMultiplier.weight = 100; //toDo return(forgeMultiplier); }