コード例 #1
0
		public void DoCure( Mobile from )
		{
			bool cure = false;

			CureLevelInfo[] info = LevelInfo;

			for ( int i = 0; i < info.Length; ++i )
			{
				CureLevelInfo li = info[i];

				if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
				{
					cure = true;
					break;
				}
			}

			if ( cure && from.CurePoison( from ) )
			{
				from.SendLocalizedMessage( 500231 ); // You feel cured of poison!

                from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
				from.PlaySound( 0x1E0 );
			}
			else if ( !cure && from.Poisoned ) //Loki edit: It shouldn't say this if you're not actually poisoned (added second condition)
			{
				from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment!
			}
		}
コード例 #2
0
		public void DoCure( Mobile from )
		{
			bool cure = false;

			CureLevelInfo[] info = LevelInfo;

			for ( int i = 0; i < info.Length; ++i )
			{
				CureLevelInfo li = info[i];

				if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
				{
					cure = true;
					break;
				}
			}

			if ( cure && from.CurePoison( from ) )
			{
				from.SendLocalizedMessage( 500231 ); // You feel cured of poison!

				from.FixedEffect( 0x373A, 10, 15 );
				from.PlaySound( 0x1E0 );
			}
			else if ( !cure )
			{
				from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment!
			}
		}
コード例 #3
0
ファイル: Cure.cs プロジェクト: FreeReign/Rebirth-Repack
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                if ( m.Poison != null )
                {
                    int chanceToCure = (int)( 10000 + ( Caster.Skills[SkillName.Magery].Value*75 - (m.Poison.Level + 1)*1750 ) ) / 100;
                    if ( chanceToCure > Utility.Random( 100 ) && m.CurePoison( Caster ) )
                    {
                        if ( Caster != m )
                            Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

                        m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
                    }
                    else
                    {
                        Caster.SendAsciiMessage( "You failed to cure {0}!", m.Name );
                    }
                }

                m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
                m.PlaySound( 0x1E0 );
            }

            FinishSequence();
        }
コード例 #4
0
		public void Target( Mobile m )
		{
			if( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			if( m_Table.ContainsKey( m ) )
			{
				Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
			}
			else if( !Caster.CanBeginAction( typeof( GiftOfRenewalSpell ) ) )
			{
				Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
			}
			else if( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				Caster.FixedEffect( 0x374A, 10, 20 );
				Caster.PlaySound( 0x5C9 );

				if( m.Poisoned )
				{
					m.CurePoison( m );
				}
				else
				{
					double skill = Caster.Skills[SkillName.Spellweaving].Value;

					int hitsPerRound = 5 + (int)(skill / 24) + FocusLevel;
					TimeSpan duration = TimeSpan.FromSeconds( 30 + (FocusLevel * 10) );
					
					#region Mondain's Legacy
					ArcaneEmpowermentSpell.AddHealBonus( Caster, ref hitsPerRound );
					#endregion

					GiftOfRenewalInfo info = new GiftOfRenewalInfo( Caster, m, hitsPerRound );

					Timer.DelayCall( duration,
						delegate
						{
							if( StopEffect( m ) )
							{
								m.PlaySound( 0x455 );
								m.SendLocalizedMessage( 1075071 ); // The Gift of Renewal has faded.
							}
						} );



					m_Table[m] = info;

					Caster.BeginAction( typeof( GiftOfRenewalSpell ) );

					BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.GiftOfRenewal, 1031602, 1075797, duration, m, hitsPerRound.ToString() ) );
				}
			}

			FinishSequence();
		}
コード例 #5
0
ファイル: Cure.cs プロジェクト: greeduomacro/UO-Forever
		public void Target(Mobile m)
		{
			if (!Caster.CanSee(m))
			{
				Caster.SendLocalizedMessage(500237); // Target can not be seen.
			}
			else if (CheckBSequence(m))
			{
				SpellHelper.Turn(Caster, m);

				Poison p = m.Poison;

				if (p != null)
				{
					int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) -
									   ((p.Level + 1) * (Caster.EraAOS ? (p.Level < 4 ? 3300 : 3100) : 1750));
					chanceToCure /= 100;
					/*if( p.Level == 3 ) //DP tweak
					{
						chanceToCure -= 40; //@GM Magery, chance will be 65%
					}
					if( p.Level > 3 ) //lethal poison further penalty
					{
						chanceToCure -= 50; //@GM Magery, chance will be 55%
					}

					if( Caster.AccessLevel > AccessLevel.Player )
					{
						Caster.SendMessage("Chance to cure is " + chanceToCure + "%");
					}*/

					if (chanceToCure > Utility.Random(100))
					{
						if (m.CurePoison(Caster))
						{
							if (Caster != m)
							{
								Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
							}

							m.SendLocalizedMessage(1010059); // You have been cured of all poisons.
						}
					}
					else
					{
						m.SendLocalizedMessage(1010060); // You have failed to cure your target!
					}
				}

				m.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
				m.PlaySound(0x1E0);
			}

			FinishSequence();
		}
コード例 #6
0
        public void Target( Mobile m )
        {
            if ( !m.Poisoned )
            {
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                /* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
                 * The amount of fire damage is lessened if the caster has high Karma.
                 */

                Poison p = m.Poison;

                if ( p != null )
                {
                    // Cleanse by fire is now difficulty based
                    int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Chivalry].Value * 75) - ((p.Level + 1) * 2000);
                    chanceToCure /= 100;

                    if ( chanceToCure > Utility.Random( 100 ) )
                    {
                        if ( m.CurePoison( Caster ) )
                        {
                        }
                    }
                    else
                    {
                    }
                }

                m.PlaySound( 0x1E0 );
                m.FixedParticles( 0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist );

                IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 5 ), m.Map );
                IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 45 ), m.Map );
                Effects.SendMovingParticles( from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head, 0x100 );

                Caster.PlaySound( 0x208 );
                Caster.FixedParticles( 0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist );

                int damage = 50 - ComputePowerValue( 4 );

                // TODO: Should caps be applied?
                if ( damage < 13 )
                    damage = 13;
                else if ( damage > 55 )
                    damage = 55;

                AOS.Damage( Caster, Caster, damage, 0, 100, 0, 0, 0, true );
            }

            FinishSequence();
        }
コード例 #7
0
		public void Target( Mobile m )
		{
			if ( !m.Poisoned )
			{
				Caster.SendLocalizedMessage( 1060176 ); // That creature is not poisoned!
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
				 * The amount of fire damage is lessened if the caster has high Karma.
				 */

				if ( m.CurePoison( Caster ) )
				{
					if ( Caster != m )
						Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

					m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
				}

				m.PlaySound( 0x1E0 );
				m.FixedParticles( 0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist );

				IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 5 ), m.Map );
				IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 45 ), m.Map );
				Effects.SendMovingParticles( from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head, 0x100 );

				Caster.PlaySound( 0x208 );
				Caster.FixedParticles( 0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist );

				int damage = 50 - ComputePowerValue( 4 );

				// TODO: Should caps be applied?
				if ( damage < 13 )
					damage = 13;
				else if ( damage > 55 )
					damage = 55;

				AOS.Damage( Caster, Caster, damage, 0, 100, 0, 0, 0, true );
			}

			FinishSequence();
		}
コード例 #8
0
ファイル: Cure.cs プロジェクト: ITLongwell/mondains-legacy
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				Poison p = m.Poison;

				if ( p != null )
				{
					#region Mondain's Legacy mod
					int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((p.RealLevel + 1) * (Core.AOS ? (p.RealLevel < 4 ? 3300 : 3100) : 1750));
					#endregion

					chanceToCure /= 100;

					if ( chanceToCure > Utility.Random( 100 ) )
					{
						if ( m.CurePoison( Caster ) )
						{
							if ( Caster != m )
								Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

							m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
						}
					}
					else
					{
						m.SendLocalizedMessage( 1010060 ); // You have failed to cure your target!
					}
				}

				m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
				m.PlaySound( 0x1E0 );
			}

			FinishSequence();
		}
コード例 #9
0
ファイル: Cure.cs プロジェクト: greeduomacro/divinity
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                Poison p = m.Poison;

                if ( p != null )
                {

                    // Original UODemo formula: int chanceToCure = (int)( 10000 + ( Caster.Skills[SkillName.Magery].Value*75 - (m.Poison.Level + 1)*1750 ) ) / 100;

                    //Modified to be tougher:
                    int chanceToCure = (int)( 10000 + ( Caster.Skills[CastSkill].Value*75 - (m.Poison.Level + 1)*2500 ) ) / 100;

                    if ( chanceToCure > Utility.Random( 100 ) )
                    {
                        if ( m.CurePoison( Caster ) )
                        {
                            if ( Caster != m )
                                Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

                            m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage( 1010060 ); // You have failed to cure your target!
                    }
                }

                m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
                m.PlaySound( 0x1E0 );
            }

            FinishSequence();
        }
