예제 #1
0
        public static int GetRegenBonus(Mobile mobile)
        {
            if (ActiveTable == null || !ActiveTable.ContainsKey(mobile))
            {
                return(0);
            }

            Mobile user = ActiveTable[mobile];

            if (user != null)
            {
                if (VirtueHelper.IsKnight(user, VirtueName.Humility))
                {
                    return(30);
                }

                if (VirtueHelper.IsFollower(user, VirtueName.Humility))
                {
                    return(20);
                }

                if (VirtueHelper.IsSeeker(user, VirtueName.Humility))
                {
                    return(10);
                }
            }

            return(0);
        }
예제 #2
0
        public static void OnVirtueTargeted(Mobile from, object obj)
        {
            var protector = from as PlayerMobile;
            var pm        = obj as PlayerMobile;

            if (protector == null)
            {
                return;
            }

            if (!VirtueHelper.IsSeeker(protector, VirtueName.Justice))
            {
                protector.SendLocalizedMessage(1049610);                 // You must reach the first path in this virtue to invoke it.
            }
            else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
            {
                protector.SendLocalizedMessage(1049370);                 // You must wait a while before offering your protection again.
            }
            else if (protector.JusticeProtectors.Count > 0)
            {
                protector.SendLocalizedMessage(1049542);                 // You cannot protect someone while being protected.
            }
            else if (protector.Map != Map.Felucca)
            {
                protector.SendLocalizedMessage(1049372);                 // You cannot use this ability here.
            }
            else if (pm == null)
            {
                protector.SendLocalizedMessage(1049678);                 // Only players can be protected.
            }
            else if (pm.Map != Map.Felucca)
            {
                protector.SendLocalizedMessage(1049372);                 // You cannot use this ability here.
            }
            else if (pm == protector || pm.Criminal || pm.Murderer)
            {
                protector.SendLocalizedMessage(1049436);                 // That player cannot be protected.
            }
            else if (pm.JusticeProtectors.Count > 0)
            {
                protector.SendLocalizedMessage(1049369);                 // You cannot protect that player right now.
            }
            else if (pm.HasGump(typeof(AcceptProtectorGump)))
            {
                protector.SendLocalizedMessage(1049369);                 // You cannot protect that player right now.
            }
            else
            {
                pm.SendGump(new AcceptProtectorGump(protector, pm));
            }
        }
예제 #3
0
            public static int GetReduction(Mobile m)
            {
                if (VirtueHelper.IsKnight(m, VirtueName.Spirituality))
                {
                    return(20);
                }

                if (VirtueHelper.IsFollower(m, VirtueName.Spirituality))
                {
                    return(10);
                }

                if (VirtueHelper.IsSeeker(m, VirtueName.Spirituality))
                {
                    return(5);
                }

                return(0);
            }
예제 #4
0
            private static int GetPool(Mobile user)
            {
                if (VirtueHelper.IsKnight(user, VirtueName.Spirituality))
                {
                    return(200);
                }

                if (VirtueHelper.IsFollower(user, VirtueName.Spirituality))
                {
                    return(100);
                }

                if (VirtueHelper.IsSeeker(user, VirtueName.Spirituality))
                {
                    return(50);
                }

                return(0);
            }
예제 #5
0
        public static void OnVirtueAccepted(PlayerMobile protector, PlayerMobile protectee)
        {
            if (!VirtueHelper.IsSeeker(protector, VirtueName.Justice))
            {
                protector.SendLocalizedMessage(1049610);                 // You must reach the first path in this virtue to invoke it.
            }
            else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
            {
                protector.SendLocalizedMessage(1049370);                 // You must wait a while before offering your protection again.
            }
            else if (protector.JusticeProtectors.Count > 0)
            {
                protector.SendLocalizedMessage(1049542);                 // You cannot protect someone while being protected.
            }
            else if (protector.Map != Map.Felucca)
            {
                protector.SendLocalizedMessage(1049372);                 // You cannot use this ability here.
            }
            else if (protectee.Map != Map.Felucca)
            {
                protector.SendLocalizedMessage(1049372);                 // You cannot use this ability here.
            }
            else if (protectee == protector || protectee.Criminal || protectee.Murderer)
            {
                protector.SendLocalizedMessage(1049436);                 // That player cannot be protected.
            }
            else if (protectee.JusticeProtectors.Count > 0)
            {
                protector.SendLocalizedMessage(1049369);                 // You cannot protect that player right now.
            }
            else
            {
                protectee.JusticeProtectors.Add(protector);

                var args = String.Format("{0}\t{1}", protector.Name, protectee.Name);

                protectee.SendLocalizedMessage(1049451, args);                 // You are now being protected by ~1_NAME~.
                protector.SendLocalizedMessage(1049452, args);                 // You are now protecting ~2_NAME~.
            }
        }
예제 #6
0
        public static void Resurrect(Mobile from)
        {
            if (from.Alive)
            {
                return;
            }

            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            if (from.Criminal)
            {
                from.SendLocalizedMessage(1052007); // You cannot use this ability while flagged as a criminal.
            }
            else if (!VirtueHelper.IsSeeker(from, VirtueName.Sacrifice))
            {
                from.SendLocalizedMessage(1052004); // You cannot use this ability.
            }
            else if (pm.AvailableResurrects <= 0)
            {
                from.SendLocalizedMessage(1052005); // You do not have any resurrections left.
            }
            else
            {
                /*
                 * We need to wait for them to accept the gump or they can just use
                 * Sacrifice and cancel to have items in their backpack for free.
                 */
                from.CloseGump(typeof(ResurrectGump));
                from.SendGump(new ResurrectGump(from, true));
            }
        }
예제 #7
0
        public static void OnVirtueUsed(Mobile from)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            var protector = from as PlayerMobile;

            if (protector == null)
            {
                return;
            }

            if (!VirtueHelper.IsSeeker(protector, VirtueName.Justice))
            {
                protector.SendLocalizedMessage(1049610);                 // You must reach the first path in this virtue to invoke it.
            }
            else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
            {
                protector.SendLocalizedMessage(1049370);                 // You must wait a while before offering your protection again.
            }
            else if (protector.JusticeProtectors.Count > 0)
            {
                protector.SendLocalizedMessage(1049542);                 // You cannot protect someone while being protected.
            }
            else if (protector.Map != Map.Felucca)
            {
                protector.SendLocalizedMessage(1049372);                 // You cannot use this ability here.
            }
            else
            {
                protector.BeginTarget(14, false, TargetFlags.None, OnVirtueTargeted);
                protector.SendLocalizedMessage(1049366);                 // Choose the player you wish to protect.
            }
        }