예제 #1
0
        public static void Save()
        {
            InIReader IReader = new InIReader(ConfigPath)
            {
                AutoSave = false
            };

            //Paths
            IReader.Write("Paths", "DataPath", DataPath);
            IReader.Write("Paths", "MapPath", MapPath);
            IReader.Write("Paths", "SoundPath", SoundPath);

            //Graphics
            IReader.Write("Graphics", "FullScreen", FullScreen);
            IReader.Write("Graphics", "AlwaysOnTop", TopMost);

            //Network
            IReader.Write("Network", "IPAddress", IPAddress);
            IReader.Write("Network", "Port", Port);

            //Sound
            IReader.Write("Sound", "SoundOverLap", SoundOverLap);
            IReader.Write("Sound", "SoundOn", SoundOn);

            //Logs
            IReader.Write("Logs", "LogErrors", LogErrors);
            IReader.Write("Logs", "LogChat", LogChat);

            //Game Settings
            IReader.Write("Game Settings", "ShowItemNames", ShowItemNames);

            IReader.AutoSave = true;
            IReader.Save();
        }
예제 #2
0
파일: GuildData.cs 프로젝트: putao520/mir2
 public GuildBuffInfo(InIReader reader, int i)
 {
     Id                = reader.ReadInt32("Buff-" + i.ToString(), "Id", 0);
     Icon              = reader.ReadInt32("Buff-" + i.ToString(), "Icon", 0);
     name              = reader.ReadString("Buff-" + i.ToString(), "Name", "");
     LevelRequirement  = reader.ReadByte("Buff-" + i.ToString(), "LevelReq", 0);
     PointsRequirement = reader.ReadByte("Buff-" + i.ToString(), "PointsReq", 1);
     TimeLimit         = reader.ReadInt32("Buff-" + i.ToString(), "TimeLimit", 0);;
     ActivationCost    = reader.ReadInt32("Buff-" + i.ToString(), "ActivationCost", 0);
     BuffAc            = reader.ReadByte("Buff-" + i.ToString(), "BuffAc", 0);
     BuffMac           = reader.ReadByte("Buff-" + i.ToString(), "BuffMAC", 0);
     BuffDc            = reader.ReadByte("Buff-" + i.ToString(), "BuffDc", 0);
     BuffMc            = reader.ReadByte("Buff-" + i.ToString(), "BuffMc", 0);
     BuffSc            = reader.ReadByte("Buff-" + i.ToString(), "BuffSc", 0);
     BuffMaxHp         = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxHp", 0);
     BuffMaxMp         = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxMp", 0);
     BuffMineRate      = reader.ReadByte("Buff-" + i.ToString(), "BuffMineRate", 0);
     BuffGemRate       = reader.ReadByte("Buff-" + i.ToString(), "BuffGemRate", 0);
     BuffFishRate      = reader.ReadByte("Buff-" + i.ToString(), "BuffFishRate", 0);
     BuffExpRate       = reader.ReadByte("Buff-" + i.ToString(), "BuffExpRate", 0);
     BuffCraftRate     = reader.ReadByte("Buff-" + i.ToString(), "BuffCraftRate", 0);
     BuffSkillRate     = reader.ReadByte("Buff-" + i.ToString(), "BuffSkillRate", 0);
     BuffHpRegen       = reader.ReadByte("Buff-" + i.ToString(), "BuffHpRegen", 0);
     BuffMPRegen       = reader.ReadByte("Buff-" + i.ToString(), "BuffMpRegen", 0);
     BuffAttack        = reader.ReadByte("Buff-" + i.ToString(), "BuffAttack", 0);
     BuffDropRate      = reader.ReadByte("Buff-" + i.ToString(), "BuffDropRate", 0);
     BuffGoldRate      = reader.ReadByte("Buff-" + i.ToString(), "BuffGoldRate", 0);
 }
예제 #3
0
파일: GuildData.cs 프로젝트: putao520/mir2
 public void Save(InIReader reader, int i)
 {
     reader.Write("Buff-" + i.ToString(), "Id", Id);
     reader.Write("Buff-" + i.ToString(), "Icon", Icon);
     reader.Write("Buff-" + i.ToString(), "Name", name);
     reader.Write("Buff-" + i.ToString(), "LevelReq", LevelRequirement);
     reader.Write("Buff-" + i.ToString(), "PointsReq", PointsRequirement);
     reader.Write("Buff-" + i.ToString(), "TimeLimit", TimeLimit);;
     reader.Write("Buff-" + i.ToString(), "ActivationCost", ActivationCost);;
     reader.Write("Buff-" + i.ToString(), "BuffAc", BuffAc);;
     reader.Write("Buff-" + i.ToString(), "BuffMAC", BuffMac);;
     reader.Write("Buff-" + i.ToString(), "BuffDc", BuffDc);;
     reader.Write("Buff-" + i.ToString(), "BuffMc", BuffMc);;
     reader.Write("Buff-" + i.ToString(), "BuffSc", BuffSc);;
     reader.Write("Buff-" + i.ToString(), "BuffMaxHp", BuffMaxHp);;
     reader.Write("Buff-" + i.ToString(), "BuffMaxMp", BuffMaxMp);;
     reader.Write("Buff-" + i.ToString(), "BuffMineRate", BuffMineRate);;
     reader.Write("Buff-" + i.ToString(), "BuffGemRate", BuffGemRate);;
     reader.Write("Buff-" + i.ToString(), "BuffFishRate", BuffFishRate);;
     reader.Write("Buff-" + i.ToString(), "BuffExpRate", BuffExpRate);;
     reader.Write("Buff-" + i.ToString(), "BuffCraftRate", BuffCraftRate);;
     reader.Write("Buff-" + i.ToString(), "BuffSkillRate", BuffSkillRate);;
     reader.Write("Buff-" + i.ToString(), "BuffHpRegen", BuffHpRegen);;
     reader.Write("Buff-" + i.ToString(), "BuffMpRegen", BuffMPRegen);;
     reader.Write("Buff-" + i.ToString(), "BuffAttack", BuffAttack);;
     reader.Write("Buff-" + i.ToString(), "BuffDropRate", BuffDropRate);;
     reader.Write("Buff-" + i.ToString(), "BuffGoldRate", BuffGoldRate);;
 }
예제 #4
0
        static Settings()
        {
            if (File.Exists(ConfigPath))
            {
                InIReader IReader = new InIReader(ConfigPath);

                //Paths
                DataPath  = IReader.ReadString("Paths", "DataPath", DataPath);
                MapPath   = IReader.ReadString("Paths", "MapPath", MapPath);
                SoundPath = IReader.ReadString("Paths", "SoundPath", SoundPath);

                //Graphics
                FullScreen = IReader.ReadBoolean("Graphics", "FullScreen", FullScreen);
                TopMost    = IReader.ReadBoolean("Graphics", "AlwaysOnTop", TopMost);

                //Network
                IPAddress = IReader.ReadString("Network", "IPAddress", IPAddress);
                Port      = IReader.ReadInt32("Network", "Port", Port);

                //Sound
                SoundOverLap = IReader.ReadInt32("Sound", "SoundOverLap", SoundOverLap);
                SoundOn      = IReader.ReadBoolean("Sound", "SoundOn", SoundOn);

                //Logs
                LogErrors = IReader.ReadBoolean("Logs", "LogErrors", LogErrors);
                LogChat   = IReader.ReadBoolean("Logs", "LogChat", LogChat);

                //Game Settings
                ShowItemNames = IReader.ReadBoolean("Game Settings", "ShowItemNames", ShowItemNames);
            }
            else
            {
                Save();
            }
        }
예제 #5
0
 public static void Save(InIReader reader)
 {
     for (int i = 0; i < list.Count; i++)
     {
         reader.Write("Var", list[i].fieldName, list[i].value);
     }
 }
예제 #6
0
        public static void SaveMines()
        {
            File.Delete(@".\Mines.ini");
            InIReader reader = new InIReader(@".\Mines.ini");
            MineSet   Mine;

            for (int i = 0; i < MineSetList.Count; i++)
            {
                Mine = MineSetList[i];
                reader.Write("Mine" + i.ToString(), "Name", Mine.Name);
                reader.Write("Mine" + i.ToString(), "SpotRegenRate", Mine.SpotRegenRate);
                reader.Write("Mine" + i.ToString(), "MaxStones", Mine.MaxStones);
                reader.Write("Mine" + i.ToString(), "HitRate", Mine.HitRate);
                reader.Write("Mine" + i.ToString(), "DropRate", Mine.DropRate);
                reader.Write("Mine" + i.ToString(), "TotalSlots", Mine.TotalSlots);

                for (int j = 0; j < Mine.Drops.Count; j++)
                {
                    MineDrop Drop = Mine.Drops[j];
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-ItemName", Drop.ItemName);
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MinSlot", Drop.MinSlot);
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MaxSlot", Drop.MaxSlot);
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MinDura", Drop.MinDura);
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MaxDura", Drop.MaxDura);
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-BonusChance", Drop.BonusChance);
                    reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MaxBonusDura", Drop.MaxBonusDura);
                }
            }
        }
예제 #7
0
    public GuildBuffInfo(InIReader reader, int i)
    {
        Id                = reader.ReadInt32("Buff-" + i.ToString(), "Id", 0);
        Icon              = reader.ReadInt32("Buff-" + i.ToString(), "Icon", 0);
        name              = reader.ReadString("Buff-" + i.ToString(), "Name", "");
        LevelRequirement  = reader.ReadByte("Buff-" + i.ToString(), "LevelReq", 0);
        PointsRequirement = reader.ReadByte("Buff-" + i.ToString(), "PointsReq", 1);
        TimeLimit         = reader.ReadInt32("Buff-" + i.ToString(), "TimeLimit", 0);;
        ActivationCost    = reader.ReadInt32("Buff-" + i.ToString(), "ActivationCost", 0);

        Stats                           = new Stats();
        Stats[Stat.MaxAC]               = reader.ReadByte("Buff-" + i.ToString(), "BuffAc", 0);
        Stats[Stat.MaxMAC]              = reader.ReadByte("Buff-" + i.ToString(), "BuffMAC", 0);
        Stats[Stat.MaxDC]               = reader.ReadByte("Buff-" + i.ToString(), "BuffDc", 0);
        Stats[Stat.MaxMC]               = reader.ReadByte("Buff-" + i.ToString(), "BuffMc", 0);
        Stats[Stat.MaxSC]               = reader.ReadByte("Buff-" + i.ToString(), "BuffSc", 0);
        Stats[Stat.HP]                  = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxHp", 0);
        Stats[Stat.MP]                  = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxMp", 0);
        Stats[Stat.MineRatePercent]     = reader.ReadByte("Buff-" + i.ToString(), "BuffMineRate", 0);
        Stats[Stat.GemRatePercent]      = reader.ReadByte("Buff-" + i.ToString(), "BuffGemRate", 0);
        Stats[Stat.FishRatePercent]     = reader.ReadByte("Buff-" + i.ToString(), "BuffFishRate", 0);
        Stats[Stat.ExpRatePercent]      = reader.ReadByte("Buff-" + i.ToString(), "BuffExpRate", 0);
        Stats[Stat.CraftRatePercent]    = reader.ReadByte("Buff-" + i.ToString(), "BuffCraftRate", 0);
        Stats[Stat.SkillGainMultiplier] = reader.ReadByte("Buff-" + i.ToString(), "BuffSkillRate", 0);
        Stats[Stat.HealthRecovery]      = reader.ReadByte("Buff-" + i.ToString(), "BuffHpRegen", 0);
        Stats[Stat.SpellRecovery]       = reader.ReadByte("Buff-" + i.ToString(), "BuffMpRegen", 0);
        Stats[Stat.AttackBonus]         = reader.ReadByte("Buff-" + i.ToString(), "BuffAttack", 0);
        Stats[Stat.ItemDropRatePercent] = reader.ReadByte("Buff-" + i.ToString(), "BuffDropRate", 0);
        Stats[Stat.GoldDropRatePercent] = reader.ReadByte("Buff-" + i.ToString(), "BuffGoldRate", 0);
    }
예제 #8
0
        public static void WriteIni <T>(InIReader reader) where T : class, new()
        {
            Type objType = typeof(T);

            //取属性上的自定义特性
            foreach (FieldInfo fieldInfo in objType.GetFields())
            {
                object[] objAttrs = fieldInfo.GetCustomAttributes(typeof(IniAttribute), true);

                if (objAttrs.Length <= 0)
                {
                    continue;
                }

                IniAttribute attr = objAttrs[0] as IniAttribute;
                if (attr == null)
                {
                    continue;
                }

                if (fieldInfo.FieldType == typeof(bool))
                {
                    reader.Write(attr.Section, fieldInfo.Name, (bool)fieldInfo.GetValue(null));
                }
                else if (fieldInfo.FieldType == typeof(int))
                {
                    reader.Write(attr.Section, fieldInfo.Name, (int)fieldInfo.GetValue(null));
                }
                else if (fieldInfo.FieldType == typeof(string))
                {
                    reader.Write(attr.Section, fieldInfo.Name, (string)fieldInfo.GetValue(null));
                }
            }
        }
예제 #9
0
 public void Save(InIReader reader, int i)
 {
     reader.Write("Buff-" + i.ToString(), "Id", Id);
     reader.Write("Buff-" + i.ToString(), "Icon", Icon);
     reader.Write("Buff-" + i.ToString(), "Name", name);
     reader.Write("Buff-" + i.ToString(), "LevelReq", LevelRequirement);
     reader.Write("Buff-" + i.ToString(), "PointsReq", PointsRequirement);
     reader.Write("Buff-" + i.ToString(), "TimeLimit", TimeLimit);
     reader.Write("Buff-" + i.ToString(), "ActivationCost", ActivationCost);
     reader.Write("Buff-" + i.ToString(), "BuffAc", Stats[Stat.MaxAC]);
     reader.Write("Buff-" + i.ToString(), "BuffMAC", Stats[Stat.MaxMAC]);
     reader.Write("Buff-" + i.ToString(), "BuffDc", Stats[Stat.MaxDC]);
     reader.Write("Buff-" + i.ToString(), "BuffMc", Stats[Stat.MaxMC]);
     reader.Write("Buff-" + i.ToString(), "BuffSc", Stats[Stat.MaxSC]);
     reader.Write("Buff-" + i.ToString(), "BuffMaxHp", Stats[Stat.HP]);
     reader.Write("Buff-" + i.ToString(), "BuffMaxMp", Stats[Stat.MP]);
     reader.Write("Buff-" + i.ToString(), "BuffMineRate", Stats[Stat.MineRatePercent]);
     reader.Write("Buff-" + i.ToString(), "BuffGemRate", Stats[Stat.GemRatePercent]);
     reader.Write("Buff-" + i.ToString(), "BuffFishRate", Stats[Stat.FishRatePercent]);
     reader.Write("Buff-" + i.ToString(), "BuffExpRate", Stats[Stat.ExpRatePercent]);;
     reader.Write("Buff-" + i.ToString(), "BuffCraftRate", Stats[Stat.CraftRatePercent]);
     reader.Write("Buff-" + i.ToString(), "BuffSkillRate", Stats[Stat.SkillGainMultiplier]);
     reader.Write("Buff-" + i.ToString(), "BuffHpRegen", Stats[Stat.HealthRecovery]);
     reader.Write("Buff-" + i.ToString(), "BuffMpRegen", Stats[Stat.SpellRecovery]);
     reader.Write("Buff-" + i.ToString(), "BuffAttack", Stats[Stat.AttackBonus]);
     reader.Write("Buff-" + i.ToString(), "BuffDropRate", Stats[Stat.ItemDropRatePercent]);
     reader.Write("Buff-" + i.ToString(), "BuffGoldRate", Stats[Stat.GoldDropRatePercent]);
 }
예제 #10
0
 public Txtout(LoraParser lib, InIReader settings) : base(lib, settings)
 {
     if (this.config.ContainsKey("general") && this.config["general"].ContainsKey("path"))
     {
         this.filename = this.config["general"]["path"];
         this.file     = new StreamWriter(this.filename, true);
     }
     else
     {
         throw new ArgumentException("Setting section [general] is missing or its value path");
     }
 }
예제 #11
0
        public static void Save()
        {
            InIReader IReader = new InIReader(ConfigPath)
            {
                AutoSave = false
            };

            //Path
            IReader.Write("Path", "MapPath", MapPath);
            IReader.Write("Path", "LogPath", LogPath);
            IReader.Write("Path", "ClientPath", ClientPath);

            //Database
            IReader.Write("Database", "SQLServer", SQLServer);
            IReader.Write("Database", "SQLDatabase", SQLDatabase);
            IReader.Write("Database", "SQLUserID", SQLUserID);
            IReader.Write("Database", "SQLPassword", SQLPassword);

            //Network
            IReader.Write("Network", "IPAddress", IPAddress);
            IReader.Write("Network", "Port", Port);
            IReader.Write("Network", "TimeOut", TimeOut);
            IReader.Write("Network", "MaxUser", MaxUser);
            IReader.Write("Network", "ReLogTime", ReLogTime);

            //Security
            IReader.Write("Security", "CheckVersion", CheckVersion);

            //Permission
            IReader.Write("Permission", "AllowNewAccount", AllowNewAccount);
            IReader.Write("Permission", "AllowChangePassword", AllowChangePassword);
            IReader.Write("Permission", "AllowLogin", AllowLogin);
            IReader.Write("Permission", "AllowNewCharacter", AllowNewCharacter);
            IReader.Write("Permission", "AllowDeleteCharacter", AllowDeleteCharacter);
            IReader.Write("Permission", "AllowStartGame", AllowStartGame);

            //Game
            IReader.Write("Game", "DropRange", DropRange);
            IReader.Write("Game", "DropStackSize", DropStackSize);
            IReader.Write("Game", "ItemTimeOut", ItemTimeOut);

            IReader.Write("Game", "ExpRate", ExpRate);
            IReader.Write("Game", "DropRate", DropRate);

            IReader.Write("Game", "StartLevel", StartLevel);
            IReader.Write("Game", "StartGold", StartGold);

            IReader.AutoSave = true;
            IReader.Save();

            Main.EnqueueMessage("Config file Saved.");
        }
예제 #12
0
        public static void Load(InIReader reader)
        {
            List <string> list = reader.getContents();

            for (int a = 0; a < list.Count; a++)
            {
                if (String.CompareOrdinal(list[a], "[Var]") == 0)
                {
                    for (int b = a + 1; b < list.Count; b++)
                    {
                        string[] arr = list[b].Split('=');
                        FindVar(arr[0], arr[1]);
                    }
                }
            }
        }
예제 #13
0
        public static void LoadExperienceList()
        {
            if (!File.Exists(ExpListPath))
            {
                ExperienceList.Add(100);
            }
            else
            {
                int       Exp     = 100;
                InIReader IReader = new InIReader(ExpListPath);

                for (int I = 1; I <= 50; I++)
                {
                    Exp = IReader.ReadInt32("Exp", "Level" + I.ToString(), Exp);
                    ExperienceList.Add(Exp);
                }
            }
        }
예제 #14
0
        Program()
        {
            InIReader.SetSearchPath(new List <String>()
            {
                "/etc/ttnbridge", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ttnbridge"
            });
            if (!InIReader.ConfigExist("settings"))
            {
                Helper.WriteError("No settings.ini found. Abord!");
                return;
            }
            this.settings = InIReader.GetInstance("settings");
            this.logger.SetPath(this.settings.GetValue("logging", "path"));

            this.Connect();
            this.Attach();
            this.WaitForShutdown();
            this.Dispose();
        }
예제 #15
0
        static void Main(String[] _1)
        {
            InIReader.SetSearchPath(new List <String>()
            {
                "/etc/loramap", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\loramap"
            });
            if (!InIReader.ConfigExist("settings"))
            {
                Helper.WriteError("settings.ini not found!");
                _ = Console.ReadLine();
                return;
            }
            InIReader ini = InIReader.GetInstance("settings");
            Dictionary <String, String> backenddata = ini.GetSection("mqtt");

            backenddata.Add("topic", "lora/#;camera/#;sfn/#");
            ADataBackend b = (ADataBackend)ABackend.GetInstance(backenddata, ABackend.BackendType.Data);

            _ = new Server(b, ini.GetSection("webserver"));
        }
