#W# Added simple crafting queue.
This commit is contained in:
parent
9ce6874b30
commit
ac0815868e
5 changed files with 365 additions and 3 deletions
|
|
@ -920,6 +920,7 @@ namespace Server.Engines.Craft
|
|||
// Not enough resource to craft it
|
||||
if ( !ConsumeRes( from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage ) )
|
||||
{
|
||||
CraftQueue.Pause( from, "Missing resources." );
|
||||
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
|
||||
else if ( checkMessage is int && (int)checkMessage > 0 )
|
||||
|
|
@ -959,6 +960,7 @@ namespace Server.Engines.Craft
|
|||
// Not enough resource to craft it
|
||||
if ( !ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message ) )
|
||||
{
|
||||
CraftQueue.Pause( from, "Missing resources." );
|
||||
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
|
||||
else if ( message is int && (int)message > 0 )
|
||||
|
|
@ -1026,6 +1028,8 @@ namespace Server.Engines.Craft
|
|||
CommandLogging.WriteLine( from, "Crafting {0} with craft system {1}", CommandLogging.Format( item ), craftSystem.GetType().Name );
|
||||
|
||||
//from.PlaySound( 0x57 );
|
||||
// --- QUEUE SUCCESS HOOK ---
|
||||
CraftQueue.HandleResult( from, true, quality == 2 );
|
||||
}
|
||||
|
||||
if ( num == 0 )
|
||||
|
|
@ -1075,6 +1079,9 @@ namespace Server.Engines.Craft
|
|||
// SkillCheck failed.
|
||||
int num = craftSystem.PlayEndingEffect( from, true, true, toolBroken, endquality, false, this );
|
||||
|
||||
// --- QUEUE FAIL HOOK ---
|
||||
CraftQueue.HandleResult( from, false, false );
|
||||
|
||||
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, num ) );
|
||||
else if ( num > 0 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue