public static void CheckAtrophy(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            try
            {
                if ((pm.LastSacrificeLoss + LossDelay) < DateTime.Now)
                {
                    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.Now;
                }
            }
            catch
            {
            }
        }
Beispiel #2
0
        public static bool Award(Mobile from, VirtueName virtue, int amount, ref bool gainedPath)
        {
            int current = from.Virtues.GetValue((int)virtue);

            int maxAmount = GetMaxAmount(virtue);

            if (current >= maxAmount)
            {
                return(false);
            }

            if (from.FindItemOnLayer(Layer.TwoHanded) is Server.Items.VirtueShield)
            {
                amount = amount + (int)((double)amount * 1.5);
            }

            if ((current + amount) >= maxAmount)
            {
                amount = maxAmount - current;
            }

            VirtueLevel oldLevel = GetLevel(from, virtue);

            from.Virtues.SetValue((int)virtue, current + amount);

            gainedPath = (GetLevel(from, virtue) != oldLevel);

            return(true);
        }
Beispiel #3
0
        public static bool Award(Mobile from, VirtueName virtue, int amount, ref bool gainedPath)
        {
            int current = from.Virtues.GetValue((int)virtue);

            int maxAmount = GetMaxAmount(virtue);

            if (current >= maxAmount)
            {
                return(false);
            }

            if ((current + amount) >= maxAmount)
            {
                amount = maxAmount - current;
            }

            VirtueLevel oldLevel = GetLevel(from, virtue);

            from.Virtues.SetValue((int)virtue, current + amount);

            VirtueLevel newLevel = GetLevel(from, virtue);

            gainedPath = (newLevel != oldLevel);

            if (gainedPath)
            {
                EventSink.InvokeOnVirtueLevelChange(from, (int)oldLevel, (int)newLevel, (int)virtue);
            }

            return(true);
        }
Beispiel #4
0
        public static void CheckAtrophy(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            try
            {
                if ((pm.LastValorLoss + LossDelay) < DateTime.Now)
                {
                    if (VirtueHelper.Atrophy(from, VirtueName.Valor))
                    {
                        from.SendLocalizedMessage(1054040);                           // You have lost some Valor.
                    }

                    VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Valor);

                    pm.LastValorLoss = DateTime.Now;
                }
            }
            catch
            {
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391);                       // Thou can not be resurrected there!
                    return;
                }

                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendLocalizedMessage(1060398, m_Price.ToString());                               // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString());               // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020);                               // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019);                           // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker: from.Hits = AOS.Scale(from.HitsMax, 20); break;

                    case VirtueLevel.Follower: from.Hits = AOS.Scale(from.HitsMax, 40); break;

                    case VirtueLevel.Knight: from.Hits = AOS.Scale(from.HitsMax, 80); break;
                    }
                }

                Mobile m = from;

                Misc.Titles.AwardFame(from, -100, true);                   // TODO: Proper fame loss
            }
        }
        public static void Humility(Mobile from, object targ)
        {
            if (!(targ is Mobile))
            {
                return;
            }

            BaseCreature bc = targ as BaseCreature;

            VirtueLevel vl = VirtueHelper.GetLevel(from, VirtueName.Humility);

            if (bc != null && bc.ControlMaster == @from && vl >= VirtueLevel.Seeker)
            {
                int usedPoints;
                if (from.Virtues.Humility < 4399)
                {
                    usedPoints = 400;
                }
                else if (from.Virtues.Humility < 10599)
                {
                    usedPoints = 600;
                }
                else
                {
                    usedPoints = 1000;
                }

                VirtueHelper.Atrophy(from, VirtueName.Humility, usedPoints);

                switch (vl)
                {
                case VirtueLevel.Seeker:
                    bc.HumilityBuff = 1;
                    break;

                case VirtueLevel.Follower:
                    bc.HumilityBuff = 2;
                    break;

                case VirtueLevel.Knight:
                    bc.HumilityBuff = 3;
                    break;
                }

                Timer mTimer = new HumilityTimer(bc);
                mTimer.Start();
                from.SendLocalizedMessage(1155819);
            }
            else
            {
                from.SendMessage("You can only embrace your Humility on a pet.");//get cliloc
            }
        }