コード例 #10
0
ファイル: Cure.cs プロジェクト: Godkong/Origins
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendAsciiMessage( "Target can not be seen." ); // Target can not be seen.
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                Poison p = m.Poison;

                if ( p != null )
                {
                    int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((p.Level + 1) * (Core.AOS ? (p.Level < 4 ? 3300 : 3100) : 1750));
                    chanceToCure /= 100;

                    if (((10000 + ((Caster.Skills[SkillName.Magery].Value * 75) - (p.Level+1 * 1750))) / 100) > Utility.Random(1, 100)) //if ( chanceToCure > Utility.Random( 100 ) )
                    {
                        if ( m.CurePoison( Caster ) )
                        {
                            if ( Caster != m )
                                Caster.SendAsciiMessage( String.Format("You have cured {0} of all poisons!", m.Name) ); // You have cured the target of all poisons!

                            m.SendAsciiMessage(String.Format("{0} has cured you of all poisons!",Caster.Name)); // You have been cured of all poisons.
                        }
                    }
                    else
                    {
                        m.SendAsciiMessage( String.Format("You have failed to cure {0}!",m.Name )); // You have failed to cure your target!
                    }
                }

                m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
                m.PlaySound( 0x1E0 );
            }

            FinishSequence();
        }
コード例 #11
0
ファイル: RefreshStone.cs プロジェクト: rberiot/imaginenation
        public override void OnDoubleClickDead(Mobile from)
        {
            if (!from.Alive && from is PlayerMobile)
            {
                ((PlayerMobile)from).ForceResurrect();
                CommandLogging.WriteLine(from, "Refreshing and resurrecting " + from.Name);
            }
            else if (!from.Alive)
            {
                from.Resurrect();
                CommandLogging.WriteLine(from, "Refreshing and resurrecting " + from.Name);
            }

            CommandLogging.WriteLine(from, "Refreshing but not resurrecting " + from.Name);

            from.PublicOverheadMessage(MessageType.Regular, from.SpeechHue, true, "I've been refreshed.");

            from.Hits = from.HitsMax;
            from.Stam = from.StamMax;
            from.Mana = from.ManaMax;
            from.CurePoison(from);
        }
コード例 #12
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				if ( CanCureTinkerTrapPoison(m) && m.CurePoison( Caster ))
				{
					if ( Caster != m )
						Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

					m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
				}

				m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
				m.PlaySound( 0x1E0 );
			}

			FinishSequence();
		}
コード例 #13
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to use.");
                return;
            }
            else
            {
                Target t;
                int    number;

                if (from.Hunger < 20)
                {
                    from.Hunger += 3;
                    // Send message to character about their current Hunger value
                    int iHunger = from.Hunger;
                    if (iHunger < 5)
                    {
                        from.SendLocalizedMessage(500868);                           // You eat the food, but are still extremely hungry.
                    }
                    else if (iHunger < 10)
                    {
                        from.SendLocalizedMessage(500869);                           // You eat the food, and begin to feel more satiated.
                    }
                    else if (iHunger < 15)
                    {
                        from.SendLocalizedMessage(500870);                           // After eating the food, you feel much less hungry.
                    }
                    else
                    {
                        from.SendLocalizedMessage(500871);                           // You feel quite full after consuming the food.
                    }
                    this.Consume();

                    // Play a random "eat" sound
                    from.PlaySound(Utility.Random(0x3A, 3));

                    if (from.Body.IsHuman && !from.Mounted)
                    {
                        from.Animate(34, 5, 1, true, false, 0);
                    }

                    int iHeal = (int)from.Skills[SkillName.TasteID].Value;
                    int iHurt = from.HitsMax - from.Hits;

                    if (iHurt > 0)                       // DJERYV DID THIS FOR TASTE ID
                    {
                        if (iHeal > iHurt)
                        {
                            iHeal = iHurt;
                        }

                        from.Hits = from.Hits + iHeal;

                        if (from.Poisoned)
                        {
                            if ((int)from.Skills[SkillName.TasteID].Value >= Utility.RandomMinMax(1, 100))
                            {
                                from.CurePoison(from);
                                from.SendLocalizedMessage(1010059);                                   // You have been cured of all poisons.
                            }
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are simply too full to eat any more!");
                    from.Hunger = 20;
                }
            }
        }
コード例 #14
0
ファイル: Bandage.cs プロジェクト: furkanugur/imaginenation
        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);
            }
        }
コード例 #15
0
ファイル: Duel.cs プロジェクト: greeduomacro/last-wish
		private void FixMobile(Mobile m)
		{
			if (!m.Alive)
				m.Resurrect();

			HandleCorpse(m);

			m.Aggressed.Clear();
			m.Aggressors.Clear();
			m.Hits = m.HitsMax;
			m.Stam = m.StamMax;
			m.Mana = m.ManaMax;
			m.DamageEntries.Clear();
			m.Combatant = null;
			m.InvalidateProperties();

            m.Criminal = false;

			StatMod mod;

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

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

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

			m.Paralyzed = false;
			m.CurePoison(m);

			// EvilOmenSpell.CheckEffect(m);
			StrangleSpell.RemoveCurse(m);
			CorpseSkinSpell.RemoveCurse(m);

			#region Buff Icons
			if (m is PlayerMobile)
			{
				PlayerMobile pm = (PlayerMobile)m;
				pm.RemoveBuff(BuffIcon.Clumsy);
				pm.RemoveBuff(BuffIcon.CorpseSkin);
				pm.RemoveBuff(BuffIcon.EvilOmen);
				pm.RemoveBuff(BuffIcon.Curse);
				pm.RemoveBuff(BuffIcon.FeebleMind);
				pm.RemoveBuff(BuffIcon.MassCurse);
				pm.RemoveBuff(BuffIcon.Paralyze);
				pm.RemoveBuff(BuffIcon.Poison);
				pm.RemoveBuff(BuffIcon.Strangle);
				pm.RemoveBuff(BuffIcon.Weaken);
			}
			#endregion

			m.SendMessage("The duel has ended.");
		}
コード例 #16
0
        public void Target(IPoint3D targeted)
        {
            if (!Caster.CanSee(targeted))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, targeted);

                SpellHelper.GetSurfaceTop(ref targeted);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    Mobile directTarget = targeted as Mobile;

                    if (directTarget != null && Caster.CanBeBeneficial(directTarget, true))
                    {
                        targets.Add(directTarget);
                    }
                    else
                    {
                        FinishSequence();
                        return;
                    }

                    var eable = map.GetMobilesInRange(new Point3D(targeted), 2);

                    foreach (Mobile m in eable)
                    {
                        if (directTarget != m && IsValidTarget(m))
                        {
                            targets.Add(m);
                        }
                    }
                }

                Effects.PlaySound(targeted, Caster.Map, 0x299);

                if (targets.Count > 0)
                {
                    int cured = 0;

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        Caster.DoBeneficial(m);

                        Poison poison = m.Poison;

                        if (poison != null)
                        {
                            int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((poison.Level + 1) * 1750);
                            chanceToCure /= 100;
                            chanceToCure -= 1;

                            if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                            {
                                ++cured;
                            }
                        }

                        m.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                        m.PlaySound(0x1E0);
                    }

                    if (cured > 0)
                    {
                        Caster.SendLocalizedMessage(1010058);                           // You have cured the target of all poisons!
                    }
                }
            }

            FinishSequence();
        }
コード例 #17
0
ファイル: HealingStone.cs プロジェクト: pallop/Servuo
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendLocalizedMessage(502138);                   // That is too far away for you to use
                return;
            }
            else if (from != m_Caster)
            {
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                from.SendLocalizedMessage(1080116); // You must have a free hand to use a Healing Stone.
            }
            else if (from.Hits >= from.HitsMax && !from.Poisoned)
            {
                from.SendLocalizedMessage(1049547); //You are already at full health.
            }
            else if (from.BeginAction(typeof(HealingStone)))
            {
                if (m_MaxHeal > m_LifeForce)
                {
                    m_MaxHeal = m_LifeForce;
                }

                if (from.Poisoned)
                {
                    int toUse = Math.Min(120, from.Poison.RealLevel * 25);

                    if (m_MaxLifeForce < toUse)
                    {
                        from.SendLocalizedMessage(1115265); //Your Mysticism, Focus, or Imbuing Skills are not enough to use the heal stone to cure yourself.
                    }
                    else if (m_LifeForce < toUse)
                    {
                        from.SendLocalizedMessage(1115264); //Your healing stone does not have enough energy to remove the poison.
                        LifeForce -= toUse / 3;
                    }
                    else
                    {
                        from.CurePoison(from);

                        from.SendLocalizedMessage(500231); // You feel cured of poison!

                        from.FixedEffect(0x373A, 10, 15);
                        from.PlaySound(0x1E0);

                        LifeForce -= toUse;
                    }

                    if (m_LifeForce <= 0)
                    {
                        this.Consume();
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from);
                    return;
                }
                else
                {
                    int toHeal = Math.Min(m_MaxHeal, from.HitsMax - from.Hits);
                    from.Heal(toHeal);
                    Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from);

                    from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                    from.PlaySound(0x202);

                    LifeForce -= toHeal;
                    m_MaxHeal  = 1;
                }

                if (m_LifeForce <= 0)
                {
                    from.SendLocalizedMessage(1115266); //The healing stone has used up all its energy and has been destroyed.
                    this.Consume();
                }
                else
                {
                    if (m_Timer != null)
                    {
                        m_Timer.Stop();
                    }

                    m_Timer = new InternalTimer(this);
                }
            }
            else
            {
                from.SendLocalizedMessage(1095172); // You must wait a few seconds before using another Healing Stone.
            }
        }
