From 53228d30db946b7222c77fa8f562ab8e36efe6b0 Mon Sep 17 00:00:00 2001 From: eos Date: Sun, 1 Jul 2012 02:14:31 +0000 Subject: [PATCH] - GuillotineAddon has been marked constructable. - Guillotines will no longer flip when used during the animation. - Fixed the inverse lower ammo cost on quivers. (20% LAC counted as 80%.) - Lower ammo cost no longer works when no ammo is present at all. --- Scripts/Items/Special/Heritage Items/Guillotine.cs | 3 ++- Scripts/Items/Weapons/Ranged/BaseRanged.cs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Scripts/Items/Special/Heritage Items/Guillotine.cs b/Scripts/Items/Special/Heritage Items/Guillotine.cs index 5811513e9..58ad5b767 100644 --- a/Scripts/Items/Special/Heritage Items/Guillotine.cs +++ b/Scripts/Items/Special/Heritage Items/Guillotine.cs @@ -37,6 +37,7 @@ namespace Server.Items { public override BaseAddonDeed Deed { get { return new GuillotineDeed(); } } + [Constructable] public GuillotineAddon() : base() { AddComponent( new GuillotineComponent(), 0, 0, 0 ); @@ -87,7 +88,7 @@ namespace Server.Items public virtual void Activate( AddonComponent c, Mobile from ) { - if ( c.ItemID == 0x125E ) + if ( c.ItemID == 0x125E || c.ItemID == 0x1269 || c.ItemID == 0x1260 ) c.ItemID = 0x1269; else c.ItemID = 0x1247; diff --git a/Scripts/Items/Weapons/Ranged/BaseRanged.cs b/Scripts/Items/Weapons/Ranged/BaseRanged.cs index 5f3e7f748..565acbaf4 100644 --- a/Scripts/Items/Weapons/Ranged/BaseRanged.cs +++ b/Scripts/Items/Weapons/Ranged/BaseRanged.cs @@ -164,18 +164,24 @@ namespace Server.Items public virtual bool OnFired( Mobile attacker, Mobile defender ) { - BaseQuiver quiver = attacker.FindItemOnLayer( Layer.Cloak ) as BaseQuiver; - Container pack = attacker.Backpack; - if ( attacker.Player ) { - if ( quiver == null || quiver.LowerAmmoCost == 0 || quiver.LowerAmmoCost > Utility.Random( 100 ) ) + BaseQuiver quiver = attacker.FindItemOnLayer( Layer.Cloak ) as BaseQuiver; + Container pack = attacker.Backpack; + + if ( quiver == null || Utility.Random( 100 ) >= quiver.LowerAmmoCost ) { + // consume ammo if ( quiver != null && quiver.ConsumeTotal( AmmoType, 1 ) ) quiver.InvalidateWeight(); else if ( pack == null || !pack.ConsumeTotal( AmmoType, 1 ) ) return false; } + else if ( quiver.FindItemByType( AmmoType ) == null && ( pack == null || pack.FindItemByType( AmmoType ) == null ) ) + { + // lower ammo cost should not work when we have no ammo at all + return false; + } } attacker.MovingEffect( defender, EffectID, 18, 1, false, false );