beatniche
Initiate
I've gone through my charactercreation.cs and made changes to the starting skills for new characters. Unfortunately, some of the templates are starting with the correct skill values and some are starting with no skill values at all. I've included what I think is the relevant code below. I'm not certain what the error might be. Templates I've tested that I know are working correctly based on the code below are Warrior and Mage and Blacksmith. The Necromancer, Ninja, Samurai, and Paladin are all starting with 0 skill values, despite the changes I made.
Any help would be appreciated.
Code:
private static bool ValidSkills(SkillNameValue[] skills)
{
int total = 0;
for (int i = 0; i < skills.Length; ++i)
{
if (skills[i].Value < 0 || skills[i].Value > 50)
return false;
total += skills[i].Value;
for (int j = i + 1; j < skills.Length; ++j)
{
if (skills[j].Value > 0 && skills[j].Name == skills[i].Name)
return false;
}
}
return (total == 100 || total == 120);
}
private static void SetSkills(Mobile m, SkillNameValue[] skills, int prof)
{
switch ( prof )
{
case 1: // Warrior
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.Anatomy, 60),
new SkillNameValue(SkillName.Healing, 50),
new SkillNameValue(SkillName.Swords, 80),
new SkillNameValue(SkillName.Tactics, 70),
new SkillNameValue(SkillName.Lumberjacking, 50)
};
break;
}
case 2: // Magician
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.EvalInt, 50),
new SkillNameValue(SkillName.Wrestling, 70),
new SkillNameValue(SkillName.Magery, 80),
new SkillNameValue(SkillName.Meditation, 50),
new SkillNameValue(SkillName.Inscribe, 60)
};
break;
}
case 3: // Blacksmith
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.Mining, 80),
new SkillNameValue(SkillName.ArmsLore, 50),
new SkillNameValue(SkillName.Blacksmith, 70),
new SkillNameValue(SkillName.Tinkering, 60),
new SkillNameValue(SkillName.Magery, 50)
};
break;
}
case 4: // Necromancer
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.Necromancy, 80),
new SkillNameValue(SkillName.Alchemy, 50),
new SkillNameValue(SkillName.SpiritSpeak, 70),
new SkillNameValue(SkillName.Swords, 60),
new SkillNameValue(SkillName.Tactics, 50)
};
break;
}
case 5: // Paladin
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.Chivalry, 80),
new SkillNameValue(SkillName.Swords, 70),
new SkillNameValue(SkillName.Focus, 50),
new SkillNameValue(SkillName.Tactics, 60),
new SkillNameValue(SkillName.Parry, 50)
};
break;
}
case 6: //Samurai
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.Bushido, 80),
new SkillNameValue(SkillName.Swords, 70),
new SkillNameValue(SkillName.Anatomy, 60),
new SkillNameValue(SkillName.Healing, 50),
new SkillNameValue(SkillName.Parry, 50)
};
break;
}
case 7: //Ninja
{
skills = new SkillNameValue[]
{
new SkillNameValue(SkillName.Ninjitsu, 80),
new SkillNameValue(SkillName.Hiding, 60),
new SkillNameValue(SkillName.Fencing, 50),
new SkillNameValue(SkillName.Stealth, 70),
new SkillNameValue(SkillName.Poisoning, 50)
};
break;
}
default:
{
if (!ValidSkills(skills))
return;
break;
}
}
Any help would be appreciated.