1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Arriana's Quest

Discussion in 'Script Support' started by Rochaven, May 11, 2014.

  1. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    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.

    Spoiler

    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();
    }
    }
    }
     
    #1 Rochaven, May 11, 2014
    Last edited: May 11, 2014
  2. m309
    Offline

    Admin Moderator ServUO Developer

    Joined:
    Mar 3, 2013
    Messages:
    1,243
    Likes Received:
    130
    I may be off here, but I'm wondering why there is a null Constructable. Try commenting out this:

    Code (C#):
    1. [Constructable]
    2. public AncientJewelryBox() : this( null )
    3. {
    4. }
     
  3. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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 (C#):
    1. [Constructable]
    2. // Change this
    3. public AncientJewelryBox ( string name ) : base ( 0x9A8 )
    4.  
    5. // To this
    6. public AncientJewelryBox() : base ( 0x9A8 )
    When you doubleclick the item you are making sure you have all 3 items on you first right?
     
    • Like Like x 1
  4. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    Ok this is the error i got
    Spoiler

    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.......
    Spoiler

    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;
     
  5. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Remove this like m309 mentioned.
    Code (C#):
    1. public AncientJewelryBox() : this( null )
    2. {
    3. }
    I'd also change your DoubleClick method to look like this so the 'You are missing something' message triggers correctly.
    Code (C#):
    1. public override void OnDoubleClick( Mobile m )
    2. {
    3.     Item a = m.Backpack.FindItemByType( typeof(ArrianasDiamond) );
    4.     Item b = m.Backpack.FindItemByType( typeof(ArrianasClips) );
    5.     Item c = m.Backpack.FindItemByType( typeof(ArrianasHoops) );
    6.     if ( a != null && b != null && c != null )
    7.     {
    8.         m.AddToBackpack( new DiamondHoopEarrings() );
    9.         a.Delete();
    10.         b.Delete();
    11.         c.Delete();
    12.         m.SendMessage( "You Combine the knowledge of Arriana's ancestry into a Heirloom" );
    13.         this.Delete();
    14.     }
    15.     else
    16.     {
    17.         m.SendMessage( "You are missing something..." );
    18.     }
    19. }
     
    • Winner Winner x 1
  6. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    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
     
  7. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    how come (else) and( void) in both lines "public override void" are underlined red? am i missing a ; after one of those?
    Code (C#):
    1.  
    2.   else
    3.        {
    4.          m.SendMessage( "You are missing something..." );
    5.      }
    6.  
    7.      public override void Serialize ( GenericWriter writer)
    8.      {
    9.        base.Serialize ( writer );
    10.  
    11.        writer.Write ( (int) 0);
    12.      }
    13.  
    14.      public override void Deserialize( GenericReader reader )
    15.      {
    16.        base.Deserialize ( reader );
    17.  
    18.        int version = reader.ReadInt();
    19.  
     
  8. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    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 (C#):
    1.  
    2.   }
    3.          else
    4.   {
    5.  
    6.          m.SendMessage( "You are missing something..." );
    7.  
     
  9. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    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 !
     
  10. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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 (C#):
    1.     else
    2.     {
    3.         m.SendMessage( "You are missing something..." );
    4.     }
    5. } // <---- You are missing this bracket
    6.  
    7. public override void Serialize ( GenericWriter writer)
    8. {
    9.     base.Serialize ( writer );
    10.  
    11.     writer.Write ( (int) 0);
    12. }
    Edit: Nvm you figured it out before I could finish posting :).
     
    • Helpful Helpful x 1
  11. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    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?
     
Similar Threads: Arriana's Quest
Forum Title Date
Archived Bug Reports Professional Fish Quests Reward Oct 12, 2017
Script Support Questions about levelable/customizable weapons Oct 10, 2017
General Discussion Thanksgiving 2009 Quest Oct 6, 2017
Script Support Request of a extra feature in Scripts/Multis/BaseCamp.cs Sep 21, 2017
Script Support Armor Activator Script Question Sep 13, 2017
General Discussion VPS Questions Sep 13, 2017
Archived Bug Reports Industrious as an Ant Lion Quest Sep 10, 2017