/*public void Unload( Mobile from ) { if ( UsesRemaining < 1 ) return; AzhuranBlowGunDarts darts = new AzhuranBlowGunDarts( UsesRemaining ); darts.Poison = m_Poison; darts.PoisonCharges = m_PoisonCharges; from.AddToBackpack( darts ); m_UsesRemaining = 0; m_PoisonCharges = 0; m_Poison = null; PoisonedFoodAttachment attachment = XmlAttach.FindAttachment( this, typeof( PoisonedFoodAttachment ) ) as PoisonedFoodAttachment; if ( attachment != null ) { PoisonedFoodAttachment attachment2 = new PoisonedFoodAttachment( attachment.Effects, attachment.PoisonDuration, attachment.PoisonActingSpeed, from ); XmlAttach.AttachTo( darts, attachment2 ); attachment.Delete(); } InvalidateProperties(); }*/ public void Unload( Mobile from ) { if( UsesRemaining < 1 ) return; AzhuranBlowGunDarts darts = new AzhuranBlowGunDarts( UsesRemaining ); from.AddToBackpack( darts ); m_UsesRemaining = 0; m_PoisonCharges = 0; m_Poison = null; PoisonedFoodAttachment attachment = XmlAttach.FindAttachment( this, typeof( PoisonedFoodAttachment ) ) as PoisonedFoodAttachment; if( attachment != null ) attachment.Delete(); InvalidateProperties(); }
public void Reload( Mobile from, AzhuranBlowGunDarts darts ) { int need = ( MaxUses - m_UsesRemaining ); if( need <= 0 ) { // You cannot add anymore AzhuranBlowGun darts from.SendLocalizedMessage( 1063330 ); } else if( darts.UsesRemaining > 0 ) { if( m_UsesRemaining > 0 ) { from.SendMessage( "Unload the darts present in the blowgun first." ); return; } if( need > darts.UsesRemaining ) need = darts.UsesRemaining; m_PoisonCharges = 0; m_Poison = null; PoisonedFoodAttachment attachment = XmlAttach.FindAttachment( this, typeof( PoisonedFoodAttachment ) ) as PoisonedFoodAttachment; if( attachment != null ) attachment.Delete(); m_UsesRemaining += need; darts.UsesRemaining -= need; if( darts.UsesRemaining <= 0 ) darts.Delete(); InvalidateProperties(); from.SendMessage( "You have reloaded your blowgun." ); } }