CrafterEric
Member
I'm trying to setup Milva's beginner gargoyle quest and add the Letter of Gargoyle Apprenticeship to only gargoyle's backpack on character creation. I was hoping to be able to add the letter based on race, without messing with elves or allowing anyone to go on both quests. Here's the relevant part of what I have in CharacterCreation.cs:
The stuff I changed is at the bottom. I just changed a line or two from stock to the above, and I get the following errors:
Lines 60-62 are actually lines 23-25 in the code at the beginning of this post, the 3 lines starting with else if (m.Race == Race.Gargoyle) listed above. I've included the entire CharacterCreation.cs file if it helps. I also tried simply else, but that would also give the gargoyle letter to elves. I'm sure this is simple formatting, but I'm still new. Please tell me what I did wrong so I can learn from it (I'll have this answer bookmarked).
Code:
private static void AddBackpack(Mobile m)
{
Container pack = m.Backpack;
if (pack == null)
{
pack = new Backpack();
pack.Movable = false;
m.AddItem(pack);
}
PackItem(new Gold(25000)); // Starting gold can be customized here
PackItem(new daat99.MasterStorage());
PackItem(new StatBall());
PackItem(new SkillBallPlus());
PackItem(new Trash4TokensBackpack());
//PackItem(new BankCrystal());
//PackItem(new TravelAtlas());
//PackItem(new GoldLedger());
//PackItem(new LootBag());
if (m.Race != Race.Gargoyle)
PackItem(new Dagger());
PackItem(new LetterofApprenticeship());
else if (m.Race == Race.Gargoyle)
PackItem(new GargishDagger());
PackItem(new (LetterofGargoyleApprenticeship));
}
The stuff I changed is at the bottom. I just changed a line or two from stock to the above, and I get the following errors:
Code:
Errors:
+ Misc/CharacterCreation.cs:
CS1525: Line 60: Invalid expression term 'else'
CS1002: Line 60: ; expected
CS1031: Line 62: Type expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Lines 60-62 are actually lines 23-25 in the code at the beginning of this post, the 3 lines starting with else if (m.Race == Race.Gargoyle) listed above. I've included the entire CharacterCreation.cs file if it helps. I also tried simply else, but that would also give the gargoyle letter to elves. I'm sure this is simple formatting, but I'm still new. Please tell me what I did wrong so I can learn from it (I'll have this answer bookmarked).
Attachments
Last edited: