コード例 #1
0
        public override bool DoEffect(Mobile from, Mobile target)
        {
            if (!target.Hidden && from.InLOS(target) && target.Alive && from.CanBeBeneficial(target))
            {
                from.DoBeneficial(target);
                SpellHelper.Turn(from, target);

                Effects.SendLocationParticles(EffectItem.Create(new Point3D(target.X, target.Y, target.Z + 16), target.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045);
                target.PlaySound(0x3C4);

                target.Hidden = true;

                InvisibilitySpell.RemoveTimer(target);

                Timer t = new InvisibilitySpell.InternalTimer(target, TimeSpan.FromSeconds(30 + Utility.Random(91)));
                t.Start();
                InvisibilitySpell.m_Table[target] = t;

                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        public override bool DoEffect(Mobile from, Mobile target)
        {
            if (!SpellHelper.HasStatEffect(from, m_Stat) && from.InLOS(target) && target.Alive && from.CanBeBeneficial(target))
            {
                from.DoBeneficial(target);
                SpellHelper.Turn(from, target);

                if (m_Stat != StatType.All)
                {
                    SpellHelper.AddStatBonus(null, target, m_Stat);
                }
                else
                {
                    SpellHelper.AddStatBonus(null, target, StatType.Str); SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatBonus(null, target, StatType.Dex);
                    SpellHelper.AddStatBonus(null, target, StatType.Int); SpellHelper.DisableSkillCheck = false;
                }

                target.FixedParticles(m_EffIID, m_EffSpd, m_Dur, m_Eff, m_ELayer);
                target.PlaySound(m_Snd);

                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        protected override void OnBeforeThrownAt(Mobile from, TMobile target)
        {
            if (from == null || from.Deleted || target == null || target.Deleted)
            {
                return;
            }

            if (target.Alive && Heals)
            {
                from.DoBeneficial(target);
            }

            if (target.Alive && Damages)
            {
                from.DoHarmful(target);
            }

            base.OnBeforeThrownAt(from, target);
        }
コード例 #5
0
        public override bool DoEffect(Mobile from, Mobile target)
        {
            if (from.CanBeBeneficial(target) && target.Alive && from.Alive && from.InLOS(target) && !ProtectionSpell.Registry.ContainsKey(target))
            {
                from.DoBeneficial(target);
                SpellHelper.Turn(from, target);

                int val = Utility.Random(5) + 6;

                target.VirtualArmorMod += val;
                ProtectionSpell.Registry.Add(target, val);
                new ProtectionSpell.InternalTimer(TimeSpan.FromSeconds(60), target, val).Start();

                target.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist);
                target.PlaySound(0x1F7);

                return(true);
            }

            return(false);
        }
コード例 #6
0
        public override bool DoEffect(Mobile from, Mobile target)
        {
            if (target.Alive && target.Hits < target.HitsMax && from.CanBeBeneficial(target) && from.CanSee(target) && from.InLOS(target))
            {
                from.DoBeneficial(target);
                SpellHelper.Turn(from, target);

                int toHeal = Utility.RandomMinMax(m_Min, m_Max);
                if (from != target && from.NetState != null)
                {
                    from.NetState.Send(new MessageLocalizedAffix(Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (target.Hits + toHeal > target.HitsMax ? target.HitsMax - target.Hits : toHeal).ToString(), ""));
                }
                target.Heal(toHeal);

                target.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                target.PlaySound(0x202);
                return(true);
            }

            return(false);
        }
コード例 #7
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951); // You cannot heal that.
            }
            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !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 = AOS.GeneralTimeScaling * (patient.Alive ? 0.0 : 5.0);

                if (onSelf)
                {
                    //seconds = AOS.GeneralTimeScaling * (9.4 + (0.6 * ((double)(120 - dex) / 10)));
                    seconds = 10.0 + (100 - (healer.Skills[SkillName.Soins].Value)) / 10;
                }
                else
                {
                    /*if (dex > 150)
                     *  dex = 150;
                     *
                     * seconds = AOS.GeneralTimeScaling * (0.6 * ((double)(150 - dex) / 9));*/
                    seconds = 4.0 + (100 - (healer.Skills[SkillName.Soins].Value)) / 10;
                }

                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.GetNameUsedBy(patient)); //  : Attempting to heal you.
                }
                healer.SendLocalizedMessage(500956);                                             // You begin applying the bandages.
                return(context);
            }

            return(null);
        }
コード例 #8
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);
        }
コード例 #9
0
ファイル: Bandage.cs プロジェクト: Grimoric/RunUO.T2A
		public static BandageContext BeginHeal( Mobile healer, Mobile patient )
		{
			bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );

			if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
			{
				healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
			}
			else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !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 = 9.4 + (0.6 * ((double)(120 - dex) / 10));
				}
				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 ) );

				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;
		}
コード例 #10
0
ファイル: Bandage.cs プロジェクト: zerodowned/kaltar
        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);
        }
コード例 #11
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);
        }
コード例 #12
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);
        }
