#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
1191
Scripts/Items/Food/Beverage.cs
Normal file
1191
Scripts/Items/Food/Beverage.cs
Normal file
File diff suppressed because it is too large
Load diff
59
Scripts/Items/Food/BeverageEmpty.cs
Normal file
59
Scripts/Items/Food/BeverageEmpty.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1f81, 0x1f82, 0x1f83, 0x1f84 )]
|
||||
public class Glass : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Glass() : base( 0x1f81 )
|
||||
{
|
||||
this.Weight = 0.1;
|
||||
}
|
||||
|
||||
public Glass( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GlassBottle : Item
|
||||
{
|
||||
[Constructable]
|
||||
public GlassBottle() : base( 0xe2b )
|
||||
{
|
||||
this.Weight = 0.3;
|
||||
}
|
||||
|
||||
public GlassBottle( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
532
Scripts/Items/Food/Bowls.cs
Normal file
532
Scripts/Items/Food/Bowls.cs
Normal file
|
|
@ -0,0 +1,532 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EmptyWoodenBowl : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyWoodenBowl() : base( 0x15F8 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public EmptyWoodenBowl( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class EmptyPewterBowl : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyPewterBowl() : base( 0x15FD )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public EmptyPewterBowl( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodenBowlOfCarrots : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfCarrots() : base( 0x15F9 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyWoodenBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public WoodenBowlOfCarrots( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodenBowlOfCorn : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfCorn() : base( 0x15FA )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyWoodenBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public WoodenBowlOfCorn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodenBowlOfLettuce : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfLettuce() : base( 0x15FB )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyWoodenBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public WoodenBowlOfLettuce( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodenBowlOfPeas : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfPeas() : base( 0x15FC )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyWoodenBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public WoodenBowlOfPeas( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PewterBowlOfCarrots : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfCarrots() : base( 0x15FE )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyPewterBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public PewterBowlOfCarrots( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PewterBowlOfCorn : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfCorn() : base( 0x15FF )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyPewterBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public PewterBowlOfCorn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PewterBowlOfLettuce : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfLettuce() : base( 0x1600 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyPewterBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public PewterBowlOfLettuce( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PewterBowlOfPeas : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfPeas() : base( 0x1601 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyPewterBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public PewterBowlOfPeas( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PewterBowlOfPotatos : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfPotatos() : base( 0x1602 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyPewterBowl() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public PewterBowlOfPotatos( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[TypeAlias( "Server.Items.EmptyLargeWoodenBowl" )]
|
||||
public class EmptyWoodenTub : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyWoodenTub() : base( 0x1605 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public EmptyWoodenTub( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[TypeAlias( "Server.Items.EmptyLargePewterBowl" )]
|
||||
public class EmptyPewterTub : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyPewterTub() : base( 0x1603 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public EmptyPewterTub( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodenBowlOfStew : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfStew() : base( 0x1604 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 2.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyWoodenTub() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public WoodenBowlOfStew( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodenBowlOfTomatoSoup : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfTomatoSoup() : base( 0x1606 )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 2.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new EmptyWoodenTub() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public WoodenBowlOfTomatoSoup( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
912
Scripts/Items/Food/CookableFood.cs
Normal file
912
Scripts/Items/Food/CookableFood.cs
Normal file
|
|
@ -0,0 +1,912 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class CookableFood : Item
|
||||
{
|
||||
private int m_CookingLevel;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int CookingLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CookingLevel;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_CookingLevel = value;
|
||||
}
|
||||
}
|
||||
|
||||
public CookableFood( int itemID, int cookingLevel ) : base( itemID )
|
||||
{
|
||||
m_CookingLevel = cookingLevel;
|
||||
}
|
||||
|
||||
public CookableFood( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public abstract Food Cook();
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
// Version 1
|
||||
writer.Write( (int) m_CookingLevel );
|
||||
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_CookingLevel = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
#endif
|
||||
|
||||
public static bool IsHeatSource( object targeted )
|
||||
{
|
||||
int itemID;
|
||||
|
||||
if ( targeted is Item )
|
||||
itemID = ((Item)targeted).ItemID;
|
||||
else if ( targeted is StaticTarget )
|
||||
itemID = ((StaticTarget)targeted).ItemID;
|
||||
else
|
||||
return false;
|
||||
|
||||
if ( itemID >= 0xDE3 && itemID <= 0xDE9 )
|
||||
return true; // Campfire
|
||||
else if ( itemID >= 0x461 && itemID <= 0x48E )
|
||||
return true; // Sandstone oven/fireplace
|
||||
else if ( itemID >= 0x92B && itemID <= 0x96C )
|
||||
return true; // Stone oven/fireplace
|
||||
else if ( itemID == 0xFAC )
|
||||
return true; // Firepit
|
||||
else if ( itemID >= 0x184A && itemID <= 0x184C )
|
||||
return true; // Heating stand (left)
|
||||
else if ( itemID >= 0x184E && itemID <= 0x1850 )
|
||||
return true; // Heating stand (right)
|
||||
else if ( itemID >= 0x398C && itemID <= 0x399F )
|
||||
return true; // Fire field
|
||||
else if ( itemID >= 0x3E4 && itemID <= 0x3E9 )
|
||||
return true; // Bonfire
|
||||
else if ( itemID >= 0x29FD && itemID <= 0x2A03 )
|
||||
return true; // Stone Firepit
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CookableFood m_Item;
|
||||
|
||||
public InternalTarget( CookableFood item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted ) return;
|
||||
|
||||
if ( CookableFood.IsHeatSource( targeted ) )
|
||||
{
|
||||
if ( from.BeginAction( typeof( CookableFood ) ) )
|
||||
{
|
||||
from.PlaySound( 0x225 );
|
||||
|
||||
m_Item.Consume();
|
||||
|
||||
InternalTimer t = new InternalTimer( from, targeted as IPoint3D, from.Map, m_Item );
|
||||
t.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500119 ); // You must wait to perform another action
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private IPoint3D m_Point;
|
||||
private Map m_Map;
|
||||
private CookableFood m_CookableFood;
|
||||
|
||||
public InternalTimer( Mobile from, IPoint3D p, Map map, CookableFood cookableFood ) : base( TimeSpan.FromSeconds( 5.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Point = p;
|
||||
m_Map = map;
|
||||
m_CookableFood = cookableFood;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.EndAction( typeof( CookableFood ) );
|
||||
|
||||
if ( m_From.Map != m_Map || (m_Point != null && m_From.GetDistanceToSqrt( m_Point ) > 3) )
|
||||
{
|
||||
m_From.SendLocalizedMessage( 500686 ); // You burn the food to a crisp! It's ruined.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( SkillCheck.TestTrade( m_From, Trades.Cooking, m_CookableFood.CookingLevel, 100 ) )
|
||||
{
|
||||
Food cookedFood = m_CookableFood.Cook();
|
||||
|
||||
if ( m_From.AddToBackpack( cookedFood ) )
|
||||
m_From.PlaySound( 0x57 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage( 500686 ); // You burn the food to a crisp! It's ruined.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** RawRibs **********
|
||||
public class RawRibs : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public RawRibs() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawRibs( int amount ) : base( 0x9F1, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawRibs( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Ribs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ********** RawLambLeg **********
|
||||
public class RawLambLeg : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public RawLambLeg() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawLambLeg( int amount ) : base( 0x1609, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawLambLeg( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version == 0 && Weight == 1 )
|
||||
Weight = -1;
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new LambLeg();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** RawChickenLeg **********
|
||||
public class RawChickenLeg : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public RawChickenLeg() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawChickenLeg( int amount ) : base( 0x1607, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawChickenLeg( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new ChickenLeg();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** RawHam **********
|
||||
public class RawHam : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public RawHam() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawHam( int amount ) : base( 0x096F, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Name = "raw ham";
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawHam( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Ham();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** RawHam **********
|
||||
public class RawSlabOfBacon : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public RawSlabOfBacon() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawSlabOfBacon( int amount ) : base( 0x0E0F, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Name = "raw slab of bacon";
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawSlabOfBacon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Ham();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** RawBird **********
|
||||
public class RawBird : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public RawBird() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawBird( int amount ) : base( 0x9B9, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawBird( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new CookedBird();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ********** UnbakedPeachCobbler **********
|
||||
public class UnbakedPeachCobbler : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041335; } } // unbaked peach cobbler
|
||||
|
||||
[Constructable]
|
||||
public UnbakedPeachCobbler() : base( 0x1042, 25 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UnbakedPeachCobbler( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
public override Food Cook()
|
||||
{
|
||||
return new PeachCobbler();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** UnbakedFruitPie **********
|
||||
public class UnbakedFruitPie : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041334; } } // unbaked fruit pie
|
||||
|
||||
[Constructable]
|
||||
public UnbakedFruitPie() : base( 0x1042, 25 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UnbakedFruitPie( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new FruitPie();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** UnbakedMeatPie **********
|
||||
public class UnbakedMeatPie : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041338; } } // unbaked meat pie
|
||||
|
||||
[Constructable]
|
||||
public UnbakedMeatPie() : base( 0x1042, 25 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UnbakedMeatPie( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new MeatPie();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** UnbakedPumpkinPie **********
|
||||
public class UnbakedPumpkinPie : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041342; } } // unbaked pumpkin pie
|
||||
|
||||
[Constructable]
|
||||
public UnbakedPumpkinPie() : base( 0x1042, 25 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UnbakedPumpkinPie( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new PumpkinPie();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** UnbakedApplePie **********
|
||||
public class UnbakedApplePie : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041336; } } // unbaked apple pie
|
||||
|
||||
[Constructable]
|
||||
public UnbakedApplePie() : base( 0x1042, 25 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UnbakedApplePie( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new ApplePie();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** UncookedCheesePizza **********
|
||||
[TypeAlias( "Server.Items.UncookedPizza" )]
|
||||
public class UncookedCheesePizza : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041341; } } // uncooked cheese pizza
|
||||
|
||||
[Constructable]
|
||||
public UncookedCheesePizza() : base( 0x1083, 20 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UncookedCheesePizza( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( ItemID == 0x1040 )
|
||||
ItemID = 0x1083;
|
||||
|
||||
if ( Hue == 51 )
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new CheesePizza();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** UncookedSausagePizza **********
|
||||
public class UncookedSausagePizza : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041337; } } // uncooked sausage pizza
|
||||
|
||||
[Constructable]
|
||||
public UncookedSausagePizza() : base( 0x1083, 20 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UncookedSausagePizza( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new SausagePizza();
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
// ********** UncookedPizza **********
|
||||
public class UncookedPizza : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public UncookedPizza() : base( 0x1083, 20 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UncookedPizza( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( ItemID == 0x1040 )
|
||||
ItemID = 0x1083;
|
||||
|
||||
if ( Hue == 51 )
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Pizza();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// ********** UnbakedQuiche **********
|
||||
public class UnbakedQuiche : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041339; } } // unbaked quiche
|
||||
|
||||
[Constructable]
|
||||
public UnbakedQuiche() : base( 0x1042, 25 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public UnbakedQuiche( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Quiche();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** Eggs **********
|
||||
public class Eggs : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public Eggs() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Eggs( int amount ) : base( 0x9B5, 15 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Eggs( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version < 1 )
|
||||
{
|
||||
Stackable = true;
|
||||
|
||||
if ( Weight == 0.5 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new FriedEggs();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** CookieMix **********
|
||||
public class CookieMix : CookableFood
|
||||
{
|
||||
[Constructable]
|
||||
public CookieMix() : base( 0x103F, 20 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public CookieMix( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Cookies();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** CakeMix **********
|
||||
public class CakeMix : CookableFood
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041002; } } // cake mix
|
||||
|
||||
[Constructable]
|
||||
public CakeMix() : base( 0x103F, 40 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public CakeMix( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new Cake();
|
||||
}
|
||||
}
|
||||
|
||||
public class RawFishSteak : CookableFood
|
||||
{
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawFishSteak() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RawFishSteak( int amount ) : base( 0x097A, 10 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RawFishSteak( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override Food Cook()
|
||||
{
|
||||
return new FishSteak();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
643
Scripts/Items/Food/Cooking.cs
Normal file
643
Scripts/Items/Food/Cooking.cs
Normal file
|
|
@ -0,0 +1,643 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class UtilityItem
|
||||
{
|
||||
static public int RandomChoice( int itemID1, int itemID2 )
|
||||
{
|
||||
int iRet = 0;
|
||||
switch ( Utility.Random( 2 ) )
|
||||
{
|
||||
default:
|
||||
case 0: iRet = itemID1; break;
|
||||
case 1: iRet = itemID2; break;
|
||||
}
|
||||
return iRet;
|
||||
}
|
||||
}
|
||||
|
||||
// ********** Dough **********
|
||||
public class Dough : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Dough() : base( 0x103d )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Dough( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
#if false
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
#endif
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Dough m_Item;
|
||||
|
||||
public InternalTarget( Dough item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted ) return;
|
||||
|
||||
if ( targeted is Eggs )
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Eggs)targeted).Consume();
|
||||
|
||||
from.AddToBackpack( new UnbakedQuiche() );
|
||||
from.AddToBackpack( new Eggshells() );
|
||||
}
|
||||
else if ( targeted is CheeseWheel )
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((CheeseWheel)targeted).Consume();
|
||||
|
||||
from.AddToBackpack( new CheesePizza() );
|
||||
}
|
||||
else if ( targeted is Sausage )
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Sausage)targeted).Consume();
|
||||
|
||||
from.AddToBackpack( new SausagePizza() );
|
||||
}
|
||||
else if ( targeted is Apple )
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Apple)targeted).Consume();
|
||||
|
||||
from.AddToBackpack( new UnbakedApplePie() );
|
||||
}
|
||||
|
||||
else if ( targeted is Peach )
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Peach)targeted).Consume();
|
||||
|
||||
from.AddToBackpack( new UnbakedPeachCobbler() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** SweetDough **********
|
||||
public class SweetDough : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1041340; } } // sweet dough
|
||||
|
||||
[Constructable]
|
||||
public SweetDough() : base( 0x103d )
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
Hue = 150;
|
||||
}
|
||||
|
||||
public SweetDough( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Hue == 51 )
|
||||
Hue = 150;
|
||||
}
|
||||
|
||||
#if false
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
#endif
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private SweetDough m_Item;
|
||||
|
||||
public InternalTarget( SweetDough item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted ) return;
|
||||
|
||||
if ( targeted is BowlFlour )
|
||||
{
|
||||
m_Item.Delete();
|
||||
((BowlFlour)targeted).Delete();
|
||||
|
||||
from.AddToBackpack( new CakeMix() );
|
||||
}
|
||||
else if ( targeted is Campfire )
|
||||
{
|
||||
from.PlaySound( 0x225 );
|
||||
m_Item.Delete();
|
||||
InternalTimer t = new InternalTimer( from, (Campfire)targeted );
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Campfire m_Campfire;
|
||||
|
||||
public InternalTimer( Mobile from, Campfire campfire ) : base( TimeSpan.FromSeconds( 5.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Campfire = campfire;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_From.GetDistanceToSqrt( m_Campfire ) > 3 )
|
||||
{
|
||||
m_From.SendLocalizedMessage( 500686 ); // You burn the food to a crisp! It's ruined.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( SkillCheck.TestTrade( m_From, Trades.Cooking, 0, 10 ) )
|
||||
{
|
||||
if ( m_From.AddToBackpack( new Muffins() ) )
|
||||
m_From.PlaySound( 0x57 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage( 500686 ); // You burn the food to a crisp! It's ruined.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** JarHoney **********
|
||||
public class JarHoney : Item
|
||||
{
|
||||
[Constructable]
|
||||
public JarHoney() : base( 0x9ec )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public JarHoney( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private JarHoney m_Item;
|
||||
|
||||
public InternalTarget( JarHoney item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted ) return;
|
||||
|
||||
if ( targeted is Dough )
|
||||
{
|
||||
m_Item.Delete();
|
||||
((Dough)targeted).Consume();
|
||||
|
||||
from.AddToBackpack( new SweetDough() );
|
||||
}
|
||||
|
||||
if (targeted is BowlFlour)
|
||||
{
|
||||
m_Item.Consume();
|
||||
((BowlFlour)targeted).Delete();
|
||||
|
||||
from.AddToBackpack( new CookieMix() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** BowlFlour **********
|
||||
public class BowlFlour : Item
|
||||
{
|
||||
[Constructable]
|
||||
public BowlFlour() : base( 0xa1e )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public BowlFlour( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** WoodenBowl **********
|
||||
public class WoodenBowl : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowl() : base( 0x15f8 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public WoodenBowl( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** PitcherWater **********
|
||||
/*public class PitcherWater : Item
|
||||
{
|
||||
[Constructable]
|
||||
public PitcherWater() : base(Utility.Random( 0x1f9d, 2 ))
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public PitcherWater( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PitcherWater m_Item;
|
||||
|
||||
public InternalTarget( PitcherWater item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted ) return;
|
||||
|
||||
if ( targeted is BowlFlour )
|
||||
{
|
||||
m_Item.Delete();
|
||||
((BowlFlour)targeted).Delete();
|
||||
|
||||
from.AddToBackpack( new Dough() );
|
||||
from.AddToBackpack( new WoodenBowl() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// ********** SackFlour **********
|
||||
[TypeAlias( "Server.Items.SackFlourOpen" )]
|
||||
public class SackFlour : Item, IHasQuantity
|
||||
{
|
||||
private int m_Quantity;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Quantity
|
||||
{
|
||||
get{ return m_Quantity; }
|
||||
set
|
||||
{
|
||||
if ( value < 0 )
|
||||
value = 0;
|
||||
else if ( value > 20 )
|
||||
value = 20;
|
||||
|
||||
m_Quantity = value;
|
||||
|
||||
if ( m_Quantity == 0 )
|
||||
Delete();
|
||||
else if ( m_Quantity < 20 && (ItemID == 0x1039 || ItemID == 0x1045) )
|
||||
++ItemID;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SackFlour() : base( 0x1039 )
|
||||
{
|
||||
Weight = 5.0;
|
||||
m_Quantity = 20;
|
||||
}
|
||||
|
||||
public SackFlour( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 2 ); // version
|
||||
|
||||
writer.Write( (int) m_Quantity );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 2:
|
||||
case 1:
|
||||
{
|
||||
m_Quantity = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Quantity = 20;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version < 2 && Weight == 1.0 )
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
if ( (ItemID == 0x1039 || ItemID == 0x1045) )
|
||||
++ItemID;
|
||||
|
||||
#if false
|
||||
this.Delete();
|
||||
|
||||
from.AddToBackpack( new SackFlourOpen() );
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if false
|
||||
// ********** SackFlourOpen **********
|
||||
public class SackFlourOpen : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1024166; } } // open sack of flour
|
||||
|
||||
[Constructable]
|
||||
public SackFlourOpen() : base(UtilityItem.RandomChoice( 0x1046, 0x103a ))
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public SackFlourOpen( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private SackFlourOpen m_Item;
|
||||
|
||||
public InternalTarget( SackFlourOpen item ) : base( 1, false, TargetFlags.None )
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Item.Deleted ) return;
|
||||
|
||||
if ( targeted is WoodenBowl )
|
||||
{
|
||||
m_Item.Delete();
|
||||
((WoodenBowl)targeted).Delete();
|
||||
|
||||
from.AddToBackpack( new BowlFlour() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// ********** Eggshells **********
|
||||
public class Eggshells : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Eggshells() : base( 0x9b4 )
|
||||
{
|
||||
Weight = 0.5;
|
||||
}
|
||||
|
||||
public Eggshells( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WheatSheaf : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WheatSheaf() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WheatSheaf( int amount ) : base( 7869 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.BeginTarget( 4, false, TargetFlags.None, new TargetCallback( OnTarget ) );
|
||||
}
|
||||
|
||||
public virtual void OnTarget( Mobile from, object obj )
|
||||
{
|
||||
if ( obj is AddonComponent )
|
||||
obj = (obj as AddonComponent).Addon;
|
||||
|
||||
IFlourMill mill = obj as IFlourMill;
|
||||
|
||||
if ( mill != null )
|
||||
{
|
||||
int needs = mill.MaxFlour - mill.CurFlour;
|
||||
|
||||
if ( needs > this.Amount )
|
||||
needs = this.Amount;
|
||||
|
||||
mill.CurFlour += needs;
|
||||
Consume( needs );
|
||||
}
|
||||
}
|
||||
|
||||
public WheatSheaf( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
1286
Scripts/Items/Food/Food.cs
Normal file
1286
Scripts/Items/Food/Food.cs
Normal file
File diff suppressed because it is too large
Load diff
632
Scripts/Items/Food/Fruits.cs
Normal file
632
Scripts/Items/Food/Fruits.cs
Normal file
|
|
@ -0,0 +1,632 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FruitBasket : Food
|
||||
{
|
||||
[Constructable]
|
||||
public FruitBasket() : base( 1, 0x993 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
FillFactor = 5;
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public FruitBasket( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat( Mobile from )
|
||||
{
|
||||
if ( !base.Eat( from ) )
|
||||
return false;
|
||||
|
||||
from.AddToBackpack( new Basket() );
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x171f, 0x1720 )]
|
||||
public class Banana : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Banana() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Banana( int amount ) : base( amount, 0x171f )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Banana( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable( 0x1721, 0x1722 )]
|
||||
public class Bananas : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Bananas() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bananas( int amount ) : base( amount, 0x1721 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Bananas( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SplitCoconut : Food
|
||||
{
|
||||
[Constructable]
|
||||
public SplitCoconut() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SplitCoconut( int amount ) : base( amount, 0x1725 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public SplitCoconut( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Lemon : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Lemon() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Lemon( int amount ) : base( amount, 0x1728 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Lemon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Lemons : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Lemons() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Lemons( int amount ) : base( amount, 0x1729 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Lemons( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Lime : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Lime() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Lime( int amount ) : base( amount, 0x172a )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Lime( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Limes : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Limes() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Limes( int amount ) : base( amount, 0x172B )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Limes( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Coconut : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Coconut() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Coconut( int amount ) : base( amount, 0x1726 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Coconut( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class OpenCoconut : Food
|
||||
{
|
||||
[Constructable]
|
||||
public OpenCoconut() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public OpenCoconut( int amount ) : base( amount, 0x1723 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public OpenCoconut( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Dates : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Dates() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Dates( int amount ) : base( amount, 0x1727 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Dates( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Grapes : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Grapes() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Grapes( int amount ) : base( amount, 0x9D1 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Grapes( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Peach : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Peach() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Peach( int amount ) : base( amount, 0x9D2 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Peach( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Pear : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Pear() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Pear( int amount ) : base( amount, 0x994 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Pear( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Apple : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Apple() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Apple( int amount ) : base( amount, 0x9D0 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Apple( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Watermelon : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Watermelon() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Watermelon( int amount ) : base( amount, 0xC5C )
|
||||
{
|
||||
this.Weight = 5.0;
|
||||
this.FillFactor = 5;
|
||||
}
|
||||
|
||||
public Watermelon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version < 1 )
|
||||
{
|
||||
if ( FillFactor == 2 )
|
||||
FillFactor = 5;
|
||||
|
||||
if ( Weight == 2.0 )
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallWatermelon : Food
|
||||
{
|
||||
[Constructable]
|
||||
public SmallWatermelon() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallWatermelon( int amount ) : base( amount, 0xC5D )
|
||||
{
|
||||
this.Weight = 5.0;
|
||||
this.FillFactor = 5;
|
||||
}
|
||||
|
||||
public SmallWatermelon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xc72, 0xc73 )]
|
||||
public class Squash : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Squash() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Squash( int amount ) : base( amount, 0xc72 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Squash( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xc79, 0xc7a )]
|
||||
public class Cantaloupe : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Cantaloupe() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cantaloupe( int amount ) : base( amount, 0xc79 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Cantaloupe( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
140
Scripts/Items/Food/MagicDrink.cs
Normal file
140
Scripts/Items/Food/MagicDrink.cs
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FlaskAle : Item
|
||||
{
|
||||
public FlaskAle() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public FlaskAle( int amount ) : base( 0x0DDF )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Name = "flask of ale";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendMessage( "This must be in your backpack to drink." );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// increase characters thirst value based on type of drink
|
||||
if ( from.Thirst < 20 )
|
||||
{
|
||||
from.Thirst += 2;
|
||||
// Send message to character about their current thirst value
|
||||
int iThirst = from.Thirst;
|
||||
if ( iThirst < 5 )
|
||||
from.SendMessage( "You drink the ale but are still extremely thirsty" );
|
||||
else if ( iThirst < 10 )
|
||||
from.SendMessage( "You drink the ale and feel less thirsty" );
|
||||
else if ( iThirst < 15 )
|
||||
from.SendMessage( "You drink the ale and feel much less thirsty" );
|
||||
else
|
||||
from.SendMessage( "You drink the ale and are no longer thirsty" );
|
||||
|
||||
this.Consume();
|
||||
from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You are simply too quenched to drink anymore" );
|
||||
from.Thirst = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FlaskAle( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class FlaskWine : Item
|
||||
{
|
||||
public FlaskWine() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public FlaskWine( int amount ) : base( 0x0DE0 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Name = "flask of wine";
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendMessage( "This must be in your backpack to drink." );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// increase characters thirst value based on type of drink
|
||||
if ( from.Thirst < 20 )
|
||||
{
|
||||
from.Thirst += 2;
|
||||
// Send message to character about their current thirst value
|
||||
int iThirst = from.Thirst;
|
||||
if ( iThirst < 5 )
|
||||
from.SendMessage( "You drink the wine but are still extremely thirsty" );
|
||||
else if ( iThirst < 10 )
|
||||
from.SendMessage( "You drink the wine and feel less thirsty" );
|
||||
else if ( iThirst < 15 )
|
||||
from.SendMessage( "You drink the wine and feel much less thirsty" );
|
||||
else
|
||||
from.SendMessage( "You drink the wine and are no longer thirsty" );
|
||||
|
||||
this.Consume();
|
||||
from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You are simply too quenched to drink anymore" );
|
||||
from.Thirst = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FlaskWine( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
243
Scripts/Items/Food/Vegetables.cs
Normal file
243
Scripts/Items/Food/Vegetables.cs
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0xc77, 0xc78 )]
|
||||
public class Carrot : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Carrot() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Carrot( int amount ) : base( amount, 0xc78 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Carrot( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xc7b, 0xc7c )]
|
||||
public class Cabbage : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Cabbage() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cabbage( int amount ) : base( amount, 0xc7b )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Cabbage( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xc6d, 0xc6e )]
|
||||
public class Onion : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Onion() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Onion( int amount ) : base( amount, 0xc6d )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Onion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xc70, 0xc71 )]
|
||||
public class Lettuce : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Lettuce() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Lettuce( int amount ) : base( amount, 0xc70 )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Lettuce( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Tomato : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Tomato() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Tomato( int amount ) : base( amount, 0x098F )
|
||||
{
|
||||
Name = "tomato";
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 1;
|
||||
}
|
||||
|
||||
public Tomato( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0xC6A, 0xC6B )]
|
||||
public class Pumpkin : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Pumpkin() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Pumpkin( int amount ) : base( amount, 0xC6A )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 8;
|
||||
}
|
||||
|
||||
public Pumpkin( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version < 1 )
|
||||
{
|
||||
if ( FillFactor == 4 )
|
||||
FillFactor = 8;
|
||||
|
||||
if ( Weight == 5.0 )
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallPumpkin : Food
|
||||
{
|
||||
[Constructable]
|
||||
public SmallPumpkin() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallPumpkin( int amount ) : base( amount, 0xC6C )
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 8;
|
||||
}
|
||||
|
||||
public SmallPumpkin( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue