public static void LoadGuildSettings() { if (!File.Exists(ConfigPath + @".\GuildSettings.ini")) { Guild_CreationCostList.Add(new ItemVolume(){Amount = 1000000}); Guild_CreationCostList.Add(new ItemVolume(){ItemName = "WoomaHorn",Amount = 1}); return; } InIReader reader = new InIReader(ConfigPath + @".\GuildSettings.ini"); Guild_RequiredLevel = reader.ReadByte("Guilds", "MinimumLevel", Guild_RequiredLevel); Guild_ExpRate = reader.ReadFloat("Guilds", "ExpRate", Guild_ExpRate); Guild_PointPerLevel = reader.ReadByte("Guilds", "PointPerLevel", Guild_PointPerLevel); Guild_WarTime = reader.ReadInt64("Guilds", "WarTime", Guild_WarTime); Guild_WarCost = reader.ReadUInt32("Guilds", "WarCost", Guild_WarCost); int i = 0; while (reader.ReadUInt32("Required-" + i.ToString(),"Amount",0) != 0) { Guild_CreationCostList.Add(new ItemVolume() { ItemName = reader.ReadString("Required-" + i.ToString(), "ItemName", ""), Amount = reader.ReadUInt32("Required-" + i.ToString(), "Amount", 0) } ); i++; } i = 0; while (reader.ReadInt64("Exp", "Level-" + i.ToString(), -1) != -1) { Guild_ExperienceList.Add(reader.ReadInt64("Exp", "Level-" + i.ToString(), 0)); i++; } i = 0; while (reader.ReadInt32("Cap", "Level-" + i.ToString(), -1) != -1) { Guild_MembercapList.Add(reader.ReadInt32("Cap", "Level-" + i.ToString(), 0)); i++; } byte TotalBuffs = reader.ReadByte("Guilds", "TotalBuffs", 0); for (i = 0; i < TotalBuffs; i++) { Guild_BuffList.Add(new GuildBuffInfo(reader, i)); } }
public static void LoadEXP() { long exp = 100; InIReader reader = new InIReader(ConfigPath + @".\ExpList.ini"); for (int i = 1; i <= 500; i++) { exp = reader.ReadInt64("Exp", "Level" + i, exp); ExperienceList.Add(exp); } //ArcherSpells - Elemental system reader = new InIReader(ConfigPath + @".\OrbsExpList.ini"); for (int i = 1; i <= 4; i++) { exp = i * 50;//default exp value exp = reader.ReadInt64("Exp", "Orb" + i, exp); OrbsExpList.Add(exp); exp = i * 2;//default defense value exp = reader.ReadInt64("Def", "Orb" + i, exp); OrbsDefList.Add(exp); exp = i * 4;//default power value exp = reader.ReadInt64("Att", "Orb" + i, exp); OrbsDmgList.Add(exp); } }
public static void LoadEXP() { long exp = 100; InIReader reader = new InIReader(@".\ExpList.ini"); for (int i = 1; i <= 50; i++) { exp = reader.ReadInt64("Exp", "Level" + i, exp); ExperienceList.Add(exp); } }
public static void LoadFishing() { if (!File.Exists(ConfigPath + @".\FishingSystem.ini")) { SaveFishing(); return; } InIReader reader = new InIReader(ConfigPath + @".\FishingSystem.ini"); FishingAttempts = reader.ReadInt32("Rates", "Attempts", FishingAttempts); FishingSuccessStart = reader.ReadInt32("Rates", "SuccessStart", FishingSuccessStart); FishingSuccessMultiplier = reader.ReadInt32("Rates", "SuccessMultiplier", FishingSuccessMultiplier); FishingDelay = reader.ReadInt64("Rates", "Delay", FishingDelay); FishingMobSpawnChance = reader.ReadInt32("Rates", "MonsterSpawnChance", FishingMobSpawnChance); FishingMonster = reader.ReadString("Game", "Monster", FishingMonster); }
static Settings() { Main.EnqueueMessage("Loading Config file."); if (File.Exists(ConfigPath)) { InIReader IReader = new InIReader(ConfigPath); //Path MapPath = IReader.ReadString("Path", "MapPath", MapPath); LogPath = IReader.ReadString("Path", "LogPath", LogPath); ClientPath = IReader.ReadString("Path", "ClientPath", ClientPath); //Database SQLServer = IReader.ReadString("Database", "SQLServer", SQLServer); SQLDatabase = IReader.ReadString("Database", "SQLDatabase", SQLDatabase); SQLUserID = IReader.ReadString("Database", "SQLUserID", SQLUserID); SQLPassword = IReader.ReadString("Database", "SQLPassword", SQLPassword); //Network IPAddress = IReader.ReadString("Network", "IPAddress", IPAddress); Port = IReader.ReadInt32("Network", "Port", Port); TimeOut = IReader.ReadInt64("Network", "TimeOut", TimeOut); MaxUser = IReader.ReadInt32("Network", "MaxUser", MaxUser); ReLogTime = IReader.ReadDouble("Network", "ReLogTime", ReLogTime); //Security CheckVersion = IReader.ReadBoolean("Security", "CheckVersion", CheckVersion); //Permission AllowNewAccount = IReader.ReadBoolean("Permission", "AllowNewAccount", AllowNewAccount); AllowChangePassword = IReader.ReadBoolean("Permission", "AllowChangePassword", AllowChangePassword); AllowLogin = IReader.ReadBoolean("Permission", "AllowLogin", AllowLogin); AllowNewCharacter = IReader.ReadBoolean("Permission", "AllowNewCharacter", AllowNewCharacter); AllowDeleteCharacter = IReader.ReadBoolean("Permission", "AllowDeleteCharacter", AllowDeleteCharacter); AllowStartGame = IReader.ReadBoolean("Permission", "AllowStartGame", AllowStartGame); //Game DropRange = IReader.ReadInt32("Game", "DropRange", DropRange); DropStackSize = IReader.ReadInt32("Game", "DropStackSize", DropStackSize); ItemTimeOut = IReader.ReadInt32("Game", "ItemTimeOut", ItemTimeOut); ExpRate = IReader.ReadSingle("Game", "ExpRate", ExpRate); DropRate = IReader.ReadSingle("Game", "DropRate", DropRate); StartLevel = IReader.ReadByte("Game", "StartLevel", StartLevel); StartGold = IReader.ReadInt64("Game", "StartGold", StartGold); if (ExpRate <= 0) { ExpRate = 1; } if (StartLevel <= 0) { StartLevel = 1; } Main.EnqueueMessage("Config file loaded."); } else { Main.EnqueueMessage("Config file not found, creating Config file."); Save(); } LoadVersion(); LoadExperienceList(); }