예제 #16
0
        public static void LoadMines()
        {
            if (!File.Exists(@".\Mines.ini"))
            {
                MineSetList.Add(new MineSet(1));
                MineSetList.Add(new MineSet(2));
                SaveMines();
                return;
            }
            InIReader reader = new InIReader(@".\Mines.ini");
            int       i      = 0;
            MineSet   Mine;

            while (reader.ReadByte("Mine" + i.ToString(), "SpotRegenRate", 255) != 255)
            {
                Mine               = new MineSet();
                Mine.Name          = reader.ReadString("Mine" + i.ToString(), "Name", Mine.Name);
                Mine.SpotRegenRate = reader.ReadByte("Mine" + i.ToString(), "SpotRegenRate", Mine.SpotRegenRate);
                Mine.MaxStones     = reader.ReadByte("Mine" + i.ToString(), "MaxStones", Mine.MaxStones);
                Mine.HitRate       = reader.ReadByte("Mine" + i.ToString(), "HitRate", Mine.HitRate);
                Mine.DropRate      = reader.ReadByte("Mine" + i.ToString(), "DropRate", Mine.DropRate);
                Mine.TotalSlots    = reader.ReadByte("Mine" + i.ToString(), "TotalSlots", Mine.TotalSlots);
                int j = 0;
                while (reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MinSlot", 255) != 255)
                {
                    Mine.Drops.Add(new MineDrop()
                    {
                        ItemName     = reader.ReadString("Mine" + i.ToString(), "D" + j.ToString() + "-ItemName", ""),
                        MinSlot      = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MinSlot", 255),
                        MaxSlot      = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MaxSlot", 255),
                        MinDura      = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MinDura", 255),
                        MaxDura      = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MaxDura", 255),
                        BonusChance  = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-BonusChance", 255),
                        MaxBonusDura = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MaxBonusDura", 255)
                    });
                    j++;
                }
                MineSetList.Add(Mine);
                i++;
            }
        }
예제 #17
0
        public static void ReadIni <T>(InIReader reader) where T : class, new()
        {
            Type objType = typeof(T);

            //取属性上的自定义特性
            foreach (FieldInfo fieldInfo in objType.GetFields())
            {
                object[] objAttrs = fieldInfo.GetCustomAttributes(typeof(IniAttribute), true);
                if (objAttrs.Length <= 0)
                {
                    continue;
                }

                IniAttribute attr = objAttrs[0] as IniAttribute;
                if (attr == null)
                {
                    continue;
                }

                if (Reader.FindValue(attr.Section, fieldInfo.Name) == null)
                {
                    continue;
                }

                if (fieldInfo.FieldType == typeof(bool))
                {
                    bool value = reader.ReadBoolean(attr.Section, fieldInfo.Name, false);
                    fieldInfo.SetValue(null, value);
                }
                else if (fieldInfo.FieldType == typeof(int))
                {
                    int value = reader.ReadInt32(attr.Section, fieldInfo.Name, 0);
                    fieldInfo.SetValue(null, value);
                }
                else if (fieldInfo.FieldType == typeof(string))
                {
                    string value = reader.ReadString(attr.Section, fieldInfo.Name, "");
                    fieldInfo.SetValue(null, value);
                }
            }
        }
예제 #18
0
        public Program(String[] _)
        {
            InIReader.SetSearchPath(new List <String>()
            {
                "/etc/lorabot", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\lorabot"
            });
            if (!InIReader.ConfigExist("settings"))
            {
                Helper.WriteError("No settings.ini found. Abord!");
                return;
            }
            InIReader settings = InIReader.GetInstance("settings");

            this.logger.SetPath(settings.GetValue("logging", "path"));

            LoraParser parser = new LoraParser(settings.GetValue("general", "key"));

            LoraController lora = new LoraController(settings.GetSection("lora"));

            lora.Received += parser.ReceivedPacket;

            this.ModulLoader("Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls", parser);
            this.ModulInterconnect();
            this.ModulEvents();

            parser.DataUpdate   += this.Lora_Parsed;
            parser.PanicUpdate  += this.Lora_Parsed;
            parser.StatusUpdate += this.Lora_Parsed;
            lora.Transmitted    += this.Lora_Transmitted;

            this.WaitForShutdown();
            Console.WriteLine("after wait");

            this.ModulDispose();
            Console.WriteLine("after dispose");

            lora.Dispose();
            Console.WriteLine("after loradisp");
        }
예제 #19
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void LoadMarriage()
 {
     if (!File.Exists(ConfigPath + @".\MarriageSystem.ini"))
     {
         SaveMarriage();
         return;
     }
     InIReader reader = new InIReader(ConfigPath + @".\MarriageSystem.ini");
     LoverEXPBonus = reader.ReadInt32("Config", "EXPBonus", LoverEXPBonus);
     MarriageCooldown = reader.ReadInt32("Config", "MarriageCooldown", MarriageCooldown);
     WeddingRingRecall = reader.ReadBoolean("Config", "AllowLoverRecall", WeddingRingRecall);
     MarriageLevelRequired = reader.ReadInt32("Config", "MinimumLevel", MarriageLevelRequired);
     ReplaceWedRingCost = reader.ReadInt32("Config", "ReplaceRingCost", ReplaceWedRingCost);
 }
예제 #20
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveMarriage()
 {
     File.Delete(ConfigPath + @".\MarriageSystem.ini");
     InIReader reader = new InIReader(ConfigPath + @".\MarriageSystem.ini");
     reader.Write("Config", "EXPBonus", LoverEXPBonus);
     reader.Write("Config", "MarriageCooldown", MarriageCooldown);
     reader.Write("Config", "AllowLoverRecall", WeddingRingRecall);
     reader.Write("Config", "MinimumLevel", MarriageLevelRequired);
     reader.Write("Config", "ReplaceRingCost", ReplaceWedRingCost); 
 }
예제 #21
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void SaveBaseStats()
        {
            File.Delete(ConfigPath + @".\BaseStats.ini");
            InIReader reader = new InIReader(ConfigPath + @".\BaseStats.ini");

            for (int i = 0; i < ClassBaseStats.Length; i++)
            {
                reader.Write(BaseStatClassNames[i], "HpGain", ClassBaseStats[i].HpGain);
                reader.Write(BaseStatClassNames[i], "HpGainRate", ClassBaseStats[i].HpGainRate);
                reader.Write(BaseStatClassNames[i], "MpGainRate", ClassBaseStats[i].MpGainRate);
                reader.Write(BaseStatClassNames[i], "BagWeightGain", ClassBaseStats[i].BagWeightGain);
                reader.Write(BaseStatClassNames[i], "WearWeightGain", ClassBaseStats[i].WearWeightGain);
                reader.Write(BaseStatClassNames[i], "HandWeightGain", ClassBaseStats[i].HandWeightGain);
                reader.Write(BaseStatClassNames[i], "MinAc", ClassBaseStats[i].MinAc);
                reader.Write(BaseStatClassNames[i], "MaxAc", ClassBaseStats[i].MaxAc);
                reader.Write(BaseStatClassNames[i], "MinMac", ClassBaseStats[i].MinMac);
                reader.Write(BaseStatClassNames[i], "MaxMac", ClassBaseStats[i].MaxMac);
                reader.Write(BaseStatClassNames[i], "MinDc", ClassBaseStats[i].MinDc);
                reader.Write(BaseStatClassNames[i], "MaxDc", ClassBaseStats[i].MaxDc);
                reader.Write(BaseStatClassNames[i], "MinMc", ClassBaseStats[i].MinMc);
                reader.Write(BaseStatClassNames[i], "MaxMc", ClassBaseStats[i].MaxMc);
                reader.Write(BaseStatClassNames[i], "MinSc", ClassBaseStats[i].MinSc);
                reader.Write(BaseStatClassNames[i], "MaxSc", ClassBaseStats[i].MaxSc);
                reader.Write(BaseStatClassNames[i], "StartAgility", ClassBaseStats[i].StartAgility);
                reader.Write(BaseStatClassNames[i], "StartAccuracy", ClassBaseStats[i].StartAccuracy);
                reader.Write(BaseStatClassNames[i], "StartCriticalRate", ClassBaseStats[i].StartCriticalRate);
                reader.Write(BaseStatClassNames[i], "StartCriticalDamage", ClassBaseStats[i].StartCriticalDamage);
                reader.Write(BaseStatClassNames[i], "CritialRateGain", ClassBaseStats[i].CritialRateGain);
                reader.Write(BaseStatClassNames[i], "CriticalDamageGain", ClassBaseStats[i].CriticalDamageGain);
            }
        }
예제 #22
0
        public static void SaveRandomItemStats()
        {
            File.Delete(@".\RandomItemStats.ini");
            InIReader      reader = new InIReader(@".\RandomItemStats.ini");
            RandomItemStat stat;

            for (int i = 0; i < RandomItemStatsList.Count; i++)
            {
                stat = RandomItemStatsList[i];
                reader.Write("Item" + i.ToString(), "MaxDuraChance", stat.MaxDuraChance);
                reader.Write("Item" + i.ToString(), "MaxDuraStatChance", stat.MaxDuraStatChance);
                reader.Write("Item" + i.ToString(), "MaxDuraMaxStat", stat.MaxDuraMaxStat);
                reader.Write("Item" + i.ToString(), "MaxAcChance", stat.MaxAcChance);
                reader.Write("Item" + i.ToString(), "MaxAcStatChance", stat.MaxAcStatChance);
                reader.Write("Item" + i.ToString(), "MaxAcMaxStat", stat.MaxAcMaxStat);
                reader.Write("Item" + i.ToString(), "MaxMacChance", stat.MaxMacChance);
                reader.Write("Item" + i.ToString(), "MaxMacStatChance", stat.MaxMacStatChance);
                reader.Write("Item" + i.ToString(), "MaxMACMaxStat", stat.MaxMacMaxStat);
                reader.Write("Item" + i.ToString(), "MaxDcChance", stat.MaxDcChance);
                reader.Write("Item" + i.ToString(), "MaxDcStatChance", stat.MaxDcStatChance);
                reader.Write("Item" + i.ToString(), "MaxDcMaxStat", stat.MaxDcMaxStat);
                reader.Write("Item" + i.ToString(), "MaxMcChance", stat.MaxMcChance);
                reader.Write("Item" + i.ToString(), "MaxMcStatChance", stat.MaxMcStatChance);
                reader.Write("Item" + i.ToString(), "MaxMcMaxStat", stat.MaxMcMaxStat);
                reader.Write("Item" + i.ToString(), "MaxScChance", stat.MaxScChance);
                reader.Write("Item" + i.ToString(), "MaxScStatChance", stat.MaxScStatChance);
                reader.Write("Item" + i.ToString(), "MaxScMaxStat", stat.MaxScMaxStat);
                reader.Write("Item" + i.ToString(), "AccuracyChance", stat.AccuracyChance);
                reader.Write("Item" + i.ToString(), "AccuracyStatChance", stat.AccuracyStatChance);
                reader.Write("Item" + i.ToString(), "AccuracyMaxStat", stat.AccuracyMaxStat);
                reader.Write("Item" + i.ToString(), "AgilityChance", stat.AgilityChance);
                reader.Write("Item" + i.ToString(), "AgilityStatChance", stat.AgilityStatChance);
                reader.Write("Item" + i.ToString(), "AgilityMaxStat", stat.AgilityMaxStat);
                reader.Write("Item" + i.ToString(), "HpChance", stat.HpChance);
                reader.Write("Item" + i.ToString(), "HpStatChance", stat.HpStatChance);
                reader.Write("Item" + i.ToString(), "HpMaxStat", stat.HpMaxStat);
                reader.Write("Item" + i.ToString(), "MpChance", stat.MpChance);
                reader.Write("Item" + i.ToString(), "MpStatChance", stat.MpStatChance);
                reader.Write("Item" + i.ToString(), "MpMaxStat", stat.MpMaxStat);
                reader.Write("Item" + i.ToString(), "StrongChance", stat.StrongChance);
                reader.Write("Item" + i.ToString(), "StrongStatChance", stat.StrongStatChance);
                reader.Write("Item" + i.ToString(), "StrongMaxStat", stat.StrongMaxStat);
                reader.Write("Item" + i.ToString(), "MagicResistChance", stat.MagicResistChance);
                reader.Write("Item" + i.ToString(), "MagicResistStatChance", stat.MagicResistStatChance);
                reader.Write("Item" + i.ToString(), "MagicResistMaxStat", stat.MagicResistMaxStat);
                reader.Write("Item" + i.ToString(), "PoisonResistChance", stat.PoisonResistChance);
                reader.Write("Item" + i.ToString(), "PoisonResistStatChance", stat.PoisonResistStatChance);
                reader.Write("Item" + i.ToString(), "PoisonResistMaxStat", stat.PoisonResistMaxStat);
                reader.Write("Item" + i.ToString(), "HpRecovChance", stat.HpRecovChance);
                reader.Write("Item" + i.ToString(), "HpRecovStatChance", stat.HpRecovStatChance);
                reader.Write("Item" + i.ToString(), "HpRecovMaxStat", stat.HpRecovMaxStat);
                reader.Write("Item" + i.ToString(), "MpRecovChance", stat.MpRecovChance);
                reader.Write("Item" + i.ToString(), "MpRecovStatChance", stat.MpRecovStatChance);
                reader.Write("Item" + i.ToString(), "MpRecovMaxStat", stat.MpRecovMaxStat);
                reader.Write("Item" + i.ToString(), "PoisonRecovChance", stat.PoisonRecovChance);
                reader.Write("Item" + i.ToString(), "PoisonRecovStatChance", stat.PoisonRecovStatChance);
                reader.Write("Item" + i.ToString(), "PoisonRecovMaxStat", stat.PoisonRecovMaxStat);
                reader.Write("Item" + i.ToString(), "CriticalRateChance", stat.CriticalRateChance);
                reader.Write("Item" + i.ToString(), "CriticalRateStatChance", stat.CriticalRateStatChance);
                reader.Write("Item" + i.ToString(), "CriticalRateMaxStat", stat.CriticalRateMaxStat);
                reader.Write("Item" + i.ToString(), "CriticalDamageChance", stat.CriticalDamageChance);
                reader.Write("Item" + i.ToString(), "CriticalDamageStatChance", stat.CriticalDamageStatChance);
                reader.Write("Item" + i.ToString(), "CriticalDamageMaxStat", stat.CriticalDamageMaxStat);
                reader.Write("Item" + i.ToString(), "FreezeChance", stat.FreezeChance);
                reader.Write("Item" + i.ToString(), "FreezeStatChance", stat.FreezeStatChance);
                reader.Write("Item" + i.ToString(), "FreezeMaxStat", stat.FreezeMaxStat);
                reader.Write("Item" + i.ToString(), "PoisonAttackChance", stat.PoisonAttackChance);
                reader.Write("Item" + i.ToString(), "PoisonAttackStatChance", stat.PoisonAttackStatChance);
                reader.Write("Item" + i.ToString(), "PoisonAttackMaxStat", stat.PoisonAttackMaxStat);
                reader.Write("Item" + i.ToString(), "AttackSpeedChance", stat.AttackSpeedChance);
                reader.Write("Item" + i.ToString(), "AttackSpeedStatChance", stat.AttackSpeedStatChance);
                reader.Write("Item" + i.ToString(), "AttackSpeedMaxStat", stat.AttackSpeedMaxStat);
                reader.Write("Item" + i.ToString(), "LuckChance", stat.LuckChance);
                reader.Write("Item" + i.ToString(), "LuckStatChance", stat.LuckStatChance);
                reader.Write("Item" + i.ToString(), "LuckMaxStat", stat.LuckMaxStat);
                reader.Write("Item" + i.ToString(), "CurseChance", stat.CurseChance);
            }
        }
예제 #23
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void LoadGoods()
        {
            if (!File.Exists(ConfigPath + @".\GoodsSystem.ini"))
            {
                SaveGoods();
                return;
            }

            InIReader reader = new InIReader(ConfigPath + @".\GoodsSystem.ini");
            GoodsOn = reader.ReadBoolean("Goods", "On", GoodsOn);
            GoodsMaxStored = reader.ReadUInt32("Goods", "MaxStored", GoodsMaxStored);
            GoodsBuyBackTime = reader.ReadUInt32("Goods", "BuyBackTime", GoodsBuyBackTime);
            GoodsBuyBackMaxStored = reader.ReadUInt32("Goods", "BuyBackMaxStored", GoodsBuyBackMaxStored);
        }
예제 #24
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        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);
            }
        }
예제 #25
0
 public GuildBuffInfo(InIReader reader, int i)
 {
     Id  = reader.ReadInt32("Buff-" + i.ToString(), "Id",0);
     Icon = reader.ReadInt32("Buff-" + i.ToString(), "Icon", 0);
     name = reader.ReadString("Buff-" + i.ToString(), "Name","");
     LevelRequirement = reader.ReadByte("Buff-" + i.ToString(), "LevelReq",0);
     PointsRequirement = reader.ReadByte("Buff-" + i.ToString(), "PointsReq",1);
     TimeLimit = reader.ReadInt32("Buff-" + i.ToString(), "TimeLimit",0);;
     ActivationCost = reader.ReadInt32("Buff-" + i.ToString(), "ActivationCost",0);
     BuffAc = reader.ReadByte("Buff-" + i.ToString(), "BuffAc",0);
     BuffMac = reader.ReadByte("Buff-" + i.ToString(), "BuffMAC",0);
     BuffDc = reader.ReadByte("Buff-" + i.ToString(), "BuffDc",0);
     BuffMc = reader.ReadByte("Buff-" + i.ToString(), "BuffMc",0);
     BuffSc = reader.ReadByte("Buff-" + i.ToString(), "BuffSc",0);
     BuffMaxHp = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxHp",0);
     BuffMaxMp = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxMp",0);
     BuffMineRate = reader.ReadByte("Buff-" + i.ToString(), "BuffMineRate",0);
     BuffGemRate = reader.ReadByte("Buff-" + i.ToString(), "BuffGemRate",0);
     BuffFishRate = reader.ReadByte("Buff-" + i.ToString(), "BuffFishRate",0);
     BuffExpRate = reader.ReadByte("Buff-" + i.ToString(), "BuffExpRate",0);
     BuffCraftRate = reader.ReadByte("Buff-" + i.ToString(), "BuffCraftRate",0);
     BuffSkillRate = reader.ReadByte("Buff-" + i.ToString(), "BuffSkillRate",0);
     BuffHpRegen = reader.ReadByte("Buff-" + i.ToString(), "BuffHpRegen",0);
     BuffMPRegen = reader.ReadByte("Buff-" + i.ToString(), "BuffMpRegen",0);
     BuffAttack = reader.ReadByte("Buff-" + i.ToString(), "BuffAttack",0);
     BuffDropRate = reader.ReadByte("Buff-" + i.ToString(), "BuffDropRate",0);
     BuffGoldRate = reader.ReadByte("Buff-" + i.ToString(), "BuffGoldRate",0);
 }
