Esempio n. 1
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            using (var eopl = new ExtendedOPL(list))
            {
                if (!Trading)
                {
                    eopl.Add("Not Trading".WrapUOHtmlColor(Color.OrangeRed));
                    return;
                }

                if (!ShowCashName)
                {
                    return;
                }

                var name = CashName.GetString();

                if (!String.IsNullOrWhiteSpace(name))
                {
                    eopl.Add("Trades For {0}".WrapUOHtmlColor(Color.SkyBlue), name);
                }

                var races = RequiredRaces;

                if (races != null && races.Length > 0)
                {
                    foreach (var r in races)
                    {
                        eopl.Add("Trades With {0}".WrapUOHtmlColor(Color.LawnGreen), r.PluralName);
                    }
                }
            }
        }
Esempio n. 2
0
        private static void OnItemOPLRequest(Item item, Mobile viewer, ExtendedOPL list)
        {
            if (item == null || list == null)
            {
                return;
            }

            if (viewer == null && item.Parent is Mobile)
            {
                viewer = (Mobile)item.Parent;
            }

            if (viewer == null)
            {
                return;
            }

            var throwable = item as IBaseThrowable;

            if (throwable == null)
            {
                return;
            }

            GetProperties(throwable, viewer, list);
        }
Esempio n. 3
0
		private static void OnItemOPLRequest(Item item, Mobile viewer, ExtendedOPL list)
		{
			if (item == null || list == null)
			{
				return;
			}

			if (viewer == null && item.Parent is Mobile)
			{
				viewer = (Mobile)item.Parent;
			}

			if (viewer == null)
			{
				return;
			}

			var throwable = item as IBaseThrowable;

			if (throwable == null)
			{
				return;
			}

			GetProperties(throwable, viewer, list);
		}
Esempio n. 4
0
		public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
		{
			if (throwable == null || list == null)
			{
				return;
			}

			var lines = new List<string>();

			if (throwable.Consumable)
			{
				lines.Add("Consumable");
			}

			if (throwable.ClearHands)
			{
				lines.Add("Clears Hands");
			}

			if (!throwable.AllowCombat)
			{
				lines.Add("Non-Combat");
			}

			if (lines.Count > 0)
			{
				list.Add(String.Join(", ", lines).WrapUOHtmlColor(Color.Orange));
				lines.Clear();
			}

			if (throwable.RequiredSkillValue > 0)
			{
				list.Add("Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue);
			}

			DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
			TimeSpan diff = TimeSpan.Zero;

			if (readyWhen > now)
			{
				diff = readyWhen - now;
			}

			if (diff > TimeSpan.Zero)
			{
				list.Add("Use: {0:D2}:{1:D2}:{2:D2}".WrapUOHtmlColor(Color.LimeGreen), diff.Hours, diff.Minutes, diff.Seconds);
			}
			else if (!String.IsNullOrWhiteSpace(throwable.Usage))
			{
				list.Add("Use: {0}".WrapUOHtmlColor(Color.Cyan), throwable.Usage);
			}

			if (!String.IsNullOrWhiteSpace(throwable.Token))
			{
				list.Add("\"{0}\"".WrapUOHtmlColor(Color.Gold), throwable.Token);
			}
		}
Esempio n. 5
0
        public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
        {
            if (throwable == null || list == null)
            {
                return;
            }

            var lines = new List <string>();

            if (throwable.Consumable)
            {
                lines.Add("Consumable");
            }

            if (throwable.ClearHands)
            {
                lines.Add("Clears Hands");
            }

            if (!throwable.AllowCombat)
            {
                lines.Add("Non-Combat");
            }

            if (lines.Count > 0)
            {
                list.Add(String.Join(", ", lines).WrapUOHtmlColor(Color.Orange));
                lines.Clear();
            }

            if (throwable.RequiredSkillValue > 0)
            {
                list.Add("Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue);
            }

            DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
            var      diff = TimeSpan.Zero;

            if (readyWhen > now)
            {
                diff = readyWhen - now;
            }

            if (diff > TimeSpan.Zero)
            {
                list.Add("Use: {0:D2}:{1:D2}:{2:D2}".WrapUOHtmlColor(Color.LimeGreen), diff.Hours, diff.Minutes, diff.Seconds);
            }
            else if (!String.IsNullOrWhiteSpace(throwable.Usage))
            {
                list.Add("Use: {0}".WrapUOHtmlColor(Color.Cyan), throwable.Usage);
            }

            if (!String.IsNullOrWhiteSpace(throwable.Token))
            {
                list.Add("\"{0}\"".WrapUOHtmlColor(Color.Gold), throwable.Token);
            }
        }
Esempio n. 6
0
        public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
        {
            Item item;

            list.Add(
                equipped && IsEquipped(viewer, out item)
                                        ? item.ResolveName(viewer).ToUpperWords().WrapUOHtmlColor(EquipmentSets.CMOptions.PartNameColorRaw)
                                        : Name.ToUpperWords().WrapUOHtmlColor(EquipmentSets.CMOptions.InactiveColorRaw));
        }
Esempio n. 7
0
        public static void AddTrashProperties(Mobile m, Mobile viewer, ExtendedOPL list)
        {
            if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || m == null || m.Deleted || viewer == null ||
                viewer.Deleted || list == null || !(m is ITrashTokenProperties) || !(viewer is PlayerMobile))
            {
                return;
            }

            InternalAddTrashProperties(viewer, list);
        }
Esempio n. 8
0
		private static void GetProperties(Item item, Mobile viewer, ExtendedOPL list)
		{
			if (!CMOptions.ModuleEnabled || item == null || item.Deleted || !item.Layer.IsEquip() || list == null ||
				World.Loading)
			{
				return;
			}

			if (viewer == null && item.Parent is Mobile)
			{
				viewer = (Mobile)item.Parent;
			}

			if (viewer == null || !viewer.Player)
			{
				return;
			}

			var itemType = item.GetType();
			var equipped = item.IsEquipped();

			var parent = item.Parent as Mobile;

			var npc = parent != null && ((parent is BaseCreature || !parent.Player) && !parent.IsControlled<PlayerMobile>());

			foreach (var set in
				FindSetsFor(itemType)
					.Where(s => s.Display && !s.Parts.Any(p => p.Valid && p.Display && p.IsTypeOf(itemType) && !p.DisplaySet)))
			{
				set.GetProperties(viewer, list, equipped);

				if (npc)
				{
					continue;
				}

				if (set.DisplayParts)
				{
					foreach (var part in set.Parts.Where(p => p.Valid && p.Display))
					{
						part.GetProperties(viewer, list, equipped);
					}
				}

				if (!set.DisplayMods)
				{
					continue;
				}

				foreach (var mod in set.Mods.Where(mod => mod.Valid && mod.Display))
				{
					mod.GetProperties(viewer, list, equipped);
				}
			}
		}
Esempio n. 9
0
        private static void GetProperties(Item item, Mobile viewer, ExtendedOPL list)
        {
            if (!CMOptions.ModuleEnabled || item == null || item.Deleted || !item.Layer.IsEquip() || list == null ||
                World.Loading)
            {
                return;
            }

            if (viewer == null && item.Parent is Mobile)
            {
                viewer = (Mobile)item.Parent;
            }

            if (viewer == null || !viewer.Player)
            {
                return;
            }

            var itemType = item.GetType();
            var equipped = item.IsEquipped();

            var parent = item.Parent as Mobile;

            var npc = parent != null && ((parent is BaseCreature || !parent.Player) && !parent.IsControlled <PlayerMobile>());

            foreach (var set in
                     FindSetsFor(itemType)
                     .Where(s => s.Display && !s.Parts.Any(p => p.Display && p.IsTypeOf(itemType) && !p.DisplaySet)))
            {
                set.GetProperties(viewer, list, equipped);

                if (npc)
                {
                    continue;
                }

                if (set.DisplayParts)
                {
                    foreach (var part in set.Parts.Where(p => p.Display))
                    {
                        part.GetProperties(viewer, list, equipped);
                    }
                }

                if (!set.DisplayMods)
                {
                    continue;
                }

                foreach (var mod in set.Mods.Where(mod => mod.Display))
                {
                    mod.GetProperties(viewer, list, equipped);
                }
            }
        }
Esempio n. 10
0
        public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
        {
            if (!this.CheckExpansion())
            {
                return;
            }

            string value;

            if (String.IsNullOrEmpty(Desc))
            {
                if (String.IsNullOrWhiteSpace(Name))
                {
                    return;
                }

                value =
                    String.Format(
                        "[{0:#,0}] {1}",
                        PartsRequired,
                        Name.ToUpperWords());
            }
            else if (String.IsNullOrWhiteSpace(Name))
            {
                value =
                    String.Format(
                        "[{0:#,0}]: {1}",
                        PartsRequired,
                        Desc);
            }
            else
            {
                value =
                    String.Format(
                        "[{0:#,0}] {1}: {2}",
                        PartsRequired,
                        Name.ToUpperWords(),
                        Desc);
            }

            if (String.IsNullOrWhiteSpace(value))
            {
                return;
            }

            var color = equipped && IsActive(viewer)
                                ? EquipmentSets.CMOptions.ModNameColorRaw
                                : EquipmentSets.CMOptions.InactiveColorRaw;

            value = value.WrapUOHtmlColor(color);

            list.Add(value);
        }
Esempio n. 11
0
        private static void GetProperties(Item item, Mobile viewer, ExtendedOPL list)
        {
            if (!CMOptions.ModuleEnabled || item == null || item.Deleted || !item.Layer.IsEquip() || list == null)
            {
                return;
            }

            if (viewer == null && item.Parent is Mobile)
            {
                viewer = (Mobile)item.Parent;
            }

            if (viewer == null)
            {
                return;
            }

            Type itemType = item.GetType();
            bool equipped = item.IsEquipped();

            foreach (EquipmentSet set in
                     FindSetsFor(itemType)
                     .Where(s => s.Display && !s.Parts.Any(p => p.Valid && p.Display && p.IsTypeOf(itemType) && !p.DisplaySet)))
            {
                set.GetProperties(viewer, list, equipped);

                if (set.DisplayParts)
                {
                    foreach (EquipmentSetPart part in set.Parts.Where(p => p.Valid && p.Display))
                    {
                        part.GetProperties(viewer, list, equipped);
                    }
                }

                if (!set.DisplayMods)
                {
                    continue;
                }

                foreach (EquipmentSetMod mod in set.Mods.Where(mod => mod.Valid && mod.Display))
                {
                    mod.GetProperties(viewer, list, equipped);
                }
            }
        }
Esempio n. 12
0
		private static void GetProperties(Item item, Mobile viewer, ExtendedOPL list)
		{
			if (!CMOptions.ModuleEnabled || item == null || item.Deleted || !item.Layer.IsEquip() || list == null)
			{
				return;
			}

			if (viewer == null && item.Parent is Mobile)
			{
				viewer = (Mobile)item.Parent;
			}

			if (viewer == null)
			{
				return;
			}

			Type itemType = item.GetType();
			bool equipped = item.IsEquipped();

			foreach (EquipmentSet set in
				FindSetsFor(itemType)
					.Where(s => s.Display && !s.Parts.Any(p => p.Valid && p.Display && p.IsTypeOf(itemType) && !p.DisplaySet)))
			{
				set.GetProperties(viewer, list, equipped);

				if (set.DisplayParts)
				{
					foreach (EquipmentSetPart part in set.Parts.Where(p => p.Valid && p.Display))
					{
						part.GetProperties(viewer, list, equipped);
					}
				}

				if (!set.DisplayMods)
				{
					continue;
				}

				foreach (EquipmentSetMod mod in set.Mods.Where(mod => mod.Valid && mod.Display))
				{
					mod.GetProperties(viewer, list, equipped);
				}
			}
		}
Esempio n. 13
0
        public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
        {
            list.Add(String.Empty);

            var name  = Name.ToUpperWords();
            var count = Parts.Count;

            if (!equipped)
            {
                list.Add("{0} [{1:#,0}]".WrapUOHtmlColor(EquipmentSets.CMOptions.SetNameColorRaw), name, count);
            }
            else
            {
                var cur = CountEquippedParts(viewer);

                list.Add("{0} [{1:#,0} / {2:#,0}]".WrapUOHtmlColor(EquipmentSets.CMOptions.SetNameColorRaw), name, cur, count);
            }
        }
Esempio n. 14
0
 public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
 {
     if (!equipped)
     {
         list.Add(
             "{0} [{1:#,0}]".WrapUOHtmlColor(EquipmentSets.CMOptions.SetNameColorRaw),
             Name.ToUpperWords(),
             Parts.Count(p => p.Valid));
     }
     else
     {
         list.Add(
             "{0} [{1:#,0} / {2:#,0}]".WrapUOHtmlColor(EquipmentSets.CMOptions.SetNameColorRaw),
             Name.ToUpperWords(),
             GetEquippedParts(viewer).Length,
             Parts.Count(p => p.Valid));
     }
 }
Esempio n. 15
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            var eopl = new ExtendedOPL(list);

            if (Info != null)
            {
                eopl.Add(Info.Name.WrapUOHtmlColor(Color.Gold));
                eopl.Add("Group Size: {0}", Info.GroupMax);

                eopl.Add("Deadline: {0}", Info.Duration.ToSimpleString(@"<d\d ><h\h ><m\m ><s\s >"));
                eopl.Add("Lockout: {0}", Info.Lockout.ToSimpleString(@"<d\d ><h\h ><m\m ><s\s >"));
            }

            eopl.Add("[{0}]", Active ? "Active".WrapUOHtmlColor(Color.LawnGreen) : "Inactive".WrapUOHtmlColor(Color.OrangeRed));
            eopl.Apply();
        }
