#WW# Looms and Spinning wheels now process entire stacks.
This commit is contained in:
parent
791f82b4d0
commit
743e84145c
4 changed files with 117 additions and 32 deletions
|
|
@ -66,8 +66,7 @@ namespace Server.Items
|
|||
{
|
||||
m_Flax = flax;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Flax.Deleted )
|
||||
return;
|
||||
|
|
@ -91,8 +90,28 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
m_Flax.Consume();
|
||||
wheel.BeginSpin( new SpinCallback( Flax.OnSpun ), from, m_Flax.Hue );
|
||||
int amount = m_Flax.Amount;
|
||||
int hue = m_Flax.Hue;
|
||||
|
||||
m_Flax.Delete();
|
||||
|
||||
wheel.BeginSpin( ( w, m, h ) =>
|
||||
{
|
||||
int totalThread = 6 * amount;
|
||||
|
||||
while ( totalThread > 0 )
|
||||
{
|
||||
int threadToGive = Math.Min( totalThread, 60000 );
|
||||
|
||||
Item spools = new SpoolOfThread( threadToGive );
|
||||
spools.Hue = h;
|
||||
m.AddToBackpack( spools );
|
||||
|
||||
totalThread -= threadToGive;
|
||||
}
|
||||
|
||||
m.SendLocalizedMessage( 1010577 ); // You put the spools of thread in your backpack.
|
||||
}, from, hue );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -102,4 +121,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue