Beispiel #1
0
        public SplinteringWeaponContext(Mobile from, Mobile defender, Item weapon)
            : base(from, defender, weapon, EffectsType.Splintering, TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(4))
        {
            StartForceWalk(defender);

            if (Core.EJ)
            {
                if (!(defender is PlayerMobile) || !IsBleedImmune(defender))
                {
                    BleedAttack.BeginBleed(defender, from, true);
                    AddBleedImmunity(defender);
                }
            }
            else
            {
                BleedAttack.BeginBleed(defender, from, true);
            }

            defender.SendLocalizedMessage(1112486); // A shard of the brittle weapon has become lodged in you!
            from.SendLocalizedMessage(1113077);     // A shard of your blade breaks off and sticks in your opponent!

            Server.Effects.PlaySound(defender.Location, defender.Map, 0x1DF);

            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.SplinteringEffect, 1154670, 1152144, TimeSpan.FromSeconds(10), defender));
        }
Beispiel #2
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentMove(attacker);

            // Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
            TransformContext context = TransformationSpellHelper.GetContext(defender);

            if ((context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell))) ||
                (defender is BaseCreature && ((BaseCreature)defender).BleedImmune))
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159);               // Your target is bleeding!
            defender.SendLocalizedMessage(1060160);               // You are bleeding!

            if (defender is PlayerMobile)
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                   // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BleedAttack.BeginBleed(defender, attacker, (AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.BloodDrinker) != 0));
        }
Beispiel #3
0
        public SplinteringWeaponContext(Mobile from, Mobile defender, Item weapon)
            : base(from, defender, weapon, EffectsType.Splintering, TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(4))
        {
            StartForceWalk(defender);
            BleedAttack.BeginBleed(defender, from, true);

            defender.SendLocalizedMessage(1112486); // A shard of the brittle weapon has become lodged in you!
            Server.Effects.PlaySound(from.Location, from.Map, 0x1DF);

            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.SplinteringEffect, 1154670, 1152144, TimeSpan.FromSeconds(10), defender));
        }
        public static MedKitContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970);                   // MedKits cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (patient.Poisoned || BleedAttack.IsBleeding(patient))
            {
                healer.SendMessage("You cannot do that right now.");
            }
            else if (!patient.Alive)
            {
                healer.SendMessage("It's too late for them.");
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds  = 10;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                MedKitContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                seconds *= 1000;

                context = new MedKitContext(healer, patient, TimeSpan.FromMilliseconds(seconds));

                m_Table[healer] = context;

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name);                       //  : Attempting to heal you.
                }
                healer.SendMessage("You begin working on the patient...");
                return(context);
            }

            return(null);
        }
Beispiel #5
0
        private static int GetPoisonStrength(Mobile patient)
        {
            if (BleedAttack.IsBleeding(patient))
            {
                return(3);
            }

            if (patient.Poisoned)
            {
                return(patient.Poison.Level);
            }

            return(0);
        }
Beispiel #6
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (attacker != null && defender != null)
            {
                // No special effects 90% of the time for players
                if (attacker.Player && attacker.AccessLevel == AccessLevel.Player && Utility.RandomDouble() < 0.90)
                {
                    return;
                }

                // Always bleed.
                if (!BleedAttack.IsBleeding(defender))
                {
                    // Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
                    TransformContext context = TransformationSpellHelper.GetContext(defender);

                    if ((context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell))) ||
                        (defender is BaseCreature && ((BaseCreature)defender).BleedImmune))
                    {
                        return;
                    }
                    else if (defender is PlayerMobile)
                    {
                        defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                           // You are bleeding profusely
                        defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name);         // ~1_NAME~ is bleeding profusely
                    }

                    defender.PlaySound(0x133);
                    defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

                    BleedAttack.BeginBleed(defender, attacker, true);
                }

                // 20% chance of Mortal Strike, costs 10 stam each use but cannot be used if you have < 80 stam.
                if (Utility.RandomDouble() > 0.80 && attacker.Stam > 79 && !MortalStrike.IsWounded(defender))
                {
                    MortalStrike.BeginWound(defender, TimeSpan.FromSeconds(6.0));

                    attacker.SendLocalizedMessage(1060086);                       // You deliver a mortal wound!
                    defender.SendLocalizedMessage(1060087);                       // You have been mortally wounded!

                    defender.PlaySound(0x1E1);
                    defender.FixedParticles(0x37B9, 244, 25, 9944, 31, 0, EffectLayer.Waist);

                    attacker.Stam -= 15;
                }
            }
        }
Beispiel #7
0
        public void CheckPoisonOrBleed()
        {
            bool bleeding = BleedAttack.IsBleeding(m_Patient) || SplinteringWeaponContext.IsBleeding(m_Patient);
            bool poisoned = m_Patient.Poisoned;

            if (bleeding || poisoned)
            {
                double healing = m_Healer.Skills[SkillName.Healing].Value;
                double anatomy = m_Healer.Skills[SkillName.Anatomy].Value;
                double chance  = ((healing + anatomy) - 120) * 25;

                if (poisoned)
                {
                    chance /= m_Patient.Poison.RealLevel * 20;
                }
                else
                {
                    chance /= 3 * 20;
                }

                if (chance >= Utility.Random(100))
                {
                    m_HealedPoisonOrBleed = poisoned ? m_Patient.Poison.RealLevel : 3;

                    if (poisoned && m_Patient.CurePoison(m_Healer))
                    {
                        m_Patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.
                    }
                    else
                    {
                        if (BleedAttack.IsBleeding(m_Patient))
                        {
                            BleedAttack.EndBleed(m_Patient, false);
                        }
                        else
                        {
                            SplinteringWeaponContext.EndBleeding(m_Patient, false);
                        }

                        m_Patient.SendLocalizedMessage(1060088); // You bind the wound and stop the bleeding
                        m_Patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
                    }
                }
            }
        }
Beispiel #8
0
        public void AttemptMidlifeCure()
        {
            if (m_Bandage == null || !m_Bandage.AttemptsMidlifeCure)
            {
                return;
            }

            if (m_Healer != m_Patient || !m_Healer.Alive || !m_Healer.IsPlayer)
            {
                return;
            }

            SkillName primarySkill   = GetPrimarySkill(m_Patient, m_Healer);
            SkillName secondarySkill = GetSecondarySkill(m_Patient, m_Healer);

            double healing = m_Healer.Skills[primarySkill].Value;
            double anatomy = m_Healer.Skills[secondarySkill].Value;

            if (healing >= 80.0 && anatomy >= 80.0)
            {
                int poisonStrength = GetPoisonStrength(m_Patient);
                if (poisonStrength > 0)
                {
                    double chance = (healing + anatomy - 120) * 25 / (poisonStrength * 2000);
                    if (chance > Utility.RandomDouble())
                    {
                        if (BleedAttack.IsBleeding(m_Patient))
                        {
                            m_Patient.SendLocalizedMessage(1060167);                               // The bleeding wounds have healed, you are no longer bleeding!

                            BleedAttack.EndBleed(m_Patient, message: false);
                        }
                        else if (m_Patient.Poisoned && m_Patient.CurePoison(m_Healer))
                        {
                            m_Patient.SendLocalizedMessage(1010059);                               // You have been cured of all poisons.
                        }

                        m_AmountDivisor = poisonStrength;
                    }
                }
            }
        }