예제 #26
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void LoadGem()
        {
            if (!File.Exists(ConfigPath + @".\GemSystem.ini"))
            {
                SaveGem();
                return;
            }
            InIReader reader = new InIReader(ConfigPath + @".\GemSystem.ini");
            GemStatIndependent = reader.ReadBoolean("Config", "GemStatIndependent", GemStatIndependent);


        }
예제 #27
0
 public Mqtt(LoraParser lib, InIReader settings) : base(lib, settings)
 {
 }
예제 #28
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void SaveAwakeAttribute()
        {
            File.Delete(ConfigPath + @".\AwakeningSystem.ini");
            InIReader reader = new InIReader(ConfigPath + @".\AwakeningSystem.ini");
            reader.Write("Attribute", "SuccessRate", Awake.AwakeSuccessRate);
            reader.Write("Attribute", "HitRate", Awake.AwakeHitRate);
            reader.Write("Attribute", "MaxUpgradeLevel", Awake.MaxAwakeLevel);

            reader.Write("IncreaseValue", "WeaponValue", Awake.Awake_WeaponRate);
            reader.Write("IncreaseValue", "HelmetValue", Awake.Awake_HelmetRate);
            reader.Write("IncreaseValue", "ArmorValue", Awake.Awake_ArmorRate);

            for (int i = 0; i < 4; i++)
            {
                reader.Write("Value", "ChanceMax_" + ((ItemGrade)(i + 1)).ToString(), Awake.AwakeChanceMax[i]);
            }

            if (Awake.AwakeMaterials.Count == 0)
            {
                for (int i = 0; i < (int)AwakeType.HPMP; i++)
                {
                    for (int j = 0; j < 4; j++)
                    {
                        reader.Write("Materials_BaseValue", ((AwakeType)(i + 1)).ToString() + "_" + ((ItemGrade)(j + 1)).ToString() + "_Material1", 1);
                        reader.Write("Materials_BaseValue", ((AwakeType)(i + 1)).ToString() + "_" + ((ItemGrade)(j + 1)).ToString() + "_Material2", 1);
                    }
                }
            }
            else
            {
                for (int i = 0; i < (int)AwakeType.HPMP; i++)
                {
                    List<byte>[] value = Awake.AwakeMaterials[i];

                    for (int j = 0; j < value[0].Count; j++)
                    {
                        reader.Write("Materials_BaseValue", ((AwakeType)(i + 1)).ToString() + "_" + ((ItemGrade)(j + 1)).ToString() + "_Material1", value[0][j]);
                        reader.Write("Materials_BaseValue", ((AwakeType)(i + 1)).ToString() + "_" + ((ItemGrade)(j + 1)).ToString() + "_Material2", value[1][j]);
                    }

                    Awake.AwakeMaterials.Add(value);
                }
            }

            for (int c = 0; c < 4; c++)
            {
                reader.Write("Materials_IncreaseValue", "Materials_" + ((ItemGrade)(c + 1)).ToString(), Awake.AwakeMaterialRate[c]);
            }
        }
예제 #29
0
        public static void LoadRandomItemStats()
        {
            if (!File.Exists(@".\RandomItemStats.ini"))
            {
                RandomItemStatsList.Add(new RandomItemStat());
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Weapon));
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Armour));
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Helmet));
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Necklace));
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Bracelet));
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Ring));
                RandomItemStatsList.Add(new RandomItemStat(ItemType.Belt));
                SaveRandomItemStats();
                return;
            }
            InIReader      reader = new InIReader(@".\RandomItemStats.ini");
            int            i      = 0;
            RandomItemStat stat;

            while (reader.ReadByte("Item" + i.ToString(), "MaxDuraChance", 255) != 255)
            {
                stat = new RandomItemStat
                {
                    MaxDuraChance            = reader.ReadByte("Item" + i.ToString(), "MaxDuraChance", 0),
                    MaxDuraStatChance        = reader.ReadByte("Item" + i.ToString(), "MaxDuraStatChance", 1),
                    MaxDuraMaxStat           = reader.ReadByte("Item" + i.ToString(), "MaxDuraMaxStat", 1),
                    MaxAcChance              = reader.ReadByte("Item" + i.ToString(), "MaxAcChance", 0),
                    MaxAcStatChance          = reader.ReadByte("Item" + i.ToString(), "MaxAcStatChance", 1),
                    MaxAcMaxStat             = reader.ReadByte("Item" + i.ToString(), "MaxAcMaxStat", 1),
                    MaxMacChance             = reader.ReadByte("Item" + i.ToString(), "MaxMacChance", 0),
                    MaxMacStatChance         = reader.ReadByte("Item" + i.ToString(), "MaxMacStatChance", 1),
                    MaxMacMaxStat            = reader.ReadByte("Item" + i.ToString(), "MaxMACMaxStat", 1),
                    MaxDcChance              = reader.ReadByte("Item" + i.ToString(), "MaxDcChance", 0),
                    MaxDcStatChance          = reader.ReadByte("Item" + i.ToString(), "MaxDcStatChance", 1),
                    MaxDcMaxStat             = reader.ReadByte("Item" + i.ToString(), "MaxDcMaxStat", 1),
                    MaxMcChance              = reader.ReadByte("Item" + i.ToString(), "MaxMcChance", 0),
                    MaxMcStatChance          = reader.ReadByte("Item" + i.ToString(), "MaxMcStatChance", 1),
                    MaxMcMaxStat             = reader.ReadByte("Item" + i.ToString(), "MaxMcMaxStat", 1),
                    MaxScChance              = reader.ReadByte("Item" + i.ToString(), "MaxScChance", 0),
                    MaxScStatChance          = reader.ReadByte("Item" + i.ToString(), "MaxScStatChance", 1),
                    MaxScMaxStat             = reader.ReadByte("Item" + i.ToString(), "MaxScMaxStat", 1),
                    AccuracyChance           = reader.ReadByte("Item" + i.ToString(), "AccuracyChance", 0),
                    AccuracyStatChance       = reader.ReadByte("Item" + i.ToString(), "AccuracyStatChance", 1),
                    AccuracyMaxStat          = reader.ReadByte("Item" + i.ToString(), "AccuracyMaxStat", 1),
                    AgilityChance            = reader.ReadByte("Item" + i.ToString(), "AgilityChance", 0),
                    AgilityStatChance        = reader.ReadByte("Item" + i.ToString(), "AgilityStatChance", 1),
                    AgilityMaxStat           = reader.ReadByte("Item" + i.ToString(), "AgilityMaxStat", 1),
                    HpChance                 = reader.ReadByte("Item" + i.ToString(), "HpChance", 0),
                    HpStatChance             = reader.ReadByte("Item" + i.ToString(), "HpStatChance", 1),
                    HpMaxStat                = reader.ReadByte("Item" + i.ToString(), "HpMaxStat", 1),
                    MpChance                 = reader.ReadByte("Item" + i.ToString(), "MpChance", 0),
                    MpStatChance             = reader.ReadByte("Item" + i.ToString(), "MpStatChance", 1),
                    MpMaxStat                = reader.ReadByte("Item" + i.ToString(), "MpMaxStat", 1),
                    StrongChance             = reader.ReadByte("Item" + i.ToString(), "StrongChance", 0),
                    StrongStatChance         = reader.ReadByte("Item" + i.ToString(), "StrongStatChance", 1),
                    StrongMaxStat            = reader.ReadByte("Item" + i.ToString(), "StrongMaxStat", 1),
                    MagicResistChance        = reader.ReadByte("Item" + i.ToString(), "MagicResistChance", 0),
                    MagicResistStatChance    = reader.ReadByte("Item" + i.ToString(), "MagicResistStatChance", 1),
                    MagicResistMaxStat       = reader.ReadByte("Item" + i.ToString(), "MagicResistMaxStat", 1),
                    PoisonResistChance       = reader.ReadByte("Item" + i.ToString(), "PoisonResistChance", 0),
                    PoisonResistStatChance   = reader.ReadByte("Item" + i.ToString(), "PoisonResistStatChance", 1),
                    PoisonResistMaxStat      = reader.ReadByte("Item" + i.ToString(), "PoisonResistMaxStat", 1),
                    HpRecovChance            = reader.ReadByte("Item" + i.ToString(), "HpRecovChance", 0),
                    HpRecovStatChance        = reader.ReadByte("Item" + i.ToString(), "HpRecovStatChance", 1),
                    HpRecovMaxStat           = reader.ReadByte("Item" + i.ToString(), "HpRecovMaxStat", 1),
                    MpRecovChance            = reader.ReadByte("Item" + i.ToString(), "MpRecovChance", 0),
                    MpRecovStatChance        = reader.ReadByte("Item" + i.ToString(), "MpRecovStatChance", 1),
                    MpRecovMaxStat           = reader.ReadByte("Item" + i.ToString(), "MpRecovMaxStat", 1),
                    PoisonRecovChance        = reader.ReadByte("Item" + i.ToString(), "PoisonRecovChance", 0),
                    PoisonRecovStatChance    = reader.ReadByte("Item" + i.ToString(), "PoisonRecovStatChance", 1),
                    PoisonRecovMaxStat       = reader.ReadByte("Item" + i.ToString(), "PoisonRecovMaxStat", 1),
                    CriticalRateChance       = reader.ReadByte("Item" + i.ToString(), "CriticalRateChance", 0),
                    CriticalRateStatChance   = reader.ReadByte("Item" + i.ToString(), "CriticalRateStatChance", 1),
                    CriticalRateMaxStat      = reader.ReadByte("Item" + i.ToString(), "CriticalRateMaxStat", 1),
                    CriticalDamageChance     = reader.ReadByte("Item" + i.ToString(), "CriticalDamageChance", 0),
                    CriticalDamageStatChance = reader.ReadByte("Item" + i.ToString(), "CriticalDamageStatChance", 1),
                    CriticalDamageMaxStat    = reader.ReadByte("Item" + i.ToString(), "CriticalDamageMaxStat", 1),
                    FreezeChance             = reader.ReadByte("Item" + i.ToString(), "FreezeChance", 0),
                    FreezeStatChance         = reader.ReadByte("Item" + i.ToString(), "FreezeStatChance", 1),
                    FreezeMaxStat            = reader.ReadByte("Item" + i.ToString(), "FreezeMaxStat", 1),
                    PoisonAttackChance       = reader.ReadByte("Item" + i.ToString(), "PoisonAttackChance", 0),
                    PoisonAttackStatChance   = reader.ReadByte("Item" + i.ToString(), "PoisonAttackStatChance", 1),
                    PoisonAttackMaxStat      = reader.ReadByte("Item" + i.ToString(), "PoisonAttackMaxStat", 1),
                    AttackSpeedChance        = reader.ReadByte("Item" + i.ToString(), "AttackSpeedChance", 0),
                    AttackSpeedStatChance    = reader.ReadByte("Item" + i.ToString(), "AttackSpeedStatChance", 1),
                    AttackSpeedMaxStat       = reader.ReadByte("Item" + i.ToString(), "AttackSpeedMaxStat", 1),
                    LuckChance               = reader.ReadByte("Item" + i.ToString(), "LuckChance", 0),
                    LuckStatChance           = reader.ReadByte("Item" + i.ToString(), "LuckStatChance", 1),
                    LuckMaxStat              = reader.ReadByte("Item" + i.ToString(), "LuckMaxStat", 1),
                    CurseChance              = reader.ReadByte("Item" + i.ToString(), "CurseChance", 0)
                };
                RandomItemStatsList.Add(stat);
                i++;
            }
        }
예제 #30
0
파일: CustomAI.cs 프로젝트: Pete107/Mir2
        public CustomAI LoadCustomAI(string mobName)
        {
            if (mobName.Length <= 0) return null;
            try
            {
                InIReader Reader = new InIReader(@".\Custom\Unique AIs\" + mobName + ".ini");
                CustomAI mobAI = new CustomAI();
                mobAI.Name = mobName;

                #region Loading the Bools
                mobAI.SetXY = Reader.ReadBoolean("Bools", "SetXY", mobAI.SetXY);
                mobAI.MapSpecific = Reader.ReadBoolean("Bools", "MapSpecific", mobAI.MapSpecific);
                mobAI.AnnounceSpawn = Reader.ReadBoolean("Bools", "AnnounceSpawn", mobAI.AnnounceSpawn);
                mobAI.AnnounceDrop = Reader.ReadBoolean("Bools", "AnnounceDrop", mobAI.AnnounceDrop);
                mobAI.AnnounceDeath = Reader.ReadBoolean("Bools", "AnnounceDeath", mobAI.AnnounceDeath);
                mobAI.UseMassAttack = Reader.ReadBoolean("Bools", "UseMassAttack", mobAI.UseMassAttack);
                mobAI.UseSpecialAttack = Reader.ReadBoolean("Bools", "UseSpecialAttack", mobAI.UseSpecialAttack);
                mobAI.UseMeleeAttack = Reader.ReadBoolean("Bools", "UseMeleeAttack", mobAI.UseMeleeAttack);
                mobAI.UseRangeAttack = Reader.ReadBoolean("Bools", "UseRangeAttack", mobAI.UseRangeAttack);
                mobAI.UseMagicAttack = Reader.ReadBoolean("Bools", "UseMagicAttack", mobAI.UseMagicAttack);
                mobAI.Target = Reader.ReadBoolean("Bools", "Target", mobAI.Target);
                mobAI.UseKillTimer = Reader.ReadBoolean("Bools", "UseKillTimer", mobAI.UseKillTimer);
                mobAI.IgnorePets = Reader.ReadBoolean("Bools", "IgnorePets", mobAI.IgnorePets);
                mobAI.DamagePetsMore = Reader.ReadBoolean("Bools", "DamagePetsMore", mobAI.DamagePetsMore);
                mobAI.CanPara = Reader.ReadBoolean("Bools", "CanPara", mobAI.CanPara);
                mobAI.CanGreen = Reader.ReadBoolean("Bools", "CanGreen", mobAI.CanGreen);
                mobAI.CanRed = Reader.ReadBoolean("Bools", "CanRed", mobAI.CanRed);
                mobAI.Spawn_Slaves = Reader.ReadBoolean("Bools", "SpawnSlaves", mobAI.Spawn_Slaves);
                #endregion

                #region Loading the Kill Timer
                if (mobAI.UseKillTimer)
                {
                    mobAI.KillTimer = Reader.ReadString("Strings", "KillTimer", mobAI.KillTimer);
                    if (mobAI.killTimer.Length > 0)
                    {
                        string[] timeString = mobAI.KillTimer.Split(' ');
                        string[] dateString = timeString[0].Split('-');
                        dateString[0] = dateString[0].Replace("(", "");
                        mobAI.LastKillDay = Convert.ToInt32(dateString[0]);
                        mobAI.LastKillMonth = Convert.ToInt32(dateString[1]);
                        mobAI.LastKillYear = Convert.ToInt32(dateString[2]);
                        dateString[1] = dateString[1].Replace("(", "");
                        dateString[1] = dateString[1].Replace(")", "");
                        string[] tempString = timeString[1].Split(':');
                        if (tempString[0].Contains("("))
                            tempString[0] = tempString[0].Replace("(", "");
                        if (tempString[1].Contains(")"))
                            tempString[1] = tempString[1].Replace(")", "");
                        mobAI.LastKillHour = Convert.ToInt32(tempString[0]);
                        mobAI.LastKillMinute = Convert.ToInt32(tempString[1]);
                    }
                    mobAI.RespawnDay = Reader.ReadInt32("Ints", "RespawnDays", mobAI.RespawnDay);
                    mobAI.RespawnMonth = Reader.ReadInt32("Ints", "RespawnMonths", mobAI.RespawnMonth);
                    mobAI.RespawnYear = Reader.ReadInt32("Ints", "RespawnYears", mobAI.RespawnYear);
                    mobAI.RespawnHour = Reader.ReadInt32("Ints", "RespawnHours", mobAI.RespawnHour);
                    mobAI.RespawnMinute = Reader.ReadInt32("Ints", "RespawnMinutes", mobAI.RespawnMinute);
                }
                #endregion

                if (mobAI.MapSpecific)
                    mobAI.MapName = Reader.ReadString("Strings", "MapName", mobAI.MapName);

                #region Loading the announcers
                if (mobAI.AnnounceSpawn)
                    mobAI.SpawnMessage = Reader.ReadString("Strings", "SpawnMessage", mobAI.SpawnMessage);

                if (mobAI.AnnounceDeath)
                    mobAI.DeadMessage = Reader.ReadString("Strings", "DeathMessage", mobAI.DeadMessage);

                if (mobAI.AnnounceDrop)
                    mobAI.ItemMessage = Reader.ReadString("Strings", "ItemMessage", mobAI.ItemMessage);
                #endregion

                if (SetXY)
                {
                    mobAI.MapX = Reader.ReadInt32("Ints", "MapX", mobAI.MapX);
                    mobAI.MapY = Reader.ReadInt32("Ints", "MapY", mobAI.MapY);
                }
                #region Loading the Attacks
                if (mobAI.UseMassAttack)
                {
                    mobAI.MassAttackEffect = Reader.ReadInt32("Ints", "MassAttackEffect", mobAI.MassAttackEffect);
                    mobAI.MassAttackDamage = Reader.ReadInt32("Damage", "MassAttackDamage", mobAI.MassAttackDamage);
                }
                if (mobAI.UseSpecialAttack)
                {
                    mobAI.SpecialAttackEffect = Reader.ReadInt32("Ints", "SpecialAttackEffect", mobAI.SpecialAttackEffect);
                    mobAI.SpecialAttackDamage = Reader.ReadInt32("Damage", "SpecialAttackDamage", mobAI.SpecialAttackDamage);
                }
                if (mobAI.UseMeleeAttack)
                {
                    mobAI.MeleeAttackEffect = Reader.ReadInt32("Ints", "MeleeAttackEffect", mobAI.MeleeAttackEffect);
                    mobAI.MeleeAttackDamage = Reader.ReadInt32("Damage", "MeleeAttackDamage", mobAI.MeleeAttackDamage);
                }
                if (mobAI.UseRangeAttack)
                {
                    mobAI.RangeAttackEffect = Reader.ReadInt32("Ints", "RangeAttackEffect", mobAI.RangeAttackEffect);
                    mobAI.RangeAttackDamage = Reader.ReadInt32("Damage", "RangeAttackDamage", mobAI.RangeAttackDamage);
                }
                if (mobAI.UseMagicAttack)
                {
                    mobAI.MagicAttackEffect = Reader.ReadInt32("Ints", "MagicAttackEffect", mobAI.MagicAttackEffect);
                    mobAI.MagicAttackDamage = Reader.ReadInt32("Damage", "MagicAttackDamage", mobAI.MagicAttackDamage);
                }
                if (mobAI.Target)
                {
                    mobAI.TargetClass = Reader.ReadInt32("Strings", "TargetClass", mobAI.TargetClass); //Default = Warrior
                    mobAI.TargetedClass = (MirClass)mobAI.TargetClass;
                    mobAI.TargetAttackDamage = Reader.ReadInt32("Damage", "TargetDamage", mobAI.TargetAttackDamage);
                }
                if (mobAI.DamagePetsMore)
                    mobAI.PetAttackDamage = Reader.ReadInt32("Damage", "PetDamage", mobAI.PetAttackDamage);
                #endregion

                #region Loading the Slaves Spawns
                if (mobAI.Spawn_Slaves)
                {
                    for (int i = 0; i < 4; i++)
                    {
                        SpawnSlaves monsters = new SpawnSlaves();
                        monsters.Name = Reader.ReadString("Slaves", "Slave" + i, monsters.Name);
                        monsters.Count = Reader.ReadInt32("Slaves", "SlaveCount" + i, monsters.Count);
                        mobAI.Slaves.Add(monsters);
                    }
                }
                #endregion

                #region Loading the Item Drops
                mobAI.ItemCount = Reader.ReadInt32("Ints", "ItemCount", mobAI.ItemCount);
                if (mobAI.ItemCount > 0)
                {
                    for (int i = 0; i < mobAI.ItemCount; i++)
                    {
                        DropItemsWithAnnounce items = new DropItemsWithAnnounce();
                        items.Name = Reader.ReadString("Items", "Item" + i, items.Name);
                        items.Chance = Reader.ReadInt32("Items", "ItemChance" + i, items.Chance);
                        mobAI.Drops.Add(items);
                    }
                }
                #endregion

                #region Loading the current location
                mobAI.CurrentMap = Reader.ReadString("States", "CurrentMap", CurrentMap);
                mobAI.CurrentX = Reader.ReadInt32("States", "CurrentX", CurrentX);
                mobAI.CurrentY = Reader.ReadInt32("States", "CurrentY", CurrentY);

                #endregion

                return mobAI;
            }
            catch
            {
                SMain.Enqueue("Error with loading config");
                return null;
            }

        }
예제 #31
0
파일: CustomAI.cs 프로젝트: Pete107/Mir2
        public bool Save(CustomAI mobToSave)
        {
            if (mobToSave == null || mobToSave.Name.Length <= 0)
                return false;
            InIReader Writer = new InIReader(@".\Custom\Unique AIs\" + mobToSave.Name + ".ini");
            Writer.Write("Bools", "SetXY", mobToSave.SetXY);
            Writer.Write("Bools", "MapSpecific", mobToSave.MapSpecific);
            Writer.Write("Bools", "AnnounceSpawn", mobToSave.AnnounceSpawn);
            Writer.Write("Bools", "AnnounceDrop", mobToSave.AnnounceDrop);
            Writer.Write("Bools", "AnnounceDeath", mobToSave.AnnounceDeath);
            Writer.Write("Bools", "UseMassAttack", mobToSave.UseMassAttack);
            Writer.Write("Bools", "UseSpecialAttack", mobToSave.UseSpecialAttack);
            Writer.Write("Bools", "UseMeleeAttack", mobToSave.UseMeleeAttack);
            Writer.Write("Bools", "UseRangeAttack", mobToSave.UseRangeAttack);
            Writer.Write("Bools", "Target", mobToSave.Target);
            Writer.Write("Bools", "UseKillTimer", mobToSave.UseKillTimer);
            Writer.Write("Bools", "IgnorePets", mobToSave.IgnorePets);
            Writer.Write("Bools", "DamagePetsMore", mobToSave.DamagePetsMore);
            Writer.Write("Bools", "CanPara", mobToSave.CanPara);
            Writer.Write("Bools", "CanGreen", mobToSave.CanGreen);
            Writer.Write("Bools", "CanRed", mobToSave.CanRed);
            Writer.Write("Bools", "SpawnSlaves", mobToSave.Spawn_Slaves);
            if (mobToSave.MapSpecific)
                Writer.Write("Strings", "MapName", mobToSave.MapName);
            if (mobToSave.AnnounceSpawn)
                Writer.Write("Strings", "SpawnMessage", mobToSave.SpawnMessage);
            if (mobToSave.AnnounceDeath)
                Writer.Write("Strings", "DeathMessage", mobToSave.DeadMessage);
            if (mobToSave.AnnounceDrop)
                Writer.Write("Strings", "ItemMessage", mobToSave.ItemMessage);
            if (mobToSave.SetXY)
            {
                Writer.Write("Ints", "MapX", mobToSave.MapX);
                Writer.Write("Ints", "MapY", mobToSave.MapY);
            }

            if (mobToSave.UseMassAttack)
            {
                Writer.Write("Ints", "MassAttackEffect", mobToSave.MassAttackEffect);
                Writer.Write("Damage", "MassAttackDamage", mobToSave.MassAttackDamage);
            }
            if (mobToSave.UseSpecialAttack)
            {
                Writer.Write("Ints", "SpecialAttackEffect", mobToSave.SpecialAttackEffect);
                Writer.Write("Damage", "SpecialAttackDamage", mobToSave.SpecialAttackDamage);
            }
            if (mobToSave.UseMeleeAttack)
            {
                Writer.Write("Ints", "MeleeAttackEffect", mobToSave.MeleeAttackEffect);
                Writer.Write("Damage", "MeleeAttackDamage", mobToSave.MeleeAttackDamage);
            }
            if (mobToSave.UseRangeAttack)
            {
                Writer.Write("Ints", "RangeAttackEffect", mobToSave.RangeAttackEffect);
                Writer.Write("Damage", "RangeAttackDamage", mobToSave.RangeAttackDamage);
            }
            if (mobToSave.UseMagicAttack)
            {
                Writer.Write("Ints", "MagicAttackEffect", mobToSave.MagicAttackEffect);
                Writer.Write("Damage", "MagicAttackDamage", mobToSave.MagicAttackDamage);
            }
            if (mobToSave.Target)
            {
                Writer.Write("Strings", "TargetClass", mobToSave.TargetClass); //Default = Warrior
                Writer.Write("Damage", "TargetDamage", mobToSave.TargetAttackDamage);
            }
            if (mobToSave.DamagePetsMore || !mobToSave.IgnorePets)
                Writer.Write("Damage", "PetDamage", mobToSave.PetAttackDamage);

            if (mobToSave.UseKillTimer)
            {
                Writer.Write("Strings", "KillTimer", mobToSave.KillTimer);
                Writer.Write("Ints", "RespawnDays", mobToSave.RespawnDay);
                Writer.Write("Ints", "RespawnMonths", mobToSave.RespawnMonth);
                Writer.Write("Ints", "RespawnYears", mobToSave.RespawnYear);
                Writer.Write("Ints", "RespawnHours", mobToSave.RespawnHour);
                Writer.Write("Ints", "RespawnMinutes", mobToSave.RespawnMinute);
            }
            Writer.Write("Ints", "ItemCount", mobToSave.ItemCount);

            if (mobToSave.Spawn_Slaves)
            {
                for (int i = 0; i < mobToSave.Slaves.Count; i++)
                {
                    Writer.Write("Slaves", "Slave" + i, mobToSave.Slaves[i].Name);
                    Writer.Write("Slaves", "SlaveCount" + i, mobToSave.Slaves[i].Count);
                }
            }
            if (mobToSave.ItemCount > 0)
            {
                for (int i = 0; i < mobToSave.ItemCount; i++)
                {
                    Writer.Write("Items", "Item" + i, mobToSave.Drops[i].Name);
                    Writer.Write("Items", "ItemChance" + i, mobToSave.Drops[i].Chance);
                }
            }
            Writer.Write("States", "Status", mobToSave.Alive);
            Writer.Write("States", "CurrentMap", mobToSave.CurrentMap);
            Writer.Write("States", "CurrentX", mobToSave.CurrentX);
            Writer.Write("States", "CurrentY", mobToSave.CurrentY);

            return true;
        }
예제 #32
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void LoadMentor()
 {
     if (!File.Exists(ConfigPath + @".\MentorSystem.ini"))
     {
         SaveMarriage();
         return;
     }
     InIReader reader = new InIReader(ConfigPath + @".\MentorSystem.ini");
     MentorLevelGap = reader.ReadByte("Config", "LevelGap", MentorLevelGap);
     MentorSkillBoost = reader.ReadBoolean("Config", "MenteeSkillBoost", MentorSkillBoost);
     MentorLength = reader.ReadByte("Config", "MentorshipLength", MentorLength);
     MentorDamageBoost = reader.ReadByte("Config", "MentorDamageBoost", MentorDamageBoost);
     MentorExpBoost = reader.ReadByte("Config", "MenteeExpBoost", MentorExpBoost);
     MenteeExpBank = reader.ReadByte("Config", "PercentXPtoMentor", MenteeExpBank);
 }
예제 #33
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveRandomItemStats()
 {
     File.Delete(ConfigPath + @".\RandomItemStats.ini");
     InIReader reader = new InIReader(ConfigPath + @".\RandomItemStats.ini");
     RandomItemStat stat;
     for (int i = 0; i < RandomItemStatsList.Count; i++)
     {
         stat = RandomItemStatsList[i];
         reader.Write("Item" + i.ToString(), "MaxDuraChance", stat.MaxDuraChance);
         reader.Write("Item" + i.ToString(), "MaxDuraStatChance", stat.MaxDuraStatChance);
         reader.Write("Item" + i.ToString(), "MaxDuraMaxStat", stat.MaxDuraMaxStat);
         reader.Write("Item" + i.ToString(), "MaxAcChance", stat.MaxAcChance);
         reader.Write("Item" + i.ToString(), "MaxAcStatChance", stat.MaxAcStatChance);
         reader.Write("Item" + i.ToString(), "MaxAcMaxStat", stat.MaxAcMaxStat);
         reader.Write("Item" + i.ToString(), "MaxMacChance", stat.MaxMacChance);
         reader.Write("Item" + i.ToString(), "MaxMacStatChance", stat.MaxMacStatChance);
         reader.Write("Item" + i.ToString(), "MaxMACMaxStat", stat.MaxMacMaxStat);
         reader.Write("Item" + i.ToString(), "MaxDcChance", stat.MaxDcChance);
         reader.Write("Item" + i.ToString(), "MaxDcStatChance", stat.MaxDcStatChance);
         reader.Write("Item" + i.ToString(), "MaxDcMaxStat", stat.MaxDcMaxStat);
         reader.Write("Item" + i.ToString(), "MaxMcChance", stat.MaxMcChance);
         reader.Write("Item" + i.ToString(), "MaxMcStatChance",  stat.MaxMcStatChance);
         reader.Write("Item" + i.ToString(), "MaxMcMaxStat", stat.MaxMcMaxStat);
         reader.Write("Item" + i.ToString(), "MaxScChance", stat.MaxScChance);
         reader.Write("Item" + i.ToString(), "MaxScStatChance", stat.MaxScStatChance);
         reader.Write("Item" + i.ToString(), "MaxScMaxStat", stat.MaxScMaxStat);
         reader.Write("Item" + i.ToString(), "AccuracyChance", stat.AccuracyChance);
         reader.Write("Item" + i.ToString(), "AccuracyStatChance", stat.AccuracyStatChance);
         reader.Write("Item" + i.ToString(), "AccuracyMaxStat", stat.AccuracyMaxStat);
         reader.Write("Item" + i.ToString(), "AgilityChance", stat.AgilityChance);
         reader.Write("Item" + i.ToString(), "AgilityStatChance", stat.AgilityStatChance);
         reader.Write("Item" + i.ToString(), "AgilityMaxStat", stat.AgilityMaxStat);
         reader.Write("Item" + i.ToString(), "HpChance", stat.HpChance);
         reader.Write("Item" + i.ToString(), "HpStatChance", stat.HpStatChance);
         reader.Write("Item" + i.ToString(), "HpMaxStat", stat.HpMaxStat);
         reader.Write("Item" + i.ToString(), "MpChance", stat.MpChance);
         reader.Write("Item" + i.ToString(), "MpStatChance", stat.MpStatChance);
         reader.Write("Item" + i.ToString(), "MpMaxStat", stat.MpMaxStat);
         reader.Write("Item" + i.ToString(), "StrongChance", stat.StrongChance);
         reader.Write("Item" + i.ToString(), "StrongStatChance", stat.StrongStatChance);
         reader.Write("Item" + i.ToString(), "StrongMaxStat", stat.StrongMaxStat);
         reader.Write("Item" + i.ToString(), "MagicResistChance", stat.MagicResistChance);
         reader.Write("Item" + i.ToString(), "MagicResistStatChance", stat.MagicResistStatChance);
         reader.Write("Item" + i.ToString(), "MagicResistMaxStat", stat.MagicResistMaxStat);
         reader.Write("Item" + i.ToString(), "PoisonResistChance", stat.PoisonResistChance);
         reader.Write("Item" + i.ToString(), "PoisonResistStatChance", stat.PoisonResistStatChance);
         reader.Write("Item" + i.ToString(), "PoisonResistMaxStat", stat.PoisonResistMaxStat);
         reader.Write("Item" + i.ToString(), "HpRecovChance", stat.HpRecovChance);
         reader.Write("Item" + i.ToString(), "HpRecovStatChance", stat.HpRecovStatChance);
         reader.Write("Item" + i.ToString(), "HpRecovMaxStat", stat.HpRecovMaxStat);
         reader.Write("Item" + i.ToString(), "MpRecovChance", stat.MpRecovChance);
         reader.Write("Item" + i.ToString(), "MpRecovStatChance", stat.MpRecovStatChance);
         reader.Write("Item" + i.ToString(), "MpRecovMaxStat", stat.MpRecovMaxStat);
         reader.Write("Item" + i.ToString(), "PoisonRecovChance", stat.PoisonRecovChance);
         reader.Write("Item" + i.ToString(), "PoisonRecovStatChance", stat.PoisonRecovStatChance);
         reader.Write("Item" + i.ToString(), "PoisonRecovMaxStat", stat.PoisonRecovMaxStat);
         reader.Write("Item" + i.ToString(), "CriticalRateChance", stat.CriticalRateChance);
         reader.Write("Item" + i.ToString(), "CriticalRateStatChance", stat.CriticalRateStatChance);
         reader.Write("Item" + i.ToString(), "CriticalRateMaxStat", stat.CriticalRateMaxStat);
         reader.Write("Item" + i.ToString(), "CriticalDamageChance", stat.CriticalDamageChance);
         reader.Write("Item" + i.ToString(), "CriticalDamageStatChance", stat.CriticalDamageStatChance);
         reader.Write("Item" + i.ToString(), "CriticalDamageMaxStat", stat.CriticalDamageMaxStat);
         reader.Write("Item" + i.ToString(), "FreezeChance", stat.FreezeChance);
         reader.Write("Item" + i.ToString(), "FreezeStatChance", stat.FreezeStatChance);
         reader.Write("Item" + i.ToString(), "FreezeMaxStat", stat.FreezeMaxStat);
         reader.Write("Item" + i.ToString(), "PoisonAttackChance", stat.PoisonAttackChance);
         reader.Write("Item" + i.ToString(), "PoisonAttackStatChance", stat.PoisonAttackStatChance);
         reader.Write("Item" + i.ToString(), "PoisonAttackMaxStat", stat.PoisonAttackMaxStat);
         reader.Write("Item" + i.ToString(), "AttackSpeedChance", stat.AttackSpeedChance);
         reader.Write("Item" + i.ToString(), "AttackSpeedStatChance", stat.AttackSpeedStatChance);
         reader.Write("Item" + i.ToString(), "AttackSpeedMaxStat", stat.AttackSpeedMaxStat);
         reader.Write("Item" + i.ToString(), "LuckChance", stat.LuckChance);
         reader.Write("Item" + i.ToString(), "LuckStatChance", stat.LuckStatChance);
         reader.Write("Item" + i.ToString(), "LuckMaxStat", stat.LuckMaxStat);
         reader.Write("Item" + i.ToString(), "CurseChance", stat.CurseChance);
     }
 }
예제 #34
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveMentor()
 {
     File.Delete(ConfigPath + @".\MentorSystem.ini");
     InIReader reader = new InIReader(ConfigPath + @".\MentorSystem.ini");
     reader.Write("Config", "LevelGap", MentorLevelGap);
     reader.Write("Config", "MenteeSkillBoost", MentorSkillBoost);
     reader.Write("Config", "MentorshipLength", MentorLength);
     reader.Write("Config", "MentorDamageBoost", MentorDamageBoost);
     reader.Write("Config", "MenteeExpBoost", MentorExpBoost);
     reader.Write("Config", "PercentXPtoMentor", MenteeExpBank);
 }
예제 #35
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveMines()
 {
     File.Delete(ConfigPath + @".\Mines.ini");
     InIReader reader = new InIReader(ConfigPath + @".\Mines.ini");
     MineSet Mine;
     for (int i = 0; i < MineSetList.Count; i++)
     {
         Mine = MineSetList[i];
         reader.Write("Mine" + i.ToString(), "Name", Mine.Name);
         reader.Write("Mine" + i.ToString(), "SpotRegenRate", Mine.SpotRegenRate);
         reader.Write("Mine" + i.ToString(), "MaxStones", Mine.MaxStones);
         reader.Write("Mine" + i.ToString(), "HitRate", Mine.HitRate);
         reader.Write("Mine" + i.ToString(), "DropRate", Mine.DropRate);
         reader.Write("Mine" + i.ToString(), "TotalSlots", Mine.TotalSlots);
         
         for (int j = 0; j < Mine.Drops.Count; j++)
         {
             MineDrop Drop = Mine.Drops[j];
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-ItemName", Drop.ItemName);
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MinSlot", Drop.MinSlot);
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MaxSlot", Drop.MaxSlot);
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MinDura", Drop.MinDura);
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MaxDura", Drop.MaxDura);
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-BonusChance", Drop.BonusChance);
             reader.Write("Mine" + i.ToString(), "D" + j.ToString() + "-MaxBonusDura", Drop.MaxBonusDura);
         }
     }
 }
예제 #36
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveGem()
 {
     File.Delete(ConfigPath + @".\GemSystem.ini");
     InIReader reader = new InIReader(ConfigPath + @".\GemSystem.ini");
     reader.Write("Config", "GemStatIndependent", GemStatIndependent);
 }
예제 #37
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void SaveGuildSettings()
        {
            File.Delete(ConfigPath + @".\GuildSettings.ini");
            InIReader reader = new InIReader(ConfigPath + @".\GuildSettings.ini");
            reader.Write("Guilds", "MinimumLevel", Guild_RequiredLevel);
            reader.Write("Guilds", "ExpRate", Guild_ExpRate);
            reader.Write("Guilds", "PointPerLevel", Guild_PointPerLevel);
            reader.Write("Guilds", "TotalBuffs", Guild_BuffList.Count);
            reader.Write("Guilds", "WarTime", Guild_WarTime);
            reader.Write("Guilds", "WarCost", Guild_WarCost);

            int i = 0;
            for (i = 0; i < Guild_ExperienceList.Count; i++)
            {
                reader.Write("Exp", "Level-" + i.ToString(), Guild_ExperienceList[i]);
            }
            for (i = 0; i < Guild_MembercapList.Count; i++)
            {
                reader.Write("Cap", "Level-" + i.ToString(), Guild_MembercapList[i]);
            }
            for (i = 0; i < Guild_CreationCostList.Count; i++)
            {
                reader.Write("Required-" + i.ToString(), "ItemName", Guild_CreationCostList[i].ItemName);
                reader.Write("Required-" + i.ToString(), "Amount", Guild_CreationCostList[i].Amount);
            }
            for (i = 0; i < Guild_BuffList.Count; i++)
            {
                Guild_BuffList[i].Save(reader, i);
            }
        }
예제 #38
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveGoods()
 {
     File.Delete(ConfigPath + @".\GoodsSystem.ini");
     InIReader reader = new InIReader(ConfigPath + @".\GoodsSystem.ini");
     reader.Write("Goods", "On", GoodsOn);
     reader.Write("Goods", "MaxStored", GoodsMaxStored);
     reader.Write("Goods", "BuyBackTime", GoodsBuyBackTime);
     reader.Write("Goods", "BuyBackMaxStored", GoodsBuyBackMaxStored);
 }
예제 #39
0
        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();
        }
예제 #40
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void LoadBaseStats()
        {
            if (!File.Exists(ConfigPath + @".\BaseStats.ini"))
            {
                SaveBaseStats();
                return;
            }

            InIReader reader = new InIReader(ConfigPath + @".\BaseStats.ini");

            for (int i = 0; i < ClassBaseStats.Length; i++)
            {
                ClassBaseStats[i].HpGain = reader.ReadFloat(BaseStatClassNames[i], "HpGain", ClassBaseStats[i].HpGain);
                ClassBaseStats[i].HpGainRate = reader.ReadFloat(BaseStatClassNames[i], "HpGainRate", ClassBaseStats[i].HpGainRate);
                ClassBaseStats[i].MpGainRate = reader.ReadFloat(BaseStatClassNames[i], "MpGainRate", ClassBaseStats[i].MpGainRate);
                ClassBaseStats[i].BagWeightGain = reader.ReadFloat(BaseStatClassNames[i], "BagWeightGain", ClassBaseStats[i].BagWeightGain);
                ClassBaseStats[i].WearWeightGain = reader.ReadFloat(BaseStatClassNames[i], "WearWeightGain", ClassBaseStats[i].WearWeightGain);
                ClassBaseStats[i].HandWeightGain = reader.ReadFloat(BaseStatClassNames[i], "HandWeightGain", ClassBaseStats[i].HandWeightGain);
                ClassBaseStats[i].MinAc = reader.ReadByte(BaseStatClassNames[i], "MinAc", ClassBaseStats[i].MinAc);
                ClassBaseStats[i].MaxAc = reader.ReadByte(BaseStatClassNames[i], "MaxAc", ClassBaseStats[i].MaxAc);
                ClassBaseStats[i].MinMac = reader.ReadByte(BaseStatClassNames[i], "MinMac", ClassBaseStats[i].MinMac);
                ClassBaseStats[i].MaxMac = reader.ReadByte(BaseStatClassNames[i], "MaxMac", ClassBaseStats[i].MaxMac);
                ClassBaseStats[i].MinDc = reader.ReadByte(BaseStatClassNames[i], "MinDc", ClassBaseStats[i].MinDc);
                ClassBaseStats[i].MaxDc = reader.ReadByte(BaseStatClassNames[i], "MaxDc", ClassBaseStats[i].MaxDc);
                ClassBaseStats[i].MinMc = reader.ReadByte(BaseStatClassNames[i], "MinMc", ClassBaseStats[i].MinMc);
                ClassBaseStats[i].MaxMc = reader.ReadByte(BaseStatClassNames[i], "MaxMc", ClassBaseStats[i].MaxMc);
                ClassBaseStats[i].MinSc = reader.ReadByte(BaseStatClassNames[i], "MinSc", ClassBaseStats[i].MinSc);
                ClassBaseStats[i].MaxSc = reader.ReadByte(BaseStatClassNames[i], "MaxSc", ClassBaseStats[i].MaxSc);
                ClassBaseStats[i].StartAgility = reader.ReadByte(BaseStatClassNames[i], "StartAgility", ClassBaseStats[i].StartAgility);
                ClassBaseStats[i].StartAccuracy = reader.ReadByte(BaseStatClassNames[i], "StartAccuracy", ClassBaseStats[i].StartAccuracy);
                ClassBaseStats[i].StartCriticalRate = reader.ReadByte(BaseStatClassNames[i], "StartCriticalRate", ClassBaseStats[i].StartCriticalRate);
                ClassBaseStats[i].StartCriticalDamage = reader.ReadByte(BaseStatClassNames[i], "StartCriticalDamage", ClassBaseStats[i].StartCriticalDamage);
                ClassBaseStats[i].CritialRateGain = reader.ReadByte(BaseStatClassNames[i], "CritialRateGain", ClassBaseStats[i].CritialRateGain);
                ClassBaseStats[i].CriticalDamageGain = reader.ReadByte(BaseStatClassNames[i], "CriticalDamageGain", ClassBaseStats[i].CriticalDamageGain);
            }
        }
예제 #41
0
        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);
            }
        }