Esempio n. 16
0
        private static void InternalAddTrashProperties(Mobile viewer, ExtendedOPL list)
        {
            if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || viewer == null || viewer.Deleted || list == null ||
                !(viewer is PlayerMobile))
            {
                return;
            }

            var p = EnsureProfile(viewer);

            var todayTotal = p.GetTokenTotal(DateTime.UtcNow);
            var total      = p.GetTokenTotal();

            list.Add(
                "<basefont color=#{0:X6}>Total Tokens Earned: {1}",
                Color.SkyBlue.ToRgb(),
                total <= 0 ? "0" : total.ToString("#,#"));

            if (CMOptions.DailyLimit > 0)
            {
                const int blocks = 10;
                var       cur    = (Math.Max(0, Math.Min(CMOptions.DailyLimit, (double)todayTotal)) / CMOptions.DailyLimit) * 100.0;
                var       left   = (int)Math.Floor(cur / blocks);
                var       right  = blocks - left;

                list.Add("<basefont color=#{0:X6}>Tokens Earned Today:", Color.SkyBlue.ToRgb());
                list.Add(
                    "[<basefont color=#{0:X6}>{1}<basefont color=#{2:X6}>{3}<basefont color=#{4:X6}>] {5}/{6}",
                    Color.LimeGreen.ToRgb(),
                    new String('=', left),
                    Color.OrangeRed.ToRgb(),
                    new String('=', right),
                    Color.SkyBlue.ToRgb(),
                    todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"),
                    CMOptions.DailyLimit.ToString("#,#"));
            }
            else
            {
                list.Add("Tokens Earned Today: {0}", todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"));
            }

            list.Add("<basefont color=#ffffff>");
        }