Beispiel #9
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient, bool enhanced)
        {
            bool isDeadPet = patient is BaseCreature && ((BaseCreature)patient).IsDeadPet;

            if (patient is IRepairableMobile)
            {
                healer.SendLocalizedMessage(500970); // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951); // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955); // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                var delay = GetDelay(healer, patient);

                if (patient is PlayerMobile)
                {
                    BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1002082, 1151400, delay, healer, string.Format("{0}", patient.Name)));
                }
                else
                {
                    BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Veterinary, 1002167, 1151400, delay, healer, string.Format("{0}", patient.Name)));
                }

                context = new BandageContext(healer, patient, delay, enhanced);

                m_Table[healer] = context;

                if (healer != patient)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name); //  : Attempting to heal you.
                }

                healer.SendLocalizedMessage(500956); // You begin applying the bandages.

                if (healer.NetState != null && healer.NetState.IsEnhancedClient)
                {
                    healer.NetState.Send(new BandageTimerPacket((int)delay.TotalSeconds));
                }

                return(context);
            }

            return(null);
        }
Beispiel #10
0
        public void EndHeal()
        {
            StopHeal();
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(Healer, Patient);
            SkillName secondarySkill = GetSecondarySkill(Healer, Patient);

            BaseCreature petPatient = Patient as BaseCreature;
            int          patientNumber;
            int          healerNumber;

            if (!Healer.Alive)
            {
                healerNumber  = 500962; // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!Healer.InRange(Patient, Bandage.Range))
            {
                healerNumber  = 500963; // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = Healer.Skills[primarySkill].Value;
                double anatomy = Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == Healer) ||
                    (Engines.VvV.ViceVsVirtueSystem.Enabled && petPatient is Server.Engines.VvV.VvVMount && petPatient.ControlMaster == Healer))
                //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (Patient.Map == null || !Patient.Map.CanFit(Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042; // Target can not be resurrected at that location.
                        patientNumber = 502391; // Thou can not be resurrected there!
                    }
                    else if (Patient.Region != null && Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965; // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 1049658; // The owner has been asked to sanctify the resurrection.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                var friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 1049658; // The owner has been asked to sanctify the resurrection.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049659; // Neither the owner or friends of the pet are nearby to sanctify the resurrection.
                                }
                            }
                        }
                        else
                        {
                            Patient.CloseGump(typeof(ResurrectGump));
                            Patient.SendGump(new ResurrectGump(Patient, Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256; // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966; // You are unable to resurrect your patient.
                    }

                    patientNumber = -1;
                }
            }
            else if (Patient.Poisoned)
            {
                Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                double healing = Healer.Skills[primarySkill].Value;
                double anatomy = Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (Patient.Poison.RealLevel * 0.1) - (Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (Patient.CurePoison(Healer))
                    {
                        healerNumber  = (Healer == Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                            // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060; // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(Patient))
            {
                healerNumber  = 1060088; // You bind the wound and stop the bleeding
                patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(Patient, false);
            }
            else if (MortalStrike.IsWounded(Patient))
            {
                healerNumber  = (Healer == Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (Patient.Hits == Patient.HitsMax)
            {
                healerNumber  = 500967; // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = Healer.Skills[primarySkill].Value;
                double anatomy = Healer.Skills[secondarySkill].Value;

                FirstAidBelt belt = Healer.FindItemOnLayer(Layer.Waist) as FirstAidBelt;

                if (belt != null)
                {
                    HealingBonus += belt.HealingBonus;
                }

                Item item = Healer.FindItemOnLayer(Layer.TwoHanded);

                if (item is Asclepius || item is GargishAsclepius)
                {
                    HealingBonus += 15;
                }

                if (HealingBonus > 0)
                {
                    healing += HealingBonus;
                }

                double chance = ((healing + 10.0) / 100.0) - (Slips * 0.02);

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969; // You finish applying the bandages.

                    double min, max;

                    if (Core.AOS)
                    {
                        min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                        max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
                    }
                    else
                    {
                        min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                        max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                    }

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (Patient.Body.IsMonster || Patient.Body.IsAnimal)
                    {
                        toHeal += Patient.HitsMax / 100;
                    }

                    if (Core.AOS)
                    {
                        toHeal -= toHeal * Slips * 0.35; // TODO: Verify algorithm
                    }
                    else
                    {
                        toHeal -= Slips * 4;
                    }

                    #region City Loyalty
                    if (Server.Engines.CityLoyalty.CityLoyaltySystem.HasTradeDeal(Healer, Engines.CityLoyalty.TradeDeal.GuildOfHealers))
                    {
                        toHeal += (int)Math.Ceiling(toHeal * 0.05);
                    }
                    #endregion

                    if (HealedPoisonOrBleed > 0)
                    {
                        toHeal /= HealedPoisonOrBleed;
                    }

                    if (SearingWounds.IsUnderEffects(Patient))
                    {
                        toHeal /= 2;
                        Patient.SendLocalizedMessage(1151178); // The cauterized wound resists some of your healing.
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968; // You apply the bandages, but they barely help.
                    }
                    else if (Patient != Healer && Patient is PlayerMobile && Healer is PlayerMobile)
                    {
                        SpiritualityVirtue.OnHeal(Healer, Math.Min((int)toHeal, Patient.HitsMax - Patient.Hits));
                    }

                    Patient.Heal((int)toHeal, Healer, false);
                }
                else
                {
                    healerNumber = 500968; // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }

            if (Patient is PlayerMobile)
            {
                BuffInfo.RemoveBuff(Healer, BuffIcon.Healing);
            }
            else
            {
                BuffInfo.RemoveBuff(Healer, BuffIcon.Veterinary);
            }
        }
Beispiel #11
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970);                   // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendAsciiMessage("That being is not damaged!");
                //healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendAsciiMessage("Target cannot be resurrected at that location.");
                //healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    if (Core.AOS)
                    {
                        seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10));                         // TODO: Verify algorithm
                    }
                    else
                    {
                        seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                    }
                }
                else
                {
                    if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary)
                    {
                        //if ( dex >= 40 )
                        seconds = 2.0;
                        //else
                        //	seconds = 3.0;
                    }
                    else
                    {
                        if (dex >= 100)
                        {
                            seconds = 3.0 + resDelay;
                        }
                        else if (dex >= 40)
                        {
                            seconds = 4.0 + resDelay;
                        }
                        else
                        {
                            seconds = 5.0 + resDelay;
                        }
                    }
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                if ((patient.LastHealTime + TimeSpan.FromMinutes(3.0)) < DateTime.Now)
                {
                    patient.LastHealTime = DateTime.Now;
                    context = new BandageContext(healer, patient, TimeSpan.FromSeconds(/*seconds*/ 0.0));
                }
                else
                {
                    healer.SendAsciiMessage("This being cannot be newly bandaged yet.");
                }

                m_Table[healer] = context;

                /*if ( !onSelf )
                 * patient.SendAsciiMessage(String.Format("{0} : Attempting to heal you.", healer.Name));*/
                //patient.SendLocalizedMessage( 1008078, false, healer.Name ); //  : Attempting to heal you.

                //healer.SendAsciiMessage("You begin applying the bandages.");
                //healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
Beispiel #12
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                m_Healer.SendAsciiMessage("You were unable to finish your work before you died.");
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                m_Healer.SendAsciiMessage("You did not stay close enough to heal your target.");
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Core.SE && petPatient is Factions.FactionWarHorse && petPatient.ControlMaster == m_Healer))                        //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        m_Healer.SendAsciiMessage("Target can not be resurrected at that location.");
                        m_Patient.SendAsciiMessage("Thou can not be resurrected there!");
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395;                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        m_Healer.SendAsciiMessage("You are able to resurrect your patient.");
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && master.InRange(petPatient, 3))
                            {
                                m_Healer.SendAsciiMessage("You are able to resurrect the creature.");
                                healerNumber = 503255;                                 // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        m_Healer.SendAsciiMessage("You are able to resurrect the creature.");
                                        healerNumber = 503255;                                         // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    m_Healer.SendAsciiMessage("The pet's owner must be nearby to attempt resurrection.");
                                }
                                //healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
                            }
                        }
                        else
                        {
                            m_Patient.CantWalk = true;
                            m_Patient.CloseGump(typeof(ResurrectGump));

                            if (m_Patient is PlayerMobile && !((PlayerMobile)m_Patient).HasMenu)
                            {
                                ((PlayerMobile)m_Patient).HasMenu = true;
                                m_Patient.SendMenu(new ResurrectGump(m_Patient, m_Healer));
                            }
                            //m_Patient.SendGump( new ResurrectGump( m_Patient, m_Healer ) );
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        m_Healer.SendAsciiMessage("You fail to resurrect the creature.");
                        healerNumber = 503256; // You fail to resurrect the creature.
                    }
                    else
                    {
                        m_Healer.SendAsciiMessage("You are unable to resurrect your patient.");
                        healerNumber = 500966; // You are unable to resurrect your patient.
                    }

                    patientNumber = -1;
                }
            }

            /*else if ( m_Patient.Poisoned )
             * {
             * m_Healer.SendAsciiMessage("You finish applying the bandages.");
             *      //m_Healer.SendLocalizedMessage( 500969 ); // You finish applying the bandages.
             *
             *      double healing = m_Healer.Skills[primarySkill].Value;
             *      double anatomy = m_Healer.Skills[secondarySkill].Value;
             *      double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);
             *
             *      if ( (checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble() )
             *      {
             *              if ( m_Patient.CurePoison( m_Healer ) )
             *              {
             * m_Healer.SendAsciiMessage("You have cured the target of all poisons.");
             * m_Patient.SendAsciiMessage("You have been cured of all poisons.");
             *                      healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
             *                      patientNumber = 1010059; // You have been cured of all poisons.
             *              }
             *              else
             *              {
             *                      healerNumber = -1;
             *                      patientNumber = -1;
             *              }
             *      }
             *      else
             *      {
             * m_Healer.SendAsciiMessage("You have failed to cure your target!");
             *              healerNumber = 1010060; // You have failed to cure your target!
             *              patientNumber = -1;
             *      }
             * }*/
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088;                // You bind the wound and stop the bleeding
                patientNumber = 1060167;                // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else
            {
                checkSkills = true;

                int    CurrHP = m_Patient.Hits;
                int    MaxHP  = m_Patient.Str;
                int    Damage = MaxHP - CurrHP;
                double toHeal = 1;

                if ((m_Healer.Skills[primarySkill].Value * 10) >= (Damage * 1000 / MaxHP))
                {
                    toHeal = (Damage * (50 + m_Healer.Skills[primarySkill].Value / 2)) / 100;
                }

                if (toHeal <= 1)
                {
                    m_Healer.SendAsciiMessage("You apply the bandages, but they barely help.");
                }
                else
                {
                    m_Healer.SendAsciiMessage("You apply the bandages.");
                }

                m_Patient.Heal((int)toHeal, m_Healer, false);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(primarySkill, 0.0, 100.0);
            }
        }