예제 #42
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void LoadRandomItemStats()
 {
     //note: i could have used a flat file system for this which would be faster, 
     //BUT: it's only loaded @ server startup so speed isnt vital.
     //and i think settings should be available outside the exe for ppl to edit it easyer + lets ppl share config without forcing ppl to run it in an exe
     if (!File.Exists(ConfigPath + @".\RandomItemStats.ini"))
     {
         RandomItemStatsList.Add(new RandomItemStat());
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Weapon));
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Armour));
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Helmet));
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Necklace));
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Bracelet));
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Ring));
         RandomItemStatsList.Add(new RandomItemStat(ItemType.Belt));
         SaveRandomItemStats();
         return;
     }
     InIReader reader = new InIReader(ConfigPath + @".\RandomItemStats.ini");
     int i = 0;
     RandomItemStat stat;
     while (reader.ReadByte("Item" + i.ToString(),"MaxDuraChance",255) != 255)
     {
         stat = new RandomItemStat();
         stat.MaxDuraChance = reader.ReadByte("Item" + i.ToString(), "MaxDuraChance", 0);
         stat.MaxDuraStatChance = reader.ReadByte("Item" + i.ToString(), "MaxDuraStatChance", 1);
         stat.MaxDuraMaxStat = reader.ReadByte("Item" + i.ToString(), "MaxDuraMaxStat", 1);
         stat.MaxAcChance = reader.ReadByte("Item" + i.ToString(), "MaxAcChance", 0);
         stat.MaxAcStatChance = reader.ReadByte("Item" + i.ToString(), "MaxAcStatChance", 1);
         stat.MaxAcMaxStat = reader.ReadByte("Item" + i.ToString(), "MaxAcMaxStat", 1);
         stat.MaxMacChance = reader.ReadByte("Item" + i.ToString(), "MaxMacChance", 0);
         stat.MaxMacStatChance = reader.ReadByte("Item" + i.ToString(), "MaxMacStatChance", 1);
         stat.MaxMacMaxStat = reader.ReadByte("Item" + i.ToString(), "MaxMACMaxStat", 1);
         stat.MaxDcChance = reader.ReadByte("Item" + i.ToString(), "MaxDcChance", 0);
         stat.MaxDcStatChance = reader.ReadByte("Item" + i.ToString(), "MaxDcStatChance", 1);
         stat.MaxDcMaxStat = reader.ReadByte("Item" + i.ToString(), "MaxDcMaxStat", 1);
         stat.MaxMcChance = reader.ReadByte("Item" + i.ToString(), "MaxMcChance", 0);
         stat.MaxMcStatChance = reader.ReadByte("Item" + i.ToString(), "MaxMcStatChance", 1);
         stat.MaxMcMaxStat = reader.ReadByte("Item" + i.ToString(), "MaxMcMaxStat", 1);
         stat.MaxScChance = reader.ReadByte("Item" + i.ToString(), "MaxScChance", 0);
         stat.MaxScStatChance = reader.ReadByte("Item" + i.ToString(), "MaxScStatChance", 1);
         stat.MaxScMaxStat = reader.ReadByte("Item" + i.ToString(), "MaxScMaxStat", 1);
         stat.AccuracyChance = reader.ReadByte("Item" + i.ToString(), "AccuracyChance", 0);
         stat.AccuracyStatChance = reader.ReadByte("Item" + i.ToString(), "AccuracyStatChance", 1);
         stat.AccuracyMaxStat = reader.ReadByte("Item" + i.ToString(), "AccuracyMaxStat", 1);
         stat.AgilityChance = reader.ReadByte("Item" + i.ToString(), "AgilityChance", 0);
         stat.AgilityStatChance = reader.ReadByte("Item" + i.ToString(), "AgilityStatChance", 1);
         stat.AgilityMaxStat = reader.ReadByte("Item" + i.ToString(), "AgilityMaxStat", 1);
         stat.HpChance = reader.ReadByte("Item" + i.ToString(), "HpChance", 0);
         stat.HpStatChance = reader.ReadByte("Item" + i.ToString(), "HpStatChance", 1);
         stat.HpMaxStat = reader.ReadByte("Item" + i.ToString(), "HpMaxStat", 1);
         stat.MpChance = reader.ReadByte("Item" + i.ToString(), "MpChance", 0);
         stat.MpStatChance = reader.ReadByte("Item" + i.ToString(), "MpStatChance", 1);
         stat.MpMaxStat = reader.ReadByte("Item" + i.ToString(), "MpMaxStat", 1);
         stat.StrongChance = reader.ReadByte("Item" + i.ToString(), "StrongChance", 0);
         stat.StrongStatChance = reader.ReadByte("Item" + i.ToString(), "StrongStatChance", 1);
         stat.StrongMaxStat = reader.ReadByte("Item" + i.ToString(), "StrongMaxStat", 1);
         stat.MagicResistChance = reader.ReadByte("Item" + i.ToString(), "MagicResistChance", 0);
         stat.MagicResistStatChance = reader.ReadByte("Item" + i.ToString(), "MagicResistStatChance", 1);
         stat.MagicResistMaxStat = reader.ReadByte("Item" + i.ToString(), "MagicResistMaxStat", 1);
         stat.PoisonResistChance = reader.ReadByte("Item" + i.ToString(), "PoisonResistChance", 0);
         stat.PoisonResistStatChance = reader.ReadByte("Item" + i.ToString(), "PoisonResistStatChance", 1);
         stat.PoisonResistMaxStat = reader.ReadByte("Item" + i.ToString(), "PoisonResistMaxStat", 1);
         stat.HpRecovChance = reader.ReadByte("Item" + i.ToString(), "HpRecovChance", 0);
         stat.HpRecovStatChance = reader.ReadByte("Item" + i.ToString(), "HpRecovStatChance", 1);
         stat.HpRecovMaxStat = reader.ReadByte("Item" + i.ToString(), "HpRecovMaxStat", 1);
         stat.MpRecovChance = reader.ReadByte("Item" + i.ToString(), "MpRecovChance", 0);
         stat.MpRecovStatChance = reader.ReadByte("Item" + i.ToString(), "MpRecovStatChance", 1);
         stat.MpRecovMaxStat = reader.ReadByte("Item" + i.ToString(), "MpRecovMaxStat", 1);
         stat.PoisonRecovChance = reader.ReadByte("Item" + i.ToString(), "PoisonRecovChance", 0);
         stat.PoisonRecovStatChance = reader.ReadByte("Item" + i.ToString(), "PoisonRecovStatChance", 1);
         stat.PoisonRecovMaxStat = reader.ReadByte("Item" + i.ToString(), "PoisonRecovMaxStat", 1);
         stat.CriticalRateChance = reader.ReadByte("Item" + i.ToString(), "CriticalRateChance", 0);
         stat.CriticalRateStatChance = reader.ReadByte("Item" + i.ToString(), "CriticalRateStatChance", 1);
         stat.CriticalRateMaxStat = reader.ReadByte("Item" + i.ToString(), "CriticalRateMaxStat", 1);
         stat.CriticalDamageChance = reader.ReadByte("Item" + i.ToString(), "CriticalDamageChance", 0);
         stat.CriticalDamageStatChance = reader.ReadByte("Item" + i.ToString(), "CriticalDamageStatChance", 1);
         stat.CriticalDamageMaxStat = reader.ReadByte("Item" + i.ToString(), "CriticalDamageMaxStat", 1);
         stat.FreezeChance = reader.ReadByte("Item" + i.ToString(), "FreezeChance", 0);
         stat.FreezeStatChance = reader.ReadByte("Item" + i.ToString(), "FreezeStatChance", 1);
         stat.FreezeMaxStat = reader.ReadByte("Item" + i.ToString(), "FreezeMaxStat", 1);
         stat.PoisonAttackChance = reader.ReadByte("Item" + i.ToString(), "PoisonAttackChance", 0);
         stat.PoisonAttackStatChance = reader.ReadByte("Item" + i.ToString(), "PoisonAttackStatChance", 1);
         stat.PoisonAttackMaxStat = reader.ReadByte("Item" + i.ToString(), "PoisonAttackMaxStat", 1);
         stat.AttackSpeedChance = reader.ReadByte("Item" + i.ToString(), "AttackSpeedChance", 0);
         stat.AttackSpeedStatChance = reader.ReadByte("Item" + i.ToString(), "AttackSpeedStatChance", 1);
         stat.AttackSpeedMaxStat = reader.ReadByte("Item" + i.ToString(), "AttackSpeedMaxStat", 1);
         stat.LuckChance = reader.ReadByte("Item" + i.ToString(), "LuckChance", 0);
         stat.LuckStatChance = reader.ReadByte("Item" + i.ToString(), "LuckStatChance", 1);
         stat.LuckMaxStat = reader.ReadByte("Item" + i.ToString(), "LuckMaxStat", 1);
         stat.CurseChance = reader.ReadByte("Item" + i.ToString(), "CurseChance", 0);
         RandomItemStatsList.Add(stat);
         i++;
     }
 }
