Tukaram
Member
I am installing Arianna's Quest that I downloaded with some quest package...
It is an old quest where Arianna gives you a magic jewelry box, and sends you to collect 3 items from her relatives. They each ask for something in return, of course. At the end of the quest you have the magic jewelry box, 3 pieces of jewelry, and 2 books of clues. When you double click the box it deletes the 3 pieces of jewelry and leaves you the special quest jewelry that Arriana wants. That leaves some junk in your bag - the jewelry box, and 2 books.
I looked at the code and see how they delete the 3 pieces of jewelry, and can add the box & books (just to clean up your backpack). As it is written all the items that are deleted are required to be in your pack to make the quest item. The problem is I don't think the books should be a required item. Here is the code where I added the books & box. Is there a way to make it delete the 2 books, if you have them, but still work and make the quest item if you do not have them?
Am I making any sense ha ha
Items "a", "b", and "c" were in the original script. I added items "d", "e", and "f". I want "e" and "f" to be optional. I tested this and it does work - I just don't want the books to be required.
I tried remarking out the if (e != null) for e & f. Then Visual Studio made me move the closing bracket for each of them above the else command. The script loaded fine, but when I double clicked the box the server crashed. So it is not quite right...
It is an old quest where Arianna gives you a magic jewelry box, and sends you to collect 3 items from her relatives. They each ask for something in return, of course. At the end of the quest you have the magic jewelry box, 3 pieces of jewelry, and 2 books of clues. When you double click the box it deletes the 3 pieces of jewelry and leaves you the special quest jewelry that Arriana wants. That leaves some junk in your bag - the jewelry box, and 2 books.
I looked at the code and see how they delete the 3 pieces of jewelry, and can add the box & books (just to clean up your backpack). As it is written all the items that are deleted are required to be in your pack to make the quest item. The problem is I don't think the books should be a required item. Here is the code where I added the books & box. Is there a way to make it delete the 2 books, if you have them, but still work and make the quest item if you do not have them?
Am I making any sense ha ha
Items "a", "b", and "c" were in the original script. I added items "d", "e", and "f". I want "e" and "f" to be optional. I tested this and it does work - I just don't want the books to be required.
I tried remarking out the if (e != null) for e & f. Then Visual Studio made me move the closing bracket for each of them above the else command. The script loaded fine, but when I double clicked the box the server crashed. So it is not quite right...
Code:
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)
{
Item d = m.Backpack.FindItemByType(typeof(AncientJewelryBox));
if (d != null)
{
Item e = m.Backpack.FindItemByType(typeof(GrandpaTamsJournal));
if (e != null)
{
Item f = m.Backpack.FindItemByType(typeof(UncleJohnsBook));
if (f != null)
{
m.AddToBackpack(new DiamondHoopEarrings());
a.Delete();
b.Delete();
c.Delete();
d.Delete();
e.Delete();
f.Delete();
m.SendMessage("You Combine the knowledge of Arriana's ancestry into a Heirloom");
this.Delete();
}
}
else
{
m.SendMessage("You are missing something...");
}
}
}
}
}
}