コード例 #13
0
ファイル: Bandage.cs プロジェクト: phpjunkie420/RunUO
        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);
        }
コード例 #14
0
			public static void CURE(
				TriggerObject trigObj, IPoint2D target, Mobile from, int range, bool playeronly, bool mobsonly)
			{
				if (target == null)
				{
					return;
				}

				// apply the damage to all mobs within range if range is > 0
				Map map = (target is IEntity) ? ((IEntity)target).Map : Map.Felucca;
				Mobile targetMob = target as Mobile;

				// if it's a death trigger, then don't do damage to trigObj.This (if you do, it results in an infinite loop!)
				Mobile dyingMob = (trigObj.TrigName == TriggerName.onDeath ? trigObj.This as Mobile : null);

				if (range >= 0)
				{
					var rangelist = map.GetMobilesInRange(new Point3D(target, 0), range);
					// don't do damage in a list like this--if mobs are killed it screws up the enumerator!
					// ... copy the list first
					var affected = new List<Mobile>();

					affected.AddRange(
						rangelist.OfType<Mobile>()
								 .Where(p => p.Alive && (p is PlayerMobile && !mobsonly) || (p is BaseCreature && !playeronly)));

					rangelist.Free();

					foreach (Mobile mob in affected.Where(mob => mob != dyingMob))
					{
						if (from != null)
						{
							if (from.CanBeBeneficial(mob))
							{
								from.DoBeneficial(mob);
								mob.CurePoison(from);
							}
						}
						else
						{
							mob.CurePoison(mob);
						}
					}
				} // range of -1 means hit only the target
				else if ((targetMob is PlayerMobile && !mobsonly) || (targetMob is BaseCreature && !playeronly))
				{
					if (targetMob.Alive && targetMob != dyingMob)
					{
						if (from != null)
						{
							if (from.CanBeBeneficial(targetMob))
							{
								from.DoBeneficial(targetMob);
								targetMob.CurePoison(from);
							}
						}
						else
						{
							targetMob.CurePoison(targetMob);
						}
					}
				}
			}
コード例 #15
0
        public void OnTarget(Mobile from, object targeted)
        {
            if (this.Deleted || this.Amount <= 0)
            {
                return;
            }

            Mobile targ = targeted as Mobile;

            if (from.NextSkillTime > DateTime.Now)
            {
                from.SendSkillMessage();                 // You must wait...
            }
            else if (targ == null || targ.Deleted || !targ.Alive || !(targ.Body.IsHuman || targ.Body.IsAnimal || targ.Body.IsSea || (targ is BaseCreature && ((BaseCreature)targ).Controled && !((BaseCreature)targ).Summoned)))
            {
                // you can heal anything tamable... I guess.
                from.SendLocalizedMessage(500951);                   // You cannot heal that.
            }
            else if (!from.InRange(targ, 3))
            {
                from.SendLocalizedMessage(500295);                     // You are too far away to do that.
            }
            else if (Notoriety.Compute(from, targ) == Notoriety.Enemy) // || Server.Misc.NotorietyHandlers.CheckAggressor( from.Aggressors, targ ) || Server.Misc.NotorietyHandlers.CheckAggressed( from.Aggressed, targ ) )
            {
                from.SendAsciiMessage("You cannot heal them right now.");
            }
            else if (!from.CanSee(targ) || !from.InLOS(targ))
            {
                from.SendAsciiMessage("You can't see that.");
            }
            else if (targ.Hits >= targ.HitsMax)
            {
                from.SendLocalizedMessage(500955);                   // That being is not damaged!
            }
            else if (!targ.CanBeginAction(typeof(Bandage)) || !from.CanBeBeneficial(targ, true, true))
            {
                from.SendAsciiMessage("This being cannot be newly bandaged yet.");
            }
            else
            {
                from.DoBeneficial(targ);
                from.RevealingAction();

                this.Consume();

                int       damage = targ.HitsMax - targ.Hits;
                int       sk     = damage * 100 / targ.HitsMax;
                int       healed = 1;
                SkillName skill  = GetSkillFor(targ);
                if (from.CheckSkill(skill, sk - 25.0, sk + 25.0))
                {
                    targ.PlaySound(0x57);

                    double scale = (75.0 + from.Skills[skill].Value - sk) / 100.0;
                    if (scale > 1.0)
                    {
                        scale = 1.0;
                    }
                    else if (scale < 0.5)
                    {
                        scale = 0.5;
                    }
                    healed = (int)(damage * scale);

                    if (healed < 1)
                    {
                        healed = 1;
                    }
                    else if (healed > 100)
                    {
                        healed = 100;
                    }
                }

                targ.Hits += healed;
                if (healed > 1)
                {
                    from.SendAsciiMessage("You apply the bandages.");
                }
                else
                {
                    from.SendAsciiMessage("You apply the bandages, but they barely help.");
                }

                targ.BeginAction(typeof(Bandage));
                new BandageExpire(targ).Start();
            }
        }
コード例 #16
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);
        }
コード例 #17
0
ファイル: Bandage.cs プロジェクト: FreeReign/imaginenation
		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;
		}
