OK here is what I have got going I am new to C# and I am trying to add the ability to create checks from bankers I started work on it and here is what I have.
[code:1]using System;
using System.Collections;
using Server.Items;
using Server.Scripts.Items;
using Server.ContextMenus;
using Server.Scripts.Misc;
using Server.Mobiles;
namespace Server.Scripts.Mobiles
{
public class Banker : Mobile
{
[Constructable]
public Banker()
{
InitStats( 100, 100, 25 );
Title = "the banker";
Hue = Utility.RandomSkinHue();
if ( this.Female = Utility.RandomBool() )
{
this.Body = 0x191;
this.Name = NameList.RandomFemaleName();
}
else
{
this.Body = 0x190;
this.Name = NameList.RandomMaleName();
}
AddItem( new FancyShirt( Utility.RandomNeutralHue() ) );
AddItem( new ShortPants( Utility.RandomNeutralHue() ) );
AddItem( new Boots( Utility.RandomNeutralHue() ) );
Item hair = new Item( Utility.RandomList( 0x203B, 0x2049, 0x2048, 0x204A ) );
hair.Hue = Utility.RandomNondyedHue();
hair.Layer = Layer.Hair;
hair.Movable = false;
hair.Newbied = true;
AddItem( hair );
Container pack = new Backpack();
pack.DropItem( new Gold( 1000, 2000 ) );
pack.Movable = false;
pack.Newbied = true;
AddItem( pack );
}
public Banker( Serial serial ) : base( serial )
{
}
public override void OnSpeech( SpeechEventArgs e )
{
if ( e.Mobile.InRange( this, 12 ) && e.HasKeyword( 0x0002 ) )
{
BankBox box = e.Mobile.BankBox;
if ( box != null )
box.Open();
}
else if ( e.Mobile.InRange( this, 12 ) && e.HasKeyword( 0x0003 ) )
{
e.Mobile.Backpack.DropItem( new BankCheck( 1000 ) );
}
}
public override void GetContextMenuEntries( Mobile from, ArrayList list )
{
base.GetContextMenuEntries( from, list );
list.Add( new OpenBankEntry( from, this ) );
}
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();
}
}
}[/code:1]
ok the area I added is
[code:1]else if ( e.Mobile.InRange( this, 12 ) && e.HasKeyword( 0x0003 ) )
{
e.Mobile.Backpack.DropItem( new BankCheck( 1000 ) );
}[/code:1]
ok when you say check it creates a 1k check in your backpack I am trying to get it to create in your bank also check your bank if you have enough it takes it from your amount. I want to add later the ability to specify how big of a check right now I want to start small. Also if there is any coding errors or any clean ups I need to do let me know I will continue working on it but I wanted you guys to see what I am working on.