public Evolution(string evolutionStringFormat, MetaTable <int> itemDb, MetaTable <int> mobDb) { if (String.IsNullOrEmpty(evolutionStringFormat)) { return; } string[] data = evolutionStringFormat.Trim(',').Split(','); for (int i = 0; i < data.Length; i++) { var field = data[i]; if (field.StartsWith("#")) { var target = new EvolutionTarget(); target.Target = DbIOUtils.Name2Id(mobDb, ServerMobAttributes.AegisName, field.Substring(1), "mob_db", true).ToString(); Targets.Add(target); } else { var last = Targets.Last(); last.ItemRequirements.Add(new Utilities.Extension.Tuple <object, int>(DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, data[i], "item_db", true), Int32.Parse(data[i + 1]))); i++; } } }
public string GetStringFormat(RangeListView lv, Dictionary <string, MetaTable <int> > dbs) { var itemDb = dbs[ServerDbs.Items]; StringBuilder b = new StringBuilder(); b.Append(DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, _requirement.Item1.ToString(), "item_db", true)); b.Append(","); b.Append(_requirement.Item2); b.Append(","); return(b.ToString()); }
public string GetStringFormat(RangeListView lv, Dictionary <string, MetaTable <int> > dbs) { var itemDb = dbs[ServerDbs.Items]; var mobDb = dbs[ServerDbs.Mobs]; StringBuilder b = new StringBuilder(); b.Append("#"); b.Append(DbIOUtils.Name2Id(mobDb, ServerMobAttributes.AegisName, EvolutionTarget.Target, "item_db", true)); b.Append(","); foreach (Utilities.Extension.Tuple <object, int> item in EvolutionTarget.ItemRequirements) { b.Append(DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, item.Item1.ToString(), "item_db", true)); b.Append(","); b.Append(item.Item2); b.Append(","); } return(b.ToString()); }
//private void _tuple_TupleModified(object sender, bool value) { // OnPropertyChanged(); //} private void _reload() { object res = DbIOUtils.Name2Id(_mobsTable, ServerMobAttributes.AegisName, _evolutionTarget.Target, "mob_db", true); EvolutionName = ""; if (res is int) { int key = (int)res; ID = res.ToString(); if (_mobsTable.ContainsKey(key)) { EvolutionName = (string)_mobsTable.GetTuple(key).GetRawValue(ServerMobAttributes.KRoName.Index); } } else { ID = res.ToString(); } }
private void _reload() { object res = DbIOUtils.Name2Id(_itemsTable, ServerItemAttributes.AegisName, _requirement.Item1 as string, "mob_db", true); Name = ""; if (res is int) { int key = (int)res; ID = res.ToString(); if (_itemsTable.ContainsKey(key)) { Name = (string)_itemsTable.GetTuple(key).GetRawValue(ServerItemAttributes.Name.Index); } } else { ID = res.ToString(); } Amount = _requirement.Item2; }
private void _miPasteRequirement_Click(object sender, RoutedEventArgs e) { try { if (_tab.List.SelectedItem == null) { return; } if (!Clipboard.ContainsText()) { return; } string text = Clipboard.GetText(); string[] elementsToAdd = text.Trim(',').Split(','); if (elementsToAdd.Length % 2 != 0) { throw new Exception("The number of arguments must be even."); } List <Utilities.Extension.Tuple <object, int> > copy = new List <Utilities.Extension.Tuple <object, int> >(); var itemDb = _tab.ProjectDatabase.GetMetaTable <int>(ServerDbs.Items); for (int i = 0; i < elementsToAdd.Length; i += 2) { copy.Add(new Utilities.Extension.Tuple <object, int>(DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, elementsToAdd[i], "item_db", true).ToString(), Int32.Parse(elementsToAdd[i + 1]))); } var btable = _tab.Table; btable.Commands.Begin(); TValue item = (TValue)_tab.List.SelectedItem; bool changed = false; try { _evolution = new Evolution(); foreach (var targetEv in _lv.Items.OfType <PetEvolutionView>()) { if (targetEv == _lv.SelectedItem) { List <Utilities.Extension.Tuple <object, int> > requirements = new List <Utilities.Extension.Tuple <object, int> >(); foreach (var requirement in _lvRequirements.Items.OfType <PetEvolutionTargetView>()) { if (copy.Any(p => p.Item1.ToString() == requirement.ID.ToString(CultureInfo.InvariantCulture) && p.Item2 == requirement.Amount)) { var cpyEntry = copy.Where(p => p.Item1.ToString() == requirement.ID.ToString(CultureInfo.InvariantCulture) && p.Item2 == requirement.Amount).ToList(); foreach (var ea in cpyEntry) { copy.Remove(ea); } } else if (copy.Any(p => p.Item1.ToString() == requirement.ID.ToString(CultureInfo.InvariantCulture) && p.Item2 != requirement.Amount)) { var cpyEntry = copy.First(p => p.Item1.ToString() == requirement.ID.ToString(CultureInfo.InvariantCulture)); requirements.Add(cpyEntry); copy.Remove(cpyEntry); changed = true; } else { requirements.Add(requirement.Requirement); } } if (copy.Count > 0) { requirements.AddRange(copy.Select(p => new Utilities.Extension.Tuple <object, int>(DbIOUtils.Id2Name(itemDb, ServerItemAttributes.AegisName, p.Item1.ToString()), p.Item2))); changed = true; } targetEv.EvolutionTarget.ItemRequirements = requirements; } _evolution.Targets.Add(targetEv.EvolutionTarget); } if (changed) { btable.Commands.Set(item, ServerPetAttributes.Evolution, _evolution.ToString()); } } catch (Exception err) { ErrorHandler.HandleException(err); } btable.Commands.EndEdit(); if (changed) { _updateAction(item); } } catch (Exception err) { ErrorHandler.HandleException(err); } }
public static void Loader <TKey>(DbDebugItem <TKey> debug, AbstractDb <TKey> db) { if (debug.FileType == FileType.Yaml) { var ele = new YamlParser(debug.FilePath); var table = debug.AbsractDb.Table; if (ele.Output == null || ((ParserArray)ele.Output).Objects.Count == 0 || (ele.Output["copy_paste"] ?? ele.Output["Body"]) == null) { return; } var mobDb = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Mobs); var itemDb = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Items); foreach (var quest in ele.Output["copy_paste"] ?? ele.Output["Body"]) { try { int id = Int32.Parse(quest["Id"]); TKey questId = (TKey)(object)id; table.SetRaw(questId, ServerQuestsAttributes.QuestTitle, "\"" + (quest["Title"] ?? "").Trim('\"') + "\""); table.SetRaw(questId, ServerQuestsAttributes.TimeLimitNew, (quest["TimeLimit"] ?? "")); var targets = quest["Targets"] as ParserList; if (targets != null) { int count = 0; foreach (var target in targets) { if (count >= 3) { debug.ReportIdExceptionWithError("The maximum amount of targets has been reached (up to 3).", id, targets.Line); continue; } table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.TargetId1.Index + 2 * count], DbIOUtils.Name2Id(mobDb, ServerMobAttributes.AegisName, target["Mob"] ?? "", "mob_db", true)); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Val1.Index + 2 * count], target["Count"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Id1.Index + count], target["Id"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Race1.Index + count], target["Race"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Size1.Index + count], target["Size"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Element1.Index + count], target["Element"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.MinLevel1.Index + count], target["MinLevel"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.MaxLevel1.Index + count], target["MaxLevel"] ?? "0"); count++; } } var drops = quest["Drops"] as ParserList; if (drops != null) { int count = 0; foreach (var drop in drops) { if (count >= 3) { debug.ReportIdExceptionWithError("The maximum amount of drops has been reached (up to 3).", id, drops.Line); continue; } table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.NameId1.Index + 3 * count], DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, drop["Item"] ?? "", "item_db", true)); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Rate1.Index + 3 * count], drop["Rate"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.MobId1.Index + 3 * count], DbIOUtils.Name2Id(mobDb, ServerMobAttributes.AegisName, drop["Mob"] ?? "", "mob_db", true)); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Count1.Index + count], drop["Count"] ?? "1"); count++; } } } catch { if (quest["Id"] == null) { if (!debug.ReportIdException("#", quest.Line)) { return; } } else if (!debug.ReportIdException(quest["Id"], quest.Line)) { return; } } } } else if (debug.FileType == FileType.Txt) { List <DbAttribute> attributes = new List <DbAttribute>(db.AttributeList.Attributes); bool rAthenaNewFormat = false; int[] oldColumns = { 0, 1, 2, 3, 4, 5, 6, 7, 17 }; foreach (string[] elements in TextFileHelper.GetElementsByCommasQuotes(IOHelper.ReadAllBytes(debug.FilePath))) { try { TKey id = (TKey)TypeDescriptor.GetConverter(typeof(TKey)).ConvertFrom(elements[0]); if (elements.Length == 18) { rAthenaNewFormat = true; db.Attached["rAthenaFormat"] = 18; } if (rAthenaNewFormat) { for (int index = 1; index < elements.Length; index++) { DbAttribute property = attributes[index]; db.Table.SetRaw(id, property, elements[index]); } } else { for (int index = 1; index < oldColumns.Length; index++) { DbAttribute property = attributes[oldColumns[index]]; db.Table.SetRaw(id, property, elements[index]); } } } catch { if (elements.Length <= 0) { if (!debug.ReportIdException("#")) { return; } } else if (!debug.ReportIdException(elements[0])) { return; } } } } else if (debug.FileType == FileType.Conf) { var ele = new LibconfigParser(debug.FilePath); var table = debug.AbsractDb.Table; foreach (var quest in ele.Output["copy_paste"] ?? ele.Output["quest_db"]) { try { int id = Int32.Parse(quest["Id"]); TKey questId = (TKey)(object)id; table.SetRaw(questId, ServerQuestsAttributes.QuestTitle, "\"" + (quest["Name"] ?? "") + "\""); table.SetRaw(questId, ServerQuestsAttributes.TimeLimit, (quest["TimeLimit"] ?? "0")); var targets = quest["Targets"] as ParserList; if (targets != null) { int count = 0; foreach (var target in targets) { if (count >= 3) { debug.ReportIdExceptionWithError("The maximum amount of targets has been reached (up to 3).", id, targets.Line); continue; } table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.TargetId1.Index + 2 * count], target["MobId"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Val1.Index + 2 * count], target["Count"] ?? "0"); count++; } } var drops = quest["Drops"] as ParserList; if (drops != null) { int count = 0; foreach (var drop in drops) { if (count >= 3) { debug.ReportIdExceptionWithError("The maximum amount of drops has been reached (up to 3).", id, drops.Line); continue; } table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.NameId1.Index + 3 * count], drop["ItemId"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.Rate1.Index + 3 * count], drop["Rate"] ?? "0"); table.SetRaw(questId, ServerQuestsAttributes.AttributeList[ServerQuestsAttributes.MobId1.Index + 3 * count], drop["MobId"] ?? "0"); count++; } } } catch { if (quest["Id"] == null) { if (!debug.ReportIdException("#", quest.Line)) { return; } } else if (!debug.ReportIdException(quest["Id"], quest.Line)) { return; } } } } }
public static void Loader(DbDebugItem <int> debug, AbstractDb <int> db) { if (debug.FileType == FileType.Yaml) { var ele = new YamlParser(debug.FilePath); var table = debug.AbsractDb.Table; if (ele.Output == null || ((ParserArray)ele.Output).Objects.Count == 0 || (ele.Output["copy_paste"] ?? ele.Output["Body"]) == null) { return; } var mobDb = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Mobs); var itemDb = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Items); foreach (var pet in ele.Output["copy_paste"] ?? ele.Output["Body"]) { string mob = pet["Mob"] ?? ""; int mobId = (int)DbIOUtils.Name2Id(mobDb, ServerMobAttributes.AegisName, mob, "mob_db", false); table.SetRaw(mobId, ServerPetAttributes.LureId, DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, pet["TameItem"] ?? "", "item_db", true)); table.SetRaw(mobId, ServerPetAttributes.Name, mob); table.SetRaw(mobId, ServerPetAttributes.EggId, DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, pet["EggItem"] ?? "", "item_db", true)); table.SetRaw(mobId, ServerPetAttributes.EquipId, DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, pet["EquipItem"] ?? "", "item_db", true)); table.SetRaw(mobId, ServerPetAttributes.FoodId, DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, pet["FoodItem"] ?? "", "item_db", true)); table.SetRaw(mobId, ServerPetAttributes.Fullness, pet["Fullness"] ?? ""); table.SetRaw(mobId, ServerPetAttributes.HungryDelay, pet["HungryDelay"] ?? ServerPetAttributes.HungryDelay.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.HungerIncrease, pet["HungerIncrease"] ?? ServerPetAttributes.HungerIncrease.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.IntimacyStart, pet["IntimacyStart"] ?? ServerPetAttributes.IntimacyStart.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.IntimacyFed, pet["IntimacyFed"] ?? ServerPetAttributes.IntimacyFed.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.IntimacyOverfed, pet["IntimacyOverfed"] ?? ServerPetAttributes.IntimacyOverfed.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.IntimacyHungry, pet["IntimacyHungry"] ?? ServerPetAttributes.IntimacyHungry.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.IntimacyOwnerDie, pet["Intimacy.OwnerDie"] ?? ServerPetAttributes.IntimacyOwnerDie.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.CaptureRate, pet["CaptureRate"] ?? ServerPetAttributes.CaptureRate.Default.ToString()); table.SetRaw(mobId, ServerPetAttributes.SpecialPerformance, (pet["SpecialPerformance"] ?? "true") == "true" ? "1" : "0"); table.SetRaw(mobId, ServerPetAttributes.AttackRate, pet["AttackRate"] ?? ""); table.SetRaw(mobId, ServerPetAttributes.RetaliateRate, pet["RetaliateRate"] ?? ""); table.SetRaw(mobId, ServerPetAttributes.ChangeTargetRate, pet["ChangeTargetRate"] ?? ""); table.SetRaw(mobId, ServerPetAttributes.AllowAutoFeed, pet["AllowAutoFeed"] ?? ""); table.SetRaw(mobId, ServerPetAttributes.LoyalScript, pet["Script"] ?? ""); table.SetRaw(mobId, ServerPetAttributes.PetScript, pet["SupportScript"] ?? ""); if (pet["Evolution"] != null) { var evolution = pet["Evolution"]; Evolution evolutionObj = new Evolution(); foreach (var target in evolution) { EvolutionTarget targetObj = new EvolutionTarget(); targetObj.Target = target["Target"]; foreach (var requirement in target["ItemRequirements"]) { targetObj.ItemRequirements.Add(new Utilities.Extension.Tuple <object, int>(requirement["Item"] ?? "501", Int32.Parse(requirement["Amount"]))); } evolutionObj.Targets.Add(targetObj); } table.SetRaw(mobId, ServerPetAttributes.Evolution, evolutionObj.ToString()); } } } else if (debug.FileType == FileType.Txt) { //DbIOMethods.DbLoaderComma(debug, db); DbIOMethods.DbLoaderAny(debug, db, TextFileHelper.GetElementsByCommas, true, 25); //numberOfAttributesToGuess } }
public static void Loader <TKey>(DbDebugItem <TKey> debug, AbstractDb <TKey> db) { if (debug.FileType == FileType.Yaml) { var ele = new YamlParser(debug.FilePath); var table = debug.AbsractDb.Table; if (ele.Output == null || ((ParserArray)ele.Output).Objects.Count == 0 || (ele.Output["copy_paste"] ?? ele.Output["Body"]) == null) { return; } var mobDb = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Mobs); var itemDb = SdeEditor.Instance.ProjectDatabase.GetMetaTable <int>(ServerDbs.Items); var stateFlags = new Dictionary <string, long>(); stateFlags["none"] = 0; stateFlags["hidden"] = 1; stateFlags["riding"] = 2; stateFlags["falcon"] = 3; stateFlags["cart"] = 4; stateFlags["shield"] = 5; stateFlags["recover_weight_rate"] = 6; stateFlags["move_enable"] = 7; stateFlags["water"] = 8; stateFlags["ridingdragon"] = 9; stateFlags["wug"] = 10; stateFlags["ridingwug"] = 11; stateFlags["mado"] = 12; stateFlags["elementalspirit"] = 13; stateFlags["elementalspirit2"] = 14; stateFlags["peco"] = 15; stateFlags["sunstance"] = 16; stateFlags["moonstance"] = 17; stateFlags["starstance"] = 18; stateFlags["universestance"] = 19; foreach (var skill in ele.Output["copy_paste"] ?? ele.Output["Body"]) { try { int id = Int32.Parse(skill["Id"]); TKey skillId = (TKey)(object)id; table.SetRaw(skillId, ServerSkillAttributes.Name, skill["Name"] ?? ""); table.SetRaw(skillId, ServerSkillAttributes.Desc, skill["Description"] ?? ""); table.SetRaw(skillId, ServerSkillAttributes.MaxLevel, skill["MaxLevel"] ?? "1"); table.SetRaw(skillId, ServerSkillAttributes.AttackType, Constants.Parse2DbString <AttackTypeType>(skill["Type"] ?? "None")); table.SetRaw(skillId, ServerSkillAttributes.SkillTargetType, Constants.Parse2DbString <SkillTargetType>(skill["TargetType"] ?? "0")); table.SetRaw(skillId, ServerSkillAttributes.DamageFlags, DbIOUtils.LoadFlag <SkillDamageType>(skill["DamageFlags"], "0")); table.SetRaw(skillId, ServerSkillAttributes.Inf2New, DbIOUtils.LoadFlag <SkillType2TypeNew>(skill["Flags"], "0")); table.SetRaw(skillId, ServerSkillAttributes.Range, _loadListToString(skill["Range"], "Level", "Size")); table.SetRaw(skillId, ServerSkillAttributes.HitMode, Constants.Parse2DbString <HitType>(skill["Hit"] ?? "0")); table.SetRaw(skillId, ServerSkillAttributes.HitCount, _loadListToString(skill["HitCount"], "Level", "Count", "0")); table.SetRaw(skillId, ServerSkillAttributes.SkillElement, _loadListToString(skill["Element"], "Level", "Element", "Neutral")); table.SetRaw(skillId, ServerSkillAttributes.SplashArea, _loadListToString(skill["SplashArea"], "Level", "Area")); table.SetRaw(skillId, ServerSkillAttributes.ActiveInstance, _loadListToString(skill["ActiveInstance"], "Level", "Max")); table.SetRaw(skillId, ServerSkillAttributes.Knockback, _loadListToString(skill["Knockback"], "Level", "Amount")); if (skill["CopyFlags"] != null) { var entry = skill["CopyFlags"]; table.SetRaw(skillId, ServerSkillAttributes.CopyFlags, DbIOUtils.LoadFlag <SkillCopyType>(entry["Skill"], "0")); table.SetRaw(skillId, ServerSkillAttributes.CopyFlagsRemovedRequirement, DbIOUtils.LoadFlag <SkillCopyRemoveRequirementType>(entry["RemoveRequirement"], "0")); } if (skill["NoNearNPC"] != null) { var entry = skill["NoNearNPC"]; table.SetRaw(skillId, ServerSkillAttributes.NoNearNPCRange, entry["AdditionalRange"] ?? "0"); table.SetRaw(skillId, ServerSkillAttributes.NoNearNPCType, DbIOUtils.LoadFlag <NoNearNpcType>(entry["Type"], "0")); } table.SetRaw(skillId, ServerSkillAttributes.CastInterrupt, skill["CastCancel"] ?? "false"); table.SetRaw(skillId, ServerSkillAttributes.CastDefenseReduction, skill["CastDefenseReduction"] ?? "0"); table.SetRaw(skillId, ServerSkillAttributes.CastingTime, _loadListToString(skill["CastTime"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.AfterCastActDelay, _loadListToString(skill["AfterCastActDelay"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.AfterCastWalkDelay, _loadListToString(skill["AfterCastWalkDelay"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.Duration1, _loadListToString(skill["Duration1"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.Duration2, _loadListToString(skill["Duration2"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.Cooldown, _loadListToString(skill["Cooldown"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.FixedCastTime, _loadListToString(skill["FixedCastTime"], "Level", "Time")); table.SetRaw(skillId, ServerSkillAttributes.CastTimeFlags, DbIOUtils.LoadFlag <CastingFlags>(skill["CastTimeFlags"], "0")); table.SetRaw(skillId, ServerSkillAttributes.CastDelayFlags, DbIOUtils.LoadFlag <CastingFlags>(skill["CastDelayFlags"], "0")); if (skill["Requires"] != null) { var entry = skill["Requires"]; table.SetRaw(skillId, ServerSkillAttributes.RequireHpCost, _loadListToString(entry["HpCost"], "Level", "Amount")); table.SetRaw(skillId, ServerSkillAttributes.RequireSpCost, _loadListToString(entry["SpCost"], "Level", "Amount")); table.SetRaw(skillId, ServerSkillAttributes.RequireHpRateCost, _loadListToString(entry["HpRateCost"], "Level", "Amount")); table.SetRaw(skillId, ServerSkillAttributes.RequireSpRateCost, _loadListToString(entry["SpRateCost"], "Level", "Amount")); table.SetRaw(skillId, ServerSkillAttributes.RequireMaxHpTrigger, _loadListToString(entry["MaxHpTrigger"], "Level", "Amount")); table.SetRaw(skillId, ServerSkillAttributes.RequireZenyCost, _loadListToString(entry["ZenyCost"], "Level", "Amount")); table.SetRaw(skillId, ServerSkillAttributes.RequireWeapons, DbIOUtils.LoadFlag <WeaponType>(entry["Weapon"], "0xFFFFFF")); table.SetRaw(skillId, ServerSkillAttributes.RequireAmmoTypes, DbIOUtils.LoadFlag <AmmoType>(entry["Ammo"], "0")); table.SetRaw(skillId, ServerSkillAttributes.RequireAmmoAmount, entry["AmmoAmount"] ?? "0"); table.SetRaw(skillId, ServerSkillAttributes.RequireState, DbIOUtils.LoadFlag(entry["State"], stateFlags, "0")); if (entry["Status"] != null) { table.SetRaw(skillId, ServerSkillAttributes.RequireStatuses, Methods.Aggregate(entry["Status"].OfType <ParserKeyValue>().Select(p => p.Key).ToList(), ":")); } else { table.SetRaw(skillId, ServerSkillAttributes.RequireStatuses, ""); } table.SetRaw(skillId, ServerSkillAttributes.RequireSpiritSphereCost, _loadListToString(entry["SpiritSphereCost"], "Level", "Amount")); if (entry["ItemCost"] != null) { StringBuilder b = new StringBuilder(); var itemList = entry["ItemCost"]; foreach (var item in itemList) { string key = item["Item"]; int value = Int32.Parse(item["Amount"]); key = DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, key, "item_db", true).ToString(); b.Append(key); b.Append(":"); b.Append(value); b.Append(":"); } table.SetRaw(skillId, ServerSkillAttributes.RequireItemCost, b.ToString().Trim(':')); } if (entry["Equipment"] != null) { StringBuilder b = new StringBuilder(); var itemList = entry["Equipment"]; foreach (var item in itemList.OfType <ParserKeyValue>()) { string key = item.Key; key = DbIOUtils.Name2Id(itemDb, ServerItemAttributes.AegisName, key, "item_db", true).ToString(); b.Append(key); b.Append(":"); } table.SetRaw(skillId, ServerSkillAttributes.RequiredEquipment, b.ToString().Trim(':')); } } if (skill["Unit"] != null) { var entry = skill["Unit"]; table.SetRaw(skillId, ServerSkillAttributes.UnitId, entry["Id"] ?? ""); table.SetRaw(skillId, ServerSkillAttributes.UnitAlternateId, entry["AlternateId"] ?? ""); table.SetRaw(skillId, ServerSkillAttributes.UnitLayout, _loadListToString(entry["Layout"], "Level", "Size")); table.SetRaw(skillId, ServerSkillAttributes.UnitRange, _loadListToString(entry["Range"], "Level", "Size")); table.SetRaw(skillId, ServerSkillAttributes.UnitInterval, entry["Interval"] ?? "0"); table.SetRaw(skillId, ServerSkillAttributes.UnitTarget, DbIOUtils.LoadFlag <UnitTargetType>(entry["Target"], "0x3F0000")); table.SetRaw(skillId, ServerSkillAttributes.UnitFlag, DbIOUtils.LoadFlag <UnitFlagType>(entry["Flag"], "0")); } } catch (FileParserException fpe) { debug.ReportIdException(fpe, skill["Id"]); } catch { if (skill["Id"] == null) { if (!debug.ReportIdException("#", skill.Line)) { return; } } else if (!debug.ReportIdException(skill["Id"], skill.Line)) { return; } } } } }