Beispiel #13
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (m_Talisman == null || m_Talisman.Deleted)
                {
                    return;
                }

                Mobile target = o as Mobile;

                if (from.Talisman != m_Talisman)
                {
                    from.SendLocalizedMessage(502641);                       // You must equip this item to use it.
                }
                else if (target == null)
                {
                    from.SendLocalizedMessage(1046439);                       // That is not a valid target.
                }
                else if (m_Talisman.ChargeTime > 0)
                {
                    from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString());                       // You must wait ~1_val~ seconds for this to recharge.
                }
                else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0)
                {
                    from.SendLocalizedMessage(1042544);                       // This item is out of charges.
                }
                else
                {
                    switch (m_Talisman.Removal)
                    {
                    case TalismanRemoval.Curse:
                        target.PlaySound(0xF6);
                        target.PlaySound(0x1F7);
                        target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                        IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map);
                        IEntity mto   = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map);
                        Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                        StatMod mod;

                        mod = target.GetStatMod("[Magic] Str Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Str Offset");
                        }

                        mod = target.GetStatMod("[Magic] Dex Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Dex Offset");
                        }

                        mod = target.GetStatMod("[Magic] Int Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Int Offset");
                        }

                        target.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(target);
                        StrangleSpell.RemoveCurse(target);
                        CorpseSkinSpell.RemoveCurse(target);
                        CurseSpell.RemoveEffect(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                        target.SendLocalizedMessage(1072408);                                   // Any curses on you have been lifted

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072409);                                       // Your targets curses have been lifted
                        }
                        break;

                    case TalismanRemoval.Damage:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        BleedAttack.EndBleed(target, true);
                        MortalStrike.EndWound(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                        BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                        target.SendLocalizedMessage(1072405);                                   // Your lasting damage effects have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072406);                                       // Your Targets lasting damage effects have been removed!
                        }
                        break;

                    case TalismanRemoval.Ward:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        MagicReflectSpell.EndReflect(target);
                        ReactiveArmorSpell.EndArmor(target);
                        ProtectionSpell.EndProtection(target);

                        target.SendLocalizedMessage(1072402);                                   // Your wards have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072403);                                       // Your target's wards have been removed!
                        }
                        break;

                    case TalismanRemoval.Wildfire:
                        // TODO
                        break;
                    }

                    m_Talisman.OnAfterUse(from);
                }
            }
