Пример #1
0
        public static void AddMasterKill(Mobile m, Shrine shrine)
        {
            var list = _List.FirstOrDefault(x => x.Mobile == m);

            if (list != null && list.Shrine != null)
            {
                if (list.Shrine.Any(y => y.Shrine == shrine))
                {
                    _List.FirstOrDefault(x => x.Mobile == m).Shrine.FirstOrDefault(y => y.Shrine == shrine).MasterDeath++;
                }
                else
                {
                    _List.FirstOrDefault(x => x.Mobile == m).Shrine.Add(new ShrineArray {
                        Shrine = shrine, MasterDeath = 1
                    });
                }
            }
            else
            {
                var sa = new List <ShrineArray>
                {
                    new ShrineArray {
                        Shrine = shrine, MasterDeath = 1
                    }
                };

                var ra = new RewardArray(m, sa);

                _List.Add(ra);
            }
        }
Пример #2
0
        public static void FragmentIncrease(Mobile m, Shrine shrine)
        {
            if (m == null)
            {
                return;
            }

            var list = _List.FirstOrDefault(x => x.Mobile == m);

            if (list != null && list.Shrine != null)
            {
                if (list.Shrine.Any(y => y.Shrine == shrine))
                {
                    _List.FirstOrDefault(x => x.Mobile == m).Shrine.FirstOrDefault(y => y.Shrine == shrine).FragmentCount++;
                }
                else
                {
                    _List.FirstOrDefault(x => x.Mobile == m).Shrine.Add(new ShrineArray {
                        Shrine = shrine, FragmentCount = 1
                    });
                }
            }
            else
            {
                var sa = new List <ShrineArray>
                {
                    new ShrineArray {
                        Shrine = shrine, FragmentCount = 1
                    }
                };

                var ra = new RewardArray(m, sa);

                _List.Add(ra);
            }

            TitleCheck(m, shrine);
        }