コード例 #1
0
ファイル: GeneralSettings.cs プロジェクト: FreeReign/forkuo
 public GeneralSettings(string shardName = "My Shard", bool autoDetect = true,
     string address = null, int port = 2593, Expansion expansion = Expansion.SA)
 {
     this._ShardName = shardName;
     this._AutoDetect = autoDetect;
     this._Address = address;
     this._Port = port;
     this._Expansion = expansion;
 }
コード例 #2
0
ファイル: Race.cs プロジェクト: m309/ForkUO
        protected Race(int raceID, int raceIndex, string name, string pluralName, int maleBody, int femaleBody, int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion)
        {
            this.m_RaceID = raceID;
            this.m_RaceIndex = raceIndex;

            this.m_Name = name;

            this.m_MaleBody = maleBody;
            this.m_FemaleBody = femaleBody;
            this.m_MaleGhostBody = maleGhostBody;
            this.m_FemaleGhostBody = femaleGhostBody;

            this.m_RequiredExpansion = requiredExpansion;
            this.m_PluralName = pluralName;
        }
コード例 #3
0
        public Race( int raceID, int raceIndex, string name, string pluralName, int maleBody, int femaleBody, int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion )
        {
            m_RaceID = raceID;
            m_RaceIndex = raceIndex;

            m_Name = name;

            m_MaleBody = maleBody;
            m_FemaleBody = femaleBody;
            m_MaleGhostBody = maleGhostBody;
            m_FemaleGhostBody = femaleGhostBody;

            m_RequiredExpansion = requiredExpansion;
            m_PluralName = pluralName;
        }
コード例 #4
0
ファイル: Race.cs プロジェクト: Telm/RunUO_EME
        protected Race( int raceID, int raceIndex, string name, string pluralName,string shortName, string unknownName, int maleBody, int femaleBody, int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion, LanguageKnowledge basicKnowledge )
        {
            m_RaceID = raceID;
            m_RaceIndex = raceIndex;

            m_Name = name;
            m_ShortName = shortName;
            m_UnknownName = unknownName;

            m_MaleBody = maleBody;
            m_FemaleBody = femaleBody;
            m_MaleGhostBody = maleGhostBody;
            m_FemaleGhostBody = femaleGhostBody;

            m_RequiredExpansion = requiredExpansion;
            m_PluralName = pluralName;
            m_BasicRaceLanguagesKnowledge = basicKnowledge;
        }
コード例 #5
0
ファイル: Race.cs プロジェクト: silky/ModernUO
        protected Race(
            int raceID, int raceIndex, string name, string pluralName, int maleBody, int femaleBody,
            int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion
            )
        {
            RaceID    = raceID;
            RaceIndex = raceIndex;

            Name = name;

            MaleBody        = maleBody;
            FemaleBody      = femaleBody;
            MaleGhostBody   = maleGhostBody;
            FemaleGhostBody = femaleGhostBody;

            RequiredExpansion = requiredExpansion;
            PluralName        = pluralName;
        }
コード例 #6
0
        public static FeatureFlags GetFeatures(Expansion ex)
        {
            var info = GetInfo(ex);

            if (info != null)
            {
                return(info.SupportedFeatures);
            }

            switch (ex)
            {
            case Expansion.None:
                return(FeatureFlags.ExpansionNone);

            case Expansion.T2A:
                return(FeatureFlags.ExpansionT2A);

            case Expansion.UOR:
                return(FeatureFlags.ExpansionUOR);

            case Expansion.UOTD:
                return(FeatureFlags.ExpansionUOTD);

            case Expansion.LBR:
                return(FeatureFlags.ExpansionLBR);

            case Expansion.AOS:
                return(FeatureFlags.ExpansionAOS);

            case Expansion.SE:
                return(FeatureFlags.ExpansionSE);

            case Expansion.ML:
                return(FeatureFlags.ExpansionML);

            case Expansion.SA:
                return(FeatureFlags.ExpansionSA);

            case Expansion.HS:
                return(FeatureFlags.ExpansionHS);
            }

            return(FeatureFlags.ExpansionNone);
        }
コード例 #7
0
ファイル: GeneralSettings.cs プロジェクト: jasegiffin/JustUO
		public GeneralSettings(
			string shardName = "My Shard",
			bool autoDetect = true,
			string address = null,
			int port = 2593,
			Expansion expansion = Expansion.SA,
			AccessLevel maxPlayerLevel = AccessLevel.VIP,
			AccessLevel lowestStaffLevel = AccessLevel.Counselor,
			AccessLevel lowestOwnerLevel = AccessLevel.CoOwner)
		{
			ShardName = shardName;
			AutoDetect = autoDetect;
			Address = address;
			Port = port;
			Expansion = expansion;
			MaxPlayerLevel = maxPlayerLevel;
			LowestStaffLevel = lowestStaffLevel;
			LowestOwnerLevel = lowestOwnerLevel;
		}
