MightyHythloth
Wanderer
Fatal error on random case
Greetings. I'm trying to create an item that when double clicked gives you a check for a random amount and deletes the item itself. I have the other parts of the item working fine, but for some reason I keep getting a fatal error with this part. Btw, using 2.0RC1
Greetings. I'm trying to create an item that when double clicked gives you a check for a random amount and deletes the item itself. I have the other parts of the item working fine, but for some reason I keep getting a fatal error with this part. Btw, using 2.0RC1
Code:
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use
it.
}
else
switch ( Utility.Random(2))
{
default:
case 0: from.AddToBackpack( new BankCheck( 100000 ) ); break;
case 1: from.AddToBackpack( new BankCheck( 250000 ) ); break;
}
this.Delete;
}