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();
		}
Example #2
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 ( 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();
        }
Example #3
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!
			}
		}
		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!
			}
		}
Example #5
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);

				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();
		}
Example #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();
        }
		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();
		}
Example #8
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 );

				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();
		}
Example #9
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 );

                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();
        }
Example #10
0
        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);
        }
Example #11
0
        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();
        }
Example #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();
		}
Example #13
0
        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();
        }
Example #14
0
		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.");
		}
Example #15
0
        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 );
        }
Example #16
0
        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;
        }
Example #17
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 );
				//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();
		}
Example #18
0
        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\"");
            }
        }
Example #19
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 );
				//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();
		}
Example #20
0
		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 );
		}
Example #21
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();
		}