jayates
Member
I got a nice idea. It's a small crate that suppossedly cooks your Fish Steaks! It only gives out reg fish steaks though. I've got 3 different types set and it still only gives out regular ole' fish steaks... sheesh. Can someone take a look at the script and see why... cause i'm lost here. Thank you.
namespace Server.Items
{
public class FishInstaOven : Item
{
public override string DefaultName { get { return "Little Bit Fish Box"; }}
[Constructable]
public FishInstaOven() : base(2473) //small crate
{
Movable = false;
Hue = 2615;
}
public FishInstaOven(Serial serial) : base(serial)
{ }
private int CheckGrouping(Item a, Item b)
{
return b.Hue.CompareTo(a.Hue);
}
public override void OnDoubleClick(Mobile p)
{
var success = false;
if ((success = p.Backpack.ConsumeTotalGrouped(typeof(RawFishSteak), 48, true, null, CheckGrouping)))
{
p.AddToBackpack(new FishSteak(48));
}
else if ((success = p.Backpack.ConsumeTotalGrouped(typeof(BigHalibutSteak), 48, true, null, CheckGrouping)))
{
p.AddToBackpack(new HalibutFishSteak(48));
}
else if ((success = p.Backpack.ConsumeTotalGrouped(typeof(BigFlukeSteak), 48, true, null, CheckGrouping)))
{
p.AddToBackpack(new FlukeFishSteak(48));
}
if (success)
{
p.SendMessage(89, "You recieve 48 cooked Fish Steaks!");
p.Say ("Sizzle... sizzle... sizzle");
//Delete();
}
else
{
p.SendMessage(89, "This can only cook raw fish steaks... and 48 at once!");
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
namespace Server.Items
{
public class FishInstaOven : Item
{
public override string DefaultName { get { return "Little Bit Fish Box"; }}
[Constructable]
public FishInstaOven() : base(2473) //small crate
{
Movable = false;
Hue = 2615;
}
public FishInstaOven(Serial serial) : base(serial)
{ }
private int CheckGrouping(Item a, Item b)
{
return b.Hue.CompareTo(a.Hue);
}
public override void OnDoubleClick(Mobile p)
{
var success = false;
if ((success = p.Backpack.ConsumeTotalGrouped(typeof(RawFishSteak), 48, true, null, CheckGrouping)))
{
p.AddToBackpack(new FishSteak(48));
}
else if ((success = p.Backpack.ConsumeTotalGrouped(typeof(BigHalibutSteak), 48, true, null, CheckGrouping)))
{
p.AddToBackpack(new HalibutFishSteak(48));
}
else if ((success = p.Backpack.ConsumeTotalGrouped(typeof(BigFlukeSteak), 48, true, null, CheckGrouping)))
{
p.AddToBackpack(new FlukeFishSteak(48));
}
if (success)
{
p.SendMessage(89, "You recieve 48 cooked Fish Steaks!");
p.Say ("Sizzle... sizzle... sizzle");
//Delete();
}
else
{
p.SendMessage(89, "This can only cook raw fish steaks... and 48 at once!");
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}