Fixed crossbow enchant formula according to client.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment
2019-11-12 14:01:44 +00:00
parent ad66cf571e
commit 586de07c89
2 changed files with 56 additions and 8 deletions

View File

@@ -114,12 +114,18 @@ public class FuncEnchant extends AbstractFunction
{ {
if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND) if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND)
{ {
if ((type == WeaponType.BOW) || (type == WeaponType.CROSSBOW)) if (type == WeaponType.BOW)
{ {
// P. Atk. increases by 10 for bows. // P. Atk. increases by 10 for bows.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (10 * enchant) + (20 * overenchant); value += (10 * enchant) + (20 * overenchant);
} }
else if (type == WeaponType.CROSSBOW)
{
// P. Atk. increases by 7 for crossbows.
// Starting at +4, P. Atk. bonus double.
value += (7 * enchant) + (14 * overenchant);
}
else else
{ {
// P. Atk. increases by 6 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons. // P. Atk. increases by 6 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons.
@@ -139,12 +145,18 @@ public class FuncEnchant extends AbstractFunction
{ {
if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND) if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND)
{ {
if ((type == WeaponType.BOW) || (type == WeaponType.CROSSBOW)) if (type == WeaponType.BOW)
{ {
// P. Atk. increases by 8 for bows. // P. Atk. increases by 8 for bows.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (8 * enchant) + (16 * overenchant); value += (8 * enchant) + (16 * overenchant);
} }
else if (type == WeaponType.CROSSBOW)
{
// P. Atk. increases by 6 for crossbows.
// Starting at +4, P. Atk. bonus double.
value += (6 * enchant) + (12 * overenchant);
}
else else
{ {
// P. Atk. increases by 5 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons. // P. Atk. increases by 5 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons.
@@ -165,12 +177,18 @@ public class FuncEnchant extends AbstractFunction
{ {
if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND) if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND)
{ {
if ((type == WeaponType.BOW) || (type == WeaponType.CROSSBOW)) if (type == WeaponType.BOW)
{ {
// P. Atk. increases by 6 for bows. // P. Atk. increases by 6 for bows.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (6 * enchant) + (12 * overenchant); value += (6 * enchant) + (12 * overenchant);
} }
else if (type == WeaponType.CROSSBOW)
{
// P. Atk. increases by 5 for crossbows.
// Starting at +4, P. Atk. bonus double.
value += (5 * enchant) + (10 * overenchant);
}
else else
{ {
// P. Atk. increases by 4 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons. // P. Atk. increases by 4 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons.
@@ -192,13 +210,19 @@ public class FuncEnchant extends AbstractFunction
switch (type) switch (type)
{ {
case BOW: case BOW:
case CROSSBOW:
{ {
// Bows increase by 4. // Bows increase by 4.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (4 * enchant) + (8 * overenchant); value += (4 * enchant) + (8 * overenchant);
break; break;
} }
case CROSSBOW:
{
// Crossbows increase by 3.
// Starting at +4, P. Atk. bonus double.
value += (3 * enchant) + (6 * overenchant);
break;
}
default: default:
{ {
// P. Atk. increases by 2 for all weapons with the exception of bows. // P. Atk. increases by 2 for all weapons with the exception of bows.

View File

@@ -114,12 +114,18 @@ public class FuncEnchant extends AbstractFunction
{ {
if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND) if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND)
{ {
if ((type == WeaponType.BOW) || (type == WeaponType.CROSSBOW)) if (type == WeaponType.BOW)
{ {
// P. Atk. increases by 10 for bows. // P. Atk. increases by 10 for bows.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (10 * enchant) + (20 * overenchant); value += (10 * enchant) + (20 * overenchant);
} }
else if (type == WeaponType.CROSSBOW)
{
// P. Atk. increases by 7 for crossbows.
// Starting at +4, P. Atk. bonus double.
value += (7 * enchant) + (14 * overenchant);
}
else else
{ {
// P. Atk. increases by 6 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons. // P. Atk. increases by 6 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons.
@@ -139,12 +145,18 @@ public class FuncEnchant extends AbstractFunction
{ {
if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND) if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND)
{ {
if ((type == WeaponType.BOW) || (type == WeaponType.CROSSBOW)) if (type == WeaponType.BOW)
{ {
// P. Atk. increases by 8 for bows. // P. Atk. increases by 8 for bows.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (8 * enchant) + (16 * overenchant); value += (8 * enchant) + (16 * overenchant);
} }
else if (type == WeaponType.CROSSBOW)
{
// P. Atk. increases by 6 for crossbows.
// Starting at +4, P. Atk. bonus double.
value += (6 * enchant) + (12 * overenchant);
}
else else
{ {
// P. Atk. increases by 5 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons. // P. Atk. increases by 5 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons.
@@ -165,12 +177,18 @@ public class FuncEnchant extends AbstractFunction
{ {
if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND) if (item.getWeaponItem().getBodyPart() == Item.SLOT_LR_HAND)
{ {
if ((type == WeaponType.BOW) || (type == WeaponType.CROSSBOW)) if (type == WeaponType.BOW)
{ {
// P. Atk. increases by 6 for bows. // P. Atk. increases by 6 for bows.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (6 * enchant) + (12 * overenchant); value += (6 * enchant) + (12 * overenchant);
} }
else if (type == WeaponType.CROSSBOW)
{
// P. Atk. increases by 5 for crossbows.
// Starting at +4, P. Atk. bonus double.
value += (5 * enchant) + (10 * overenchant);
}
else else
{ {
// P. Atk. increases by 4 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons. // P. Atk. increases by 4 for two-handed swords, two-handed blunts, dualswords, and two-handed combat weapons.
@@ -192,13 +210,19 @@ public class FuncEnchant extends AbstractFunction
switch (type) switch (type)
{ {
case BOW: case BOW:
case CROSSBOW:
{ {
// Bows increase by 4. // Bows increase by 4.
// Starting at +4, P. Atk. bonus double. // Starting at +4, P. Atk. bonus double.
value += (4 * enchant) + (8 * overenchant); value += (4 * enchant) + (8 * overenchant);
break; break;
} }
case CROSSBOW:
{
// Crossbows increase by 3.
// Starting at +4, P. Atk. bonus double.
value += (3 * enchant) + (6 * overenchant);
break;
}
default: default:
{ {
// P. Atk. increases by 2 for all weapons with the exception of bows. // P. Atk. increases by 2 for all weapons with the exception of bows.