Esempio n. 17
0
 public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
 {
     if (!String.IsNullOrEmpty(Desc))
     {
         list.Add(
             "[{0:#,0}] {1}: {2}".WrapUOHtmlColor(
                 equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
             PartsRequired,
             Name.ToUpperWords(),
             Desc);
     }
     else
     {
         list.Add(
             "[{0:#,0}] {1}".WrapUOHtmlColor(
                 equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
             PartsRequired,
             Name.ToUpperWords());
     }
 }
Esempio n. 18
0
		public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
		{
			if (throwable == null || list == null)
			{
				return;
			}

			var lines = new List<string>();

			if (throwable.Consumable)
			{
				lines.Add("Consumable");
			}

			if (throwable.ClearHands)
			{
				lines.Add("Clears Hands");
			}

			if (!throwable.AllowCombat)
			{
				lines.Add("Non-Combat");
			}

			if (lines.Count > 0)
			{
				string s = String.Format("<basefont color=#{0:X6}>{1}", Color.Orange.ToArgb(), String.Join(", ", lines));
				lines.Clear();
				lines.Add(s);
			}

			if (throwable.RequiredSkillValue > 0)
			{
				lines.Add(
					String.Format(
						"<basefont color=#ffffff>Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue));
			}

			DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
			TimeSpan diff = TimeSpan.Zero;

			if (readyWhen > now)
			{
				diff = readyWhen - now;
			}

			if (diff > TimeSpan.Zero)
			{
				string time = String.Format("{0:D2}:{1:D2}:{2:D2}", diff.Hours, diff.Minutes, diff.Seconds);
				lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.LimeGreen.ToArgb(), time));
			}
			else if (!String.IsNullOrWhiteSpace(throwable.Usage))
			{
				lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.Cyan.ToArgb(), throwable.Usage));
			}

			if (!String.IsNullOrWhiteSpace(throwable.Token))
			{
				lines.Add(String.Format("<basefont color=#{0:X6}>\"{1}\"", Color.Gold.ToArgb(), throwable.Token));
			}

			if (lines.Count > 0)
			{
				list.Add(String.Format("{0}<basefont color=#ffffff>", String.Join("\n", lines)));
			}

			lines.Clear();
		}