コード例 #8
0
ファイル: ExpansionInfo.cs プロジェクト: Ziden/ServUO
        public static FeatureFlags GetFeatures(Expansion ex)
        {
            var info = GetInfo(ex);

            if (info != null)
            {
                return(info.SupportedFeatures);
            }

            return(FeatureFlags.ExpansionEJ);

            /*
             * switch (ex)
             *          {
             *                  case Expansion.None:
             *                          return FeatureFlags.ExpansionNone;
             *                  case Expansion.T2A:
             *                          return FeatureFlags.ExpansionT2A;
             *                  case Expansion.UOR:
             *                          return FeatureFlags.ExpansionUOR;
             *                  case Expansion.UOTD:
             *                          return FeatureFlags.ExpansionUOTD;
             *                  case Expansion.LBR:
             *                          return FeatureFlags.ExpansionLBR;
             *                  case Expansion.AOS:
             *                          return FeatureFlags.ExpansionAOS;
             *                  case Expansion.SE:
             *                          return FeatureFlags.ExpansionSE;
             *                  case Expansion.ML:
             *                          return FeatureFlags.ExpansionML;
             *                  case Expansion.SA:
             *                          return FeatureFlags.ExpansionSA;
             *                  case Expansion.HS:
             *                          return FeatureFlags.ExpansionHS;
             *                  case Expansion.TOL:
             *                          return FeatureFlags.ExpansionTOL;
             *                  case Expansion.EJ:
             *                          return FeatureFlags.ExpansionEJ;
             *          }
             *
             *          return FeatureFlags.ExpansionNone;
             */
        }
コード例 #9
0
        private static void LoadRegions(XmlElement xml, Map map, Region parent)
        {
            foreach (XmlElement xmlReg in xml.SelectNodes("region"))
            {
                Expansion expansion = Expansion.None;

                if (ReadEnum(xmlReg, "expansion", ref expansion, false) && expansion > Core.Expansion)
                {
                    continue;
                }

                Type type = DefaultRegionType;

                ReadType(xmlReg, "type", ref type, false);

                if (!typeof(Region).IsAssignableFrom(type))
                {
                    Utility.PushColor(ConsoleColor.Red);
                    Console.WriteLine("Invalid region type '{0}' in regions.xml", type.FullName);
                    Utility.PopColor();
                    continue;
                }

                Region region = null;
                try
                {
                    region = (Region)Activator.CreateInstance(type, new object[] { xmlReg, map, parent });
                }
                catch (Exception ex)
                {
                    Utility.PushColor(ConsoleColor.Red);
                    Console.WriteLine("Error during the creation of region type '{0}': {1}", type.FullName, ex);
                    Utility.PopColor();
                    continue;
                }

                region.Register();

                LoadRegions(xmlReg, map, region);
            }
        }
コード例 #10
0
		public static FeatureFlags GetFeatures(Expansion ex)
		{
			var info = GetInfo(ex);

			if (info != null)
			{
				return info.SupportedFeatures;
			}

			switch (ex)
			{
				case Expansion.None:
					return FeatureFlags.ExpansionNone;
				case Expansion.T2A:
					return FeatureFlags.ExpansionT2A;
				case Expansion.UOR:
					return FeatureFlags.ExpansionUOR;
				case Expansion.UOTD:
					return FeatureFlags.ExpansionUOTD;
				case Expansion.LBR:
					return FeatureFlags.ExpansionLBR;
				case Expansion.AOS:
					return FeatureFlags.ExpansionAOS;
				case Expansion.SE:
					return FeatureFlags.ExpansionSE;
				case Expansion.ML:
					return FeatureFlags.ExpansionML;
				case Expansion.SA:
					return FeatureFlags.ExpansionSA;
				case Expansion.HS:
					return FeatureFlags.ExpansionHS;
				case Expansion.TOL:
					return FeatureFlags.ExpansionTOL;
				case Expansion.EJ:
					return FeatureFlags.ExpansionEJ;
			}

			return FeatureFlags.ExpansionNone;
		}
