#WW# Looms and Spinning wheels now process entire stacks.

This commit is contained in:
WarrentyExpired 2026-08-07 19:37:23 -04:00
parent f0bb877f6a
commit d07e5931a8
4 changed files with 116 additions and 31 deletions

View file

@ -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
}
}
}
}
}