jayates
Member
Was wondering if someone could help me with my script? Here's what i'm wanting it to do. There's an Empty Flavor Vial and depending on which flavoring you have in your backpack it'll give you the one you want. Here's my script just needing some help to get it to work.
using System;
using Server;
using Server.Gumps;
using Server.Network;
using System.Collections;
using Server.Multis;
using Server.Mobiles;
namespace Server.Items
{
public class EmptyFlavorVial : Item
{
[Constructable]
public EmptyFlavorVial() : this( null )
{
}
[Constructable]
public EmptyFlavorVial ( string name ) : base (3620) //vial
{
Name = "an Empty Flavor Vial";
LootType = LootType.Blessed;
Hue = 0;
}
public EmptyFlavorVial ( Serial serial ) : base ( serial )
{
}
public override void OnDoubleClick( Mobile p )
{
Item a = p.Backpack.FindItemByType( typeof(FlavorOne), 10 );
if ( a != null )
{
p.AddToBackpack( new FlavoredVialOne() );
a.Delete();
p.SendMessage( "You successfully combined the flavors with the vial!" );
this.Delete();
}
}
Item a = p.Backpack.FindItemByType( typeof(FlavorTwo), 10 );
if ( a != null )
{
p.AddToBackpack( new FlavoredVialTwo() );
a.Delete();
p.SendMessage( "You successfully combined the flavors with the vial!" );
this.Delete();
}
}
Item a = p.Backpack.FindItemByType( typeof(FlavorThree), 10 );
if ( a != null )
{
p.AddToBackpack( new FlavoredVialThree() );
a.Delete();
p.SendMessage( "You successfully combined the flavors with the vial!" );
this.Delete();
}
else
{
p.SendMessage( "You are missing the correct flavors!" );
}
}
public override void Serialize ( GenericWriter writer)
{
base.Serialize ( writer );
writer.Write ( (int) 0);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize ( reader );
int version = reader.ReadInt();
}
}
}