コード例 #18
0
ファイル: Bandage.cs プロジェクト: nydehi/divinity
        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 seconds  = patient.Alive ? (patient.Poisoned ? 6.0 : 5.0) : 10.0;
                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//was: seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                    {
                        seconds *= 3;

                        if (healer.Skills[SkillName.Healing].Value > 90)
                        {
                            seconds -= 3.0 * ((healer.Skills[SkillName.Healing].Value - 90.0) / 10.0);
                        }
                    }
                }

                /*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;
                 *      }
                 * }*/

                // according to stratics:
                // dex | heal self | heal other | cure self | cure other
                // 100 |   11s     |   3s       |   13      |  4
                seconds *= 0.74 + ((double)(100 - dex) / 75) * 0.26;


                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);
        }
コード例 #19
0
ファイル: Bandage.cs プロジェクト: greeduomacro/UO-Forever
		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);
				double poisonDelay = (patient.Poisoned ? ((100.0 - healer.Skills[SkillName.Poisoning].Value) / 40.0) : 0.0);
				int dex = healer.Dex;

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

				if (onSelf)
				{
					/*if (healer.EraAOS)
					{
						seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10));
					}
					else
					{
						seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
					}*/

					seconds = 10.0 + ((100 - dex) / 18.75) + poisonDelay;
				}
				else
				{
					/*if (healer.EraAOS && GetPrimarySkill(patient) == SkillName.Veterinary)
					{
						seconds = 2.0;
					}
					else if (healer.EraAOS)
					{
						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;
						}
					}*/

					seconds = 3.0 + ((100 - dex) / 37.5) + resDelay + poisonDelay;
				}

				BandageContext context = GetContext(healer);

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

				//seconds *= 1000;

				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;
		}
コード例 #20
0
ファイル: Bandage.cs プロジェクト: proxeeus/RunUO.T2A
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            if (!patient.Poisoned && patient.Hits == patient.HitsMax)
            {
                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 = 9.4 + 0.6 * ((double)(120 - dex) / 10);
                }
                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));

                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);
        }
コード例 #21
0
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadFollower);

            PlayerMobile playerPatient = patient as PlayerMobile;

            if (patient is Golem)
            {
                healer.SendLocalizedMessage(500970); // Bandages cannot be used on that.
                return(null);
            }

            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendLocalizedMessage(500951); // You cannot heal that.
                return(null);
            }

            else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !isDeadPet)
            {
                healer.SendLocalizedMessage(500955); // That being is not damaged!
                return(null);
            }

            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.
                return(null);
            }

            if (healer.CanBeBeneficial(patient, true, true))
            {
                healer.DoBeneficial(patient);

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

                double seconds;
                double resDelay = 0;

                if (!patient.Alive)
                {
                    resDelay += 5;
                }

                if (onSelf)
                {
                    seconds = SkillCooldown.HealingSelfCooldown;
                }

                else
                {
                    seconds = SkillCooldown.HealingOtherCooldown + resDelay;
                }

                BandageContext context = GetContext(healer);

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

                double rapidTreatmentValue = healer.GetSpecialAbilityEntryValue(SpecialAbilityEffect.RapidTreatment);

                if (rapidTreatmentValue > 0)
                {
                    seconds *= rapidTreatmentValue;
                }

                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);
        }
コード例 #22
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 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) && !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.Ceiling((double)11 - 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();
				}
				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;
		}
コード例 #23
0
ファイル: Bandage.cs プロジェクト: greeduomacro/hubroot
        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 = 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;
                    }
                }

                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;
        }
コード例 #24
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);
        }
コード例 #25
0
ファイル: Bandage.cs プロジェクト: Jascen/UOSmart
		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 // Old
                        seconds = 5.0 + (0.5 * ((double)(90 - dex) / 10)); // New
                        if (seconds < 2.0)
                            seconds = 2.0;
                    }
					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;
						}
					}
                }
                BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1071289, 1002082, TimeSpan.FromSeconds(seconds), healer));
                if (healer != patient)
                    BuffInfo.AddBuff(patient, new BuffInfo(BuffIcon.Incognito, 1071289, 1002082, TimeSpan.FromSeconds(seconds), patient));
                // Healing = 1002082
                // BandageSelf = 1076227
                // * Bandages = 1078821
                // Bandage Self = 1114306
                // Bandage Selected Target = 1114307

                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;
		}
コード例 #26
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);
        }
コード例 #27
0
ファイル: Bandage.cs プロジェクト: Drake1187/runuocustom
        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);
        }
コード例 #28
0
ファイル: Bandage.cs プロジェクト: StoryOfTheBard/UOLegends
        public static BandageContext BeginHeal(Mobile healer, Mobile patient)
        {
            bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet);

            if (patient is Golem)
            {
                healer.SendAsciiMessage("Bandages cannot be used on that.");
            }
            else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead)
            {
                healer.SendAsciiMessage("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.SendAsciiMessage("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.SendAsciiMessage(healer.Name + " : Attempting to heal you.");
                }

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

            return(null);
        }