
public override int CalculateLeftHandSwingCount()
{
if (CanUseLefthandedWeapon == false)
return 0;
if (GetBaseSpecLevel(Specs.Left_Axe) > 0)
return 1; // always use left axe
// DW/FW chance
int specLevel = Math.Max(GetModifiedSpecLevel(Specs.Celtic_Dual), GetModifiedSpecLevel(Specs.Dual_Wield));
if (specLevel > 0 || GetBaseSpecLevel(Specs.Fist_Wraps) > 0)
{
return Util.Chance(25 + (specLevel - 1) * 68 / 100) ? 1 : 0;
}
// HtH chance
specLevel = GetModifiedSpecLevel(Specs.HandToHand);
InventoryItem attackWeapon = AttackWeapon;
InventoryItem leftWeapon = (Inventory == null) ? null : Inventory.GetItem(eInventorySlot.LeftHandWeapon);
if (specLevel > 0 && ActiveWeaponSlot == eActiveWeaponSlot.Standard
&& attackWeapon != null && attackWeapon.Object_Type == (int)eObjectType.HandToHand &&
leftWeapon != null && leftWeapon.Object_Type == (int)eObjectType.HandToHand)
{
specLevel--;
int randomChance = Util.Random(99);
int hitChance = specLevel >> 1;
if (randomChance < hitChance)
return 1; // 1 hit = spec/2
hitChance += specLevel >> 2;
if (randomChance < hitChance)
return 2; // 2 hits = spec/4
hitChance += specLevel >> 4;
if (randomChance < hitChance)
return 3; // 3 hits = spec/16
return 0;
}
return 0;
}
// calculate LA damage reduction
if (owner is GamePlayer)
{
if (owner.CanUseLefthandedWeapon && leftWeapon != null && leftWeapon.Object_Type != (int)eObjectType.Shield
&& attackWeapon != null && (attackWeapon.Item_Type == Slot.RIGHTHAND || attackWeapon.Item_Type == Slot.LEFTHAND))
{
leftHandSwingCount = owner.CalculateLeftHandSwingCount();
int LASpec = ((GamePlayer)owner).GetModifiedSpecLevel(Specs.Left_Axe);
if (LASpec > 0)
effectiveness *= 0.625 + 0.0034 * LASpec;
}
}
Return to “%s” Storm Shard: D2
Users browsing this forum: No registered users and 1 guest