#WW# Looms and Spinning wheels now process entire stacks.
This commit is contained in:
parent
f0bb877f6a
commit
d07e5931a8
4 changed files with 116 additions and 31 deletions
|
|
@ -77,7 +77,7 @@ namespace Server.Items
|
|||
m_Cotton = cotton;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Cotton.Deleted )
|
||||
return;
|
||||
|
|
@ -101,8 +101,28 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
m_Cotton.Consume();
|
||||
wheel.BeginSpin( new SpinCallback( Cotton.OnSpun ), from, m_Cotton.Hue );
|
||||
int amount = m_Cotton.Amount;
|
||||
int hue = m_Cotton.Hue;
|
||||
|
||||
m_Cotton.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
|
||||
|
|
@ -112,4 +132,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue