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 #2
0
        public void Target(Mobile m)
        {
            //STARTMOD
            if (m is BaseCreature)
            {
                BaseCreature m_Pet = (BaseCreature)m;

                if (m_Pet.IsDeadBondedPet)
                {
                    m_Pet.PlaySound(0x214);
                    m_Pet.FixedEffect(0x376A, 10, 16);
                    m_Pet.ResurrectPet();
                    Misc.Titles.AwardFame(Caster, 500, true);
                    return;
                }
            }
            //ENDMOD

            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m == Caster)
            {
                Caster.SendLocalizedMessage(501039);                   // Thou can not resurrect thyself.
            }
            else if (!Caster.Alive)
            {
                Caster.SendLocalizedMessage(501040);                   // The resurrecter must be alive.
            }
            else if (m.Alive)
            {
                Caster.SendLocalizedMessage(501041);                   // Target is not dead.
            }
            else if (!Caster.InRange(m, 1))
            {
                Caster.SendLocalizedMessage(501042);                   // Target is not close enough.
            }
            else if (!m.Player)
            {
                Caster.SendLocalizedMessage(501043);                   // Target is not a being.
            }
            else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
            {
                Caster.SendLocalizedMessage(501042);              // Target can not be resurrected at that location.
                m.SendLocalizedMessage(502391);                   // Thou can not be resurrected there!
            }
            else if (m.Region != null && m.Region.Name == "Khaldun")
            {
                Caster.SendLocalizedMessage(1010395);                   // The veil of death in this area is too strong and resists thy efforts to restore life.
            }
            else if (CheckBSequence(m, true))
            {
                SpellHelper.Turn(Caster, m);

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

                TAVUtilities.FindCorpse(m);

                if (Caster is TeiravonMobile)
                {
                    TeiravonMobile TAV = (TeiravonMobile)Caster;

                    int expTo = m.HitsMax * TAV.PlayerLevel / 2;

                    if (TAV.HasFeat(TeiravonMobile.Feats.HealersOath))
                    {
                        expTo *= 3;
                    }

                    if (Misc.Titles.AwardExp(TAV, expTo))
                    {
                        TAV.SendMessage("You have gained {0} experience.", expTo);
                    }
                    Misc.Titles.AwardFame(Caster, (int)(m.Fame * .1), true);
                }

                m.Resurrect();
                Misc.Titles.AwardFame(m, -(int)(m.Fame * .1), true);
            }

            FinishSequence();
        }