Пример #1
0
 public EncounterGroup FillGroupInfo(EncounterGroup Group)
 {
     foreach (EncounterGroup grp in _groups)
         if (grp.Name == Group.Name)
             return grp.Clone();
     return null;
 }
Пример #2
0
        private void lstGroups_SelectionChanged(object sender, EventArgs e)
        {
            FOCommon.Worldmap.EncounterGroup.EncounterGroup grp = (FOCommon.Worldmap.EncounterGroup.EncounterGroup)lstGroups.SelectedObject;
            if (grp == null)
            {
                return;
            }

            if (CurrentGroup != null)
            {
                SaveCurrentGroup();
            }

            CurrentGroup = grp;
            RefreshNpcList();
            RefreshPerks();

            numGroupId.Value               = grp.Id;
            numSpacing.Value               = grp.Spacing;
            numRatioMin.Value              = grp.RatioMin;
            numRatioMax.Value              = grp.RatioMax;
            numDistMin.Value               = grp.DistMin;
            numDistMax.Value               = grp.DistMax;
            numFactionId.Value             = grp.FactionId;
            cmbFactionMode.SelectedIndex   = grp.FactionMode;
            cmbGroupPosition.SelectedIndex = grp.Position - 1;
            numQuantityDay.Value           = decimal.Parse(grp.QuantityDay.ToString());
            numQuantityNight.Value         = decimal.Parse(grp.QuantityNight.ToString());
            txtGMName.Text = grp.GMName;
        }
Пример #3
0
        public static List <FOCommon.Worldmap.EncounterGroup.EncounterGroup> LoadNew(List <string> lines)
        {
            List <FOCommon.Worldmap.EncounterGroup.EncounterGroup> Groups = new List <FOCommon.Worldmap.EncounterGroup.EncounterGroup>();

            int            groupId = 0;
            EncounterGroup Group   = null;

            foreach (string line in lines)
            {
                if (line.StartsWith("*")) // Npc data
                {
                    string[] parts = line.Split('|');
                    string[] param = parts[0].Split(',');

                    EncounterNpc NpcObj = new EncounterNpc(Int32.Parse(param[1]), Int32.Parse(param[2]), param[3], Int32.Parse(param[4]), param[5] == "1" ? true : false,
                                                           Int32.Parse(param[6]), Int32.Parse(param[7]), Int32.Parse(param[8]));

                    for (int i = 1; i < parts.Length; i++)
                    {
                        string[] npcData = parts[i].Split(',');
                        if (Int32.Parse(npcData[0]) == (int)GroupFormatData.Item)
                        {
                            EncounterItem item = new EncounterItem(Int32.Parse(npcData[1]), Int32.Parse(npcData[2]), Int32.Parse(npcData[3]), Int32.Parse(npcData[4]));
                            NpcObj.AddItem(item);
                        }
                        else if (Int32.Parse(npcData[0]) == (int)GroupFormatData.Perk)
                        {
                            EncounterPerk perk = new EncounterPerk(npcData[1], Int32.Parse(npcData[2]), Int32.Parse(npcData[3]), Int32.Parse(npcData[4]));
                            NpcObj.Perks.Add(perk);
                        }
                    }
                    Group.Npcs.Add(NpcObj);
                }
                else // Group data
                {
                    if (String.IsNullOrEmpty(line) || line.Length < 5)
                    {
                        continue;
                    }

                    string[] param = line.Split(',');

                    float quantityDay   = (float)double.Parse(param[7], NumberStyles.Any, ci);
                    float quantityNight = (float)double.Parse(param[8], NumberStyles.Any, ci);

                    Group = new FOCommon.Worldmap.EncounterGroup.EncounterGroup(param[0], Int32.Parse(param[1]), Int32.Parse(param[2]),
                                                                                Int32.Parse(param[3]), Int32.Parse(param[4]), Int32.Parse(param[5]), Int32.Parse(param[6]), quantityDay, quantityNight, Int32.Parse(param[9]), Int32.Parse(param[10]));

                    if (Group != null)
                    {
                        Group.Id = groupId++;
                        Groups.Add(Group);
                    }
                }
            }

            return(Groups);
        }
