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 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; }
/// <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); } }
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; }
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; }