public static void ParseUserSkills() { int count = 0; foreach (var o in DC.GetMainObjectsByName("SkillGetConList")) { foreach (var data in (List<Dictionary<string, object>>)DC.GetValues(o)["SkillList"]) { UserSkill skill = new UserSkill(); skill.SkillId = int.Parse(data["skillId"].ToString()); skill.Level = int.Parse(data["level"].ToString()); skill.RaceGenderClass = new RaceGenderClass { Race = (Race) Enum.Parse(typeof (Race), data["race"].ToString()), Gender = (Gender) Enum.Parse(typeof (Gender), data["gender"].ToString()), Class = (PlayerClass) Enum.Parse(typeof (PlayerClass), data["class"].ToString()), }; skill.IsActive = bool.Parse(data["isActive"].ToString()); skill.PrevSkillId = int.Parse(data["prevSkillId"].ToString()); skill.PrevSkillOverride = bool.Parse(data["prevSkillOverride"].ToString()); if (!UserSkills.ContainsKey(skill.TemplateId)) UserSkills.Add(skill.TemplateId, new Dictionary<int, UserSkill>()); Dictionary<string, object> stringData; try { stringData = Strings[skill.TemplateId][skill.SkillId]; } catch { stringData = null; } if (stringData != null) { skill.Name = stringData["name"].ToString(); skill.Tooltip = stringData["tooltip"].ToString(); } else { skill.Name = "UNK"; skill.Tooltip = ""; } UserSkills[skill.TemplateId].Add(skill.SkillId, skill); count++; } } Console.WriteLine("Load {0} user skills...", count); }
public void SkillPurchased(Player player, UserSkill skill) { new SpSkillPurchased(skill).Send(player); new SpSkillList(player).Send(player); new SpTraidSkillList(player, SkillsLearnService.GetSkillLearnList(player)).Send(player); }
public static void ParseUserSkills() { int count = 0; foreach (var o in DC.GetMainObjectsByName("SkillGetConList")) { foreach (var data in (List<Dictionary<string, object>>)DC.GetValues(o)["SkillList"]) { UserSkill skill = new UserSkill(); skill.SkillId = int.Parse(data["skillId"].ToString()); skill.Level = int.Parse(data["level"].ToString()); skill.RaceGenderClass = new RaceGenderClass(data["race"].ToString(), data["gender"].ToString(), data["class"].ToString()); skill.IsActive = bool.Parse(data["isActive"].ToString()); skill.PrevSkillId = int.Parse(data["prevSkillId"].ToString()); skill.PrevSkillOverride = bool.Parse(data["prevSkillOverride"].ToString()); if (!UserSkills.ContainsKey(skill.TemplateId)) UserSkills.Add(skill.TemplateId, new Dictionary<int, UserSkill>()); Dictionary<string, object> stringData = null; Dictionary<int, Dictionary<string, object>> rgcStrings; Strings.TryGetValue(skill.RaceGenderClass, out rgcStrings); if (rgcStrings != null) rgcStrings.TryGetValue(skill.SkillId, out stringData); if (stringData != null) { skill.Name = stringData["name"].ToString(); skill.Tooltip = stringData["tooltip"].ToString(); } else { skill.Name = null; skill.Tooltip = null; } UserSkills[skill.TemplateId].Add(skill.SkillId, skill); count++; } } Console.WriteLine("Load {0} user skills...", count); }
public static void SkillPurchased(Player player, UserSkill skill) { FeedbackService.SkillPurchased(player, skill); QuestEngine.OnPlayerLearnSkill(player); }
public SpSkillPurchased(UserSkill skill) { Skill = skill; }