Beispiel #14
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            if (Healer is Player)
            {
                ((Player)Healer).EoC++;
            }

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (petPatient is BaseMount && ((BaseMount)petPatient).IsInjured)
            {
                if (Healer.Skills.Veterinary.Value < 100.0)
                {
                    Healer.SendMessage("You are not skilled enough to even attempt helping this animal..");
                    return;
                }

                else
                {
                    List <Item> healerItems  = Healer.Backpack.AcquireItems();
                    bool        hasSewingKit = false;

                    for (int i = 0; i < healerItems.Count || hasSewingKit; i++)
                    {
                        if (healerItems[i] is SewingKit)
                        {
                            hasSewingKit = true;
                        }
                    }

                    if (!hasSewingKit)
                    {
                        Healer.SendMessage("You require a sewing kit to mend the damage done to this creature.");
                    }

                    else
                    {
                        if (Utility.RandomDouble() < 0.1125)
                        {
                            petPatient.Kill();
                            Healer.SendMessage("Your efforts to assist the creature leads to its demise.");
                        }

                        else
                        {
                            ((BaseMount)petPatient).IsInjured = false;
                            Healer.SendMessage
                                ("You sucessfully mend the creature's injuries with bandages and thread.");
                        }
                    }
                }
            }

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962; // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963; // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042; // Target can not be resurrected at that location.
                        patientNumber = 502391; // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965; // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255; // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 503255; // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256; // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966; // You are unable to resurrect your patient.
                    }
                    patientNumber = -1;
                }
            }
            //else if( m_Patient.Poisoned )
            //{
            //    m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

            //    double healing = m_Healer.Skills[primarySkill].Value;
            //    double anatomy = m_Healer.Skills[secondarySkill].Value;
            //    double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);

            //    if( (checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble() )
            //    {
            //        if( m_Patient.CurePoison(m_Healer) )
            //        {
            //            //healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
            //            //patientNumber = 1010059; // You have been cured of all poisons.
            //        }
            //        else
            //        {
            //            healerNumber = -1;
            //            patientNumber = -1;
            //        }
            //    }
            //    else
            //    {
            //        healerNumber = 1010060; // You have failed to cure your target!
            //        patientNumber = -1;
            //    }
            //}
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088; // You bind the wound and stop the bleeding
                patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, true);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967; // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969; // You finish applying the bandages.

                    double toHeal = (((anatomy + healing) * 0.10) + Utility.RandomMinMax(0, 4));

                    if (m_Healer is Player)
                    {
                        Player player = m_Healer as Player;
                        Medic  med    = Perk.GetByType <Medic>(player);

                        if (med != null && med.IsDoctor())
                        {
                            toHeal = (toHeal * 1.5);
                        }
                    }

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    if (Core.AOS)
                    {
                        toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm
                    }
                    else
                    {
                        toHeal -= m_Slips * 4;
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968; // You apply the bandages, but they barely help.
                    }

                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968; // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 100.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 100.0);
            }
        }
Beispiel #15
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient, Bandage origin)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970);                   // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits >= patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendAsciiMessage("That being is not damaged!");
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042);                   // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                //Maka
                if (healer is PlayerMobile)
                {
                    ((PlayerMobile)healer).WeaponTimerCheck();
                }

                healer.RevealingAction();

                if (patient.Player)
                {
                    healer.DoBeneficial(patient);
                }

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                //double seconds;
                double bandageDelay = (patient.Alive ? 2.5 : 0.0);

                /*
                 *              if ( onSelf )
                 *              {
                 *                  if ( Core.AOS )
                 *                      seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm
                 *                  else
                 *                      seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                 *              }
                 *              else
                 *              {
                 *                  if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
                 *                  {
                 *                      seconds = 2.0;
                 *                  }
                 *                                      else if ( Core.AOS )
                 *                      {
                 *                              if (dex < 204)
                 *                              {
                 *                                      seconds = 3.2-(Math.Sin((double)dex/130)*2.5) + resDelay;
                 *                              }
                 *                              else
                 *                              {
                 *                                      seconds = 0.7 + resDelay;
                 *                              }
                 *                      }
                 *                  else
                 *                  {
                 *                      if ( dex >= 100 )
                 *                          seconds = 3.0 + resDelay;
                 *                      else if ( dex >= 40 )
                 *                          seconds = 4.0 + resDelay;
                 *                     else
                 *                          seconds = 5.0 + resDelay;
                 *                  }
                 *              }
                 */
                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                //seconds *= 1000;
                //context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds));

                context = new BandageContext(healer, patient, TimeSpan.FromSeconds(bandageDelay), origin);

                m_Table[healer] = context;

                healer.SendAsciiMessage(string.Format("You put the clean bandages on the wounded {0}.", patient.Name));
                return(context);
            }

            return(null);
        }
Beispiel #16
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            //vira para quem vai curar
            SpellHelper.Turn(healer, patient);

            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970);                   // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955);                   // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042);                   // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    if (Core.AOS)
                    {
                        seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10));                         // TODO: Verify algorithm
                    }
                    else
                    {
                        seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                    }
                }
                else
                {
                    if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary)
                    {
                        //if ( dex >= 40 )
                        seconds = 2.0;
                        //else
                        //	seconds = 3.0;
                    }
                    else
                    {
                        if (dex >= 100)
                        {
                            seconds = 3.0 + resDelay;
                        }
                        else if (dex >= 40)
                        {
                            seconds = 4.0 + resDelay;
                        }
                        else
                        {
                            seconds = 5.0 + resDelay;
                        }
                    }
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds));

                m_Table[healer] = context;

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name);                       //  : Attempting to heal you.
                }
                //mensagens
                if (patient.Alive)
                {
                    healer.Emote("*{0} esta tratando os ferimentos de {1}*", healer.Name, patient.Name);
                    if (healer.Body.Type == BodyType.Human && !healer.Mounted)
                    {
                        healer.Animate(10, 5, 1, true, false, 0);
                        healer.PlaySound(72);
                    }
                }
                else
                {
                    healer.Emote("*{0} esta estancando os ferimentos de {1}*", healer.Name, patient.Name);
                    if (healer.Body.Type == BodyType.Human && !healer.Mounted)
                    {
                        healer.Animate(10, 5, 4, true, false, 0);
                        healer.PlaySound(72);
                    }
                }

                healer.SendLocalizedMessage(500956);   // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
Beispiel #17
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient, bool enhanced) // TODO: Implement Pub 71 healing changes
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is IRepairableMobile)
            {
                healer.SendLocalizedMessage(500970); // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951); // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !SplinteringWeaponContext.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955); // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    if (Core.AOS)
                    {
                        seconds = Math.Min(8, Math.Ceiling(11.0 - healer.Dex / 20));
                        seconds = Math.Max(seconds, 4);
                    }
                    else
                    {
                        seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                    }
                }
                else
                {
                    if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary)
                    {
                        seconds = 2.0;
                    }
                    else if (Core.AOS)
                    {
                        seconds = Math.Ceiling((double)4 - healer.Dex / 60);
                        seconds = Math.Max(seconds, 2);
                    }
                    else
                    {
                        if (dex >= 100)
                        {
                            seconds = 3.0 + resDelay;
                        }
                        else if (dex >= 40)
                        {
                            seconds = 4.0 + resDelay;
                        }
                        else
                        {
                            seconds = 5.0 + resDelay;
                        }
                    }
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                if (patient is PlayerMobile)
                {
                    BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1002082, 1151400, TimeSpan.FromSeconds(seconds), healer, String.Format("{0}", patient.Name)));
                }
                else
                {
                    BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Veterinary, 1002167, 1151400, TimeSpan.FromSeconds(seconds), healer, String.Format("{0}", patient.Name)));
                }

                seconds *= 1000;

                context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds), enhanced);

                m_Table[healer] = context;

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name); //  : Attempting to heal you.
                }

                healer.SendLocalizedMessage(500956); // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
Beispiel #18
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient, Bandage bandage)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is BaseCreature && ((BaseCreature)patient).IsGolem)
            {
                // Bandages cannot be used on that.
                healer.SendLocalizedMessage(500970);
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                // You cannot heal that.
                healer.SendLocalizedMessage(500951);
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                // That being is not damaged!
                healer.SendLocalizedMessage(500955);
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                // Target cannot be resurrected at that location.
                healer.SendLocalizedMessage(501042);
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    seconds = 5 + (0.5 * ((double)(120 - dex) / 10));                            // TODO: Verify algorithm
                }
                else
                {
                    if (GetPrimarySkill(patient, healer) == SkillName.Veterinary)
                    {
                        seconds = 2;
                    }
                    else
                    {
                        seconds = 4 - ((double)(dex / 60)) + resDelay;
                    }
                }

                if (seconds < 1)
                {
                    seconds = 1;
                }

                if (seconds > 8)
                {
                    seconds = 8;
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.RefreshTimer(TimeSpan.FromSeconds(seconds));
                }
                else
                {
                    m_Table[healer] = context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds), bandage);
                }

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name);                       //  : Attempting to heal you.
                }
                if (healer.Client != null)
                {
                    healer.Client.Send(new CooldownInfo(bandage, (int)seconds));
                }

                BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1151311, 1151400, TimeSpan.FromSeconds(seconds), healer, patient.Name));

                healer.SendLocalizedMessage(500956);                   // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
Beispiel #19
0
        public void EndHeal()
        {
            m_Table.Remove(m_Healer);

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

            m_Timer = null;

            if (m_Bandage != null)
            {
                m_Bandage.OnHealFinished(this);
            }

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient, m_Healer);
            SkillName secondarySkill = GetSecondarySkill(m_Patient, m_Healer);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (m_Patient is BaseMount && m_Healer == (Mobile)petPatient.ControlMaster && (((BaseMount)m_Patient).ItemID == 16047 || ((BaseMount)m_Patient).ItemID == 16048 || ((BaseMount)m_Patient).ItemID == 16049 || ((BaseMount)m_Patient).ItemID == 16050))
                {
                    healerNumber  = 503255;                    // You are able to resurrect the creature.
                    patientNumber = -1;

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

                    petPatient.ControlMaster.CloseGump(typeof(PetResurrectGump));

                    if (petPatient.ControlMaster == m_Healer)
                    {
                        petPatient.ResurrectPet();

                        for (int i = 0; i < petPatient.Skills.Length; ++i)                           // Decrease all skills on pet.
                        {
                            petPatient.Skills[i].Base -= 0.1;
                        }
                    }
                    else
                    {
                        petPatient.ControlMaster.SendGump(new PetResurrectGump(m_Healer, petPatient));
                    }
                }
                else if ((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.Name == "Khaldun")
                    {
                        healerNumber  = 1010395;                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255;                                 // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));

                                if (master == m_Healer)
                                {
                                    petPatient.ResurrectPet();

                                    for (int i = 0; i < petPatient.Skills.Length; ++i)                                       // Decrease all skills on pet.
                                    {
                                        petPatient.Skills[i].Base -= 0.1;
                                    }
                                }
                                else
                                {
                                    master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                                }
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 503255;                                         // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));

                                        if (friend == m_Healer)
                                        {
                                            petPatient.ResurrectPet();
                                        }
                                        else
                                        {
                                            friend.SendGump(new PetResurrectGump(m_Healer, petPatient));
                                        }

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670;                                     // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256;                         // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966;                         // You are unable to resurrect your patient.
                    }
                    patientNumber = -1;
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969);                   // You finish applying the bandages.

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060;                    // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088;                // You bind the wound and stop the bleeding
                patientNumber = 1060167;                // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967;                // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                if (m_Bandage != null)
                {
                    healing += m_Bandage.HealingBonus;
                }

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969;                     // You finish applying the bandages.

                    double min, max;

                    if (m_Patient.IsPlayer)
                    {
                        min = (anatomy / 6.0) + (healing / 6.0) + 3.0;
                        max = (anatomy / 6.0) + (healing / 3.0) + 10.0;
                    }
                    else
                    {
                        min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                        max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                    }

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    toHeal -= toHeal * m_Slips * (0.35 + Math.Max(0, 140 - m_Healer.Dex) / 400.0);                         // TODO: Verify algorithm

                    if (m_AmountDivisor > 1)
                    {
                        toHeal /= m_AmountDivisor;
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968;                         // You apply the bandages, but they barely help.
                    }

                    int healedPoints = (int)toHeal;

                    Server.Spells.Spellweaving.ArcaneEmpowermentSpell.ApplyHealBonus(m_Healer, ref healedPoints);

                    m_Patient.Heal(healedPoints, m_Healer, message: false);
                }
                else
                {
                    healerNumber = 500968;                     // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }
        }
Beispiel #20
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970); // Bandages cannot be used on that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955); // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    //if( Core.AOS )

                    seconds = 4 + (0.5 * ((double)(120 - dex) / 10));

                    Item handOne = healer.FindItemOnLayer(Layer.OneHanded);
                    Item handTwo = healer.FindItemOnLayer(Layer.TwoHanded);

                    bool freeHand = handOne == null; if (!freeHand)
                    {
                        freeHand = handTwo == null;
                    }

                    if (!freeHand)
                    {
                        seconds++;
                    }

                    //else
                    //    seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                }

                else
                {
                    if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary)
                    {
                        if (dex >= 40)
                        {
                            seconds = 2.0;
                        }
                        else
                        {
                            seconds = 3.0;
                        }
                    }

                    else
                    {
                        if (dex >= 100)
                        {
                            seconds = 2.0 + resDelay;
                        }

                        else if (dex >= 75)
                        {
                            seconds = 3.0 + resDelay;
                        }

                        else
                        {
                            seconds = 4.0 + resDelay;
                        }
                    }
                }

                if (healer.Player)
                {
                    Medic med = Perk.GetByType <Medic>((Player)healer);

                    if (med != null)
                    {
                        seconds -= med.GetHealTimeBonus(seconds);
                    }
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds));

                m_Table[healer] = context;

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name); //  : Attempting to heal you.
                }
                healer.SendLocalizedMessage(500956);                           // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
Beispiel #21
0
        public void Target(BaseTalisman talis, Mobile owner, Mobile m)
        {
            if (this.Parent == owner)
            {
                //Curse Removal
                if (talis.m_TalismanType == TalismanType.CurseRemoval)
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Malus");
                    }

                    mod = m.GetStatMod("[Magic] Dex Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Malus");
                    }

                    mod = m.GetStatMod("[Magic] Int Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Malus");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072409);               // Your targets curses have been lifted
                    }
                    m.SendLocalizedMessage(1072408);                       // Any curses on you have been lifted
                }

                //Damage Removal
                if (talis.m_TalismanType == TalismanType.DamageRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);
                    BleedAttack.EndBleed(m, false);
                    MortalStrike.EndWound(m);
                    m.CurePoison(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Bleed);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072406);               // Your Targets lasting damage effects have been removed!
                    }
                    m.SendLocalizedMessage(1072405);                       // Your lasting damage effects have been removed!
                }

                //Ward Removal
                if (talis.m_TalismanType == TalismanType.WardRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);

                    ProtectionSpell.RemoveWard(m);
                    ReactiveArmorSpell.RemoveWard(m);
                    MagicReflectSpell.RemoveWard(m);
                    TransformationSpell.RemoveContext(m, true);
                    ReaperFormSpell.RemoveEffects(m);
                    if (StoneFormSpell.UnderEffect(m))
                    {
                        StoneFormSpell.RemoveEffects(m);
                    }

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072403);               // Your target's wards have been removed!
                    }
                    m.SendLocalizedMessage(1072402);                       // Your wards have been removed!
                }

                //Wildfire Removal
                if (talis.m_TalismanType == TalismanType.WildfireRemoval)
                {
                    owner.SendLocalizedMessage(1042753, "Wildfire Removal");                       // ~1_SOMETHING~ has been temporarily disabled.
                }
                //CARGE TIMER
                ChargeTimeLeft = 1200;
                m_ChargeTimer  = new ChargeTimeLeftTimer(this);
                m_ChargeTimer.Start();
                m_ChargeTimeLeft3 = DateTime.Now;
            }
            else if (m_TalismanType != 0)
            {
                m.SendLocalizedMessage(502641);                   // You must equip this item to use it.
            }
        }