Esempio n. 19
0
 public static ObjectPropertyList GetOPL(this IEntity e, bool headerOnly)
 {
     return(ExtendedOPL.ResolveOPL(e, headerOnly));
 }
Esempio n. 20
0
        public static void Configure()
        {
            if (Configured)
            {
                return;
            }

            DisplayRetroBoot();

            CommandUtility.Register("VNC", AccessLevel.Administrator, OnCoreCommand);

            OutgoingPacketOverrides.Init();
            ExtendedOPL.Init();

            var now = DateTime.UtcNow;

            ToConsole(String.Empty);
            ToConsole("Compile action started...");

            TryCatch(CompileServices, ToConsole);
            TryCatch(CompileModules, ToConsole);

            Compiled = true;

            InvokeByPriority(OnCompiled);

            var time = (DateTime.UtcNow - now).TotalSeconds;

            ToConsole("Compile action completed in {0:F2} second{1}", time, (time != 1) ? "s" : String.Empty);

            now = DateTime.UtcNow;

            ToConsole(String.Empty);
            ToConsole("Configure action started...");

            TryCatch(ConfigureServices, ToConsole);
            TryCatch(ConfigureModules, ToConsole);

            Configured = true;

            InvokeByPriority(OnConfigured);

            time = (DateTime.UtcNow - now).TotalSeconds;

            ToConsole("Configure action completed in {0:F2} second{1}", time, (time != 1) ? "s" : String.Empty);

            ProcessINIT();

            EventSink.ServerStarted += () =>
            {
                EventSink.WorldSave += e =>
                {
                    TryCatch(Backup, ToConsole);
                    TryCatch(Save, ToConsole);
                };
                EventSink.Shutdown += e => TryCatch(Dispose, ToConsole);
                EventSink.Crashed  += e => TryCatch(Dispose, ToConsole);
            };

            try
            {
                var crashed = typeof(EventSink).GetEventDelegates("Crashed");

                foreach (var m in crashed.OfType <CrashedEventHandler>())
                {
                    EventSink.Crashed -= m;
                }

                EventSink.Crashed += e => Crashed = true;

                foreach (var m in crashed.OfType <CrashedEventHandler>())
                {
                    EventSink.Crashed += m;
                }
            }
            catch (Exception x)
            {
                ToConsole(x);

                EventSink.Crashed += e => Crashed = true;
            }
        }