コード例 #11
0
ファイル: NetState.cs プロジェクト: PepeBiondi/runsa
		public bool SupportsExpansion( Expansion ex, bool checkCoreExpansion ) {
            return true;
		}
コード例 #12
0
        public Region(XmlElement xml, Map map, Region parent)
        {
            m_Map     = map;
            m_Parent  = parent;
            m_Dynamic = false;

            if (m_Parent == null)
            {
                m_ChildLevel = 0;
                m_Priority   = DefaultPriority;
            }
            else
            {
                m_ChildLevel = m_Parent.ChildLevel + 1;
                m_Priority   = m_Parent.Priority;
            }

            ReadString(xml, "name", ref m_Name, false);

            if (parent == null)
            {
                ReadInt32(xml, "priority", ref m_Priority, false);
            }

            int minZ = MinZ;
            int maxZ = MaxZ;

            XmlElement zrange = xml["zrange"];

            ReadInt32(zrange, "min", ref minZ, false);
            ReadInt32(zrange, "max", ref maxZ, false);

            List <Rectangle3D> area = new List <Rectangle3D>();

            foreach (XmlElement xmlRect in xml.SelectNodes("rect"))
            {
                Expansion expansion = Expansion.None;

                if (ReadEnum(xmlRect, "expansion", ref expansion, false) && expansion > Core.Expansion)
                {
                    continue;
                }

                Rectangle3D rect = new Rectangle3D();
                if (ReadRectangle3D(xmlRect, minZ, maxZ, ref rect))
                {
                    area.Add(rect);
                }
            }

            m_Area = area.ToArray();

            if (m_Area.Length == 0)
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("Empty area for region '{0}'", this);
                Utility.PopColor();
            }

            if (!ReadPoint3D(xml["go"], map, ref m_GoLocation, false) && m_Area.Length > 0)
            {
                Point3D start = m_Area[0].Start;
                Point3D end   = m_Area[0].End;

                int x = start.X + (end.X - start.X) / 2;
                int y = start.Y + (end.Y - start.Y) / 2;

                m_GoLocation = new Point3D(x, y, m_Map.GetAverageZ(x, y));
            }

            MusicName music = DefaultMusic;

            ReadEnum(xml["music"], "name", ref music, false);

            Music = music;
        }
コード例 #13
0
ファイル: SkillExt.cs プロジェクト: AllanNisbet/runuo
        public static IEnumerable <SkillName> OfExpansion(this IEnumerable <SkillName> skills, Expansion ex)
        {
            foreach (var sk in skills)
            {
                switch (sk)
                {
                case SkillName.Chivalry:
                case SkillName.Focus:
                case SkillName.Necromancy:
                case SkillName.SpiritSpeak:
                {
                    if (ex >= Expansion.AOS)
                    {
                        yield return(sk);
                    }
                }
                break;

                case SkillName.Bushido:
                case SkillName.Ninjitsu:
                {
                    if (ex >= Expansion.SE)
                    {
                        yield return(sk);
                    }
                }
                break;

                case SkillName.Spellweaving:
                {
                    if (ex >= Expansion.ML)
                    {
                        yield return(sk);
                    }
                }
                break;

                case SkillName.Imbuing:
                case SkillName.Throwing:
                case SkillName.Mysticism:
                {
                    if (ex >= Expansion.SA)
                    {
                        yield return(sk);
                    }
                }
                break;

                default:
                    yield return(sk);

                    break;
                }
            }
        }
コード例 #14
0
ファイル: SkillExt.cs プロジェクト: AllanNisbet/runuo
 public static IEnumerable <Skill> OfExpansion(this Skills skills, Expansion ex)
 {
     return(OfExpansion(skills.Select(sk => sk.SkillName), ex).Select(sk => skills[sk]));
 }
コード例 #15
0
ファイル: ExpansionInfo.cs プロジェクト: bstahly/runuo
        public static FeatureFlags GetFeatures(Expansion ex)
        {
            var info = GetInfo(ex);

            if (info != null)
            {
                return info.SupportedFeatures;
            }

            switch (ex)
            {
                case Expansion.None:
                    return FeatureFlags.ExpansionNone;
                case Expansion.T2A:
                    return FeatureFlags.ExpansionT2A;
                case Expansion.UOR:
                    return FeatureFlags.ExpansionUOR;
                case Expansion.UOTD:
                    return FeatureFlags.ExpansionUOTD;
                case Expansion.LBR:
                    return FeatureFlags.ExpansionLBR;
                case Expansion.AOS:
                    return FeatureFlags.ExpansionAOS;
                case Expansion.SE:
                    return FeatureFlags.ExpansionSE;
                case Expansion.ML:
                    return FeatureFlags.ExpansionML;
                case Expansion.SA:
                    return FeatureFlags.ExpansionSA;
                case Expansion.HS:
                    return FeatureFlags.ExpansionHS;
                case Expansion.TOL:
                    return FeatureFlags.ExpansionTOL;
            }

            return FeatureFlags.ExpansionNone;
        }
