Yvan Major

Member
Where can we set the use of items?

I am just back from OSI-Atlantic and it seem the items are getting used much faster than on OSI and so i want to lower the speed its using.

Have crafted a golden chainmail leggings... Killed 3-4 fan dancers, few low mobs, 1 daemon and on the succubus my leggings are 0/51.

It is by far different from OSI.

Thanks for any help.
 
I noticed it too. I had a brand new shield 250/250, fought fan dancers for a while (a few hundred? however long it takes to get 4 Tots). and the shield was at 0/250. Odd part was the rest of the armor and my sword took no damage. The shield took it all.
 
If i understand it correctly the item got 25% chances to get durability loss ? How many hits are reduce each time ?


Code:
            if (25 > Utility.Random(100)) // 25% chance to lower durability
            {
                if (Core.AOS && this.m_AosArmorAttributes.SelfRepair + (this.IsSetItem && this.m_SetEquipped ? this.m_SetSelfRepair : 0) > Utility.Random(10))
                {
                    this.HitPoints += 2;
                }
 
We reduced that chance by a lot because 1 barracoon were able to destroy a 255\255 weapon as sampire. Would be nice if we get it acurate to EA
 
We reduced that chance by a lot because 1 barracoon were able to destroy a 255\255 weapon as sampire. Would be nice if we get it acurate to EA

You know where we can see the amount of durability the item can be reduce from x to x ?
 
You know where we can see the amount of durability the item can be reduce from x to x ?
We lowered the chance on TC until it feels better, its still not perfect but compared to vanilla justuo\servuo much better.


Code:
using Server.Items;
using Server.Mobiles;
using Server.Network;

namespace Server.Interfaces
{
  public interface IDestructible
  {
  int HitPoints { get; set; }
  int MaxHitPoints { get; set; }
  }

  public static class IDestructibleExt
  {
  public static double Destructchance { get { return 0.05; } }

  public static bool HandleDurability(this IDestructible item, BaseWeapon weapon, int Absorbed)
  {
  if (Utility.RandomDouble() <= Destructchance)
  {
  if (item is BaseArmor)
  {
  var ba = (BaseArmor)item;
  var sr = ba.ArmorAttributes.SelfRepair + (ba.IsSetItem && ba.SetEquipped ? ba.SetSelfRepair : 0);
  if (sr > Utility.RandomMinMax(0, 9))
  ba.HitPoints += 2;
  else
  {
  int wear;

  if (weapon.Type == WeaponType.Bashing)
  wear = Absorbed / 2;
  else
  wear = Utility.RandomMinMax(0, 1);

  if (wear > 0 && ba.MaxHitPoints > 0)
  {
  if (ba.HitPoints >= wear)
  {
  ba.HitPoints -= wear;
  wear = 0;
  }
  else
  {
  wear -= ba.HitPoints;
  ba.HitPoints = 0;
  }

  if (wear > 0)
  {
  if (ba.MaxHitPoints > wear)
  {
  ba.MaxHitPoints -= wear;

  if (ba.Parent is Mobile)
  ((Mobile)ba.Parent).LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061121);  // Your equipment is severely damaged.
  }
  else
  {
  ba.Delete();
  }
  }
  }
  }
  }
  else if (item is BaseWeapon)
  {

  }
  }


  return true;
  }

  public static bool HandleDurability(this IDestructible item, Mobile attacker, Mobile defender)
  {
  if ((item.MaxHitPoints > 0) && (item is BaseWeapon))
  {
  var bw = (BaseWeapon)item;

  var doaction = (defender is Slime || defender is ToxicElemental || defender is CorrosiveSlime || (Utility.RandomDouble() <= Destructchance));

  if ((bw.MaxRange <= 1) && (doaction))
  {

  if (bw.MaxRange <= 1 && (defender is Slime || defender is ToxicElemental || defender is CorrosiveSlime))
  {
  attacker.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500263); // *Acid blood scars your weapon!*
  }

  var sr = bw.WeaponAttributes.SelfRepair + (bw.IsSetItem && bw.SetEquipped ? bw.SetSelfRepair : 0);
  if (sr > Utility.RandomMinMax(0, 9))
  bw.HitPoints += 2;
  else
  {

  if (bw.HitPoints > 0)
  {
  --bw.HitPoints;
  }
  else if (bw.MaxHitPoints > 1)
  {
  --bw.MaxHitPoints;

  if (bw.Parent is Mobile)
  {
  ((Mobile)bw.Parent).LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061121);// Your equipment is severely damaged.
  }
  }
  else
  {
  bw.Delete();
  }
  }
  }
  }
  return true;
  }

  }
}

