ModernUO/Projects/Scripts/Engines/Craft/DefCooking.cs
Kamron Batman 179cb50557 Updates Packets & Randomizer (#43)
* Fixes a bug with the main loop. Removes unnecessary optimizations for RDRand.

* WIP - Rewriting packets.

* Cleanup and updates README

* Converts more packets

* Fixes header

* Converts Effects packets.

* Forgot the send command

* Adds the start of containers packets.

* Adds message packets with caching

* Extends the send methods

* Starts to add Acquire methods

* Converted the packets

* Cleanup

* Cleanup

* Adds more packets

* Adds more packets

* Fixes clearing arrays from pool. Adds Mobile Incoming

* Converts more packets.

* Moves more packets

* Moves more packets

* Test compression

* Merges

* Migrating to an idiomatic syntax that also supports compression, and proxying.

* Optimize the stack alloc. Changes attributes

* Converted container packets

* Visual Studio doesn't auto save files. I am still getting used to subpar IDEs.

* Adds static packet caching. Will profile later. Converts more packets

* Fixes packets and changes how compression is configured

* WIP - Adds basics for Gumps. Not finished though.

* Fix file

* Fixes formatting

* Changed SpanWriter to be more idiomatic.

* Fixes Span vs RawSpan and missing stackallocs

* Converts over some more gumps

* WIP - Deletes 32bit support.

* Drops RDRand32 support.

* Fixes gump compilation

* Converting gump components

* Removes old huffman compression function

* Revert signature for backwards compatibility

* WIP - Converting more gump components

* Creates ArraySet for the strings. Updates AppendTo to reference that.

* Converts the maining gump components

* Cleans up gump components

* Cleans up directives

* Cleans up ArraySet and moves it. Adds null-coalescing-assignment

* Cleanup, Target Packets, and C# 8 changes.

* Removed OPL Packet

* World packets

* Fixing packet uses

* Cleans up code. Fixes packet uses in various places.

* More cleanup for packets

* Code cleanup

* Converts more packet uses and cleans up more code

* More code cleanup

* Finishes fixing the packets in Item

* Updates secure trade packets

* Updates core and gets it to compile.

* Moved packets to scripts. Fixed account handler use of packets

* Code cleanup

* Updates chat packets

* Code cleanuo

* Adds party packets, but need to implement them.

* Party packets WIP

* Finishes party packets

* Rearrange movement namespaces and classes

* Finishes plant packets

* Code Formatting

* Fixes moving effects

* Code cleanup, eliminates equipinfo

* Adds more packets. Fixes bugs with various packets.

* Finishes mahjon packets

* Fixes mahjong packet

* Code cleanup

* Finishes mahjong packets

* Adds Map packets

* Add multifacet maps and charts

* Cleans up some packets with UTF8

* Optimizes packets

* Cleans up more packets. Moves the MessageHelper

* Removes assistant support. Removes extended protocol. Incorporates MapUO packets as normal packets.

* Updates protocol extensions packet receiver

* Fixes a few bugs. Fixes a few more packets.

* Code cleanup and fixing more packets

* Fixes packet effects

* Cleaned up more code

* Buff Icon cleanup

* Removed unused constructors

* Code Cleanup. Adds BoatHS Packets

* Moves house files. Updates house foundation packets.

* Deployment cleanup

* Fixes:

* Code cleanup

* More code cleanup

* More code cleanup

* Cleaned up BaseHouse

* Enforces styling

* Converts foreach to linq where possible.

* Dont need that

* Goals/Readme updates

* Removes 32bit support at the highest level. Turns on HRT by default.

* Code cleanup. Fixes extended features packet.

* Fixes various bugs

* Code cleanup

* Code cleanup

* Code cleanup. Fixes gump X/Y assignment.

* Code cleanup using |= operator

* More code cleanup

* Cleanup

* Fixes spacing issues. Thanks Visual Studio. You suck.

* Compiler error

* Fixes NPE from RunUO 2.7

* Renames ScriptCompiler to AssemblyHandler. Fixes packets. Updates README

* Fixes more packets. Stupid trailing nulls.

* Fixes various bugs.

* Fixes for gumps

* Fixes more gump stuff. Going to split it out later since it is getting insane

* Recoded the gump writing

* WIP

* *Added output path of scripts project to dev branch
*Activated debugging in code
2019-11-11 12:40:16 +01:00

283 lines
12 KiB
C#

using System;
using Server.Items;
namespace Server.Engines.Craft
{
public class DefCooking : CraftSystem
{
private static CraftSystem m_CraftSystem;
private DefCooking() : base(1, 1, 1.25) // base( 1, 1, 1.5 )
{
}
public override SkillName MainSkill => SkillName.Cooking;
public override int GumpTitleNumber => 1044003;
public static CraftSystem CraftSystem => m_CraftSystem ??= new DefCooking();
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
public override double GetChanceAtMin(CraftItem item) => 0.0;
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool?.Deleted != false || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void InitCraftList()
{
int index;
/* Begin Ingredients */
index = AddCraft(typeof(SackFlour), 1044495, 1024153, 0.0, 100.0, typeof(WheatSheaf), 1044489, 2, 1044490);
SetNeedMill(index, true);
index = AddCraft(typeof(Dough), 1044495, 1024157, 0.0, 100.0, typeof(SackFlour), 1044468, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
index = AddCraft(typeof(SweetDough), 1044495, 1041340, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(JarHoney), 1044472, 1, 1044253);
index = AddCraft(typeof(CakeMix), 1044495, 1041002, 0.0, 100.0, typeof(SackFlour), 1044468, 1, 1044253);
AddRes(index, typeof(SweetDough), 1044475, 1, 1044253);
index = AddCraft(typeof(CookieMix), 1044495, 1024159, 0.0, 100.0, typeof(JarHoney), 1044472, 1, 1044253);
AddRes(index, typeof(SweetDough), 1044475, 1, 1044253);
if (Core.ML)
{
index = AddCraft(typeof(CocoaButter), 1044495, 1079998, 0.0, 100.0, typeof(CocoaPulp), 1080530, 1, 1044253);
SetItemHue(index, 0x457);
SetNeededExpansion(index, Expansion.ML);
SetNeedOven(index, true);
index = AddCraft(typeof(CocoaLiquor), 1044495, 1079999, 0.0, 100.0, typeof(CocoaPulp), 1080530, 1, 1044253);
AddRes(index, typeof(EmptyPewterBowl), 1025629, 1, 1044253);
SetItemHue(index, 0x46A);
SetNeededExpansion(index, Expansion.ML);
SetNeedOven(index, true);
}
/* End Ingredients */
/* Begin Preparations */
index = AddCraft(typeof(UnbakedQuiche), 1044496, 1041339, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Eggs), 1044477, 1, 1044253);
// TODO: This must also support chicken and lamb legs
index = AddCraft(typeof(UnbakedMeatPie), 1044496, 1041338, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(RawRibs), 1044482, 1, 1044253);
index = AddCraft(typeof(UncookedSausagePizza), 1044496, 1041337, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Sausage), 1044483, 1, 1044253);
index = AddCraft(typeof(UncookedCheesePizza), 1044496, 1041341, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(CheeseWheel), 1044486, 1, 1044253);
index = AddCraft(typeof(UnbakedFruitPie), 1044496, 1041334, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Pear), 1044481, 1, 1044253);
index = AddCraft(typeof(UnbakedPeachCobbler), 1044496, 1041335, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Peach), 1044480, 1, 1044253);
index = AddCraft(typeof(UnbakedApplePie), 1044496, 1041336, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Apple), 1044479, 1, 1044253);
index = AddCraft(typeof(UnbakedPumpkinPie), 1044496, 1041342, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Pumpkin), 1044484, 1, 1044253);
if (Core.SE)
{
index = AddCraft(typeof(GreenTea), 1044496, 1030315, 80.0, 130.0, typeof(GreenTeaBasket), 1030316, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft(typeof(WasabiClumps), 1044496, 1029451, 70.0, 120.0, typeof(BaseBeverage), 1046458, 1,
1044253);
AddRes(index, typeof(WoodenBowlOfPeas), 1025633, 3, 1044253);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(SushiRolls), 1044496, 1030303, 90.0, 120.0, typeof(BaseBeverage), 1046458, 1,
1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(SushiPlatter), 1044496, 1030305, 90.0, 120.0, typeof(BaseBeverage), 1046458, 1,
1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
SetNeededExpansion(index, Expansion.SE);
}
index = AddCraft(typeof(TribalPaint), 1044496, 1040000, Core.ML ? 55.0 : 80.0, Core.ML ? 105.0 : 80.0,
typeof(SackFlour), 1044468, 1, 1044253);
AddRes(index, typeof(TribalBerry), 1046460, 1, 1044253);
if (Core.SE)
{
index = AddCraft(typeof(EggBomb), 1044496, 1030249, 90.0, 120.0, typeof(Eggs), 1044477, 1, 1044253);
AddRes(index, typeof(SackFlour), 1044468, 3, 1044253);
SetNeededExpansion(index, Expansion.SE);
}
/* End Preparations */
/* Begin Baking */
index = AddCraft(typeof(BreadLoaf), 1044497, 1024156, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Cookies), 1044497, 1025643, 0.0, 100.0, typeof(CookieMix), 1044474, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Cake), 1044497, 1022537, 0.0, 100.0, typeof(CakeMix), 1044471, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Muffins), 1044497, 1022539, 0.0, 100.0, typeof(SweetDough), 1044475, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Quiche), 1044497, 1041345, 0.0, 100.0, typeof(UnbakedQuiche), 1044518, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(MeatPie), 1044497, 1041347, 0.0, 100.0, typeof(UnbakedMeatPie), 1044519, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(SausagePizza), 1044497, 1044517, 0.0, 100.0, typeof(UncookedSausagePizza), 1044520, 1,
1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(CheesePizza), 1044497, 1044516, 0.0, 100.0, typeof(UncookedCheesePizza), 1044521, 1,
1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(FruitPie), 1044497, 1041346, 0.0, 100.0, typeof(UnbakedFruitPie), 1044522, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(PeachCobbler), 1044497, 1041344, 0.0, 100.0, typeof(UnbakedPeachCobbler), 1044523, 1,
1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(ApplePie), 1044497, 1041343, 0.0, 100.0, typeof(UnbakedApplePie), 1044524, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(PumpkinPie), 1044497, 1041348, 0.0, 100.0, typeof(UnbakedPumpkinPie), 1046461, 1,
1044253);
SetNeedOven(index, true);
if (Core.SE)
{
index = AddCraft(typeof(MisoSoup), 1044497, 1030317, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft(typeof(WhiteMisoSoup), 1044497, 1030318, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft(typeof(RedMisoSoup), 1044497, 1030319, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft(typeof(AwaseMisoSoup), 1044497, 1030320, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
}
/* End Baking */
/* Begin Barbecue */
index = AddCraft(typeof(CookedBird), 1044498, 1022487, 0.0, 100.0, typeof(RawBird), 1044470, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft(typeof(ChickenLeg), 1044498, 1025640, 0.0, 100.0, typeof(RawChickenLeg), 1044473, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft(typeof(FishSteak), 1044498, 1022427, 0.0, 100.0, typeof(RawFishSteak), 1044476, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft(typeof(FriedEggs), 1044498, 1022486, 0.0, 100.0, typeof(Eggs), 1044477, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft(typeof(LambLeg), 1044498, 1025642, 0.0, 100.0, typeof(RawLambLeg), 1044478, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft(typeof(Ribs), 1044498, 1022546, 0.0, 100.0, typeof(RawRibs), 1044485, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
/* End Barbecue */
/* Begin Chocolatiering */
if (Core.ML)
{
index = AddCraft(typeof(DarkChocolate), 1080001, 1079994, 15.0, 100.0, typeof(SackOfSugar), 1079997, 1,
1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
SetItemHue(index, 0x465);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(MilkChocolate), 1080001, 1079995, 32.5, 107.5, typeof(SackOfSugar), 1079997, 1,
1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1022544, 1, 1044253);
SetBeverageType(index, BeverageType.Milk);
SetItemHue(index, 0x461);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(WhiteChocolate), 1080001, 1079996, 52.5, 127.5, typeof(SackOfSugar), 1079997, 1,
1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
AddRes(index, typeof(Vanilla), 1080000, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1022544, 1, 1044253);
SetBeverageType(index, BeverageType.Milk);
SetItemHue(index, 0x47E);
SetNeededExpansion(index, Expansion.ML);
}
/* End Chocolatiering */
}
}
}