コード例 #16
0
ファイル: CraftItem.cs プロジェクト: Leodinas/uolite
		private object RequiredExpansionMessage( Expansion expansion )	//Eventually convert to TextDefinition, but that requires that we convert all the gumps to ues it too.  Not that it wouldn't be a bad idea.
		{
			switch( expansion )
			{
				case Expansion.SE:
					return 1063307; // The "Samurai Empire" expansion is required to attempt this item.
				case Expansion.ML:
					return 1072650; // The "Mondain's Legacy" expansion is required to attempt this item.
				default:
					return String.Format( "The \"{0}\" expansion is required to attempt this item.", ExpansionInfo.GetInfo( expansion ).Name );
			}
		}
コード例 #17
0
ファイル: NetState.cs プロジェクト: notsentient/RunZHA
 public bool SupportsExpansion( Expansion ex )
 {
     return SupportsExpansion( ex, true );
 }
コード例 #18
0
ファイル: GeneralSettings.cs プロジェクト: FreeReign/forkuo
        protected override sealed void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        this._ShardName = reader.ReadString();
                        this._AutoDetect = reader.ReadBool();
                        this._Address = reader.ReadString();
                        this._Port = reader.ReadInt();
                        this._Expansion = (Expansion)reader.ReadByte();
                        break;
                    }
            }
        }
コード例 #19
0
ファイル: NetState.cs プロジェクト: PepeBiondi/runsa
		public bool SupportsExpansion( Expansion ex ) {
            return true;
		}
コード例 #20
0
ファイル: NetState.cs プロジェクト: notsentient/RunZHA
 public bool SupportsExpansion( Expansion ex, bool checkCoreExpansion )
 {
     return SupportsExpansion( ExpansionInfo.GetInfo( ex ), checkCoreExpansion );
 }
コード例 #21
0
 public static ExpansionInfo GetInfo(Expansion ex)
 {
     return(GetInfo((int)ex));
 }
コード例 #22
0
        protected Race(int raceID, int raceIndex, string name, string pluralName, int maleBody, int femaleBody, int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion)
        {
            m_RaceID    = raceID;
            m_RaceIndex = raceIndex;

            m_Name = name;

            m_MaleBody        = maleBody;
            m_FemaleBody      = femaleBody;
            m_MaleGhostBody   = maleGhostBody;
            m_FemaleGhostBody = femaleGhostBody;

            m_RequiredExpansion = requiredExpansion;
            m_PluralName        = pluralName;
        }
コード例 #23
0
ファイル: LootPack.cs プロジェクト: greeduomacro/UO-Forever
		public Item Construct(bool inTokuno, bool isMondain, Expansion e)
		{
			try
			{
				Item item;

				if (m_Type == typeof(BaseRanged))
				{
					item = Loot.RandomRangedWeapon();
				}
				else if (m_Type == typeof(BaseWeapon))
				{
					item = Loot.RandomWeapon();
				}
				else if (m_Type == typeof(BaseArmor))
				{
					item = Loot.RandomArmorOrHat();
				}
				else if (m_Type == typeof(BaseShield))
				{
					item = Loot.RandomShield();
				}
				else if (m_Type == typeof(BaseJewel))
				{
					item = e >= Expansion.AOS ? Loot.RandomJewelry() : Loot.RandomArmorOrShieldOrWeapon();
				}
				else if (m_Type == typeof(BaseInstrument))
				{
					item = Loot.RandomInstrument(e >= Expansion.SE);
				}
				else if (m_Type == typeof(BaseWand))
				{
					item = Loot.RandomWand();
				}
				else if (m_Type == typeof(Amber)) // gem
				{
					item = Loot.RandomGem();
				}
				else if (m_Type == typeof(ClumsyScroll)) // low scroll
				{
					item = RandomScroll(0, 1, 3);
				}
				else if (m_Type == typeof(ArchCureScroll)) // med scroll
				{
					item = RandomScroll(1, 4, 7);
				}
				else if (m_Type == typeof(SummonAirElementalScroll)) // high scroll
				{
					item = RandomScroll(2, 8, 8);
				}
				else if (m_Type == typeof(Ribs)) //meats
				{
					item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Meat));
				}
				else if (m_Type == typeof(Apple)) //fruits/vegies
				{
					item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.FruitsAndVeggies));
				}
				else if (m_Type == typeof(SheafOfHay)) //Hay
				{
					item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.GrainsAndHay));
				}
				else if (m_Type == typeof(RawFishSteak)) //Fish
				{
					item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Fish));
				}
				else if (m_Type == typeof(Eggs)) //Eggs
				{
					item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Eggs));
				}
				else if (m_Type == typeof(Food)) //Food items
				{
					item = Loot.RandomFood();
				}
				else if (m_Type == typeof(Candle)) //Provisions
				{
					item = Loot.RandomProvision();
				}
				else
				{
					item = m_Type.CreateInstance<Item>();
				}

				return item;
			}
			catch
			{ }

			return null;
		}