コード例 #18
0
ファイル: Cure.cs プロジェクト: zerodowned/angelisland
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );
				//chance to cure poison is ((caster's magery/poison level) - 20%)

				if( m.Poison != null )
				{
					double chance = 100;
					try //I threw this try-catch block in here because Poison is whacky... there'll be a tiny 
					{   //race condition if multiple people are casting cure on the same target... 
						chance = ( (Caster.Skills[SkillName.Magery].Value / (m.Poison.Level+1) ) - 20 ) * 7.5;
						//this gives 0 chance for a mage to cure lethal
						// 37.5% chance at GM to cure deadly ( needs > 80 for a chance )
						// 100% chance at GM to cure greater ( needs > 60 for a chance )
						// 100% chance at GM to cure regular ( needs > 40 for a chance )
						// 100% chance at GM to cure lesser ( needs > 20 for a chance )

						if( Caster.AccessLevel > AccessLevel.Player )
						{
							Caster.SendMessage("Chance to cure is " + chance + "%");
						}
					}
					catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
                //new cure rate code
                /*
				Poison p = m.Poison;
				if( p != null )
				{
					int chance = 100;
					try
					{
						chance = 10000 
							         + (int)(Caster.Skills[SkillName.Magery].Value * 75) 
							         - ((p.Level + 1) * 1750);
						chance /= 100;
						if( p.Level == 3 ) //DP tweak
						{
							chance -= 15; //@GM Magery, chance will be 90%
						}
						if( p.Level > 3 ) //lethal poison further penalty
						{
							chance -= 50; //@GM Magery, chance will be 37%
						}

						if( Caster.AccessLevel > AccessLevel.Player )
						{
							Caster.SendMessage("Chance to cure is " + chance + "%");
						}
					}
					catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
					*/
					if( Utility.Random( 0, 100 ) <= chance )
					{
						if ( m.CurePoison( Caster ) )
						{
							if ( Caster != m )
								Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!
	
							m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
						}
					}
					else
					{
						Caster.SendLocalizedMessage( 1010060 ); // You have failed to cure your target!
					}
				}

				m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
				m.PlaySound( 0x1E0 );
			}

			FinishSequence();
		}
コード例 #19
0
ファイル: Bandage.cs プロジェクト: StoryOfTheBard/UOLegends
        public void EndHeal()
        {
            StopHeal();

            string healerstring  = "";
            string patientstring = "";
            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)
            {
                healerstring  = "You were unable to finish your work before you died.";
                patientstring = "";
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Core.AOS ? 2 : 1))
            {
                healerstring  = "You did not stay close enough to heal your target.";
                patientstring = "";
                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))
                    {
                        healerstring  = "Target can not be resurrected at that location.";
                        patientstring = "Thou can not be resurrected there!";                         //
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.Name == "Khaldun")
                    {
                        healerstring  = "The veil of death in this area is too strong and resists thy efforts to restore life.";
                        patientstring = "";
                    }
                    else
                    {
                        healerstring  = "You are able to resurrect your patient.";                        //
                        patientstring = "";

                        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))
                            {
                                healerstring = "You are able to resurrect the creature.";

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

                                ArrayList friends = petPatient.Friends;

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

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

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

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerstring = "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)
                    {
                        healerstring = "You fail to resurrect the creature.";                         //
                    }
                    else
                    {
                        healerstring = "You are unable to resurrect your patient.";                         //
                    }
                    patientstring = "";
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendAsciiMessage("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))
                    {
                        healerstring  = (m_Healer == m_Patient) ? "" : "You have cured the target of all poisons.";
                        patientstring = "You have been cured of all poisons.";                         //
                    }
                    else
                    {
                        healerstring  = "";
                        patientstring = "";
                    }
                }
                else
                {
                    healerstring  = "You have failed to cure your target!";
                    patientstring = "";
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerstring  = "";
                patientstring = "The bleeding wounds have healed, you are no longer bleeding!";

                BleedAttack.EndBleed(m_Patient, true);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerstring  = (m_Healer == m_Patient ? "" : "");
                patientstring = "";
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerstring  = "You heal what little damage your patient had.";                //
                patientstring = "";
            }
            else
            {
                checkSkills   = true;
                patientstring = "";

                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())
                {
                    healerstring = "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;
                        healerstring = "You apply the bandages, but they barely help.";
                    }

                    m_Patient.Heal((int)toHeal);
                }
                else
                {
                    healerstring = "You apply the bandages, but they barely help.";
                    playSound    = false;
                }
            }

            if (healerstring != "")
            {
                m_Healer.SendAsciiMessage(healerstring);
            }

            if (patientstring != "")
            {
                m_Patient.SendAsciiMessage(patientstring);
            }

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

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }
        }
コード例 #20
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
            else if (CheckSequence())
            {
                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map    map          = Caster.Map;
                Mobile directTarget = p as Mobile;

                if (map != null)
                {
                    bool feluccaRules = (map.Rules == MapRules.FeluccaRules);

                    // You can target any living mobile directly, beneficial checks apply
                    if (directTarget != null && Caster.CanBeBeneficial(directTarget, false))
                    {
                        targets.Add(directTarget);
                    }

                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2);

                    foreach (Mobile m in eable)
                    {
                        if (m == directTarget)
                        {
                            continue;
                        }

                        if (AreaCanTarget(m, feluccaRules))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                Effects.PlaySound(p, Caster.Map, Sound);

                if (targets.Count > 0)
                {
                    int cured = 0;

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        Caster.DoBeneficial(m);

                        Poison poison = m.Poison;

                        if (poison != null)
                        {
                            int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((poison.Level + 1) * 1750);
                            chanceToCure /= 100;

                            if (m.CurePoison(Caster))
                            {
                                ++cured;
                            }
                        }

                        //m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
                        m.PlaySound(Sound);
                    }

                    //if ( cured > 0 )
                    //	Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!
                }
            }

            FinishSequence();
        }
コード例 #21
0
ファイル: DMStone.cs プロジェクト: FreeReign/imaginenation
        private void FixPlayer(Mobile m, bool removeMods)
        {
            if (m == null) 
                return;

            m.CurePoison(m);

            m.Mana = m.ManaMax;
            m.Stam = m.StamMax;

            //Dead player
            if (removeMods)
            {
                m.Hits = m.HitsMax;
                m.StatMods.Clear();
            }
            else
                m.Hits = m.HitsMax;
        }
コード例 #22
0
        // modified by alari for new food system
        public virtual bool Eat(Mobile from)
        {
            // Fill the Mobile with FillFactor
            if (CheckHunger(from))                  // added HitsBonus, ManaBonus - alari
            {
                // Play a random "eat" sound
                from.PlaySound(Utility.Random(0x3A, 3));

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                if (m_Poison != null)
                {
                    from.ApplyPoison(m_Poisoner, m_Poison);
                }

                Consume();

                int iHeal = (int)from.Skills[SkillName.TasteID].Value;
                int iHurt = from.HitsMax - from.Hits;

                if (iHurt > 0)                   // WIZARD DID THIS FOR TASTE ID
                {
                    if (iHeal > iHurt)
                    {
                        iHeal = iHurt;
                    }

                    from.Hits = from.Hits + iHeal;

                    if (from.Poisoned)
                    {
                        if ((int)from.Skills[SkillName.TasteID].Value >= Utility.RandomMinMax(1, 100))
                        {
                            from.CurePoison(from);
                            from.SendLocalizedMessage(1010059);                               // You have been cured of all poisons.
                        }
                    }
                }
                // CHECK FOR ANY DUNGEON FOOD ILLNESSES //////////////////////////////////////

                if (this is FoodDriedBeef || this is FoodStaleBread)
                {
                    if (from.CheckSkill(SkillName.TasteID, 0, 100))
                    {
                    }
                    else if (Utility.RandomMinMax(1, 100) > 70)
                    {
                        int nPoison = Utility.RandomMinMax(0, 10);
                        from.Say("Poison!");
                        if (nPoison > 9)
                        {
                            from.ApplyPoison(from, Poison.Deadly);
                        }
                        else if (nPoison > 7)
                        {
                            from.ApplyPoison(from, Poison.Greater);
                        }
                        else if (nPoison > 4)
                        {
                            from.ApplyPoison(from, Poison.Regular);
                        }
                        else
                        {
                            from.ApplyPoison(from, Poison.Lesser);
                        }
                        from.SendMessage("Poison!");
                    }
                }

                return(true);
            }

            return(false);
        }