Beispiel #22
0
        public void EndHeal()
        {
            StopHeal();

            int healerNumber;
            int patientNumber;

            bool playSound = true;
            bool checkRes  = false;
            bool checkPois = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            var petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.GetRange(m_Healer.Expansion)))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                //TODO: Dbl check doesn't check for faction of the horse here?
                if (((checkRes = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (m_Patient.EraSE && petPatient is FactionWarHorse && petPatient.ControlMaster == m_Healer))
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395;                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && m_Healer == master)
                            {
                                petPatient.ResurrectPet();

                                foreach (Skill s in petPatient.Skills)
                                {
                                    double skillloss = s.Base * 0.01;
                                    s.Base -= skillloss;
                                }
                                Conquests.CheckProgress <ResConquest>(m_Healer as PlayerMobile, petPatient);
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255;                                 // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                Conquests.CheckProgress <ResConquest>(m_Healer as PlayerMobile, petPatient);
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (!friend.InRange(petPatient, 3))
                                    {
                                        continue;
                                    }

                                    healerNumber = 503255;                                     // You are able to resurrect the creature.

                                    friend.CloseGump(typeof(PetResurrectGump));
                                    friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                    found = true;
                                    Conquests.CheckProgress <ResConquest>(m_Healer as PlayerMobile, petPatient);
                                    break;
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670;                                     // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));

                            /*PlayerMobile pres = m_Patient as PlayerMobile;
                             *
                             * if (pres.MurderBounty > 0)
                             *      m_Patient.SendGump( new ResurrectGump( m_Patient, m_Healer, pres.MurderBounty ) );
                             * else*/
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                            Conquests.CheckProgress <ResConquest>(m_Healer as PlayerMobile, petPatient);
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256;                         // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966;                         // You are unable to resurrect your patient.
                    }

                    patientNumber = -1;
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969);                 // You finish applying the bandages.

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);

                if ((checkPois = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060;                    // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088;                // You bind the wound and stop the bleeding
                patientNumber = 1060167;                // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967;                // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969;                     // You finish applying the bandages.

                    double min = (anatomy / 5.5) + (healing / 5.5) + 4.0;
                    double max = (anatomy / 5.0) + (healing / 2.5) + 10.0;

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if ((m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal) && m_Patient.NetState == null)
                    // Alan Mod: player-controlled mobs heal like regular players
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    toHeal -= m_Slips * 4;

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968;                         // You apply the bandages, but they barely help.
                    }

                    var healfinal = (int)toHeal;

                    int healmessage = Math.Min(m_Patient.HitsMax - m_Patient.Hits, healfinal);

                    m_Patient.Heal(healfinal, m_Healer, false);

                    if (healmessage > 0)
                    {
                        m_Patient.PrivateOverheadMessage(
                            MessageType.Regular, 0x42, false, healmessage.ToString(CultureInfo.InvariantCulture), m_Patient.NetState);
                        if (m_Healer != m_Patient)
                        {
                            m_Patient.PrivateOverheadMessage(
                                MessageType.Regular, 0x42, false, healmessage.ToString(CultureInfo.InvariantCulture), m_Healer.NetState);
                        }
                    }
                }
                else
                {
                    healerNumber = 500968;                     // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            double minSkill = 0.0;
            double maxSkill = 90.0;

            if (checkRes)
            {
                minSkill = 65.0;
                maxSkill = 120.0;
            }
            else if (checkPois)
            {
                minSkill = 45.0;
                maxSkill = 120.0;
            }

            m_Healer.CheckSkill(secondarySkill, minSkill, maxSkill);
            m_Healer.CheckSkill(primarySkill, minSkill, maxSkill);
        }
Beispiel #23
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Core.SE && petPatient is Factions.FactionWarHorse && petPatient.ControlMaster == m_Healer))                        //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395;                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && m_Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255;                                 // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 503255;                                         // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670;                                     // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256;                         // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966;                         // You are unable to resurrect your patient.
                    }
                    patientNumber = -1;
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969);                   // You finish applying the bandages.

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060;                    // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088;                // You bind the wound and stop the bleeding
                patientNumber = 1060167;                // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967;                // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                #region Heritage Items
                healing += EnhancedBandage.HealingBonus;
                #endregion

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969;                     // You finish applying the bandages.

                    double min, max;

                    if (Core.AOS)
                    {
                        min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                        max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
                    }
                    else
                    {
                        min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                        max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                    }

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    if (Core.AOS)
                    {
                        toHeal -= toHeal * m_Slips * 0.35;                         // TODO: Verify algorithm
                    }
                    else
                    {
                        toHeal -= m_Slips * 4;
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968;                         // You apply the bandages, but they barely help.
                    }

                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968;                     // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }
        }
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, MedKit.Range))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive)
            {
                m_Healer.SendMessage("They collapsed before you could finish your work.");
                playSound = false;
            }
            else if (MortalStrike.IsWounded(m_Patient) || m_Patient.Poisoned || BleedAttack.IsBleeding(m_Patient))
            {
                m_Healer.SendMessage("You're going to need to ask them to sit still!");
                playSound = false;
            }
            else
            {
                SkillName primarySkill   = SkillName.Healing;
                SkillName secondarySkill = SkillName.Anatomy;

                checkSkills = true;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                int amount = 0;

                if (anatomy == 100.0)
                {
                    amount = 5;
                }
                else if (anatomy >= 80.0)
                {
                    amount = 4;
                }
                else if (anatomy >= 60)
                {
                    amount = 3;
                }
                else if (anatomy >= 40)
                {
                    amount = 2;
                }
                else
                {
                    amount = 1;
                }

                if (chance > Utility.RandomDouble())
                {
                    ((PlayerMobile)m_Patient).InjuryPoints -= amount;

                    if (((PlayerMobile)m_Patient).InjuryPoints < 0)
                    {
                        ((PlayerMobile)m_Patient).InjuryPoints = 0;
                    }

                    m_Patient.SendMessage("They finish patching you up.");
                    m_Healer.SendMessage("You finish treating the patient.");
                }
                else
                {
                    m_Healer.SendMessage("You have a go at them, but seem to make things worse.");
                    ((PlayerMobile)m_Patient).InjuryPoints += 1;
                    playSound = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }
        }
