示例#1
0
        public static bool IsFriendly(Mobile source, Mobile target)
        {
            ArenaRegion sourceRegion = Region.Find(source.Location, source.Map) as ArenaRegion;
            ArenaRegion targetRegion = Region.Find(target.Location, target.Map) as ArenaRegion;

            if (sourceRegion != null && sourceRegion.Arena.CurrentDuel != null && sourceRegion == targetRegion)
            {
                return(sourceRegion.Arena.CurrentDuel.IsFriendly(source, target));
            }

            return(false);
        }
示例#2
0
        public void ConfigureArena()
        {
            if (Manager == null)
            {
                Manager = new ArenaManager(this);
                Manager.MoveToWorld(Definition.ManagerLocation, Definition.Map);
            }

            if (Stone == null)
            {
                Stone = new ArenaStone(this);
                Stone.MoveToWorld(Definition.StoneLocation, Definition.Map);
            }

            if (Banner1 == null)
            {
                Banner1 = new ArenaExitBanner(Definition.BannerID1, this);
                Banner1.MoveToWorld(Definition.BannerLocation1, Definition.Map);
            }

            if (Banner2 == null)
            {
                Banner2 = new ArenaExitBanner(Definition.BannerID2, this);
                Banner2.MoveToWorld(Definition.BannerLocation2, Definition.Map);
            }

            if (Region == null)
            {
                Region = new ArenaRegion(this);
                Region.Register();
            }

            if (GuardRegion == null)
            {
                GuardRegion = new GuardedArenaRegion(string.Format("{0}_Guarded", Definition.Name), Definition.Map, Definition.GuardBounds);
                GuardRegion.Register();
            }
        }