コード例 #23
0
        private void ReadyPlayer(Mobile m)
        {
            if (!m_ScoreTable.ContainsKey(m.Serial))
            {
                m_ScoreTable.Add(m.Serial, new ScoreKeeper(m));
            }

            bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed;
            bool MagicArmor   = MagicArmorRule == pMagicArmorRule.Allowed;
            bool Potions      = PotionRule == pPotionRule.Allowed;
            bool Bandages     = BandageRule == pBandaidRule.Allowed;
            bool Pets         = PetRule == pPetRule.Allowed;
            bool Mounts       = MountRule == pMountRule.Allowed;

            if (!m.Alive)
            {
                m.Resurrect();
            }

            Container bp  = m.Backpack;
            Container bag = new Bag();

            bag.Hue = 38;
            BankBox bank   = m.BankBox;
            Item    oncurs = m.Holding;

            if (oncurs != null)
            {
                bp.DropItem(oncurs);
            }

            m.CurePoison(m);

            m.Hits = m.HitsMax;
            m.Mana = m.ManaMax;
            m.Stam = m.StamMax;

            m.StatMods.Clear();

            ArrayList items = new ArrayList();

            foreach (Layer layer in PvpCore.EquipmentLayers)
            {
                Item item = m.FindItemOnLayer(layer);

                if (item != null)
                {
                    if (item is BaseWeapon && !MagicWeapons)
                    {
                        BaseWeapon weapon = ( BaseWeapon )item;

                        if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                        {
                            items.Add(weapon);
                        }
                        else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                        {
                            items.Add(weapon);
                        }
                        else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                        {
                            items.Add(weapon);
                        }
                    }
                    else if (item is BaseArmor && !MagicArmor)
                    {
                        BaseArmor armor = ( BaseArmor )item;

                        if (armor.Durability != ArmorDurabilityLevel.Regular)
                        {
                            items.Add(armor);
                        }
                        else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                        {
                            items.Add(armor);
                        }
                    }
                }
            }

            foreach (Item item in m.Backpack.Items)
            {
                if (item != null)
                {
                    if (item is BaseWeapon && !MagicWeapons)
                    {
                        BaseWeapon weapon = ( BaseWeapon )item;

                        if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                        {
                            items.Add(weapon);
                        }
                        else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                        {
                            items.Add(weapon);
                        }
                        else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                        {
                            items.Add(weapon);
                        }
                    }
                    else if (item is BaseArmor && !MagicArmor)
                    {
                        BaseArmor armor = ( BaseArmor )item;

                        if (armor.Durability != ArmorDurabilityLevel.Regular)
                        {
                            items.Add(armor);
                        }
                        else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                        {
                            items.Add(armor);
                        }
                    }
                    else if (item is BasePotion && !Potions)
                    {
                        items.Add(item);
                    }
                    else if (item is EtherealMount && !Mounts)
                    {
                        items.Add(item);
                    }
                    else if (item is Bandage && !Bandages)
                    {
                        items.Add(item);
                    }
                }
            }

            if (!Mounts)
            {
                if (m.Mount != null)
                {
                    IMount mount = m.Mount;
                    mount.Rider = null;
                    if (mount is BaseMount)
                    {
                        if (mount is BaseCreature)
                        {
                            BaseCreature bc = ( BaseCreature )mount;
                            bc.ControlTarget = null;
                            bc.ControlOrder  = OrderType.Stay;
                            bc.Internalize();

                            bc.SetControlMaster(null);
                            bc.SummonMaster = null;

                            bc.IsStabled = true;
                            m.Stabled.Add(bc);
                            MountCollection.Add(m.Serial, bc);
                            m.SendMessage(38, "Your mount has been moved to the your stables");
                        }
                    }
                }
            }

            if (items.Count > 0)
            {
                m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank.");
            }
            foreach (Item item in items)
            {
                bag.AddItem(item);
            }

            if (bag.Items.Count > 0)
            {
                bank.DropItem(bag);
            }
            else
            {
                bag.Delete();
            }

            Contestants.Add(m);

            SpawnMobile(m);

            if (m.NetState != null)
            {
                m.SendMessage(38, "You have joined the deathmatch");
                m.SendMessage(38, "You can check the score with \"scoreboard\"");
            }
        }
コード例 #24
0
// modified for new food system
        static public bool FillHunger(Mobile from, int fillFactor, int hitsbonus, int manabonus)            // added: int hitsbonus, int manabonus - alari
        {
            if (from.Hunger >= 20)
            {
                from.SendLocalizedMessage(500867);                   // You are simply too full to eat any more!
                return(false);
            }

            int iEaten  = 0;
            int iHunger = from.Hunger + fillFactor;

            if (from.Stam < from.StamMax)
            {
                from.Stam += Utility.Random(6, 3) + fillFactor / 5;                //restore some stamina
            }
// added
            if (from.Hits < from.HitsMax && hitsbonus != 0)
            {
                from.Hits += Utility.RandomMinMax(hitsbonus, fillFactor + hitsbonus);                  //restore some health
            }
            if (from.Mana < from.ManaMax && manabonus != 0)
            {
                from.Mana += Utility.RandomMinMax(manabonus, fillFactor + manabonus);                  //restore some mana
            }
// end add

            if (iHunger >= 20)
            {
                iEaten      = 1;
                from.Hunger = 20;
                from.SendLocalizedMessage(500872);                   // You manage to eat the food, but you are stuffed!
            }
            else
            {
                iEaten      = 1;
                from.Hunger = iHunger;

                if (iHunger < 5)
                {
                    from.SendLocalizedMessage(500868);                       // You eat the food, but are still extremely hungry.
                }
                else if (iHunger < 10)
                {
                    from.SendLocalizedMessage(500869);                       // You eat the food, and begin to feel more satiated.
                }
                else if (iHunger < 15)
                {
                    from.SendLocalizedMessage(500870);                       // After eating the food, you feel much less hungry.
                }
                else
                {
                    from.SendLocalizedMessage(500871);                       // You feel quite full after consuming the food.
                }
            }

            if (iEaten > 0)               // WIZARD ADDED FOR TASTE ID
            {
                int iHeal = (int)from.Skills[SkillName.TasteID].Value;
                int iHurt = from.HitsMax - from.Hits;

                if (iHurt > 0)
                {
                    if (iHeal > iHurt)
                    {
                        iHeal = iHurt;
                    }

                    from.Hits = from.Hits + iHeal;

                    if (from.Poisoned)
                    {
                        if ((int)from.Skills[SkillName.TasteID].Value >= Utility.RandomMinMax(1, 100))
                        {
                            from.CurePoison(from);
                            from.SendLocalizedMessage(1010059);                               // You have been cured of all poisons.
                        }
                    }
                }
            }

            return(true);
        }
コード例 #25
0
ファイル: Bandage.cs プロジェクト: zerodowned/angelisland
        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 (Bandage.ProximityCheck(m_Healer, m_Patient, Core.AOS ? 2 : 1) == false)
            {
                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, CanFitFlags.requireSurface))
                    {
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    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.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                healerNumber = 1049670;                                 // The pet's owner must be nearby to attempt resurrection.
                            }
                        }
                        else
                        {
                            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  = -1;
                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 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);
                }
                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);
            }
        }
コード例 #26
0
ファイル: Bandage.cs プロジェクト: jaedan/runuo
        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);

                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);
            }
        }
コード例 #27
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map    map          = Caster.Map;
                Mobile directTarget = p as Mobile;

                if (map != null)
                {
                    bool feluccaRules = map.Rules == MapRules.FeluccaRules;

                    // You can target any living mobile directly, beneficial checks apply
                    if (directTarget != null && Caster.CanBeBeneficial(directTarget, false))
                    {
                        targets.Add(directTarget);
                    }

                    IPooledEnumerable <Mobile> eable = map.GetMobilesInRange(new Point3D(p), 2);
                    targets.AddRange(eable.Where(m => m != directTarget).Where(m => AreaCanTarget(m, feluccaRules)));

                    eable.Free();
                }

                Effects.PlaySound(p, Caster.Map, 0x299);

                if (targets.Count > 0)
                {
                    int cured = 0;

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        Caster.DoBeneficial(m);

                        Poison poison = m.Poison;

                        if (poison != null)
                        {
                            int chanceToCure = 10000 + (int)(Caster.Skills.Magery.Value * 75) -
                                               (poison.Level + 1) * 1750;
                            chanceToCure /= 100;
                            chanceToCure -= 1;

                            if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                            {
                                ++cured;
                            }
                        }

                        m.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                        m.PlaySound(0x1E0);
                    }

                    if (cured > 0)
                    {
                        Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
                    }
                }
            }

            FinishSequence();
        }
コード例 #28
0
		public void Target( Mobile m )
		{
			if ( !m.Poisoned )
			{
				Caster.SendLocalizedMessage( 1060176 ); // That creature is not poisoned!
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
				 * The amount of fire damage is lessened if the caster has high Karma.
				 */

				Poison p = m.Poison;

				if ( p != null )
				{
					// Cleanse by fire is now difficulty based 
					int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Chivalry].Value * 75) - ((p.Level + 1) * 2000);
					chanceToCure /= 100;

					if ( chanceToCure > Utility.Random( 100 ) )
					{
						if ( m.CurePoison( Caster ) )
						{
							if ( Caster != m )
								Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

							m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
						}
					}
					else
					{
						m.SendLocalizedMessage( 1010060 ); // You have failed to cure your target!
					}
				}

				m.PlaySound( 0x1E0 );
				m.FixedParticles( 0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist );

				IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 5 ), m.Map );
				IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 45 ), m.Map );
				Effects.SendMovingParticles( from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head, 0x100 );

				Caster.PlaySound( 0x208 );
                Caster.FixedParticles(0x3709, 1, 30, 9934, (( Caster is PlayerMobile && ((PlayerMobile)Caster).IsArtedarKnight) ? 27 : 0 ), 7, EffectLayer.Waist); //vinds : switch cosmetique suivant le dieu

				int damage = 50 - ComputePowerValue( 4 );

				// TODO: Should caps be applied?
				if ( damage < 13 )
					damage = 13;
				else if ( damage > 55 )
					damage = 55;

				AOS.Damage( Caster, Caster, damage, 0, 100, 0, 0, 0, true );
			}

			FinishSequence();
		}
コード例 #29
0
ファイル: PurgeSpell.cs プロジェクト: evildude807/kaltar
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckBSequence( m, false ) )
            {
                SpellHelper.Turn( Caster, m );

                m.PlaySound( 0xF6 );
                m.PlaySound( 0x1F7 );
                m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

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

                StatMod mod;

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

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

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

                m.Paralyzed = false;
                m.CurePoison( Caster );

                EvilOmenSpell.CheckEffect( m );
                StrangleSpell.RemoveCurse( m );
                CorpseSkinSpell.RemoveCurse( m );
            }

            FinishSequence();
        }
コード例 #30
0
        public void Target(Mobile m)
        {
            if (!m.Poisoned)
            {
                this.Caster.SendLocalizedMessage(1060176); // That creature is not poisoned!
            }
            else if (this.CheckBSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                /* Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points.
                 * The amount of fire damage is lessened if the caster has high Karma.
                 */

                Poison p = m.Poison;

                if (p != null)
                {
                    // Cleanse by fire is now difficulty based
                    int chanceToCure = 10000 + (int)(this.Caster.Skills[SkillName.Chivalry].Value * 75) - ((p.RealLevel + 1) * 2000);
                    chanceToCure /= 100;

                    if (chanceToCure > Utility.Random(100))
                    {
                        if (m.CurePoison(this.Caster))
                        {
                            if (this.Caster != m)
                            {
                                this.Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
                            }
                            m.SendLocalizedMessage(1010059);               // You have been cured of all poisons.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage(1010060); // You have failed to cure your target!
                    }
                }

                m.PlaySound(0x1E0);
                m.FixedParticles(0x373A, 1, 15, 5012, 3, 2, EffectLayer.Waist);

                IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 5), m.Map);
                IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 45), m.Map);
                Effects.SendMovingParticles(from, to, 0x374B, 1, 0, false, false, 63, 2, 9501, 1, 0, EffectLayer.Head, 0x100);

                this.Caster.PlaySound(0x208);
                this.Caster.FixedParticles(0x3709, 1, 30, 9934, 0, 7, EffectLayer.Waist);

                int damage = 50 - this.ComputePowerValue(4);

                // TODO: Should caps be applied?
                if (damage < 13)
                {
                    damage = 13;
                }
                else if (damage > 55)
                {
                    damage = 55;
                }

                AOS.Damage(this.Caster, this.Caster, damage, 0, 100, 0, 0, 0, true);
            }

            this.FinishSequence();
        }
コード例 #31
0
ファイル: AIHeal.cs プロジェクト: Pumpk1ns/outlands
        public static void EndBandageHeal(object state)
        {
            object[] states = (object[])state;

            BaseCreature creature = (BaseCreature)states[0];
            Mobile       target   = creature.HealTarget as Mobile;

            if (creature.Deleted)
            {
                return;
            }

            //If Heal Target Isn't Valid
            if (target == null || target.Deleted || !target.Alive || target.Map != creature.Map || target.Deleted || target.IsDeadBondedPet || !creature.CanSee(target))
            {
                creature.DoingBandage = false;
                target.BeingBandaged  = false;

                creature.NextCombatHealActionAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(creature.CombatHealActionMinDelay, creature.CombatHealActionMaxDelay));

                return;
            }

            //If Target is More Than 2 Spaces Away: We Are Being Generous With Proximity
            else if (creature.GetDistanceToSqrt(target) > 2)
            {
                creature.DoingBandage = false;
                target.BeingBandaged  = false;

                creature.NextCombatHealActionAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(creature.CombatHealActionMinDelay, creature.CombatHealActionMaxDelay));

                return;
            }

            int healingSkill     = creature.Skills[SkillName.Healing].BaseFixedPoint;
            int maxHealingAmount = healingSkill / 10; //100 At Healing Skill 100

            double healingPercent = (double)healingSkill / 1000 / 4;

            double lowPercent  = healingPercent * .90;
            double highPercent = healingPercent * 1.10;

            double healingAmount = (double)target.HitsMax * (lowPercent + ((highPercent - lowPercent) * Utility.RandomDouble()));

            //Bandage Cure
            double cureChance = .5 + ((creature.Skills[SkillName.Healing].Value / 2) / 100);

            if (target.Poisoned)
            {
                cureChance -= (5 * target.Poison.Level);

                if (Utility.RandomDouble() < cureChance)
                {
                    target.CurePoison(creature);
                }

                healingAmount /= 2;
            }

            int amountToHeal = (int)healingAmount;

            if (amountToHeal > maxHealingAmount)
            {
                amountToHeal = maxHealingAmount;
            }

            target.Heal(amountToHeal, creature);

            creature.PlaySound(0x57);

            creature.DoingBandage = false;
            target.BeingBandaged  = false;

            creature.NextCombatHealActionAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(creature.CombatHealActionMinDelay, creature.CombatHealActionMaxDelay));
        }
コード例 #32
0
ファイル: GiftOfRenewal.cs プロジェクト: Ravenwolfe/xrunuo
        public static void TryCure( Mobile m )
        {
            Poison p = m.Poison;

            Mobile caster = m_Table3[m] as Mobile;

            if ( p != null && caster != null )
            {
                int chanceToCure = 10000 + (int) ( caster.Skills[SkillName.Spellweaving].Value * 75 ) - ( ( p.Level + 1 ) * 3000 );

                chanceToCure += GetFocusLevel( caster ) * 1000;

                if ( chanceToCure > 10000 )
                    chanceToCure = 10000;

                chanceToCure /= 100;

                if ( chanceToCure > Utility.Random( 100 ) )
                {
                    if ( m.CurePoison( caster ) )
                        m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
                }
            }

            m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
            m.PlaySound( 0x1E0 );

            GiftOfRenewalTimer.ToDelete.Add( m );
        }
コード例 #33
0
ファイル: ArchCure.cs プロジェクト: zerodowned/angelisland
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );
				//chance to cure poison is ((caster's magery/poison level) - 20%)

				double chance = 100;
				try //I threw this try-catch block in here because Poison is whacky... there'll be a tiny 
				{   //race condition if multiple people are casting cure on the same target... 
					if( m.Poison != null )
					{
						//desired is: LP: 50%, DP: 90% GP-: 100%
						double multiplier = 0.5 + 0.4 * (4 - m.Poison.Level);
						chance = Caster.Skills[SkillName.Magery].Value * multiplier;
					}

					if( Caster.AccessLevel > AccessLevel.Player )
					{
						Caster.SendMessage("Chance to cure is " + chance + "%");
					}
				}
				catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }

				/*
				//new cure rates
				int chance = 100;
				Poison p = m.Poison;
				try
				{
					if( p != null )
					{
						chance = 10000 
							+ (int)(Caster.Skills[SkillName.Magery].Value * 75) 
							- ((p.Level + 1) * 1750);
						chance /= 100;
						if( p.Level > 3 ) //lethal poison further penalty
						{
							chance -= 35; //@ GM magery, chance will be 52%
						}
					}

					if( Caster.AccessLevel > AccessLevel.Player )
					{
						Caster.SendMessage("Chance to cure is " + chance + "%");
					}
				}
				catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }
				*/

				if( Utility.Random( 0, 100 ) <= chance )
				{
					if ( m.CurePoison( Caster ) )
					{
						if ( Caster != m )
							Caster.SendLocalizedMessage( 1010058 ); // You have cured the target of all poisons!

						m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
					}
				}
				else
				{
					Caster.SendLocalizedMessage( 1010060 ); // You have failed to cure your target!
				}

				m.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
				m.PlaySound( 0x1E0 );
			}

			FinishSequence();
		}