Пример #4
0
        public static List<FOCommon.Worldmap.EncounterGroup.EncounterGroup> LoadNew(List<string> lines)
        {
            List<FOCommon.Worldmap.EncounterGroup.EncounterGroup> Groups = new List<FOCommon.Worldmap.EncounterGroup.EncounterGroup>();

            int groupId = 0;
            EncounterGroup Group = null;
            foreach (string line in lines)
            {

                if (line.StartsWith("*")) // Npc data
                {
                    string[] parts = line.Split('|');
                    string[] param = parts[0].Split(',');

                    EncounterNpc NpcObj = new EncounterNpc(Int32.Parse(param[1]), Int32.Parse(param[2]), param[3], Int32.Parse(param[4]), param[5] == "1" ? true : false,
                        Int32.Parse(param[6]), Int32.Parse(param[7]), Int32.Parse(param[8]));

                    for (int i = 1; i < parts.Length; i++)
                    {
                        string[] npcData = parts[i].Split(',');
                        if (Int32.Parse(npcData[0]) == (int)GroupFormatData.Item)
                        {
                            EncounterItem item = new EncounterItem(Int32.Parse(npcData[1]), Int32.Parse(npcData[2]), Int32.Parse(npcData[3]), Int32.Parse(npcData[4]));
                            NpcObj.AddItem(item);
                        }
                        else if (Int32.Parse(npcData[0]) == (int)GroupFormatData.Perk)
                        {
                            EncounterPerk perk = new EncounterPerk(npcData[1], Int32.Parse(npcData[2]), Int32.Parse(npcData[3]), Int32.Parse(npcData[4]));
                            NpcObj.Perks.Add(perk);
                        }
                    }
                    Group.Npcs.Add(NpcObj);
                }
                else // Group data
                {
                    if (String.IsNullOrEmpty(line) || line.Length < 5)
                        continue;

                    string[] param = line.Split(',');

                    float quantityDay = (float)double.Parse(param[7], NumberStyles.Any, ci);
                    float quantityNight = (float)double.Parse(param[8], NumberStyles.Any, ci);

                    Group = new FOCommon.Worldmap.EncounterGroup.EncounterGroup(param[0], Int32.Parse(param[1]), Int32.Parse(param[2]),
                          Int32.Parse(param[3]), Int32.Parse(param[4]), Int32.Parse(param[5]), Int32.Parse(param[6]), quantityDay, quantityNight, Int32.Parse(param[9]), Int32.Parse(param[10]));

                    if (Group != null)
                    {
                        Group.Id = groupId++;
                        Groups.Add(Group);
                    }
                }
            }

            return Groups;
        }
Пример #5
0
        public bool IsDup(EncounterGroup Group)
        {
            if (ExistingGroups == null)
                return false;

            foreach (EncounterZoneGroup egrp in ExistingGroups)
                if (egrp.Name == Group.Name)
                    return true;
            return false;
        }
Пример #6
0
        private void CalculateGroupZoneStats(FOCommon.Worldmap.EncounterGroup.EncounterGroup Grp)
        {
            ZoneStatistics Zt = new ZoneStatistics(Grp);

            Zt.CalculateZoneStatistics(Zones);
            Grp.ZoneCount = Zt.ZoneCount;
            Grp.ZoneAvg   = Zt.ZoneDiffAvg;
            Grp.ZoneMax   = Zt.ZoneDiffMax;
            Grp.ZoneMed   = Zt.ZoneDiffMed;
            Grp.ZoneMin   = Zt.ZoneDiffMin;
        }