Beispiel #7
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (sender.Mobile == null || sender.Mobile.Alive)
                {
                    return;
                }
                else if (info.ButtonID == 0)
                {
                    return;
                }

                Mobile m = sender.Mobile;

                AutoLifeSpell.ResurrectEffect(m);

                if (m is PlayerMobile)
                {
                    AutoLifeSpell.EndAutoLife((PlayerMobile)m);
                }

                Misc.Titles.AwardFame(m, -(m.Fame / 10), true);
                m.Resurrect();

                if (m.AccessLevel == AccessLevel.Player)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker: m.Hits = AOS.Scale(m.HitsMax, 20); break;

                    case VirtueLevel.Follower: m.Hits = AOS.Scale(m.HitsMax, 40); break;

                    case VirtueLevel.Knight: m.Hits = AOS.Scale(m.HitsMax, 80); break;

                    default: m.Hits = 10; break;
                    }
                }
                else
                {
                    m.Hits      = m.HitsMax;
                    m.Stam      = m.StamMax;
                    m.Mana      = m.ManaMax;
                    m.Karma     = m.Fame = 0;
                    m.BodyValue = 987;
                }
            }
Beispiel #8
0
        public static void CheckAtrophy(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            try
            {
                if ((pm.LastSacrificeLoss + LossDelay) < DateTime.Now)
                {
                    if (VirtueHelper.Atrophy(from, VirtueName.Sacrifice))
                    {
                        from.SendLocalizedMessage(1052041);                           // You have lost some Sacrifice.
                    }

                    VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Sacrifice);

                    int resurrects = 0;

                    if (level >= VirtueLevel.Knight)
                    {
                        resurrects = 3;
                    }
                    else if (level >= VirtueLevel.Follower)
                    {
                        resurrects = 2;
                    }
                    else if (level >= VirtueLevel.Seeker)
                    {
                        resurrects = 1;
                    }

                    pm.AvailableResurrects = resurrects;
                    pm.LastSacrificeLoss   = DateTime.Now;
                }
            }
            catch
            {
            }
        }
Beispiel #9
0
        public static bool Award(Mobile from, VirtueName virtue, int amount, ref bool gainedPath)
        {
            int current = from.Virtues.GetValue((int)virtue);

            if (current >= 30)
            {
                return(false);
            }

            if ((current + amount) >= 30)
            {
                amount = 30 - current;
            }

            VirtueLevel oldLevel = GetLevel(from, virtue);

            from.Virtues.SetValue((int)virtue, current + amount);

            gainedPath = (GetLevel(from, virtue) != oldLevel);

            return(true);
        }
Beispiel #10
0
        public static bool CheckValor(ChampionSpawn spawn, Mobile from)
        {
            VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Valor);

            if (spawn != null && VirtueHelper.HasAny(from, VirtueName.Valor))
            {
                if (level <= VirtueLevel.Seeker && spawn.Level < 5)
                {
                    return(true);
                }

                if (level <= VirtueLevel.Follower && spawn.Level < 10)
                {
                    return(true);
                }

                if (level <= VirtueLevel.Knight && spawn.Level < 15)
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #11
0
        public static bool Award(Mobile from, VirtueName virtue, int amount, ref bool gainedPath)
        {
            int current = from.Virtues.GetValue((int)virtue);

            int maxAmount = GetMaxAmount(virtue);

            if (current >= maxAmount)
            {
                return(false);
            }

            if (from.FindItemOnLayer(Layer.TwoHanded) is VirtueShield)
            {
                amount = amount + (int)(amount * 1.5);
            }

            if (current + amount >= maxAmount)
            {
                amount = maxAmount - current;
            }

            VirtueLevel oldLevel = GetLevel(from, virtue);

            from.Virtues.SetValue((int)virtue, current + amount);

            VirtueLevel newLevel = GetLevel(from, virtue);

            gainedPath = (newLevel != oldLevel);

            if (gainedPath)
            {
                EventSink.InvokeVirtueLevelChange(new VirtueLevelChangeEventArgs(from, (int)oldLevel, (int)newLevel, (int)virtue));
            }

            return(true);
        }
Beispiel #12
0
        public static void Valor(Mobile from, object targeted)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            ChampionIdol targ = targeted as ChampionIdol;

            if (targ == null)
            {
                return;
            }

            VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Valor);

            int current = from.Virtues.GetValue((int)VirtueName.Valor);

            if (targ.Spawn.IsValorUsed)
            {
                from.SendLocalizedMessage(1054038);                   // The Champion of this region has already been challenged!
                return;
            }

            if (!targ.Spawn.Active)
            {
                if (level >= VirtueLevel.Knight)
                {
                    targ.Spawn.Active = true;

                    if (targ.Spawn.RandomizeType)
                    {
                        switch (Utility.Random(5))
                        {
                        case 0:
                            targ.Spawn.Type = ChampionSpawnType.VerminHorde;
                            break;

                        case 1:
                            targ.Spawn.Type = ChampionSpawnType.UnholyTerror;
                            break;

                        case 2:
                            targ.Spawn.Type = ChampionSpawnType.ColdBlood;
                            break;

                        case 3:
                            targ.Spawn.Type = ChampionSpawnType.Abyss;
                            break;

                        case 4:
                            targ.Spawn.Type = ChampionSpawnType.Arachnid;
                            break;
                        }
                    }

                    // It's strange, but at OSI Valor not only activate spawn but also increase 2-4 levels on it.
                    // If counts of increased levels less than 4, champion spawn can be used with Valor again for advance level.
                    int candles = Utility.RandomMinMax(2, 4);
                    targ.Spawn.Level = candles;
                    if (candles > 3)
                    {
                        targ.Spawn.IsValorUsed = true;
                    }

                    // on Stratics written:
                    // The player will sacrifice a large portion of his Valor in order to activate a champion spawn shrine.
                    // Really, player become Follower of Valor instead Knight
                    from.Virtues.SetValue((int)VirtueName.Valor, 29);

                    // Your challenge is heard by the Champion of this region! Beware its wrath!
                    targ.PublicOverheadMessage(Network.MessageType.Regular, 0x3B2, 1054037, "");

                    from.SendLocalizedMessage(1054040);                       // You have lost some Valor.
                }
                else
                {
                    from.SendLocalizedMessage(1054036);                       // You must be a Knight of Valor to summon the champion's spawn in this manner!
                }
            }
            else
            {
                if (targ.Spawn.Champion == null)
                {
                    if (CheckValor(targ.Spawn, from))
                    {
                        int sacrifice_advance_level = 0;

                        if (targ.Spawn.Level < 5)
                        {
                            sacrifice_advance_level = 5;
                        }

                        if (targ.Spawn.Level >= 5 && targ.Spawn.Level < 10)
                        {
                            sacrifice_advance_level = 10;
                        }

                        if (targ.Spawn.Level >= 10 && targ.Spawn.Level < 15)
                        {
                            sacrifice_advance_level = 15;
                        }

                        if (sacrifice_advance_level > current)
                        {
                            sacrifice_advance_level = current;
                        }

                        targ.Spawn.Level += 1;

                        from.Virtues.SetValue((int)VirtueName.Valor, current - sacrifice_advance_level);

                        // Your challenge is heard by the Champion of this region! Beware its wrath!
                        targ.PublicOverheadMessage(Network.MessageType.Regular, 0x3B2, 1054037, "");

                        from.SendLocalizedMessage(1054040);                           // You have lost some Valor.

                        targ.Spawn.IsValorUsed = true;
                    }
                    else
                    {
                        from.SendLocalizedMessage(1054039);                           // The Champion of this region ignores your challenge. You must further prove your valor.
                    }

                    if (targ.Spawn.Level >= 15 && level >= VirtueLevel.Knight)
                    {
                        if (0.03 >= Utility.RandomDouble())                           // TODO: verify
                        {
                            // Your challenge is heard by the Champion of this region! Beware its wrath!
                            targ.PublicOverheadMessage(Network.MessageType.Regular, 0x3B2, 1054037, "");

                            targ.Spawn.SpawnChampion();

                            from.Virtues.SetValue((int)VirtueName.Valor, 0);

                            from.SendLocalizedMessage(1054040);                               // You have lost some Valor.

                            targ.Spawn.IsValorUsed = true;
                        }
                        else
                        {
                            from.SendLocalizedMessage(1054039);                               // The Champion of this region ignores your challenge. You must further prove your valor.
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1054038);                       // The Champion of this region has already been challenged!
                }
            }
        }