Beispiel #25
0
        public void EndHeal(Bandage origin)
        {
            StopHeal();

            if (m_Healer is PlayerMobile)
            {
                ((PlayerMobile)m_Healer).WeaponTimerCheck();
            }

            int  healerNumber  = -1;
            int  patientNumber = -1;
            bool checkSkills   = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber = 500962;                 // You were unable to finish your work before you died.
            }
            else if (m_Healer.Paralyzed)
            {
                m_Healer.SendAsciiMessage("You were unable to finish your work before you got paralyzed");
                return;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber = 500963;                 // You did not stay close enough to heal your target.
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) || (Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == m_Healer))
                //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber = 501042;                         // Target can not be resurrected at that location.
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber = 1010395;
                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                    }
                    else
                    {
                        healerNumber = 500965;                         // You are able to resurrect your patient.

                        m_Patient.FixedEffect(0x376A, 10, 16);

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && m_Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255;                                 // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 503255;                                         // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670;                                     // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256;                         // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966;                         // You are unable to resurrect your patient.
                    }
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 40.0) / 50.0) - (m_Patient.Poison.Level * 0.11) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060; // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber = (m_Healer == m_Patient ? 1005000 : 1010398);
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber = 500967;                 // You heal what little damage your patient had.
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;
                Bandage bandage = null;

                if (origin.Parent == null && !origin.Deleted)
                {
                    origin.Consume(1);
                }
                else if ((bandage = m_Healer.Backpack.FindItemByType(typeof(Bandage), true) as Bandage) == null)
                {
                    m_Healer.SendAsciiMessage("You don't have any bandages.");
                    return;
                }
                else
                {
                    bandage.Consume(1);
                }

                double healing = m_Healer.Skills[primarySkill].Base;
                double anatomy = m_Healer.Skills[secondarySkill].Base;

                //Loki edit: Dexterity improves healing chance
                double chance = (healing / 100.0) * (0.91 + (((double)m_Healer.RawDex - 80.0) / 1000.0));

                if (chance > Utility.RandomDouble())
                {
                    double min, max;

                    min = 0.04 * ((anatomy / 4.0) + (healing / 4.0));
                    max = ((anatomy / 4.0) + (healing / 4.0)) - 4;

                    //Loki edit: Bonus from dexterity
                    double dexbonus = ((double)m_Healer.RawDex - 80.0) / 10.0;
                    min += dexbonus;
                    max += dexbonus / 2;

                    if (max < 2)
                    {
                        max = 2;
                    }

                    double toHeal = Utility.RandomMinMax((int)min, (int)max);

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968;                         // You apply the bandages, but they barely help.
                    }
                    else if ((!origin.Deleted && (!origin.EventItem || (origin.EventItem && origin.EventItemConsume))) || (bandage != null && (!bandage.EventItem || (bandage.EventItem && bandage.EventItemConsume))))
                    {
                        Item item = new BloodyBandage();

                        if (origin.EventItem || (bandage != null && bandage.EventItem))
                        {
                            item.EventItem = true;
                            item.Hue       = origin.Hue;
                            item.Name      = "event Bloody bandage";
                        }

                        Mobile from = m_Healer;

                        if (from.AddToBackpack(item))
                        {
                            from.SendAsciiMessage("You put the {0} in your pack.", item.Name ?? CliLoc.LocToString(item.LabelNumber));
                        }
                        else //Taran: Bloody bandages stack on ground if the player is overweight
                        {
                            from.SendAsciiMessage("You are overweight and put the {0} on the ground.", item.Name ?? CliLoc.LocToString(item.LabelNumber));

                            IPooledEnumerable eable = from.Map.GetItemsInRange(from.Location, 0);

                            foreach (Item i in eable)
                            {
                                if (i is BloodyBandage)
                                {
                                    if (i.Serial != item.Serial)
                                    {
                                        i.Amount++;
                                        item.Delete();
                                    }

                                    break;
                                }
                            }

                            eable.Free();
                        }
                    }
                    else if (!origin.Deleted && (origin.EventItem && !origin.EventItemConsume))
                    {
                        Mobile from = m_Healer;

                        from.PlaySound(0x57);
                        from.SendAsciiMessage("You are able to re-use your bandage and put it in your pack.");
                    }

                    //m_Patient.Heal( (int)toHeal );
                    //Rev ~ 140 update
                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968;                     // You apply the bandages, but they barely help.
                }
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }

            if (healerNumber != -1)
            {
                m_Healer.SendAsciiMessage(CliLoc.LocToString(healerNumber));
            }
            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }
            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 100.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 100.0);
            }
        }
Beispiel #26
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            //não pode estar montado
            if (m_Healer.Mounted)
            {
                m_Healer.SendMessage("Voce esta montando, e nao pode curar os ferimentos assim.");
            }
            else if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if ((!m_Healer.InRange(m_Patient, Bandage.Range) && m_Patient.Alive) || (!m_Healer.InRange(m_Patient.Corpse, Bandage.Range) && !m_Patient.Alive))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                curarPacienteMorto(ref healerNumber, ref patientNumber, ref checkSkills, primarySkill, secondarySkill, petPatient);
            }
            else if (m_Patient.Poisoned)
            {
                curarPacienteEnvenenado(ref healerNumber, ref patientNumber, ref checkSkills, primarySkill, secondarySkill);
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088;                // You bind the wound and stop the bleeding
                patientNumber = 1060167;                // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967;                // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                curarPaciente(ref healerNumber, ref patientNumber, ref playSound, ref checkSkills, primarySkill, secondarySkill);
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }
        }
Beispiel #27
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
            {
                return;
            }

            attacker.PlaySound( 0x5BC ); // Bladeweave sound effect
            attacker.FixedParticles( 0x376A, 1, 20, 0x7F5, 0x960, 0x3, EffectLayer.Waist ); // TODO: Revisar efecto

            switch ( Utility.RandomMinMax( 1, 7 ) )
            {
                case 1:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Paralyzing Blow" ); // You weave your blade to execute a ~1_attack~.
                        ParalyzingBlow at = new ParalyzingBlow();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 2:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Bleed Attack" ); // You weave your blade to execute a ~1_attack~.
                        BleedAttack at = new BleedAttack();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 3:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Double Strike" ); // You weave your blade to execute a ~1_attack~.
                        DoubleStrike at = new DoubleStrike();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 4:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Feint" ); // You weave your blade to execute a ~1_attack~.
                        Feint at = new Feint();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 5:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Mortal Strike" ); // You weave your blade to execute a ~1_attack~.
                        MortalStrike at = new MortalStrike();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 6:
                    {
                        attacker.SendLocalizedMessage( 1072841, "block" ); // You weave your blade to execute a ~1_attack~.
                        Block at = new Block();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 7:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Crushing Blow" ); // You weave your blade to execute a ~1_attack~.
                        CrushingBlow at = new CrushingBlow();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
            }
        }