예제 #43
0
 private void Connect(InIReader settings)
 {
     this.mqtt  = (ADataBackend)ABackend.GetInstance(settings.GetSection("mqtt"), ABackend.BackendType.Data);
     this.scral = new ScralPusher(settings.GetSection("scral"));
 }
예제 #44
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void LoadMines()
        {
            if (!File.Exists(ConfigPath + @".\Mines.ini"))
            {
                MineSetList.Add(new MineSet(1));
                MineSetList.Add(new MineSet(2));
                SaveMines();
                return;
            }
            InIReader reader = new InIReader(ConfigPath + @".\Mines.ini");
            int i = 0;
            MineSet Mine;
            while (reader.ReadByte("Mine" + i.ToString(), "SpotRegenRate", 255) != 255)
            {
                Mine = new MineSet();
                Mine.Name = reader.ReadString("Mine" + i.ToString(), "Name", Mine.Name);
                Mine.SpotRegenRate = reader.ReadByte("Mine" + i.ToString(), "SpotRegenRate", Mine.SpotRegenRate);
                Mine.MaxStones = reader.ReadByte("Mine" + i.ToString(), "MaxStones", Mine.MaxStones);
                Mine.HitRate = reader.ReadByte("Mine" + i.ToString(), "HitRate", Mine.HitRate);
                Mine.DropRate = reader.ReadByte("Mine" + i.ToString(), "DropRate", Mine.DropRate);
                Mine.TotalSlots = reader.ReadByte("Mine" + i.ToString(), "TotalSlots", Mine.TotalSlots);
                int j = 0;
                while (reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MinSlot", 255) != 255)
                {
                    Mine.Drops.Add(new MineDrop()
                        {
                            ItemName = reader.ReadString("Mine" + i.ToString(), "D" + j.ToString() + "-ItemName", ""),
                            MinSlot = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MinSlot", 255),
                            MaxSlot = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MaxSlot", 255),
                            MinDura = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MinDura", 255),
                            MaxDura = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MaxDura", 255),
                            BonusChance = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-BonusChance", 255),
                            MaxBonusDura = reader.ReadByte("Mine" + i.ToString(), "D" + j.ToString() + "-MaxBonusDura", 255)
                        });
                    j++;
                }
                MineSetList.Add(Mine);
                i++;
            }

        }
예제 #45
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void LoadMail()
        {
            if (!File.Exists(ConfigPath + @".\MailSystem.ini"))
            {
                SaveMail();
                return;
            }

            InIReader reader = new InIReader(ConfigPath + @".\MailSystem.ini");
            MailAutoSendGold = reader.ReadBoolean("AutoSend", "Gold", MailAutoSendGold);
            MailAutoSendItems = reader.ReadBoolean("AutoSend", "Items", MailAutoSendItems);
            MailFreeWithStamp = reader.ReadBoolean("Rates", "FreeWithStamp", MailFreeWithStamp);
            MailCostPer1KGold = reader.ReadUInt32("Rates", "CostPer1k", MailCostPer1KGold);
            MailItemInsurancePercentage = reader.ReadUInt32("Rates", "InsurancePerItem", MailItemInsurancePercentage);
        }
예제 #46
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        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));
            }



        }