コード例 #34
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;

            bool   healDamage        = true;
            bool   healThroughPoison = true;
            double BandageHealThroughPoisonScalar = SpellHelper.HealThroughPoisonScalar;

            int effectHue = 0;

            DungeonArmor.PlayerDungeonArmorProfile bandagerDungeonArmor = new DungeonArmor.PlayerDungeonArmorProfile(m_Healer, null);

            if (bandagerDungeonArmor.MatchingSet && !bandagerDungeonArmor.InPlayerCombat)
            {
                BandageHealThroughPoisonScalar += bandagerDungeonArmor.DungeonArmorDetail.BandageHealThroughPoisonScalar;
                effectHue = bandagerDungeonArmor.DungeonArmorDetail.EffectHue;
            }

            if (!m_Healer.Alive)
            {
                healDamage = false;

                healerNumber  = 500962; // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }

            else if (Engines.ConPVP.DuelContext.CheckSuddenDeath(m_Patient))
            {
                healDamage = false;

                m_Healer.SendMessage(0x22, "You cannot use this item when in sudden death.");

                return;
            }

            else if (m_Patient.Hidden && m_Patient != m_Healer)
            {
                healDamage = false;

                m_Healer.SendMessage("You can no longer see your patient.");

                return;
            }

            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healDamage = false;

                healerNumber  = 500963; // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }

            else if ((SpellHelper.CheckMulti(m_Healer.Location, m_Healer.Map) || SpellHelper.CheckMulti(m_Patient.Location, m_Patient.Map)) && !m_Healer.InLOS(m_Patient))
            {
                healDamage = false;

                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))
            {
                healDamage = false;

                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.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
                    {
                        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 (!petPatient.CanBeResurrectedThroughVeterinary)
                             * {
                             *  m_Healer.SendMessage("Another item is required to resurrect this creature");
                             *  healerNumber = 500966; // You are unable to resurrect your patient.
                             * }
                             * */

                            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;

                                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)
            {
                healDamage = false;

                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.05) - (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 (m_Patient.Hits == m_Patient.HitsMax)
            {
                healDamage = false;

                healerNumber  = 500967; // You heal what little damage your patient had.
                patientNumber = -1;
            }

            if (healDamage)
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 20.0) / 100.0) - (m_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 (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    toHeal -= m_Slips * 2.5;

                    if (healThroughPoison)
                    {
                        toHeal *= BandageHealThroughPoisonScalar;
                    }

                    PlayerMobile playerHealer = m_Healer as PlayerMobile;

                    if (playerHealer != null)
                    {
                        if (UOACZSystem.IsUOACZValidMobile(playerHealer))
                        {
                            if (playerHealer.IsUOACZHuman)
                            {
                                toHeal += 20;
                            }
                        }

                        double superiorHealing = playerHealer.GetSpecialAbilityEntryValue(SpecialAbilityEffect.SuperiorHealing);

                        if (superiorHealing > 0)
                        {
                            toHeal *= superiorHealing;
                        }
                    }

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

                    int finalHeal = (int)toHeal;

                    m_Patient.Heal(finalHeal, 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 (healThroughPoison)
            {
                Effects.PlaySound(m_Healer.Location, m_Healer.Map, 0x64B);
                Effects.SendLocationParticles(EffectItem.Create(m_Healer.Location, m_Healer.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, effectHue, 0, 5005, 0);
            }

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

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0, 1.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0, 1.0);
            }
        }
コード例 #35
0
        public virtual void Negate(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            if (m.Frozen)
            {
                m.Frozen = false;
            }

            if (m.Paralyzed)
            {
                m.Paralyzed = false;
            }

            if (m.Poisoned)
            {
                m.CurePoison(m);
            }

            if (BleedAttack.IsBleeding(m))
            {
                BleedAttack.EndBleed(m, true);
            }

            if (MortalStrike.IsWounded(m))
            {
                MortalStrike.EndWound(m);
            }

            PolymorphSpell.StopTimer(m);
            IncognitoSpell.StopTimer(m);
            DisguiseTimers.RemoveTimer(m);

            m.EndAction(typeof(PolymorphSpell));
            m.EndAction(typeof(IncognitoSpell));

            MeerMage.StopEffect(m, false);

            if (DebugMode || m.AccessLevel <= AccessLevel.Counselor)
            {
                m.RevealingAction();
                m.DisruptiveAction();
            }

            if (m.Target != null)
            {
                m.Target.Cancel(m, TargetCancelType.Overriden);
            }

            m.Spell = null;

            if (m.Combatant != null)
            {
                if (m.Combatant.Combatant != null && m.Combatant.Combatant == m)
                {
                    m.Combatant.Combatant = null;
                    m.Combatant.Warmode   = false;
                }

                m.Combatant = null;
            }

            if (m.Aggressed != null)
            {
                m.Aggressed.Clear();
            }

            if (m.Aggressors != null)
            {
                m.Aggressors.Clear();
            }

            m.Warmode  = false;
            m.Criminal = false;
            m.Delta(MobileDelta.Noto);
        }
コード例 #36
0
        public override void OnComponentUsed(AddonComponent ac, Mobile from)
        {
            if (from.Blessed)
            {
                from.SendMessage("You cannot drink from the pool while in this state.");
            }
            else if (!from.InRange(GetWorldLocation(), 3))
            {
                from.SendMessage("You will have to get closer to drink from the magical pool!");
            }
            else if (m_Uses > 0)
            {
                if (m_Pool == 1)                   // STRENGTH
                {
                    if (Apply(from, StatType.Str, m_Bonus))
                    {
                        from.FixedEffect(0x375A, 10, 15);
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You feel stronger after drinking from the pool!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 2)                   // INTELLECT
                {
                    if (Apply(from, StatType.Int, m_Bonus))
                    {
                        from.FixedEffect(0x375A, 10, 15);
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You can think much more clearly after drinking from the pool!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 3)                   // DEXTERITY
                {
                    if (Apply(from, StatType.Dex, m_Bonus))
                    {
                        from.FixedEffect(0x375A, 10, 15);
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You feel more nimble after drinking from the pool!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 4)                   // CURE
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    if (from.Poisoned)
                    {
                        from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                        from.CurePoison(from);
                        from.SendMessage("You feel much better after drinking from the pool!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                    else
                    {
                        from.SendMessage("You drink from the pool and nothing happens!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 5)                   // HEAL
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    if (from.Hits < from.HitsMax)
                    {
                        if (from.Poisoned || MortalStrike.IsWounded(from))
                        {
                            from.SendMessage("You drink from the pool and nothing happens!");
                            this.m_Uses = this.m_Uses - 1;
                        }
                        else
                        {
                            from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                            int min = 50;
                            int max = 75;
                            if (m_Bonus > 8)
                            {
                                min = 125; max = 175;
                            }
                            else if (m_Bonus > 5)
                            {
                                min = 75; max = 125;
                            }
                            from.Heal(Utility.RandomMinMax(min, max));
                            from.SendMessage("You drink from the pool and your wounds magically heal!");
                            this.m_Uses = this.m_Uses - 1;
                        }
                    }
                    else
                    {
                        from.SendMessage("You drink from the pool and nothing happens!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 6)                   // WATER ELEMENTAL
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    try
                    {
                        Map          map = this.Map;
                        BaseCreature bc  = (BaseCreature)Activator.CreateInstance(typeof(WaterElemental));

                        Point3D spawnLoc = this.Location;

                        for (int i = 0; i < 10; i++)
                        {
                            int x = Location.X + Utility.Random(4);
                            int y = Location.Y + Utility.Random(4);
                            int z = Map.GetAverageZ(x, y);

                            if (Map.CanSpawnMobile(new Point2D(x, y), this.Z))
                            {
                                spawnLoc = new Point3D(x, y, this.Z);
                            }
                            else if (Map.CanSpawnMobile(new Point2D(x, y), z))
                            {
                                spawnLoc = new Point3D(x, y, z);
                            }
                        }

                        Timer.DelayCall(TimeSpan.FromSeconds(1), delegate()
                        {
                            bc.Home      = Location;
                            bc.RangeHome = 5;
                            bc.FightMode = FightMode.Closest;
                            bc.MoveToWorld(spawnLoc, map);
                            bc.ForceReacquire();
                        });
                    }
                    catch
                    {
                    }
                    from.SendMessage("A water elemental emerges from the pool!");
                    this.m_Uses = this.m_Uses - 1;
                }
                else if (m_Pool == 7)                   // GOLD TO LEAD
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    Container cont  = from.Backpack;
                    int       nDull = 0;

                    int m_gAmount = from.Backpack.GetAmount(typeof(Gold));
                    int m_cAmount = from.Backpack.GetAmount(typeof(DDCopper));
                    int m_sAmount = from.Backpack.GetAmount(typeof(DDSilver));

                    if (cont.ConsumeTotal(typeof(Gold), m_gAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_gAmount));
                        nDull = 1;
                    }
                    if (cont.ConsumeTotal(typeof(DDCopper), m_cAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_cAmount));
                        nDull = 1;
                    }
                    if (cont.ConsumeTotal(typeof(DDSilver), m_sAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_sAmount));
                        nDull = 1;
                    }
                    if (nDull > 0)
                    {
                        from.SendMessage("After drinking from the pool, you notice all of your coins has turned to lead!");
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        LoggingFunctions.LogGenericQuest(from, "had all of their coins turn to lead after drinking from a strange pool");
                    }
                    else
                    {
                        from.SendMessage("You drink from the pool and nothing happens!");
                    }
                    this.m_Uses = this.m_Uses - 1;
                }
                else if (m_Pool == 8)                   // EQUIPPED ITEM DISAPPEARS
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    this.m_Uses = this.m_Uses - 1;
                    int  mReturn = 0;
                    Item ILost   = HiddenTrap.GetMyItem(from);
                    if (ILost != null)
                    {
                        ILost.Delete(); mReturn = 1;
                    }
                    if (mReturn != 1)
                    {
                        from.SendMessage("After drinking from the pool, you notice one of your equipped items disappears!");
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        LoggingFunctions.LogGenericQuest(from, "had an item vanish after drinking from a strange pool");
                    }
                }
                else if (m_Pool == 9)                   // LOSE A STAT POINT
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    this.m_Uses = this.m_Uses - 1;
                    int mCurse = 1;

                    if (m_Bonus > 8)
                    {
                        if (from.RawStr > 10)
                        {
                            from.RawStr = from.RawStr - 1; from.SendMessage("You lose a strength after drinking from the pool!");
                        }
                        else
                        {
                            from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0;
                        }
                    }
                    else if (m_Bonus > 5)
                    {
                        if (from.RawDex > 10)
                        {
                            from.RawDex = from.RawDex - 1; from.SendMessage("You lose a dexterity after drinking from the pool!");
                        }
                        else
                        {
                            from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0;
                        }
                    }
                    else
                    {
                        if (from.RawInt > 10)
                        {
                            from.RawInt = from.RawInt - 1; from.SendMessage("You lose an intelligence after drinking from the pool!");
                        }
                        else
                        {
                            from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0;
                        }
                    }

                    if (mCurse == 1)
                    {
                        from.FixedParticles(0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head);
                        from.FixedParticles(0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255);
                    }
                }
                else if (m_Pool == 100)                   // TREASURE CHEST
                {
                    from.PlaySound(0x364);
                    from.SendMessage("You pull a mystical chest out from the pool!");
                    this.m_Uses = 0;
                    LootChest MyChest = new LootChest(6);
                    MyChest.ItemID = Utility.RandomList(0x9AB, 0xE40, 0xE41, 0xE7C);
                    MyChest.Hue    = Utility.RandomList(0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, 0x97D, 0x97E, 0x4AA);
                    Region reg = Region.Find(from.Location, from.Map);
                    MyChest.Name = "mystical chest from " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location);
                    int xTraCash = Utility.RandomMinMax(5000, 8000);
                    ContainerFunctions.AddGoldToContainer(xTraCash, MyChest, 0);
                    int artychance = GetPlayerInfo.LuckyPlayerArtifacts(from.Luck) + 10;
                    if (Utility.RandomMinMax(0, 100) < artychance)
                    {
                        Item arty = ArtifactBuilder.CreateArtifact("random");
                        MyChest.DropItem(arty);
                    }
                    from.AddToBackpack(MyChest);

                    LoggingFunctions.LogGenericQuest(from, "found a chest full of treasure in some strange pool");
                }
                else                 // POISON
                {
                    if (from.Poisoned)
                    {
                        from.SendMessage("You are too sick to drink from this pool!");
                    }
                    else
                    {
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        if (m_Bonus > 9)
                        {
                            from.ApplyPoison(from, Poison.Deadly);
                        }
                        else if (m_Bonus > 7)
                        {
                            from.ApplyPoison(from, Poison.Greater);
                        }
                        else if (m_Bonus > 4)
                        {
                            from.ApplyPoison(from, Poison.Regular);
                        }
                        else
                        {
                            from.ApplyPoison(from, Poison.Lesser);
                        }
                        from.SendMessage("You feel more sick after drinking from the pool!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
            }
            else
            {
                from.SendMessage("The magic from the pool seems to be drained!");
            }
        }
コード例 #37
0
ファイル: Bandage.cs プロジェクト: michaelwhelehan/zuluhotel
        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);

            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)
            {
                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())                      //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
                    {
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        m_Patient.CloseGump <ResurrectGump>();;
                        m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                    }
                }
                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 (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 (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);
            }
        }
コード例 #38
0
ファイル: NobleSacrifice.cs プロジェクト: zerodowned/vivre-uo
        public override void OnCast()
        {
            if (CheckSequence())
            {
                List <Mobile> targets = new List <Mobile>();

                foreach (Mobile m in Caster.GetMobilesInRange(3))                     // TODO: Validate range
                {
                    if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
                    {
                        continue;
                    }

                    if (Caster != m && m.InLOS(Caster) && Caster.CanBeBeneficial(m, false, true) && !(m is Golem))
                    {
                        targets.Add(m);
                    }
                }

                Caster.PlaySound(0x244);
                Caster.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
                Caster.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);

                /* Attempts to Resurrect, Cure and Heal all targets in a radius around the caster.
                 * If any target is successfully assisted, the Paladin's current
                 * Hit Points, Mana and Stamina are set to 1.
                 * Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points.
                 */

                bool sacrifice = false;

                // TODO: Is there really a resurrection chance?

                double resChance = 0.1 + (0.9 * ((double)Caster.Karma / 10000));

                if ((Caster is PlayerMobile) && ((PlayerMobile)Caster).IsArtedarKnight)
                {
                    resChance = 0.1 + (0.9 * ((double)Caster.Fame / 7500));
                }


                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = targets[i];

                    if (!m.Alive)
                    {
                        if (m.Region != null && m.Region.IsPartOf("Khaldun"))
                        {
                            Caster.SendLocalizedMessage(1010395);                               // The veil of death in this area is too strong and resists thy efforts to restore life.
                        }
                        else if (resChance > Utility.RandomDouble())
                        {
                            m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
                            m.CloseGump(typeof(ResurrectGump));
                            m.SendGump(new ResurrectGump(m, Caster));
                            sacrifice = true;
                        }
                    }
                    else
                    {
                        bool sendEffect = false;

                        if (m.Poisoned && m.CurePoison(Caster))
                        {
                            Caster.DoBeneficial(m);

                            if (Caster != m)
                            {
                                Caster.SendLocalizedMessage(1010058);                      // You have cured the target of all poisons!
                            }
                            m.SendLocalizedMessage(1010059);                               // You have been cured of all poisons.
                            sendEffect = true;
                            sacrifice  = true;
                        }

                        if (m.Hits < m.HitsMax)
                        {
                            int toHeal = ComputePowerValue(10) + Utility.RandomMinMax(0, 2);

                            // TODO: Should caps be applied?
                            if (toHeal < 8)
                            {
                                toHeal = 8;
                            }
                            else if (toHeal > 24)
                            {
                                toHeal = 24;
                            }

                            Caster.DoBeneficial(m);
                            m.Heal(toHeal, Caster);
                            sendEffect = true;
                        }

                        StatMod mod;

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

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

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

                        if (m.Paralyzed)
                        {
                            m.Paralyzed = false;
                            sendEffect  = true;
                        }

                        if (EvilOmenSpell.TryEndEffect(m))
                        {
                            sendEffect = true;
                        }

                        if (StrangleSpell.RemoveCurse(m))
                        {
                            sendEffect = true;
                        }

                        if (CorpseSkinSpell.RemoveCurse(m))
                        {
                            sendEffect = true;
                        }

                        // TODO: Should this remove blood oath? Pain spike?

                        if (sendEffect)
                        {
                            m.FixedParticles(0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head);
                            sacrifice = true;
                        }
                    }
                }

                if (sacrifice)
                {
                    Caster.PlaySound(Caster.Body.IsFemale ? 0x150 : 0x423);
                    Caster.Hits = 1;
                    Caster.Stam = 1;
                    Caster.Mana = 1;
                }
            }

            FinishSequence();
        }
