void LoadConfig(ref Map yimap, int mapId) { using (var kvf = new KeyValueFormat(@"RAW\MapConfigs\" + mapId + ".ini")) { yimap.Weather = (WeatherType)kvf.Load <byte>("Weather", 0); yimap.Flags = (MapFlags)kvf.Load("Flags", 0); var x = kvf.Load <ushort>("SpawnX", 0); var y = kvf.Load <ushort>("SpawnY", 0); yimap.SpawnVector2 = new Vector2(x, y); } }
public static void LoadDb() { foreach (var file in Directory.EnumerateFileSystemEntries("RAW\\Items\\")) { using (var reader = new KeyValueFormat(file)) { var item = new Item { ItemId = reader.Load <int>("ItemID"), Level = reader.Load <byte>("ReqLvl"), Prof = reader.Load <byte>("ReqProfLvl"), Sex = reader.Load <byte>("ReqSex"), Dodge = reader.Load <short>("Dodge"), ReqStr = reader.Load <short>("ReqStr"), ReqSpi = reader.Load <short>("ReqSpi"), ReqAgi = reader.Load <short>("ReqAgi"), ReqVit = reader.Load <short>("ReqVit"), PriceBaseline = reader.Load <int>("ShopBuyPrice"), MaximumPhsyicalAttack = reader.Load <short>("MaxPhysAtk"), MinimumPhsyicalAttack = reader.Load <short>("MinPhysAtk"), Defense = reader.Load <short>("PhysDefence"), Agility = reader.Load <ushort>("Dexterity"), PotAddHp = reader.Load <ushort>("PotAddHP"), PotAddMp = reader.Load <ushort>("PotAddMP"), MaximumDurability = reader.Load <ushort>("Durability"), CurrentDurability = reader.Load <ushort>("Arrows"), MagicAttack = reader.Load <short>("MAttack"), MagicDefense = reader.Load <short>("MDefence"), Range = reader.Load <byte>("Range"), Frequency = reader.Load <ushort>("Frequency"), StackAmount = 1 }; Collections.Items.AddOrUpdate(item.ItemId, item); } } }