Sample
 
if (25 > Utility.Random(100)) // 25% chance to lower durability

I lowered it also to 10 so it will reduce the chances. I may be wrong but i think it is the amount of hits reduced to the item that must be corrected.
 
1) we need to view Weapons and Armor different. Weapon needs lower reduction of Durability then Armor due the fact they are active in combat.
2) Certain Creatures always reduces durability such as slimes
3) The chance must be MUCH lower, if we talk about weapons, lets say you whirlwind and hit 8 creatures at once by it every 1,25s. If we take out the "always remover" and only go by chance, 8 Creatures would reduce 0-8 avg 2 durability for 1 Combat Attack. If they survice 2 hits we are down to 0 to 16 but avg of 4. If we do a champ with about 300 creatures and if we consider that not all will be down by one hit but 2-6 we could say in theory over 1000 checks will be applied on a champ. if we go by 25% chance a weapon will be down per champ.
 
Great discussion and insights! Thanks! I am going to open a GitHub issue for this so we can correct the situation, but I will leave the thread in Discussion.
 
The below is on the Durability-Refactor branch

I have refactored the way armor and weapon durability worked, and made the maths configurable so we can tweak it if need be. Here are the new mechanics. This is based on my understanding of weapon and armor durability mechanics from way back, like T2A era. So if things have changed since then someone let me know.

Each point of armor durability requires a certain amount of damage dealt to that piece of armor to deduct one point. Multiple points may be deducted at one time if sufficient damage is dealt. Macing weapons do 8x damage to armor. The number of hits per point of durability and the macing multiplier are configurable.

Each point of weapon durability requires a certain number of contacts with enemies to deduct one point. Multiple points may be deducted at one time if sufficient contacts are made. Acid-blooded enemies (hard-coded as Slime, ToxicElemental, and CorrosiveSlime, but strangely not the AcidElemental) count for 10 contacts at a time and produce a warning message. The number of contacts per point of durability and the acid-blooded multiplier are configurable.

The defaults are currently set to the following:
Code:
# How much damage a peice of armor needs to take before it takes durability
# damage.
ArmorDamagePerHp=100

# The multiplier for the amount of damage applied by macing weapons to armor.
ArmorDamageMaceMod=4.0

# How many swings a weapon must land in order to take durability damage.
WeaponSwingsPerHp=40

# The swing multiplier if the defender has acid blood.
WeaponSwingAcidMod=10

These values can be found in Config/Equipment.cfg
 
On OSi the hits reduction is never more than 1 point loss per times you've been hits, i could fight few days with armors 255/255 without repairing. The legs and tunic in here are using way too fast and losing many points of durability per times you've got hits. I dropped to 5% and even there its not in the chance the reduction is applied but in term of durability points loss that i see the differences.

I have no official results but i was doing mini champs spawn in Tomb Of King few hours a day and could pass few days before having to repair a part or 2. and like i said the parts aren't using correctly, i have to repair the legs and tunic here around 10 times before i need to repair any other parts.
 
Hello everyone!
for some reason i dont have an Equipment.cfg file?.... i manually changed it in the Base Armor but how to change it for weapons ? .... i cant find the right lines in the BaseWeapon.cs

anyone able to help?`:)
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back