Пример #7
0
        public static List <FOCommon.Worldmap.EncounterGroup.EncounterGroup> LoadOld(List <string> lines)
        {
            List <FOCommon.Worldmap.EncounterGroup.EncounterGroup> Groups = new List <FOCommon.Worldmap.EncounterGroup.EncounterGroup>();
            int groupId = 0;

            foreach (string line in lines)
            {
                string[] partsdel = { "|||" };
                string[] npcsdel  = { "||" };
                string[] parts    = line.Split(partsdel, StringSplitOptions.RemoveEmptyEntries);

                string[] npcs;
                if (parts.Length == 2)
                {
                    npcs = parts[1].Split(npcsdel, StringSplitOptions.RemoveEmptyEntries);
                }
                else
                {
                    npcs = new string[0];
                }

                string[] param = parts[0].Split(',');

                float quantityDay   = (float)double.Parse(param[7], NumberStyles.Any, ci);
                float quantityNight = (float)double.Parse(param[8], NumberStyles.Any, ci);

                FOCommon.Worldmap.EncounterGroup.EncounterGroup Group = new FOCommon.Worldmap.EncounterGroup.EncounterGroup(param[0], Int32.Parse(param[1]), Int32.Parse(param[2]),
                                                                                                                            Int32.Parse(param[3]), Int32.Parse(param[4]), Int32.Parse(param[5]), Int32.Parse(param[6]), quantityDay, quantityNight, Int32.Parse(param[9]), Int32.Parse(param[10]));

                Group.Id = groupId++;

                foreach (string npc in npcs)
                {
                    string[] npcparts  = npc.Split('|');
                    string[] npcparams = npcparts[0].Split(',');

                    // Convert
                    EncounterNpc NpcObj = new EncounterNpc(Int32.Parse(npcparams[0]), Int32.Parse(npcparams[1]), npcparams[2], Int32.Parse(npcparams[3]), npcparams[4] == "1" ? true : false,
                                                           -1, -1, -1);

                    for (int i = 1; i < npcparts.Length; i++)
                    {
                        string[]      itemparam = npcparts[i].Split(',');
                        EncounterItem item      = new EncounterItem(Int32.Parse(itemparam[0]), Int32.Parse(itemparam[1]), Int32.Parse(itemparam[2]), Int32.Parse(itemparam[3]));
                        NpcObj.AddItem(item);
                    }

                    Group.Npcs.Add(NpcObj);
                }
                Groups.Add(Group);
            }
            return(Groups);
        }
