Full Version : Increase Durability LOSS
xmlspawner >>Scripting Support >>Increase Durability LOSS


<< Prev | Next >>

koluch- 12-03-2006
It seems that armor and weapons last WAY to long.
We have :
* self repair and that works VERY well, ok fine
* armor and weapon durability in ResourceInfo is 0 on the metals/leathers/woods, so no bonuses there
* Exceptionally crafted items have a durability bonus, is this correct and not sure what that value is or if it dependant on the resource.

In BaseArmor.cs the innitital value calls for a 25% chance to lower durability and we tried changing that ( on our test server ) to 90
CODE

public virtual int OnHit( BaseWeapon weapon, int damageTaken )
 {
  double HalfAr = ArmorRating / 2.0;
  int Absorbed = (int)(HalfAr + HalfAr*Utility.RandomDouble());

  damageTaken -= Absorbed;
  if ( damageTaken < 0 )
   damageTaken = 0;

  if ( Absorbed < 2 )
   Absorbed = 2;
//was 25 changed to 90
  if ( 90 > Utility.Random( 100 ) ) // 25% chance to lower durability now set to 90% chance to lower
  {
   if ( Core.AOS && m_AosArmorAttributes.SelfRepair > Utility.Random( 10 ) )
   {
    HitPoints += 2;
   }
   else
   {
    int wear;

    if ( weapon.Type == WeaponType.Bashing )
     wear = Absorbed / 2;
    else
     wear = Utility.Random( 2 );

    if ( wear > 0 && m_MaxHitPoints > 0 )
    {
     if ( m_HitPoints >= wear )
     {
      HitPoints -= wear;
      wear = 0;
     }
     else
     {
      wear -= HitPoints;
      HitPoints = 0;
     }

     if ( wear > 0 )
     {
      if ( m_MaxHitPoints > wear )
      {
       MaxHitPoints -= wear;

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

  return damageTaken;
 }


And that seemed to do nothing*sigh*
Durability comes off slow as a snail,(example)= whether it is 50/120 hits and max hits or at 0/120 and the 120 starts to lower.
Weapons and armor SHOULD get the crap beat out of it and need to be repaired or replaced.

Anyone have a suggestion OR solution as to how we can make this happen.
Perhaps I am missing something in amother script that also affects the durability dropping across the board( on hits and on max hits )

Thanks!

Koluch