Rochaven

Initiate
Does anyone see why this box isn't clicky? The quest goes that as you get a item in your pack, you double click the box and then the newly acquired item. After you you have combined three required items, you take box back to npc and receive reward. The box isn't let me me double click on it. When i open the file i see several "null" at the start and wonder if its right. This quest isn't mine , was given to me third party so no idea who or where it comes from.

using System;
using Server;
using Server.Gumps;
using Server.Network;
using System.Collections;
using Server.Multis;
using Server.Mobiles;


namespace Server.Items
{

public class AncientJewelryBox : Item
{
[Constructable]
public AncientJewelryBox() : this( null )
{
}

[Constructable]
public AncientJewelryBox ( string name ) : base ( 0x9A8 )
{
Name = "Ancient Jewelry Box";
LootType = LootType.Blessed;
Hue = 1288;
}

public AncientJewelryBox ( Serial serial ) : base ( serial )
{
}


public override void OnDoubleClick( Mobile m )

{
Item a = m.Backpack.FindItemByType( typeof(ArrianasDiamond) );
if ( a != null )
{
Item b = m.Backpack.FindItemByType( typeof(ArrianasClips) );
if ( b != null )
{
Item c = m.Backpack.FindItemByType( typeof(ArrianasHoops) );
if ( c != null )
{

m.AddToBackpack( new DiamondHoopEarrings() );
a.Delete();
b.Delete();
c.Delete();
m.SendMessage( "You Combine the knowledge of Arriana's ancestry into a Heirloom" );
this.Delete();
}
}
else
{
m.SendMessage( "You are missing something..." );
}
}
}



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();
}
}
}
 
Last edited:
I may be off here, but I'm wondering why there is a null Constructable. Try commenting out this:

Code:
[Constructable]
public AncientJewelryBox() : this( null )
{
}
 
I may be off here, but I'm wondering why there is a null Constructable. Try commenting out this:
I'd also edit the other constructor to remove the name property because it's not being used and you'll also need a parameterless constructor.
Code:
[Constructable]
// Change this
public AncientJewelryBox ( string name ) : base ( 0x9A8 )

// To this
public AncientJewelryBox() : base ( 0x9A8 )

When you doubleclick the item you are making sure you have all 3 items on you first right?
 
Ok this is the error i got
using System;
using Server;
using Server.Gumps;
using Server.Network;
using System.Collections;
using Server.Multis;
using Server.Mobiles;


namespace Server.Items
{

public class AncientJewelryBox : Item
{
[Constructable]
public AncientJewelryBox() : this( null )
{
}

[Constructable]
public AncientJewelryBox ( string name ) : base ( 0x9A8 )
{
Name = "Ancient Jewelry Box";
LootType = LootType.Blessed;
Hue = 1288;
}

public AncientJewelryBox ( Serial serial ) : base ( serial )
{
}


public override void OnDoubleClick( Mobile m )

{
Item a = m.Backpack.FindItemByType( typeof(ArrianasDiamond) );
if ( a != null )
{
Item b = m.Backpack.FindItemByType( typeof(ArrianasClips) );
if ( b != null )
{
Item c = m.Backpack.FindItemByType( typeof(ArrianasHoops) );
if ( c != null )
{

m.AddToBackpack( new DiamondHoopEarrings() );
a.Delete();
b.Delete();
c.Delete();
m.SendMessage( "You Combine the knowledge of Arriana's ancestry into a Heirloom" );
this.Delete();
}
}
else
{
m.SendMessage( "You are missing something..." );
}
}
}



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();
}
}
}
After i made these changes.......
using Server;
using Server.Gumps;
using Server.Network;
using System.Collections;
using Server.Multis;
using Server.Mobiles;


namespace Server.Items
{

public class AncientJewelryBox : Item
{
public AncientJewelryBox() : this( null )
{
}

public AncientJewelryBox () : base ( 0x9A8 )
{
Name = "Ancient Jewelry Box";
LootType = LootType.Blessed;
Hue = 1288;
 
Remove this like m309 mentioned.
Code:
public AncientJewelryBox() : this( null )
{
}

I'd also change your DoubleClick method to look like this so the 'You are missing something' message triggers correctly.
Code:
public override void OnDoubleClick( Mobile m )
{
	Item a = m.Backpack.FindItemByType( typeof(ArrianasDiamond) );
	Item b = m.Backpack.FindItemByType( typeof(ArrianasClips) );
	Item c = m.Backpack.FindItemByType( typeof(ArrianasHoops) );
	if ( a != null && b != null && c != null )
	{ 
		m.AddToBackpack( new DiamondHoopEarrings() );
		a.Delete();
		b.Delete();
		c.Delete();
		m.SendMessage( "You Combine the knowledge of Arriana's ancestry into a Heirloom" );
		this.Delete();
	}
	else
	{
		m.SendMessage( "You are missing something..." );
	}
}
 
Ahh sweet, thanks for the help guys, been working so many hours this late week i have not had time to get back to you, thanks again for the help
 
how come (else) and( void) in both lines "public override void" are underlined red? am i missing a ; after one of those?
Code:
  else
       {
         m.SendMessage( "You are missing something..." );
     }

     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();
 
Ok got it fixed all now except one wavy line saying it wants a "expected" yet if i put one in, it ask for another lol , i'm losing my mind. Heres the line below Its the expected after You are missing something.
Code:
  }
         else
  {

         m.SendMessage( "You are missing something..." );
 
O M G lol, it works !! I just has to hmmm , i dont know the proper term for it but i needed to add a single } to it, that was it......sooo simple yet i think i blew out another grey hair lol, Thanks guys !
 
You are missing a closing bracket. You need one for the 'else' and one for the void statement. Use the full code I posted above or it should look like this before your Serialize method
Code:
    else
    {
        m.SendMessage( "You are missing something..." );
    }
} // <---- You are missing this bracket

public override void Serialize ( GenericWriter writer)
{
	base.Serialize ( writer );

	writer.Write ( (int) 0);
}

Edit: Nvm you figured it out before I could finish posting :).
 
So out of curiosity , why did it require three closing brackets ? Like this
}
}
}

As i am still learning so much , understanding the reasoning for three } has me baffled. Thanks for the help and input !!! Also the script has no Maker name on it, so i dont know who make it but was thinking of posting it on servUO for anyone else that might want a fun short quest, taking no credit of course for making it and giving all credit due to those that helped me fix it. Is that allowed?
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back