コード例 #24
0
ファイル: LootPack.cs プロジェクト: zerodowned/UO-Forever
        public Item Construct(bool inTokuno, bool isMondain, Expansion e)
        {
            try
            {
                Item item;

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon();
                }
                else if (m_Type == typeof(BaseWeapon))
                {
                    item = Loot.RandomWeapon();
                }
                else if (m_Type == typeof(BaseArmor))
                {
                    item = Loot.RandomArmorOrHat();
                }
                else if (m_Type == typeof(BaseShield))
                {
                    item = Loot.RandomShield();
                }
                else if (m_Type == typeof(BaseJewel))
                {
                    item = e >= Expansion.AOS ? Loot.RandomJewelry() : Loot.RandomArmorOrShieldOrWeapon();
                }
                else if (m_Type == typeof(BaseInstrument))
                {
                    item = Loot.RandomInstrument(e >= Expansion.SE);
                }
                else if (m_Type == typeof(BaseWand))
                {
                    item = Loot.RandomWand();
                }
                else if (m_Type == typeof(Amber))                 // gem
                {
                    item = Loot.RandomGem();
                }
                else if (m_Type == typeof(ClumsyScroll))                 // low scroll
                {
                    item = RandomScroll(0, 1, 3);
                }
                else if (m_Type == typeof(ArchCureScroll))                 // med scroll
                {
                    item = RandomScroll(1, 4, 7);
                }
                else if (m_Type == typeof(SummonAirElementalScroll))                 // high scroll
                {
                    item = RandomScroll(2, 8, 8);
                }
                else if (m_Type == typeof(Ribs))                 //meats
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Meat));
                }
                else if (m_Type == typeof(Apple))                 //fruits/vegies
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.FruitsAndVeggies));
                }
                else if (m_Type == typeof(SheafOfHay))                 //Hay
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.GrainsAndHay));
                }
                else if (m_Type == typeof(RawFishSteak))                 //Fish
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Fish));
                }
                else if (m_Type == typeof(Eggs))                 //Eggs
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Eggs));
                }
                else if (m_Type == typeof(Food))                 //Food items
                {
                    item = Loot.RandomFood();
                }
                else if (m_Type == typeof(Candle))                 //Provisions
                {
                    item = Loot.RandomProvision();
                }
                else
                {
                    item = m_Type.CreateInstance <Item>();
                }

                return(item);
            }
            catch
            { }

            return(null);
        }
コード例 #25
0
ファイル: CraftItem.cs プロジェクト: justdanofficial/khaeros
 //Eventually convert to TextDefinition, but that requires that we convert all the gumps to ues it too.  Not that it wouldn't be a bad idea.
 private object RequiredExpansionMessage( Expansion expansion )
 {
     switch( expansion )
     {
         case Expansion.SE:
             return 1063307; // The "Samurai Empire" expansion is required to attempt this item.
         case Expansion.ML:
             return 1072650; // The "Mondain's Legacy" expansion is required to attempt this item.
         default:
             return String.Format( "The \"{0}\" expansion is required to attempt this item.", ExpansionInfo.GetInfo( expansion ).Name );
     }
 }
コード例 #26
0
ファイル: ExpansionInfo.cs プロジェクト: PepeBiondi/runsa
		public static ExpansionInfo GetInfo( Expansion ex )
		{
			return GetInfo( (int)ex );
		}
コード例 #27
0
ファイル: Loot.cs プロジェクト: greeduomacro/UO-Forever
		public static Item RandomPossibleReagent(Expansion e)
		{
			if (e >= Expansion.AOS)
			{
				return Construct(RegTypes, NecroRegTypes);
			}

			return Construct(RegTypes);
		}