public static RecallCoordinate Load(DataTableReaderEx reader) { RecallCoordinate info = new RecallCoordinate { ItemIndex = reader.GetString("ItemIndex"), MapName = reader.GetString("MapName"), LinkX = reader.GetInt16("LinkX"), LinkY = reader.GetInt16("LinkY"), }; return info; }
public static MapInfo Load(DataTableReaderEx reader) { MapInfo info = new MapInfo { ID = reader.GetUInt16("ID"), ShortName = reader.GetString("MapName"), FullName = reader.GetString("Name"), RegenX = (int)reader.GetUInt32("RegenX"), RegenY = (int)reader.GetUInt16("RegenY"), Kingdom = reader.GetByte("KingdomMap"), ViewRange = (ushort)reader.GetUInt32("Sight"), }; return info; }
public static ShineNPC Load(DataTableReaderEx reader) { ShineNPC info = new ShineNPC { MobName = reader.GetString("MobName"), Map = reader.GetString("Map"), Coord_X = reader.GetInt32("Coord-X"), Coord_Y = reader.GetInt32("Coord-Y"), Direct = reader.GetInt16("Direct"), NPCMenu = reader.GetByte("NPCMenu"), Role = reader.GetString("Role"), RoleArg0 = reader.GetString("RoleArg0"), }; return info; }
public static ItemUseEffectInfo Load(DataTableReaderEx reader, out string InxName) { ItemUseEffectInfo info = new ItemUseEffectInfo(); InxName = reader.GetString("ItemIndex"); ItemUseEffectType typeA = (ItemUseEffectType)reader.GetUInt32("UseEffectA"); if (typeA != ItemUseEffectType.None) { ItemEffect effect = new ItemEffect(); effect.Type = typeA; effect.Value = reader.GetUInt32("UseValueA"); info.Effects.Add(effect); } ItemUseEffectType typeB = (ItemUseEffectType)reader.GetUInt32("UseEffectB"); if (typeB != ItemUseEffectType.None) { ItemEffect effect = new ItemEffect(); effect.Type = typeB; effect.Value = reader.GetUInt32("UseValueB"); info.Effects.Add(effect); } ItemUseEffectType typeC = (ItemUseEffectType)reader.GetUInt32("UseEffectC"); if (typeC != ItemUseEffectType.None) { ItemEffect effect = new ItemEffect(); effect.Type = typeC; effect.Value = reader.GetUInt32("UseValueC"); info.Effects.Add(effect); } info.AbState = reader.GetString("UseAbStateName"); return info; }
public static LinkTable Load(DataTableReaderEx reader) { LinkTable info = new LinkTable { argument = reader.GetString("argument"), MapServer = reader.GetString("MapServer"), MapClient = reader.GetString("MapClient"), Coord_X = reader.GetInt32("Coord-X"), Coord_Y = reader.GetInt32("Coord-Y"), Direct = reader.GetInt16("Direct"), LevelFrom = reader.GetInt16("LevelFrom"), LevelTo = reader.GetInt16("LevelTo"), Party = reader.GetByte("Party"), }; return info; }
public static DropGroupInfo Load(DataTableReaderEx reader) { DropGroupInfo info = new DropGroupInfo() { GroupID = reader.GetString("ItemID"), MinCount = reader.GetByte("MinQtty"), MaxCount = reader.GetByte("MaxQtty"), Items = new List<ItemInfo>() }; return info; }
/// <summary> /// Needs serious fixing in the reader, as it throws invalid casts (files all use uint, but f**k those) /// </summary> /// <param name="reader"></param> /// <returns></returns> public static ItemInfo Load(DataTableReaderEx reader) { ItemInfo itemInfo = new ItemInfo { ItemID = reader.GetUInt16("id"), Slot = (ItemSlot)reader.GetUInt32("equip"), InxName = reader.GetString("inxname"), MaxLot = (byte)reader.GetUInt32("maxlot"), AttackSpeed = (ushort)reader.GetUInt32("atkspeed"), Level = (byte)reader.GetUInt32("demandlv"), Type = (ItemType)reader.GetUInt32("type"), Class = (ItemClass)reader.GetUInt32("class"), UpgradeLimit = reader.GetByte("uplimit"), Jobs = UnpackWhoEquip(reader.GetUInt32("whoequip")), TwoHand = reader.GetBoolean("TwoHand"), MinMagic = (ushort)reader.GetUInt32("minma"), MaxMagic = (ushort)reader.GetUInt32("maxma"), MinMelee = (ushort)reader.GetUInt32("minwc"), MaxMelee = (ushort)reader.GetUInt32("maxwc"), WeaponDef = (ushort)reader.GetUInt32("ac"), MagicDef = (ushort)reader.GetUInt32("mr"), UpSucRation = reader.GetUInt16("UpSucRatio"), UpResource = reader.GetByte("UpResource") }; return itemInfo; }
private void LoadItemInfoServer() { try { using (var reader = new DataTableReaderEx(new SHNFile(folder + @"\ItemInfoServer.shn"))) { while (reader.Read()) { ushort itemid = (ushort)reader.GetUInt32("ID"); ItemInfo item; if (ItemsByID.TryGetValue(itemid, out item)) { for (int i = 0; i < 3; i++) { string groupname = reader.GetString(DropGroupNames[i]); if (groupname.Length > 2) { DropGroupInfo group; if (DropGroups.TryGetValue(groupname, out group)) { group.Items.Add(item); } else { //Log.WriteLine(LogLevel.Warn, "{0} was assigned to unknown DropGroup {1}.", item.InxName, groupname); } } } } else Log.WriteLine(LogLevel.Warn, "ItemInfoServer has obsolete item ID: {0}.", itemid); } } } catch (Exception ex) { Log.WriteLine(LogLevel.Exception, "Error loading ItemInfoServer.shn: {0}", ex); } }
private void LoadDrops() { DropGroups = new Dictionary<string, DropGroupInfo>(); try { //first we load the dropgroups using (var groupfile = new ShineReader(folder + @"\ItemDropGroup.txt")) { var table = groupfile["ItemDropGroup"]; using (var reader = new DataTableReaderEx(table)) { while (reader.Read()) { DropGroupInfo info = DropGroupInfo.Load(reader); if (DropGroups.ContainsKey(info.GroupID)) { //Log.WriteLine(LogLevel.Warn, "Duplicate DropGroup ID found: {0}.", info.GroupID); continue; } DropGroups.Add(info.GroupID, info); } } } //now we load the actual drops int dropcount = 0; using (var tablefile = new ShineReader(folder + @"\ItemDropTable.txt")) { var table = tablefile["ItemGroup"]; using (var reader = new DataTableReaderEx(table)) { while (reader.Read()) { string mobid = reader.GetString("MobId"); MobInfo mob; if (MobsByName.TryGetValue(mobid, out mob)) { mob.MinDropLevel = (byte)reader.GetInt16("MinLevel"); mob.MaxDropLevel = (byte)reader.GetInt16("MaxLevel"); for (int i = 1; i <= 45; ++i) { string dropgroup = reader.GetString("DrItem" + i); if (dropgroup.Length <= 2) continue; DropGroupInfo group; if (DropGroups.TryGetValue(dropgroup, out group)) { float rate = reader.GetInt32("DrItem" + i + "R") / 100000f; DropInfo info = new DropInfo(group, rate); mob.Drops.Add(info); ++dropcount; } else { //this seems to happen a lot so disable this for the heck of it. // Log.WriteLine(LogLevel.Warn, "Could not find DropGroup {0}.", dropgroup); } } } else Log.WriteLine(LogLevel.Warn, "Could not find mobname: {0} for drop.", mobid); } } } Log.WriteLine(LogLevel.Info, "Loaded {0} DropGroups, with {1} drops in total.", DropGroups.Count, dropcount); } catch (Exception ex) { Log.WriteLine(LogLevel.Exception, "Error loading DropTable: {0}", ex); } }
public static ActiveSkillInfo Load(DataTableReaderEx reader) { ActiveSkillInfo inf = new ActiveSkillInfo { ID = reader.GetUInt16("ID"), Name = reader.GetString("InxName"), Step = reader.GetByte("Step"), Required = reader.GetString("DemandSk"), SP = reader.GetUInt16("SP"), HP = reader.GetUInt16("HP"), Range = reader.GetUInt16("Range"), CoolTime = reader.GetUInt32("DlyTime"), CastTime = reader.GetUInt32("CastTime"), DemandType = reader.GetByte("DemandType"), MaxTargets = reader.GetByte("TargetNumber"), }; ushort maxdamage = (ushort)reader.GetUInt32("MaxWC"); if (maxdamage == 0) { inf.IsMagic = true; inf.MinDamage = (ushort)reader.GetUInt32("MinMA"); inf.MaxDamage = (ushort)reader.GetUInt32("MaxMA"); } else { inf.MaxDamage = maxdamage; inf.MinDamage = (ushort)reader.GetUInt32("MinWC"); } return inf; }
private void LoadBadNames() { BadNames = new List<string>(); using (var file = new SHNFile(folder + @"\BadNameFilter.shn")) { using (DataTableReaderEx reader = new DataTableReaderEx(file)) { while (reader.Read()) { // Columns: BadName Type BadNames.Add(reader.GetString("BadName").ToLower()); } } } Log.WriteLine(LogLevel.Info, "Loaded {0} bad names.", BadNames.Count); }
public static MobInfoServer Load(DataTableReaderEx reader) { MobInfoServer info = new MobInfoServer { ID = reader.GetUInt32("ID"), InxName = reader.GetString("InxName"), Visible = reader.GetByte("Visible"), AC = reader.GetUInt16("AC"), TB = reader.GetUInt16("TB"), MR = reader.GetUInt16("MR"), MB = reader.GetUInt16("MB"), EnemyDetectType = reader.GetUInt32("EnemyDetectType"), MobKillInx = reader.GetUInt32("MobKillInx"), MonEXP = reader.GetUInt32("MonEXP"), EXPRange = reader.GetUInt16("EXPRange"), DetectCha = reader.GetUInt16("DetectCha"), ResetInterval = reader.GetByte("ResetInterval"), CutInterval = reader.GetUInt16("CutInterval"), CutNonAT = reader.GetUInt32("CutNonAT"), FollowCha = reader.GetUInt32("FollowCha"), PceHPRcvDly = reader.GetUInt16("PceHPRcvDly"), PceHPRcv = reader.GetUInt16("PceHPRcv"), AtkHPRcvDly = reader.GetUInt16("AtkHPRcvDly"), AtkHPRcv = reader.GetUInt16("AtkHPRcv"), Str = reader.GetUInt16("Str"), Dex = reader.GetUInt16("Dex"), Con = reader.GetUInt16("Con"), Int = reader.GetUInt16("Int"), Men = reader.GetUInt16("Men"), MobRaceType = reader.GetUInt32("MobRaceType"), Rank = reader.GetByte("Rank"), FamilyArea = reader.GetUInt32("FamilyArea"), FamilyRescArea = reader.GetUInt32("FamilyRescArea"), FamilyRescCount = reader.GetByte("FamilyRescCount"), BloodingResi = reader.GetUInt16("BloodingResi"), StunResi = reader.GetUInt16("StunResi"), MoveSpeedResi = reader.GetUInt16("MoveSpeedResi"), FearResi = reader.GetUInt16("FearResi"), ResIndex = reader.GetString("ResIndex"), KQKillPoint = reader.GetUInt16("KQKillPoint"), Return2Regen = reader.GetByte("Return2Regen"), IsRoaming = reader.GetByte("IsRoaming"), RoamingNumber = reader.GetByte("RoamingNumber"), RoamingDistance = reader.GetUInt16("RoamingDistance"), MaxSP = reader.GetUInt16("MaxSP"), BroadAtDead = reader.GetByte("BroadAtDead"), TurnSpeed = reader.GetUInt16("TurnSpeed"), WalkChase = reader.GetUInt16("WalkChase"), AllCanLoot = reader.GetByte("AllCanLoot"), DmgByHealMin = reader.GetUInt16("DmgByHealMin"), DmgByHealMax = reader.GetUInt16("DmgByHealMax"), }; return info; }