Beispiel #13
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (ResurrectMessage.SilverSapling == this.m_Msg && 1 == info.ButtonID)
            {
                PlayerMobile pm = from as PlayerMobile;
                if (null != pm && pm.Region.IsPartOf("Abyss"))
                {
                    pm.Location = pm.SSSeedLocation;
                    pm.Map      = pm.SSSeedMap;
                    if (null != pm.Corpse)
                    {
                        pm.Corpse.Location = pm.Location;
                        pm.Corpse.Map      = pm.Map;
                    }
                    pm.Resurrect();
                }
                return;
            }

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                    return;
                }

                if (this.m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, this.m_Price))
                        {
                            from.SendLocalizedMessage(1060398, this.m_Price.ToString());            // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString()); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020); // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019); // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();

                if (this.m_Healer != null && from != this.m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(this.m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker:
                        from.Hits = AOS.Scale(from.HitsMax, 20);
                        break;

                    case VirtueLevel.Follower:
                        from.Hits = AOS.Scale(from.HitsMax, 40);
                        break;

                    case VirtueLevel.Knight:
                        from.Hits = AOS.Scale(from.HitsMax, 80);
                        break;
                    }
                }

                if (this.m_FromSacrifice && from is PlayerMobile)
                {
                    ((PlayerMobile)from).AvailableResurrects -= 1;

                    Container pack   = from.Backpack;
                    Container corpse = from.Corpse;

                    if (pack != null && corpse != null)
                    {
                        List <Item> items = new List <Item>(corpse.Items);

                        for (int i = 0; i < items.Count; ++i)
                        {
                            Item item = items[i];

                            if (item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable)
                            {
                                pack.DropItem(item);
                            }
                        }
                    }
                }

                if (from.Fame > 0)
                {
                    int amount = from.Fame / 10;

                    Misc.Titles.AwardFame(from, -amount, true);
                }

                if (!Core.AOS && from.ShortTermMurders >= 5)
                {
                    double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0; // 5 to 15% loss

                    if (loss < 0.85)
                    {
                        loss = 0.85;
                    }
                    else if (loss > 0.95)
                    {
                        loss = 0.95;
                    }

                    if (from.RawStr * loss > 10)
                    {
                        from.RawStr = (int)(from.RawStr * loss);
                    }
                    if (from.RawInt * loss > 10)
                    {
                        from.RawInt = (int)(from.RawInt * loss);
                    }
                    if (from.RawDex * loss > 10)
                    {
                        from.RawDex = (int)(from.RawDex * loss);
                    }

                    for (int s = 0; s < from.Skills.Length; s++)
                    {
                        if (from.Skills[s].Base * loss > 35)
                        {
                            from.Skills[s].Base *= loss;
                        }
                    }
                }

                if (from.Alive && this.m_HitsScalar > 0)
                {
                    from.Hits = (int)(from.HitsMax * this.m_HitsScalar);
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CantWalk = false;
            from.CloseGump(typeof(ResurrectGump));

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391);                       // Thou can not be resurrected there!
                    return;
                }

                if (m_Healer != null && (m_Healer is BaseHealer) && !from.InRange(m_Healer.Location, 5))
                {
                    from.SendMessage("You've strayed too far from the healer!");
                    return;
                }


                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendLocalizedMessage(1060398, m_Price.ToString());                               // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString());               // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020);                               // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019);                           // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();
                TAVUtilities.FindCorpse(from);

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker: from.Hits = AOS.Scale(from.HitsMax, 20); break;

                    case VirtueLevel.Follower: from.Hits = AOS.Scale(from.HitsMax, 40); break;

                    case VirtueLevel.Knight: from.Hits = AOS.Scale(from.HitsMax, 80); break;
                    }

                    Misc.Titles.AwardFame(m_Healer, 2500, true);
                }

                Mobile m = from;

                Misc.Titles.AwardFame(from, -100, true);                   // TODO: Proper fame loss

                /*
                 * if ( !Core.AOS && from.ShortTermMurders >= 5 )
                 * {
                 *      double loss = (100.0 - ( 4.0 + (from.ShortTermMurders/5.0))) / 100.0;//5 to 15% loss
                 *      if ( loss < 0.85 )
                 *              loss = 0.85;
                 *      else if ( loss > 0.95 )
                 *              loss = 0.95;
                 *
                 *      if ( from.RawStr * loss > 10 )
                 *              from.RawStr = (int)(from.RawStr * loss);
                 *      if ( from.RawInt * loss > 10 )
                 *              from.RawInt = (int)(from.RawInt * loss);
                 *      if ( from.RawDex * loss > 10 )
                 *              from.RawDex = (int)(from.RawDex * loss);
                 *
                 *      for (int s=0;s<from.Skills.Length;s++)
                 *      {
                 *              if ( from.Skills[s].Base * loss > 35 )
                 *                      from.Skills[s].Base *= loss;
                 *      }
                 * }
                 */
            }
        }
