Full Version : arte this line isnt in my baseweapon.cs in 2.0
xmlspawner >>Troubleshooting >>arte this line isnt in my baseweapon.cs in 2.0


<< Prev | Next >>

Dave1969- 08-09-2006
CODE
in the AbsorbDamageAOS method around line 1173 of BaseWeapon.cs  change

   if (armor != null)
   {
    armor.OnHit(this, damage); // call OnHit to lose durability
   }
  }

  return damage;
 }


to

   if (armor != null)
   {
    armor.OnHit(this, damage); // call OnHit to lose durability

    // XmlAttachment check for OnArmorHit
    damage -= Server.Engines.XmlSpawner2.XmlAttach.OnArmorHit(attacker, defender, armorItem, this, originaldamage);
   }
  }

  return damage;
 }


ArteGordon- 08-09-2006
Here is the full AbsorbDamageAOS method taken from baseweapon.cs in the latest svn (I believe it is the same as in RC1) starting at line 1092 with those lines highlighted

QUOTE

  public virtual int AbsorbDamageAOS( Mobile attacker, Mobile defender, int damage )
  {
   bool blocked = false;

   if ( defender.Player || defender.Body.IsHuman )
   {
    blocked = CheckParry( defender );

    if ( blocked )
    {
     defender.FixedEffect( 0x37B9, 10, 16 );
     damage = 0;

     // Successful block removes the Honorable Execution penalty.
     HonorableExecution.RemovePenalty( defender );

     if ( CounterAttack.IsCountering( defender ) )
     {
      BaseWeapon weapon = defender.Weapon as BaseWeapon;

      if ( weapon != null )
       weapon.OnSwing( defender, attacker );

      CounterAttack.StopCountering( defender );
     }

     if ( Confidence.IsConfident( defender ) )
     {
      defender.SendLocalizedMessage( 1063117 ); // Your confidence reassures you as you successfully block your opponent's blow.

      double bushido = defender.Skills.Bushido.Value;

      defender.Hits += Utility.RandomMinMax( 1, (int)(bushido / 12) );
      defender.Stam += Utility.RandomMinMax( 1, (int)(bushido / 5) );
     }

     BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;

     if ( shield != null )
     {
      shield.OnHit( this, damage );
     }
    }
   }

   if ( !blocked )
   {
    double positionChance = Utility.RandomDouble();

    Item armorItem;

    if( positionChance < 0.07 )
     armorItem = defender.NeckArmor;
    else if( positionChance < 0.14 )
     armorItem = defender.HandArmor;
    else if( positionChance < 0.28 )
     armorItem = defender.ArmsArmor;
    else if( positionChance < 0.43 )
     armorItem = defender.HeadArmor;
    else if( positionChance < 0.65 )
     armorItem = defender.LegsArmor;
    else
     armorItem = defender.ChestArmor;

    IWearableDurability armor = armorItem as IWearableDurability;

    if ( armor != null )
     armor.OnHit( this, damage ); // call OnHit to lose durability
   }

   return damage;
  }