예제 #47
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveMail()
 {
     File.Delete(ConfigPath + @".\MailSystem.ini");
     InIReader reader = new InIReader(ConfigPath + @".\MailSystem.ini");
     reader.Write("AutoSend", "Gold", MailAutoSendGold);
     reader.Write("AutoSend", "Items", MailAutoSendItems);
     reader.Write("Rates", "FreeWithStamp", MailFreeWithStamp);
     reader.Write("Rates", "CostPer1k", MailCostPer1KGold);
     reader.Write("Rates", "InsurancePerItem", MailItemInsurancePercentage);
 }
예제 #48
0
파일: Settings.cs 프로젝트: thedeaths/mir2
		public static void LoadAwakeAttribute()
        {
            if (!File.Exists(ConfigPath + @".\AwakeningSystem.ini"))
            {
                return;
            }

            InIReader reader = new InIReader(ConfigPath + @".\AwakeningSystem.ini");
            Awake.AwakeSuccessRate = reader.ReadByte("Attribute", "SuccessRate", Awake.AwakeSuccessRate);
            Awake.AwakeHitRate = reader.ReadByte("Attribute", "HitRate", Awake.AwakeHitRate);
            Awake.MaxAwakeLevel = reader.ReadInt32("Attribute", "MaxUpgradeLevel", Awake.MaxAwakeLevel);
            Awake.Awake_WeaponRate = reader.ReadByte("IncreaseValue", "WeaponValue", Awake.Awake_WeaponRate);
            Awake.Awake_HelmetRate = reader.ReadByte("IncreaseValue", "HelmetValue", Awake.Awake_HelmetRate);
            Awake.Awake_ArmorRate = reader.ReadByte("IncreaseValue", "ArmorValue", Awake.Awake_ArmorRate);

            for (int i = 0; i < 4; i++)
            {
                Awake.AwakeChanceMax[i] = reader.ReadByte("Value", "ChanceMax_" + ((ItemGrade)(i + 1)).ToString(), Awake.AwakeChanceMax[i]);
            }

            for (int i = 0; i < (int)AwakeType.HPMP; i++)
            {
                List<byte>[] value = new List<byte>[2];

                for (int k = 0; k < 2; k++)
                {
                    value[k] = new List<byte>();
                }

                for (int j = 0; j < 4; j++)
                {
                    byte material1 = 1;
                    material1 = reader.ReadByte("Materials_BaseValue", ((AwakeType)(i + 1)).ToString() + "_" + ((ItemGrade)(j + 1)).ToString() + "_Material1", material1);
                    byte material2 = 1;
                    material2 = reader.ReadByte("Materials_BaseValue", ((AwakeType)(i + 1)).ToString() + "_" + ((ItemGrade)(j + 1)).ToString() + "_Material2", material2);
                    value[0].Add(material1);
                    value[1].Add(material2);
                }

                Awake.AwakeMaterials.Add(value);
            }

            for (int c = 0; c < 4; c++)
            {
                Awake.AwakeMaterialRate[c] = reader.ReadFloat("Materials_IncreaseValue", "Materials_" + ((ItemGrade)(c + 1)).ToString(), Awake.AwakeMaterialRate[c]);
            }

        }
예제 #49
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void LoadRefine()
        {
            if (!File.Exists(ConfigPath + @".\RefineSystem.ini"))
            {
                SaveRefine();
                return;
            }

            InIReader reader = new InIReader(ConfigPath + @".\RefineSystem.ini");
            OnlyRefineWeapon = reader.ReadBoolean("Config", "OnlyRefineWeapon", OnlyRefineWeapon);
            RefineBaseChance = reader.ReadByte("Config", "BaseChance", RefineBaseChance);
            RefineTime = reader.ReadInt32("Config", "Time", RefineTime);
            RefineIncrease = reader.ReadByte("Config", "StatIncrease", RefineIncrease);
            RefineCritChance = reader.ReadByte("Config", "CritChance", RefineCritChance);
            RefineCritIncrease = reader.ReadByte("Config", "CritIncrease", RefineCritIncrease);
            RefineWepStatReduce = reader.ReadByte("Config", "WepStatReducedChance", RefineWepStatReduce);
            RefineItemStatReduce = reader.ReadByte("Config", "ItemStatReducedChance", RefineItemStatReduce);
            RefineCost = reader.ReadInt32("Config", "RefineCost", RefineCost);

            RefineOreName = reader.ReadString("Ore", "OreName", RefineOreName);
        }
예제 #50
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        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);
        }
예제 #51
0
파일: Settings.cs 프로젝트: thedeaths/mir2
        public static void SaveRefine()
        {
            File.Delete(ConfigPath + @".\RefineSystem.ini");
            InIReader reader = new InIReader(ConfigPath + @".\RefineSystem.ini");
            reader.Write("Config", "OnlyRefineWeapon", OnlyRefineWeapon);
            reader.Write("Config", "BaseChance", RefineBaseChance);
            reader.Write("Config", "Time", RefineTime);
            reader.Write("Config", "StatIncrease", RefineIncrease);
            reader.Write("Config", "CritChance", RefineCritChance);
            reader.Write("Config", "CritIncrease", RefineCritIncrease);
            reader.Write("Config", "WepStatReducedChance", RefineWepStatReduce);
            reader.Write("Config", "ItemStatReducedChance", RefineItemStatReduce);
            reader.Write("Config", "RefineCost", RefineCost);

            reader.Write("Ore", "OreName", RefineOreName);

        }
예제 #52
0
 public void Save(InIReader reader, int i)
 {
     reader.Write("Buff-" + i.ToString(), "Id", Id);
     reader.Write("Buff-" + i.ToString(), "Icon", Icon);
     reader.Write("Buff-" + i.ToString(), "Name", name);
     reader.Write("Buff-" + i.ToString(), "LevelReq", LevelRequirement);
     reader.Write("Buff-" + i.ToString(), "PointsReq", PointsRequirement);
     reader.Write("Buff-" + i.ToString(), "TimeLimit", TimeLimit); ;
     reader.Write("Buff-" + i.ToString(), "ActivationCost", ActivationCost); ;
     reader.Write("Buff-" + i.ToString(), "BuffAc", BuffAc); ;
     reader.Write("Buff-" + i.ToString(), "BuffMAC", BuffMac); ;
     reader.Write("Buff-" + i.ToString(), "BuffDc", BuffDc); ;
     reader.Write("Buff-" + i.ToString(), "BuffMc", BuffMc); ;
     reader.Write("Buff-" + i.ToString(), "BuffSc", BuffSc); ;
     reader.Write("Buff-" + i.ToString(), "BuffMaxHp", BuffMaxHp); ;
     reader.Write("Buff-" + i.ToString(), "BuffMaxMp", BuffMaxMp); ;
     reader.Write("Buff-" + i.ToString(), "BuffMineRate", BuffMineRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffGemRate", BuffGemRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffFishRate", BuffFishRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffExpRate", BuffExpRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffCraftRate", BuffCraftRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffSkillRate", BuffSkillRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffHpRegen", BuffHpRegen); ;
     reader.Write("Buff-" + i.ToString(), "BuffMpRegen", BuffMPRegen); ;
     reader.Write("Buff-" + i.ToString(), "BuffAttack", BuffAttack); ;
     reader.Write("Buff-" + i.ToString(), "BuffDropRate", BuffDropRate); ;
     reader.Write("Buff-" + i.ToString(), "BuffGoldRate", BuffGoldRate); ;
 }
예제 #53
0
파일: Settings.cs 프로젝트: thedeaths/mir2
 public static void SaveFishing()
 {
     File.Delete(ConfigPath + @".\FishingSystem.ini");
     InIReader reader = new InIReader(ConfigPath + @".\FishingSystem.ini");
     reader.Write("Rates", "Attempts", FishingAttempts);
     reader.Write("Rates", "SuccessStart", FishingSuccessStart);
     reader.Write("Rates", "SuccessMultiplier", FishingSuccessMultiplier);
     reader.Write("Rates", "Delay", FishingDelay);
     reader.Write("Rates", "MonsterSpawnChance", FishingMobSpawnChance);
     reader.Write("Game", "Monster", FishingMonster);
 }