Exemplo n.º 1
0
        public static void CheckAtrophy(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            try
            {
                if ((pm.LastSacrificeLoss + LossDelay) < DateTime.UtcNow)
                {
                    if (VirtueHelper.Atrophy(from, VirtueName.Sacrifice, LossAmount))
                    {
                        from.SendLocalizedMessage(1052041); // You have lost some Sacrifice.
                    }
                    VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Sacrifice);

                    pm.AvailableResurrects = (int)level;
                    pm.LastSacrificeLoss   = DateTime.UtcNow;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        public static void ActivateEmbrace(PlayerMobile pm)
        {
            int duration = GetHonorDuration(pm);
            int usedPoints;

            if (pm.Virtues.Honor < 4399)
            {
                usedPoints = 400;
            }
            else if (pm.Virtues.Honor < 10599)
            {
                usedPoints = 600;
            }
            else
            {
                usedPoints = 1000;
            }

            VirtueHelper.Atrophy(pm, VirtueName.Honor, usedPoints);

            pm.HonorActive = true;
            pm.SendLocalizedMessage(1063235); // You embrace your honor

            Timer.DelayCall(TimeSpan.FromSeconds(duration),
                            delegate()
            {
                pm.HonorActive  = false;
                pm.LastHonorUse = DateTime.UtcNow;
                pm.SendLocalizedMessage(1063236);     // You no longer embrace your honor
            });
        }
Exemplo n.º 3
0
        public static void CheckAtrophy(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            try
            {
                if ((pm.LastCompassionLoss + LossDelay) < DateTime.UtcNow)
                {
                    VirtueHelper.Atrophy(from, VirtueName.Compassion, LossAmount);
                    //OSI has no cliloc message for losing compassion.  Weird.
                    pm.LastCompassionLoss = DateTime.UtcNow;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 4
0
        public static void CheckAtrophy(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            try
            {
                if ((pm.LastJusticeLoss + LossDelay) < DateTime.UtcNow)
                {
                    if (VirtueHelper.Atrophy(from, VirtueName.Justice, LossAmount))
                    {
                        from.SendLocalizedMessage(1049373); // You have lost some Justice.
                    }
                    pm.LastJusticeLoss = DateTime.UtcNow;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 5
0
        public static void Valor(Mobile from, object targ)
        {
            IdolOfTheChampion idol = targ as IdolOfTheChampion;

            if (idol == null || idol.Deleted || idol.Spawn == null || idol.Spawn.Deleted)
            {
                from.SendLocalizedMessage(1054035); // You must target a Champion Idol to challenge the Champion's spawn!
            }
            else if (from.Hidden)
            {
                from.SendLocalizedMessage(1052015); // You cannot do that while hidden.
            }
            else if (idol.Spawn.HasBeenAdvanced)
            {
                from.SendLocalizedMessage(1054038); // The Champion of this region has already been challenged!
            }
            else
            {
                VirtueLevel vl = VirtueHelper.GetLevel(from, VirtueName.Valor);
                if (idol.Spawn.Active)
                {
                    if (idol.Spawn.Champion != null)    //TODO: Message?
                    {
                        return;
                    }

                    int needed, consumed;
                    switch (idol.Spawn.GetSubLevel())
                    {
                    case 0:
                    {
                        needed = consumed = 2500;
                        break;
                    }

                    case 1:
                    {
                        needed = consumed = 5000;
                        break;
                    }

                    case 2:
                    {
                        needed   = 10000;
                        consumed = 7500;
                        break;
                    }

                    default:
                    {
                        needed   = 20000;
                        consumed = 10000;
                        break;
                    }
                    }

                    if (from.Virtues.GetValue((int)VirtueName.Valor) >= needed)
                    {
                        VirtueHelper.Atrophy(from, VirtueName.Valor, consumed);
                        from.SendLocalizedMessage(1054037); // Your challenge is heard by the Champion of this region! Beware its wrath!
                        idol.Spawn.HasBeenAdvanced = true;
                        idol.Spawn.AdvanceLevel();
                    }
                    else
                    {
                        from.SendLocalizedMessage(1054039); // The Champion of this region ignores your challenge. You must further prove your valor.
                    }
                }
                else
                {
                    if (vl == VirtueLevel.Knight)
                    {
                        VirtueHelper.Atrophy(from, VirtueName.Valor, 11000);
                        from.SendLocalizedMessage(1054037); // Your challenge is heard by the Champion of this region! Beware its wrath!
                        idol.Spawn.EndRestart();
                        idol.Spawn.HasBeenAdvanced = true;
                    }
                    else
                    {
                        from.SendLocalizedMessage(1054036); // You must be a Knight of Valor to summon the champion's spawn in this manner!
                    }
                }
            }
        }