Beispiel #15
0
        public override void OnResponse(GameClient state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391);                       // Thou can not be resurrected there!
                    return;
                }

                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendLocalizedMessage(1060398, m_Price.ToString());                               // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString());               // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020);                               // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019);                           // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);

                from.Resurrect(m_Healer);

                if (from is PlayerMobile)
                {
                    ((PlayerMobile)from).CheckKRStartingQuestStep(26);
                }

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker:
                        from.Hits = AOS.Scale(from.HitsMax, 20);
                        break;

                    case VirtueLevel.Follower:
                        from.Hits = AOS.Scale(from.HitsMax, 40);
                        break;

                    case VirtueLevel.Knight:
                        from.Hits = AOS.Scale(from.HitsMax, 80);
                        break;
                    }
                }

                if (m_FromSacrifice && from is PlayerMobile)
                {
                    ((PlayerMobile)from).AvailableResurrects -= 1;

                    Container pack   = from.Backpack;
                    Container corpse = from.Corpse;

                    if (pack != null && corpse != null)
                    {
                        ArrayList items = new ArrayList(corpse.Items);

                        for (int i = 0; i < items.Count; ++i)
                        {
                            Item item = (Item)items[i];

                            if (item.Movable && item.LootType != LootType.Cursed)
                            {
                                pack.DropItem(item);
                            }
                        }
                    }
                }

                if (from.Fame > 0)
                {
                    int amount = from.Fame / 10;

                    Misc.Titles.AwardFame(from, -amount, true);
                }
            }
        }
Beispiel #16
0
        public static void Valor(Mobile from, object targ)
        {
            IdolOfTheChampion idol = targ as IdolOfTheChampion;
            VirtueLevel       vl   = VirtueHelper.GetLevel(from, VirtueName.Valor);

            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.OneAdvance == true)
            {
                from.SendMessage("You have already advanced this Champion Spawn!");
            }
            else if (idol.Spawn.OneAdvance == false && idol.Spawn.Active)
            {
                if (vl == VirtueLevel.Follower)
                {
                    VirtueHelper.Atrophy(from, VirtueName.Valor, 5000);
                    idol.Spawn.AdvanceLevel();
                    idol.Spawn.OneAdvance = true;
                }
                else
                {
                    from.SendMessage("You must be a Follower of Valor to advance this Champ Spawn any further.");
                }
            }
            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();
                        int skulls = Utility.RandomMinMax(1, 3);
                        Console.WriteLine("Random Was = " + skulls);
                        while (skulls <= 3)
                        {
                            idol.Spawn.AdvanceLevel();
                            skulls++;
                        }
                    }
                    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;
                        idol.Spawn.AdvanceLevel();
                        int skulls = Utility.RandomMinMax(1, 3);
                        Console.WriteLine("Random Was = " + skulls);
                        while (skulls <= 3)
                        {
                            idol.Spawn.AdvanceLevel();
                            skulls++;
                        }
                        Console.WriteLine("This Gets Called Now.");
                    }
                    else
                    {
                        from.SendLocalizedMessage(1054036); // You must be a Knight of Valor to summon the champion's spawn in this manner!
                    }
                }
            }
        }
        public static void Honor(Mobile from, object targeted)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            Mobile targ = targeted as Mobile;

            if (targ == null)
            {
                return;
            }

            VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Honor);

            if (targ == from)
            {
                if (CantEmbrace(from))
                {
                    from.SendLocalizedMessage(1063230);                       // You must wait awhile before you can embrace honor again.

                    return;
                }

                if (level < VirtueLevel.Seeker)
                {
                    from.SendLocalizedMessage(1063234);                       // You do not have enough honor to do that

                    return;
                }

                Timer t = (Timer)m_Table[from];

                if (t != null)
                {
                    t.Stop();
                }

                Timer t2 = (Timer)m_Table2[from];

                if (t2 != null)
                {
                    t.Stop();
                }

                double delay = 0;

                switch (level)
                {
                case VirtueLevel.Seeker:
                    delay = 60.0;
                    break;

                case VirtueLevel.Follower:
                    delay = 90.0;
                    break;

                case VirtueLevel.Knight:
                    delay = 120.0;
                    break;
                }

                m_Table[from] = t = Timer.DelayCall(TimeSpan.FromSeconds(delay), new TimerStateCallback(Expire_Callback), from);

                m_Table2[from] = t2 = Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(Expire_Callback2), from);

                from.SendLocalizedMessage(1063235);                   // You embrace your honor

                if (VirtueHelper.Atrophy(from, VirtueName.Honor))
                {
                    from.SendLocalizedMessage(1063227);                       // You have lost some Honor.
                }
            }
            else
            {
                if (targ is BaseCreature)
                {
                    BaseCreature cr = targ as BaseCreature;

                    if (cr.HonorOpponent != null && cr.HonorOpponent != from)
                    {
                        from.SendLocalizedMessage(1063233);                           // Somebody else is honoring this opponent

                        return;
                    }
                }

                if (targ is PlayerMobile)
                {
                    PlayerMobile pm = targ as PlayerMobile;

                    if (pm.HonorOpponent != null && pm.HonorOpponent != from)
                    {
                        from.SendLocalizedMessage(1063233);                           // Somebody else is honoring this opponent

                        return;
                    }
                }

                if (VirtueHelper.IsHighestPath(from, VirtueName.Honor))
                {
                    from.SendLocalizedMessage(1063228);                       // You cannot gain more Honor.

                    return;
                }

                if (!from.InRange(targ.Location, 5))
                {
                    from.SendLocalizedMessage(1063232);                       // You are too far away to honor your opponent

                    return;
                }

                if (((targ.Hits * 100) / Math.Max(targ.HitsMax, 1)) < 85)
                {
                    from.SendLocalizedMessage(1063166);                       // You cannot honor this monster because it is too damaged.

                    return;
                }

                if (!NotorietyHandlers.Mobile_AllowHarmful(from, targ))
                {
                    return;
                }

                if (!from.CanSee(targ) || !from.InLOS(targ))
                {
                    return;
                }

                from.Direction = from.GetDirectionTo(targ.Location);

                from.Animate(32, 5, 1, true, false, 0);

                from.Say(1063231);                   // I honor you

                PlayerMobile player = from as PlayerMobile;

                player.HonorOpponent = targ;

                if (targ is BaseCreature)
                {
                    ((BaseCreature)targ).HonorOpponent = player;
                }

                if (targ is PlayerMobile)
                {
                    ((PlayerMobile)targ).HonorOpponent = player;
                }

                player.SpotHonor = player.Location;

                player.Perfection = 0;
            }
        }
