Hey guys,

Need a bit of help here.

I would like to make it so the players can recover more arrows/bolts than default.
Do you know if there is any line that defines a chance or % ammount of the ammo recovered?
I can't find it.

Thanks!
 
Thank you for the answer.
Still I can't see where it defines the chance or amount of ammo recovered.

public override void OnHit(Mobile attacker, IDamageable damageable, double damageBonus)
{
if (AmmoType != null && attacker.Player && damageable is Mobile && !((Mobile)damageable).Player && (((Mobile)damageable).Body.IsAnimal || ((Mobile)damageable).Body.IsMonster) &&
0.4 >= Utility.RandomDouble())
{
((Mobile)damageable).AddToBackpack(Ammo);
}

if (Core.ML && m_Velocity > 0)
{
int bonus = (int)attacker.GetDistanceToSqrt(damageable);

if (bonus > 0 && m_Velocity > Utility.Random(100))
{
AOS.Damage(damageable, attacker, bonus * 3, 100, 0, 0, 0, 0);

if (attacker.Player)
{
attacker.SendLocalizedMessage(1072794); // Your arrow hits its mark with velocity!
}

if (damageable is Mobile && ((Mobile)damageable).Player)
{
((Mobile)damageable).SendLocalizedMessage(1072795); // You have been hit by an arrow with velocity!
}
}
}

base.OnHit(attacker, damageable, damageBonus);
}
 
Back