コード例 #39
0
ファイル: DMStone.cs プロジェクト: FreeReign/imaginenation
        private void ReadyPlayer(Mobile m)
        {
            if (!m_ScoreTable.ContainsKey(m.Serial))
                m_ScoreTable.Add(m.Serial, new ScoreKeeper(m));

            if (!m_UseSphereRules)
            {
                #region DistroCode

                bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed;
                bool MagicArmor = MagicArmorRule == pMagicArmorRule.Allowed;
                bool Potions = PotionRule == pPotionRule.Allowed;
                bool Bandages = BandageRule == pBandaidRule.Allowed;
                bool Pets = PetRule == pPetRule.Allowed;
                bool Mounts = MountRule == pMountRule.Allowed;

                if (!m.Alive)
                    m.Resurrect();

                Container bp = m.Backpack;
                Container bag = new Bag();
                bag.Hue = 38;
                BankBox bank = m.BankBox;
                Item oncurs = m.Holding;

                if (oncurs != null)
                    bp.DropItem(oncurs);

                m.CurePoison(m);

                m.Hits = m.HitsMax;
                m.Mana = m.ManaMax;
                m.Stam = m.StamMax;

                m.StatMods.Clear();

                List<Item> items = new List<Item>();

                foreach (Layer layer in PvpCore.EquipmentLayers)
                {
                    Item item = m.FindItemOnLayer(layer);

                    if (item != null)
                    {
                        if (item is BaseWeapon && !MagicWeapons)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                items.Add(weapon);
                            else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                items.Add(weapon);
                            else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                items.Add(weapon);
                        }
                        else if (item is BaseArmor && !MagicArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (armor.Durability != ArmorDurabilityLevel.Regular)
                                items.Add(armor);
                            else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                items.Add(armor);
                        }
                    }
                }

                if (m.Backpack != null)
                {
                    foreach (Item item in m.Backpack.Items)
                    {
                        if (item != null)
                        {
                            if (item is BaseWeapon && !MagicWeapons)
                            {
                                BaseWeapon weapon = (BaseWeapon) item;

                                if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                    items.Add(weapon);
                                else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                    items.Add(weapon);
                                else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                    items.Add(weapon);
                            }
                            else if (item is BaseArmor && !MagicArmor)
                            {
                                BaseArmor armor = (BaseArmor) item;

                                if (armor.Durability != ArmorDurabilityLevel.Regular)
                                    items.Add(armor);
                                else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                    items.Add(armor);
                            }
                            else if (item is BasePotion && !Potions)
                                items.Add(item);
                            else if (item is EtherealMount && !Mounts)
                                items.Add(item);
                            else if (item is Bandage && !Bandages)
                                items.Add(item);
                        }
                    }
                }

                if (!Mounts)
                {
                    if (m.Mount != null)
                    {
                        IMount mount = m.Mount;
                        mount.Rider = null;
                        if (mount is BaseMount)
                        {
                            if (mount is BaseCreature)
                            {
                                BaseCreature bc = (BaseCreature)mount;
                                bc.ControlTarget = null;
                                bc.ControlOrder = OrderType.Stay;
                                bc.Internalize();

                                bc.SetControlMaster(null);
                                bc.SummonMaster = null;

                                bc.IsStabled = true;
                                m.Stabled.Add(bc);
                                MountCollection.Add(m.Serial, bc);
                                m.SendMessage(38, "Your mount has been moved to the your stables");
                            }
                        }
                    }
                }

                if (items.Count > 0)
                    m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank.");

                foreach (Item item in items)
                    bag.AddItem(item);

                if (bag.Items.Count > 0)
                    bank.DropItem(bag);
                else
                    bag.Delete();

                #endregion
            }
            
            if (m_EventSupplier != null)
                m_EventSupplier.OnMoveOver(m);

            Contestants.Add(m);

            SpawnMobile(m);

            if ( m_GiveHorses )
                DMHorse.TryGiveHorse(m);

            if (m.NetState != null)
            {
                m.SendMessage(38, "You have joined a deathmatch");
                m.SendMessage(38, "You can check the score with \".DMScore\"");
            }
        }
