public Item Mutate( Mobile from, int luckChance, Item item )
{
if ( item != null )
{
if ( item is BaseWeapon && 1 > Utility.Random( 100 ) )
{
item.Delete();
item = new FireHorn();
return item;
}
if ( item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat )
{
int bonusProps = GetBonusProperties();
if ( bonusProps < m_MaxProps && LootPack.CheckLuck( luckChance ) )
++bonusProps;
int props = 1 + bonusProps;
// Make sure we're not spawning items with 6 properties.
if ( props > m_MaxProps )
props = m_MaxProps;
if ( item is BaseWeapon )
BaseRunicTool.ApplyAttributesTo( (BaseWeapon) item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
else if ( item is BaseArmor )
BaseRunicTool.ApplyAttributesTo( (BaseArmor) item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
else if ( item is BaseJewel )
BaseRunicTool.ApplyAttributesTo( (BaseJewel) item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
else if ( item is BaseHat )
BaseRunicTool.ApplyAttributesTo( (BaseHat) item, false, luckChance, props, m_MinIntensity, m_MaxIntensity );
}
else if ( item is BaseInstrument )
{
SlayerName slayer = SlayerName.None;
slayer = BaseRunicTool.GetRandomSlayer();
if ( slayer == SlayerName.None )
{
item.Delete();
return null;
}
BaseInstrument instr = (BaseInstrument) item;
instr.Slayer = slayer;
}
if ( item.Stackable )
item.Amount = m_Quantity.Roll();
}
return item;
}