Beispiel #18
0
 public VirtueAchievement(VirtueName virtue, VirtueLevel level, TextDefinition name, TextDefinition description, int points, int unlocks)
     : base(name, description, points, unlocks)
 {
     Virtue = virtue;
     Level  = level;
 }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Pet.Deleted || !m_Pet.IsBonded || !m_Pet.IsDeadPet)
            {
                return;
            }

            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                if (m_Pet.Map == null || !m_Pet.Map.CanFit(m_Pet.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(503256);                       // You fail to resurrect the creature.
                    return;
                }
                else if (m_Pet.Region != null && m_Pet.Region.IsPartOf("Khaldun")) //TODO: Confirm for pets, as per Bandage's script.
                {
                    from.SendLocalizedMessage(1010395);                            // The veil of death in this area is too strong and resists thy efforts to restore life.
                    return;
                }

                m_Pet.PlaySound(0x214);
                m_Pet.FixedEffect(0x376A, 10, 16);
                m_Pet.ResurrectPet();

                #region SA
                if (m_Healer != null)
                {
                    int         toheal = 0;
                    VirtueLevel level  = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker: toheal = AOS.Scale(m_Pet.HitsMax, 5); break;

                    case VirtueLevel.Follower: toheal = AOS.Scale(m_Pet.HitsMax, 10); break;

                    case VirtueLevel.Knight: toheal = AOS.Scale(m_Pet.HitsMax, 20); break;
                    }

                    if (toheal > 200)
                    {
                        toheal = 200;
                    }

                    m_Pet.Hits = toheal;
                }
                #endregion

                double decreaseAmount;

                if (from == m_Pet.ControlMaster)
                {
                    decreaseAmount = 0.1;
                }
                else
                {
                    decreaseAmount = 0.2;
                }

                for (int i = 0; i < m_Pet.Skills.Length; ++i)                   //Decrease all skills on pet.
                {
                    m_Pet.Skills[i].Base -= decreaseAmount;
                }

                if (!m_Pet.IsDeadPet && m_HitsScalar > 0)
                {
                    m_Pet.Hits = (int)(m_Pet.HitsMax * m_HitsScalar);
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendMessage("Voce nao pode ressucitar aqui.");                       // Thou can not be resurrected there!
                    return;
                }

                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendMessage(string.Format("{0} de gold foi retirado do seu banco", m_Price.ToString()));                // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendMessage(string.Format("Voce ainda tem {0} de gold no banco.", Banker.GetBalance(from).ToString())); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendMessage("Voce nao tem dinheiro suficiente para pagar o curandeiro.");                               // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendMessage("Voce prefere ficar morto do que pagar isto!");                           // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker: from.Hits = AOS.Scale(from.HitsMax, 20); break;

                    case VirtueLevel.Follower: from.Hits = AOS.Scale(from.HitsMax, 40); break;

                    case VirtueLevel.Knight: from.Hits = AOS.Scale(from.HitsMax, 80); break;
                    }
                }

                if (m_FromSacrifice && from is PlayerMobile)
                {
                    ((PlayerMobile)from).AvailableResurrects -= 1;

                    Container pack   = from.Backpack;
                    Container corpse = from.Corpse;

                    if (pack != null && corpse != null)
                    {
                        List <Item> items = new List <Item>(corpse.Items);

                        for (int i = 0; i < items.Count; ++i)
                        {
                            Item item = items[i];

                            if (item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable)
                            {
                                pack.DropItem(item);
                            }
                        }
                    }
                }

                if (from.Fame > 0)
                {
                    int amount = from.Fame / 10;

                    Misc.Titles.AwardFame(from, -amount, true);
                }

                if (!Core.AOS && from.ShortTermMurders >= 5)
                {
                    double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0;                     // 5 to 15% loss

                    if (loss < 0.85)
                    {
                        loss = 0.85;
                    }
                    else if (loss > 0.95)
                    {
                        loss = 0.95;
                    }

                    if (from.RawStr * loss > 10)
                    {
                        from.RawStr = (int)(from.RawStr * loss);
                    }
                    if (from.RawInt * loss > 10)
                    {
                        from.RawInt = (int)(from.RawInt * loss);
                    }
                    if (from.RawDex * loss > 10)
                    {
                        from.RawDex = (int)(from.RawDex * loss);
                    }

                    for (int s = 0; s < from.Skills.Length; s++)
                    {
                        if (from.Skills[s].Base * loss > 35)
                        {
                            from.Skills[s].Base *= loss;
                        }
                    }
                }

                if (from.Alive && m_HitsScalar > 0)
                {
                    from.Hits = (int)(from.HitsMax * m_HitsScalar);
                }
            }
        }