Esempio n. 21
0
 public static ObjectPropertyList GetOPL(this IEntity e)
 {
     return(ExtendedOPL.ResolveOPL(e));
 }
Esempio n. 22
0
 public static ObjectPropertyList GetOPL(this IEntity e, Mobile viewer)
 {
     return(ExtendedOPL.ResolveOPL(e, viewer));
 }
Esempio n. 23
0
		public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
		{
			Item item;

			list.Add(
				equipped && IsEquipped(viewer, out item)
					? item.ResolveName(viewer).ToUpperWords().WrapUOHtmlColor(EquipmentSets.CMOptions.PartNameColorRaw)
					: Name.ToUpperWords().WrapUOHtmlColor(EquipmentSets.CMOptions.InactiveColorRaw));
		}
Esempio n. 24
0
        public static void Configure()
        {
            if (Configured)
            {
                return;
            }

            DisplayRetroBoot();

            CommandUtility.Register("VNC", AccessLevel.Administrator, OnCoreCommand);

            OutgoingPacketOverrides.Init();
            ExtendedOPL.Init();

            DateTime now = DateTime.UtcNow;

            ToConsole(String.Empty);
            ToConsole("Compile action started...");

            TryCatch(CompileServices, ToConsole);
            TryCatch(CompileModules, ToConsole);

            Compiled = true;

            if (OnCompiled != null)
            {
                TryCatch(OnCompiled, ToConsole);
            }

            double time = (DateTime.UtcNow - now).TotalSeconds;

            ToConsole("Compile action completed in {0:F2} second{1}", time, (time != 1) ? "s" : String.Empty);

            now = DateTime.UtcNow;

            ToConsole(String.Empty);
            ToConsole("Configure action started...");

            TryCatch(ConfigureServices, ToConsole);
            TryCatch(ConfigureModules, ToConsole);

            Configured = true;

            if (OnConfigured != null)
            {
                TryCatch(OnConfigured, ToConsole);
            }

            time = (DateTime.UtcNow - now).TotalSeconds;

            ToConsole("Configure action completed in {0:F2} second{1}", time, (time != 1) ? "s" : String.Empty);

            ProcessINIT();

            EventSink.ServerStarted += () =>
            {
                EventSink.WorldSave += e =>
                {
                    TryCatch(Backup, ToConsole);
                    TryCatch(Save, ToConsole);
                };
                EventSink.Shutdown += e => TryCatch(Dispose, ToConsole);
                EventSink.Crashed  += e => TryCatch(Dispose, ToConsole);
            };
        }
