Exemplo n.º 1
0
        private void Reset()
        {
            if (BattleRegion == null)
            {
                return;
            }

            IEnumerable <BaseCreature> list = BattleRegion.GetEnumeratedMobiles().OfType <BaseCreature>();

            foreach (BaseCreature bc in list.Where(b => b.Alive && !b.Controlled && !b.Summoned && b.GetMaster() == null))
            {
                bc.Kill();
            }

            foreach (KeyValuePair <int, List <BaseCreature> > kvp in MyrmidexTeam)
            {
                ColUtility.Free(kvp.Value);
            }

            foreach (KeyValuePair <int, List <BaseCreature> > kvp in TribeTeam)
            {
                ColUtility.Free(kvp.Value);
            }

            MyrmidexTeam.Clear();
            TribeTeam.Clear();
        }
Exemplo n.º 2
0
 public void RegionMessage(int message)
 {
     foreach (PlayerMobile pm in BattleRegion.GetEnumeratedMobiles().OfType <PlayerMobile>())
     {
         pm.SendLocalizedMessage(message);
     }
 }
Exemplo n.º 3
0
        public bool HasPlayers(bool ignorestaff = true)
        {
            if (BattleRegion == null)
            {
                return(false);
            }

            return(BattleRegion.GetEnumeratedMobiles().Where(m => m is PlayerMobile && (!ignorestaff || m.AccessLevel == AccessLevel.Player)).Count() > 0);
        }
Exemplo n.º 4
0
        public IEnumerable <PlayerMobile> GetPlayers(Allegiance allegiance)
        {
            if (BattleRegion == null)
            {
                return(null);
            }

            return(BattleRegion.GetEnumeratedMobiles().OfType <PlayerMobile>().Where(p => MyrmidexInvasionSystem.IsAlliedWith(p, allegiance)));
        }
Exemplo n.º 5
0
        private void AssignFlags()
        {
            if (BattleRegion != null)
            {
                BattleFlag flag = BattleRegion.GetEnumeratedItems().OfType <BattleFlag>().FirstOrDefault(i => i != null && i.ItemID == 17099);
                if (flag != null)
                {
                    TribalFlag         = flag;
                    flag.BattleSpawner = this;
                }

                flag = BattleRegion.GetEnumeratedItems().OfType <BattleFlag>().FirstOrDefault(i => i != null && i.ItemID == 1068);
                if (flag != null)
                {
                    MyrmidexFlag       = flag;
                    flag.BattleSpawner = this;
                }
            }
        }
Exemplo n.º 6
0
        private void FixFlags()
        {
            if (BattleRegion != null)
            {
                foreach (Item item in BattleRegion.GetEnumeratedItems())
                {
                    if (item is Static && (item.ItemID == 9))
                    {
                        item.Delete();
                    }
                    else if (item is BattleFlag)
                    {
                        item.Delete();
                    }
                }
            }

            Item st = new Static(0xA1F);

            st.MoveToWorld(new Point3D(913, 1871, 0), Map.TerMur);

            st = new Static(0xA1F);
            st.MoveToWorld(new Point3D(914, 1871, 0), Map.TerMur);

            BattleFlag bflag = new BattleFlag(0x42CB, 0);

            bflag.MoveToWorld(new Point3D(914, 1872, 5), Map.TerMur);

            st = new Static(0xA1F);
            st.MoveToWorld(new Point3D(913, 1792, 0), Map.TerMur);

            bflag = new BattleFlag(0x42C, 2520);
            bflag.MoveToWorld(new Point3D(914, 1793, 6), Map.TerMur);

            st = new Static(0x42D);
            st.MoveToWorld(new Point3D(913, 1793, 6), Map.TerMur);
            //bflag = new BattleFlag(0x42D, 2520);
            //bflag.MoveToWorld(new Point3D(913, 1793, 6), Map.TerMur);
        }
Exemplo n.º 7
0
 public void RegionMessage(int message)
 {
     ColUtility.ForEach(BattleRegion.GetEnumeratedMobiles().OfType <PlayerMobile>(), pm => pm.SendLocalizedMessage(message));
 }
Exemplo n.º 8
0
 public bool HasPlayers(bool ignorestaff = true)
 {
     return(BattleRegion.GetEnumeratedMobiles().OfType <PlayerMobile>().Where(m => !ignorestaff || m.AccessLevel == AccessLevel.Player).Count() > 0);
 }