Beispiel #21
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (ResurrectMessage.SilverSapling == m_Msg && 1 == info.ButtonID)
            {
                if (from is PlayerMobile pm && pm.Region.IsPartOf("Abyss"))
                {
                    pm.Location = pm.SSSeedLocation;
                    pm.Map      = pm.SSSeedMap;

                    if (null != pm.Corpse)
                    {
                        pm.Corpse.Location = pm.Location;
                        pm.Corpse.Map      = pm.Map;
                    }

                    pm.Resurrect();
                }

                return;
            }

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                    return;
                }

                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendLocalizedMessage(1060398, m_Price.ToString());                 // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString()); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020); // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019); // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker:
                        from.Hits = AOS.Scale(from.HitsMax, 20);
                        break;

                    case VirtueLevel.Follower:
                        from.Hits = AOS.Scale(from.HitsMax, 40);
                        break;

                    case VirtueLevel.Knight:
                        from.Hits = AOS.Scale(from.HitsMax, 80);
                        break;
                    }
                }

                if (m_FromSacrifice && from is PlayerMobile mobile)
                {
                    mobile.AvailableResurrects -= 1;

                    Container pack   = mobile.Backpack;
                    Container corpse = mobile.Corpse;

                    if (pack != null && corpse != null)
                    {
                        List <Item> items = new List <Item>(corpse.Items);

                        for (int i = 0; i < items.Count; ++i)
                        {
                            Item item = items[i];

                            if (item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable)
                            {
                                pack.DropItem(item);
                            }
                        }
                    }
                }

                if (m_Healer != from && m_Healer is PlayerMobile && from is PlayerMobile)
                {
                    SpiritualityVirtue.OnHeal(m_Healer, 50);
                }

                if (from.Fame > 0)
                {
                    int amount = from.Fame / 10;

                    Misc.Titles.AwardFame(from, -amount, true);
                }

                if (from.Alive && m_HitsScalar > 0)
                {
                    from.Hits = (int)(from.HitsMax * m_HitsScalar);
                }

                if (m_Callback != null)
                {
                    m_Callback(from);
                }
            }
        }
