[Help] Albetros Source

09/17/2012 10:52 coreymills#1
im working on codeing reborn into it and it downgrades the items and all but when it gets to the skills it will not teach them could someone help me out and tell me where im going wrong

all code inside Spoiler


and i changed it so there first Profession reads as Profession not Profession1

any help would be great.
09/17/2012 12:27 I don't have a username#2
Code:
            bool KeepSkill = false;

            if (KeepSkill)
            {
If this doesn't answer you...
09/17/2012 23:39 pro4never#3
Side note... why hard code things like this? In my own version (thought it was included as part of the revision I uploaded) I handle it via a database system...

When server is loaded it pulls all the entries in the database to populate nested collections for easy access.

You simply do...

foreach(Skill _skill in RebornSkillsGained[user.Profession1][user.Profession2])
user.AddSkill(_skill);
foreach(Skill _skill in RebornSkillsLost[user.Profession1][user.Profession2])
user.RemoveSkill(_skill);

Same thing for 2nd reborn except that it's..

foreach(Skill _skill in SecondRebornSkillsGained[user.Profession1][user.Profession2][user.Profession3])
user.AddSkill(_skill);
foreach(Skill _skill in SecondRebornSkillsLost[user.Profession1][user.Profession2][user.Profession3])
user.RemoveSkill(_skill);


Makes it a lot easier to edit and sooo much more readable imo.

Note: In this example it would be collections consisting of...

Dictionary<byte, Dictionary<byte, List<ushort>>>

And

Dictionary<byte, Dictionary<byte, Dictionary<byte, List<ushort>>>>