Beispiel #28
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970);                   // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955);                   // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042);                   // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    seconds = 14 - ((healer.Skills.Healing.Value / 10)) + resDelay;

                    if (seconds < 1)
                    {
                        seconds = 1;
                    }
                }
                else
                {
                    if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary)
                    {
                        //if ( dex >= 40 )
                        seconds = 3.0;
                        //else
                        //	seconds = 3.0;
                    }
                    else
                    {
                        seconds = 10 - ((healer.Skills.Healing.Value / 10)) + resDelay;

                        if (seconds < 1)
                        {
                            seconds = 1;
                        }
                    }
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }

                context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds));

                if (DateTime.Now + TimeSpan.FromSeconds(seconds) > healer.NextCombatTime)
                {
                    healer.NextCombatTime = (DateTime.Now + TimeSpan.FromSeconds(seconds));
                }

                m_Table[healer] = context;

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name); //  : Attempting to heal you.
                }
                healer.SendLocalizedMessage(500956);                           // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
            protected override void OnTarget(Mobile from, object o)
            {
                if (!(o is Mobile))
                {
                    from.SendLocalizedMessage(1046439);                       // That is not a valid target.
                    return;
                }

                Mobile target = (Mobile)o;

                switch (m_Talisman.Removal)
                {
                case TalismanRemoval.Curse:
                    target.PlaySound(0xF6);
                    target.PlaySound(0x1F7);
                    target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map);
                    IEntity mto   = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map);
                    Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    StatMod mod;

                    mod = target.GetStatMod("[Magic] Str Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        target.RemoveStatMod("[Magic] Str Offset");
                    }

                    mod = target.GetStatMod("[Magic] Dex Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        target.RemoveStatMod("[Magic] Dex Offset");
                    }

                    mod = target.GetStatMod("[Magic] Int Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        target.RemoveStatMod("[Magic] Int Offset");
                    }

                    target.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(target);
                    StrangleSpell.RemoveCurse(target);
                    CorpseSkinSpell.RemoveCurse(target);
                    CurseSpell.RemoveEffect(target);

                    BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                    if (target == from)
                    {
                        from.SendLocalizedMessage(1072408);                                   // Any curses on you have been lifted
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072409);                                   // Your targets curses have been lifted
                        target.SendLocalizedMessage(1072408);                                 // Any curses on you have been lifted
                    }

                    break;

                case TalismanRemoval.Damage:
                    target.PlaySound(0x201);
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                    BleedAttack.EndBleed(target, false);
                    MortalStrike.EndWound(target);

                    BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                    BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                    if (target == from)
                    {
                        from.SendLocalizedMessage(1072405);                                   // Your lasting damage effects have been removed!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072406);                                   // Your Targets lasting damage effects have been removed!
                        target.SendLocalizedMessage(1072405);                                 // Your lasting damage effects have been removed!
                    }

                    break;

                case TalismanRemoval.Ward:
                    target.PlaySound(0x201);
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                    // Magic reflect
                    Hashtable m_Table = MagicReflectSpell.m_Table;

                    if (m_Table == null)
                    {
                        return;
                    }

                    ResistanceMod[] mods = (ResistanceMod[])m_Table[target];

                    m_Table.Remove(target);

                    if (mods != null)
                    {
                        for (int i = 0; i < mods.Length; ++i)
                        {
                            target.RemoveResistanceMod(mods[i]);
                        }
                    }

                    BuffInfo.RemoveBuff(target, BuffIcon.MagicReflection);


                    // Reactive armor
                    m_Table = ReactiveArmorSpell.m_Table;

                    if (m_Table == null)
                    {
                        return;
                    }

                    mods = (ResistanceMod[])m_Table[target];

                    if (mods != null)
                    {
                        m_Table.Remove(target);

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            target.RemoveResistanceMod(mods[i]);
                        }
                    }

                    BuffInfo.RemoveBuff(target, BuffIcon.ReactiveArmor);


                    // Protection
                    m_Table = ProtectionSpell.m_Table;

                    if (m_Table == null)
                    {
                        return;
                    }

                    object[] pmods = (object[])m_Table[target];

                    if (mods != null)
                    {
                        m_Table.Remove(target);
                        ProtectionSpell.Registry.Remove(target);

                        target.RemoveResistanceMod((ResistanceMod)pmods[0]);
                        target.RemoveSkillMod((SkillMod)pmods[1]);
                    }

                    BuffInfo.RemoveBuff(target, BuffIcon.Protection);

                    if (target == from)
                    {
                        from.SendLocalizedMessage(1072402);                                   // Your wards have been removed!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1072403);                                   // Your target's wards have been removed!
                        target.SendLocalizedMessage(1072402);                                 // Your wards have been removed!
                    }

                    break;
                }

                m_Talisman.ChargeTime = m_Talisman.MaxChargeTime;

                if (m_Talisman.Charges > 0)
                {
                    m_Talisman.Charges -= 1;
                }

                m_Talisman.StartTimer();
                m_Talisman.InvalidateProperties();
            }
Beispiel #30
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient, bool enhanced)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970);                   // Bandages cannot be used on that.
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955);                   // That being is not damaged!
            }
            else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false)))
            {
                healer.SendLocalizedMessage(501042);                   // Target cannot be resurrected at that location.
            }
            else if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

                bool onSelf = (healer == patient);
                int  dex    = healer.Dex;

                double seconds;
                double resDelay = (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    if (Core.AOS)
                    {
                        seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10));                         // TODO: Verify algorithm
                    }
                    else
                    {
                        seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                    }
                }
                else
                {
                    if (Core.AOS && GetPrimarySkill(patient) == SkillName.Veterinary)
                    {
                        seconds = 2.0;
                    }
                    else if (Core.AOS)
                    {
                        if (dex < 204)
                        {
                            seconds = 3.2 - (Math.Sin((double)dex / 130) * 2.5) + resDelay;
                        }
                        else
                        {
                            seconds = 0.7 + resDelay;
                        }
                    }
                    else
                    {
                        if (dex >= 100)
                        {
                            seconds = 3.0 + resDelay;
                        }
                        else if (dex >= 40)
                        {
                            seconds = 4.0 + resDelay;
                        }
                        else
                        {
                            seconds = 5.0 + resDelay;
                        }
                    }
                }

                BandageContext context = GetContext(healer);

                if (context != null)
                {
                    context.StopHeal();
                }
                seconds *= 1000;

                context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds), enhanced);

                m_Table[healer] = context;

                if (!onSelf)
                {
                    patient.SendLocalizedMessage(1008078, false, healer.Name); //  : Attempting to heal you.
                }
                healer.SendLocalizedMessage(500956);                           // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;

                if (checkSkills = (healing >= 50.0 && anatomy >= 50.0))
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395;                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        m_Patient.CloseGump(typeof(ResurrectGump));
                        m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256;                         // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966;                         // You are unable to resurrect your patient.
                    }
                    patientNumber = -1;
                }
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967;                // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969;                     // You finish applying the bandages.

                    double min, max;

                    min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                    max = (anatomy / 5.0) + (healing / 2.0) + 10.0;

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    toHeal -= m_Slips * 4;

                    if (m_Patient.Poisoned)
                    {
                        toHeal /= 2;

                        double poisonCureChance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);

                        if (poisonCureChance > Utility.RandomDouble())
                        {
                            if (m_Patient.CurePoison(m_Healer))
                            {
                                m_Healer.SendMessage("You have cured the target of all poisons.");
                                m_Patient.SendMessage("You have been cured of all poisons.");
                            }
                        }
                        else
                        {
                            m_Healer.SendMessage("You have failed to cure your target.");
                        }
                    }

                    if (BleedAttack.IsBleeding(m_Patient))
                    {
                        toHeal /= 2;

                        m_Healer.SendMessage("You bind the wound and stop the bleeding.");
                        m_Patient.SendMessage("The bleeding wounds have healed, you are no longer bleeding!");

                        BleedAttack.EndBleed(m_Patient, false);
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968;                         // You apply the bandages, but they barely help.
                    }

                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968;                     // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }
        }