Esempio n. 25
0
        public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
        {
            if (throwable == null || list == null)
            {
                return;
            }

            var lines = new List <string>();

            if (throwable.Consumable)
            {
                lines.Add("Consumable");
            }

            if (throwable.ClearHands)
            {
                lines.Add("Clears Hands");
            }

            if (!throwable.AllowCombat)
            {
                lines.Add("Non-Combat");
            }

            if (lines.Count > 0)
            {
                string s = String.Format("<basefont color=#{0:X6}>{1}", Color.Orange.ToArgb(), String.Join(", ", lines));
                lines.Clear();
                lines.Add(s);
            }

            if (throwable.RequiredSkillValue > 0)
            {
                lines.Add(
                    String.Format(
                        "<basefont color=#ffffff>Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue));
            }

            DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
            TimeSpan diff = TimeSpan.Zero;

            if (readyWhen > now)
            {
                diff = readyWhen - now;
            }

            if (diff > TimeSpan.Zero)
            {
                string time = String.Format("{0:D2}:{1:D2}:{2:D2}", diff.Hours, diff.Minutes, diff.Seconds);
                lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.LimeGreen.ToArgb(), time));
            }
            else if (!String.IsNullOrWhiteSpace(throwable.Usage))
            {
                lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.Cyan.ToArgb(), throwable.Usage));
            }

            if (!String.IsNullOrWhiteSpace(throwable.Token))
            {
                lines.Add(String.Format("<basefont color=#{0:X6}>\"{1}\"", Color.Gold.ToArgb(), throwable.Token));
            }

            if (lines.Count > 0)
            {
                list.Add(String.Format("{0}<basefont color=#ffffff>", String.Join("\n", lines)));
            }

            lines.Clear();
        }
Esempio n. 26
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            ExtendedOPL.AddTo(list, "Use: Change the color of {0}".WrapUOHtmlColor(Color.LawnGreen), TargetUsage);
        }
Esempio n. 27
0
		public static void AddTrashProperties(Mobile m, Mobile viewer, ExtendedOPL list)
		{
			if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || m == null || m.Deleted || viewer == null ||
				viewer.Deleted || list == null || !(m is ITrashTokenProperties) || !(viewer is PlayerMobile))
			{
				return;
			}

			InternalAddTrashProperties(viewer, list);
		}
Esempio n. 28
0
		public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
		{
			if (!String.IsNullOrEmpty(Desc))
			{
				list.Add(
					"[{0:#,0}] {1}: {2}".WrapUOHtmlColor(
						equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
					PartsRequired,
					Name.ToUpperWords(),
					Desc);
			}
			else
			{
				list.Add(
					"[{0:#,0}] {1}".WrapUOHtmlColor(
						equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
					PartsRequired,
					Name.ToUpperWords());
			}
		}
Esempio n. 29
0
		private static void InternalAddTrashProperties(Mobile viewer, ExtendedOPL list)
		{
			if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || viewer == null || viewer.Deleted || list == null ||
				!(viewer is PlayerMobile))
			{
				return;
			}

			TrashProfile p = EnsureProfile(viewer);

			int todayTotal = p.GetTokenTotal(DateTime.UtcNow);
			int total = p.GetTokenTotal();

			list.Add(
				"<basefont color=#{0:X6}>Total Tokens Earned: {1}", Color.SkyBlue.ToArgb(), total <= 0 ? "0" : total.ToString("#,#"));

			if (CMOptions.DailyLimit > 0)
			{
				const int blocks = 10;
				double cur = (Math.Max(0, Math.Min(CMOptions.DailyLimit, (double)todayTotal)) / CMOptions.DailyLimit) * 100.0;
				int left = (int)Math.Floor(cur / blocks);
				int right = blocks - left;

				list.Add("<basefont color=#{0:X6}>Tokens Earned Today:", Color.SkyBlue.ToArgb());
				list.Add(
					"[<basefont color=#{0:X6}>{1}<basefont color=#{2:X6}>{3}<basefont color=#{4:X6}>] {5}/{6}",
					Color.LimeGreen.ToArgb(),
					new String('=', left),
					Color.OrangeRed.ToArgb(),
					new String('=', right),
					Color.SkyBlue.ToArgb(),
					todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"),
					CMOptions.DailyLimit.ToString("#,#"));
			}
			else
			{
				list.Add("Tokens Earned Today: {0}", todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"));
			}

			list.Add("<basefont color=#ffffff>");
		}