Пример #8
0
        private void btnAddGroup_Click(object sender, EventArgs e)
        {
            string input = Microsoft.VisualBasic.Interaction.InputBox("Enter the name of the new group", "Add Group", "GROUP_", -1, -1);

            if (!input.Contains("GROUP"))
            {
                Message.Show("Group name must contain 'GROUP'", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            FOCommon.Worldmap.EncounterGroup.EncounterGroup newGrp = new FOCommon.Worldmap.EncounterGroup.EncounterGroup();
            newGrp.Name = input;
            newGrp.Id   = Groups.Count;
            Groups.Add(newGrp);
            RefreshGroupList();
        }
Пример #9
0
        private void btnAddGroup_Click(object sender, EventArgs e)
        {
            string input = Microsoft.VisualBasic.Interaction.InputBox("Enter the name of the new group", "Add Group", "GROUP_", -1, -1);
            if (!input.Contains("GROUP"))
            {
                Message.Show("Group name must contain 'GROUP'", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            FOCommon.Worldmap.EncounterGroup.EncounterGroup newGrp = new FOCommon.Worldmap.EncounterGroup.EncounterGroup();
            newGrp.Name = input;
            newGrp.Id = Groups.Count;
            Groups.Add(newGrp);
            RefreshGroupList();
        }
Пример #10
0
        private void lstGroups_SelectionChanged(object sender, EventArgs e)
        {
            FOCommon.Worldmap.EncounterGroup.EncounterGroup grp = (FOCommon.Worldmap.EncounterGroup.EncounterGroup)lstGroups.SelectedObject;
            if (grp == null)
                return;

            if (CurrentGroup != null)
                SaveCurrentGroup();

            CurrentGroup = grp;
            RefreshNpcList();
            RefreshPerks();

            numGroupId.Value = grp.Id;
            numSpacing.Value = grp.Spacing;
            numRatioMin.Value = grp.RatioMin;
            numRatioMax.Value = grp.RatioMax;
            numDistMin.Value = grp.DistMin;
            numDistMax.Value = grp.DistMax;
            numFactionId.Value = grp.FactionId;
            cmbFactionMode.SelectedIndex = grp.FactionMode;
            cmbGroupPosition.SelectedIndex = grp.Position - 1;
            numQuantityDay.Value = decimal.Parse(grp.QuantityDay.ToString());
            numQuantityNight.Value = decimal.Parse(grp.QuantityNight.ToString());
            txtGMName.Text = grp.GMName;
        }
Пример #11
0
        public static List<FOCommon.Worldmap.EncounterGroup.EncounterGroup> LoadOld(List<string> lines)
        {
            List<FOCommon.Worldmap.EncounterGroup.EncounterGroup> Groups = new List<FOCommon.Worldmap.EncounterGroup.EncounterGroup>();
            int groupId = 0;

            foreach (string line in lines)
            {
                string[] partsdel = { "|||" };
                string[] npcsdel = { "||" };
                string[] parts = line.Split(partsdel, StringSplitOptions.RemoveEmptyEntries);

                string[] npcs;
                if (parts.Length == 2)
                    npcs = parts[1].Split(npcsdel, StringSplitOptions.RemoveEmptyEntries);
                else
                    npcs = new string[0];

                string[] param = parts[0].Split(',');

                float quantityDay = (float)double.Parse(param[7], NumberStyles.Any, ci);
                float quantityNight = (float)double.Parse(param[8], NumberStyles.Any, ci);

                FOCommon.Worldmap.EncounterGroup.EncounterGroup Group = new FOCommon.Worldmap.EncounterGroup.EncounterGroup(param[0], Int32.Parse(param[1]), Int32.Parse(param[2]),
                      Int32.Parse(param[3]), Int32.Parse(param[4]), Int32.Parse(param[5]), Int32.Parse(param[6]), quantityDay, quantityNight, Int32.Parse(param[9]), Int32.Parse(param[10]));

                Group.Id = groupId++;

                foreach (string npc in npcs)
                {
                    string[] npcparts = npc.Split('|');
                    string[] npcparams = npcparts[0].Split(',');

                    // Convert
                    EncounterNpc NpcObj = new EncounterNpc(Int32.Parse(npcparams[0]), Int32.Parse(npcparams[1]), npcparams[2], Int32.Parse(npcparams[3]),npcparams[4] == "1" ? true : false,
                        -1, -1, -1);

                    for (int i = 1; i < npcparts.Length; i++)
                    {
                        string[] itemparam = npcparts[i].Split(',');
                        EncounterItem item = new EncounterItem(Int32.Parse(itemparam[0]), Int32.Parse(itemparam[1]), Int32.Parse(itemparam[2]), Int32.Parse(itemparam[3]));
                        NpcObj.AddItem(item);
                    }

                    Group.Npcs.Add(NpcObj);
                }
                Groups.Add(Group);
            }
            return Groups;
        }
Пример #12
0
 public EncounterZoneGroup(String name, int quantity, EncounterGroup group)
 {
     Name = name;
     _quantity = quantity;
     _group = group;
 }
Пример #13
0
 private void lstGroups_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     EncounterGroup group = new EncounterGroup();
     group.Name = e.Item.Text;
     group.Quantity = Int32.Parse(e.Item.SubItems[1].Text);
     SelectedGroup = group;
 }