コード例 #40
0
        protected override void OnTarget(object o)
        {
            Mobile m = o as Mobile;

            if (m != null)
            {
                if (m.IsDeadBondedPet)
                {
                    Caster.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
                {
                    Caster.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m is Golem)
                {
                    Caster.SendLocalizedMessage(1046439); // That is not a valid target.
                }
                else if (m.Hits > m.HitsMax && m.Stam >= m.StamMax && m.Mana >= m.ManaMax)
                {
                    Caster.SendLocalizedMessage(1155788); // Your target is already at full health, mana and stamina!
                }
                else if (CheckBSequence(m))
                {
                    double rejuv = ((double)GetMasteryLevel() * 33.3) / 100;

                    if (rejuv > 1.0)
                    {
                        rejuv = 1.0;
                    }

                    int hitsNeeds = m.HitsMax - m.Hits;
                    int stamNeeds = m.StamMax - m.Stam;
                    int manaNeeds = m.ManaMax - m.Mana;

                    int toRejuv = 0;

                    if (hitsNeeds > 0)
                    {
                        toRejuv = (int)Math.Ceiling(hitsNeeds * rejuv);

                        if (toRejuv > 0)
                        {
                            SpellHelper.Heal(toRejuv, m, Caster, false);
                        }
                    }

                    if (stamNeeds > 0)
                    {
                        toRejuv = (int)Math.Ceiling(stamNeeds * rejuv);

                        if (toRejuv > 0)
                        {
                            m.Stam += toRejuv;
                        }
                    }

                    if (manaNeeds > 0)
                    {
                        toRejuv = (int)Math.Ceiling(manaNeeds * rejuv);

                        if (toRejuv > 0)
                        {
                            m.Mana += toRejuv;
                        }
                    }

                    if (Caster.Karma > Utility.Random(5000))
                    {
                        if (m.Poison != null)
                        {
                            m.CurePoison(Caster);
                        }

                        StatMod mod;

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

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

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

                        m.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(m);
                        StrangleSpell.RemoveCurse(m);
                        CorpseSkinSpell.RemoveCurse(m);
                        CurseSpell.RemoveEffect(m);
                        MortalStrike.EndWound(m);
                        BloodOathSpell.RemoveCurse(m);
                        MindRotSpell.ClearMindRotScalar(m);

                        BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                        BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                        BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                        BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
                    }

                    Caster.PlaySound(0x102);

                    m.SendLocalizedMessage(1155789); // You feel completely rejuvenated!

                    if (Caster != m)
                    {
                        m.PlaySound(0x102);
                        Caster.SendLocalizedMessage(1155790); // Your target has been rejuvenated!
                    }

                    int skill = ((int)Caster.Skills[CastSkill].Value + GetWeaponSkill() + GetMasteryLevel() * 40) / 3;
                    int duration;

                    if (skill >= 120)
                    {
                        duration = 60;
                    }
                    else if (skill >= 110)
                    {
                        duration = 120;
                    }
                    else
                    {
                        duration = 180;
                    }

                    TimeSpan d;

                    if (Caster.AccessLevel == AccessLevel.Player)
                    {
                        d = TimeSpan.FromMinutes(duration);
                    }
                    else
                    {
                        d = TimeSpan.FromSeconds(10);
                    }

                    AddToCooldown(d);
                }
            }
            else
            {
                Caster.SendLocalizedMessage(1046439); // That is not a valid target.
            }
        }
コード例 #41
0
ファイル: BaseCreature.cs プロジェクト: greeduomacro/uotitan
		public virtual void Heal( Mobile patient )
		{
			if ( !Alive || this.Map == Map.Internal || !CanBeBeneficial( patient, true, true ) || patient.Map != this.Map || !InRange( patient, HealEndRange ) )
			{
				StopHeal();
				return;
			}

			bool onSelf = ( patient == this );

			if ( !patient.Alive )
			{
			}
			else if ( patient.Poisoned )
			{
				int poisonLevel = patient.Poison.Level;

				double healing = Skills.Healing.Value;
				double anatomy = Skills.Anatomy.Value;
				double chance = ( healing - 30.0 ) / 50.0 - poisonLevel * 0.1;

				if ( ( healing >= 60.0 && anatomy >= 60.0 ) && chance > Utility.RandomDouble() )
				{
					if ( patient.CurePoison( this ) )
					{
						patient.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.

						CheckSkill( SkillName.Healing, 0.0, 60.0 + poisonLevel * 10.0 ); // TODO: Verify formula
						CheckSkill( SkillName.Anatomy, 0.0, 100.0 );
					}
				}
			}
			else if ( BleedAttack.IsBleeding( patient ) )
			{
				patient.SendLocalizedMessage( 1060167 ); // The bleeding wounds have healed, you are no longer bleeding!
				BleedAttack.EndBleed( patient, false );
			}
			else
			{
				double healing = Skills.Healing.Value;
				double anatomy = Skills.Anatomy.Value;
				double chance = ( healing + 10.0 ) / 100.0;

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

					min = ( anatomy / 10.0 ) + ( healing / 6.0 ) + 4.0;
					max = ( anatomy / 8.0 ) + ( healing / 3.0 ) + 4.0;

					if ( onSelf )
						max += 10;

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

					toHeal *= HealScalar;

					patient.Heal( (int)toHeal );

					CheckSkill( SkillName.Healing, 0.0, 90.0 );
					CheckSkill( SkillName.Anatomy, 0.0, 100.0 );
				}
			}

			HealEffect( patient );

			StopHeal();

			if ( ( onSelf && HealFully && Hits >= HealTrigger * HitsMax && Hits < HitsMax ) || ( !onSelf && HealOwnerFully && patient.Hits >= HealOwnerTrigger * patient.HitsMax && patient.Hits < patient.HitsMax ) )
				HealStart( patient );
		}
コード例 #42
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        // Archcure doesn't cure aggressors or victims or criminals
                        if (Caster.CanBeBeneficial(m, false) && (!Core.AOS || !IsAggressor(m) && !IsAggressed(m)) && !m.Criminal)
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                Effects.PlaySound(p, Caster.Map, 0x299);

                if (targets.Count > 0)
                {
                    int cured = 0;

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        Caster.DoBeneficial(m);

                        Poison poison = m.Poison;

                        if (poison != null)
                        {
                            int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) - ((poison.Level + 1) * 1750);
                            chanceToCure /= 100;

                            if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                            {
                                ++cured;
                            }
                        }

                        m.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                        m.PlaySound(0x1E0);
                    }

                    if (cured > 0)
                    {
                        Caster.SendLocalizedMessage(1010058);                           // You have cured the target of all poisons!
                    }
                }
            }

            FinishSequence();
        }