Beispiel #22
0
        public static void Valor(Mobile from, object targeted)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            IdolOfTheChampion idol = targeted 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
            {
                if (idol.Spawn.Active)
                {
                    if (idol.Spawn.Champion != null)
                    {
                        from.SendLocalizedMessage(1054038);                           // The Champion of this region has already been challenged!
                        return;
                    }

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

                    case 1:
                    {
                        needed   = 5000;
                        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(1054040);                           // You have lost some Valor.

                        // Your challenge is heard by the Champion of this region! Beware its wrath!
                        idol.PublicOverheadMessage(Network.MessageType.Regular, 0x3B2, 1054037, "");
                        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
                {
                    VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Valor);

                    if (level >= VirtueLevel.Knight)
                    {
                        idol.Spawn.Active = true;

                        if (idol.Spawn.RandomizeType)
                        {
                            switch (Utility.Random(5))
                            {
                            case 0:
                                idol.Spawn.Type = ChampionSpawnType.VerminHorde;
                                break;

                            case 1:
                                idol.Spawn.Type = ChampionSpawnType.UnholyTerror;
                                break;

                            case 2:
                                idol.Spawn.Type = ChampionSpawnType.ColdBlood;
                                break;

                            case 3:
                                idol.Spawn.Type = ChampionSpawnType.Abyss;
                                break;

                            case 4:
                                idol.Spawn.Type = ChampionSpawnType.Arachnid;
                                break;
                            }
                        }

                        // It's strange, but at OSI Valor not only activate spawn but also increase 2-4 levels on it.
                        // If counts of increased levels less than 4, champion spawn can be used with Valor again for advance level.
                        int candles = Utility.RandomMinMax(2, 4);
                        idol.Spawn.Level = candles;
                        if (candles > 3)
                        {
                            idol.Spawn.HasBeenAdvanced = true;
                        }

                        VirtueHelper.Atrophy(from, VirtueName.Valor, 11000);
                        from.SendLocalizedMessage(1054040);                           // You have lost some Valor.

                        // Your challenge is heard by the Champion of this region! Beware its wrath!
                        idol.PublicOverheadMessage(Network.MessageType.Regular, 0x3B2, 1054037, "");
                    }
                    else
                    {
                        from.SendLocalizedMessage(1054036);                           // You must be a Knight of Valor to summon the champion's spawn in this manner!
                    }
                }
            }
        }
Beispiel #23
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!
                    }
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391);                       // Thou can not be resurrected there!
                    return;
                }

                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendLocalizedMessage(1060398, m_Price.ToString());                               // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString());               // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020);                               // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019);                           // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);

                from.Resurrect();

                Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0);

                Effects.SendMovingParticles(new Entity(0, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                Effects.SendMovingParticles(new Entity(0, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                Effects.SendMovingParticles(new Entity(0, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100);

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker:
                        from.Hits = AOS.Scale(from.HitsMax, 20);
                        break;

                    case VirtueLevel.Follower:
                        from.Hits = AOS.Scale(from.HitsMax, 40);
                        break;

                    case VirtueLevel.Knight:
                        from.Hits = AOS.Scale(from.HitsMax, 80);
                        break;
                    }
                }

                Mobile m = from;

                Misc.Titles.AwardFame(from, -100, true);                   // TODO: Proper fame loss

                if (!Core.AOS && from.ShortTermMurders >= 5)
                {
                    double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0;                 //5 to 15% loss
                    if (loss < 0.85)
                    {
                        loss = 0.85;
                    }
                    else if (loss > 0.95)
                    {
                        loss = 0.95;
                    }

                    if (from.RawStr * loss > 10)
                    {
                        from.RawStr = (int)(from.RawStr * loss);
                    }
                    if (from.RawInt * loss > 10)
                    {
                        from.RawInt = (int)(from.RawInt * loss);
                    }
                    if (from.RawDex * loss > 10)
                    {
                        from.RawDex = (int)(from.RawDex * loss);
                    }

                    for (int s = 0; s < from.Skills.Length; s++)
                    {
                        if (from.Skills[s].Base * loss > 35)
                        {
                            from.Skills[s].Base *= loss;
                        }
                    }
                }
            }
        }