Example #1
0
		public override sealed bool Eat(Mobile from)
		{
			if (from == null || from.Deleted)
			{
				return false;
			}

			if (CheckHunger(from))
			{
				from.PlaySound(Utility.Random(0x3A, 3));

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

				if (Poison != null)
				{
					from.ApplyPoison(Poisoner, Poison);
				}

				OnEaten(from);
				Consume();
				return true;
			}

			return false;
		}
Example #2
0
        public override bool Eat( Mobile from )
        {
            if ( !CheckCooldown( from ) )
                return false;

            // The grapes of wrath invigorate you for a short time, allowing you to deal extra damage.
            from.SendLocalizedMessage( 1074847 );

            m_InfluenceList.Add( from );
            m_CooldownTable.Add( from, DateTime.Now + Cooldown );

            Timer.DelayCall( Duration, new TimerStateCallback( delegate { m_InfluenceList.Remove( from ); } ), from );

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

            from.Animate( 6 );

            if ( Poison != null )
                from.ApplyPoison( Poisoner, Poison );

            Consume();

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

			if ( !attacker.IsT2A && Layer == Layer.TwoHanded
                && (attacker.Skills[SkillName.Anatomy].Value / 100.0 * SpecialMovesController._SpearStunMaxChance) >= Utility.RandomDouble() 
                && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
			{
				defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you!
                defender.Freeze(TimeSpan.FromSeconds( SpecialMovesController._SpearStunDurationSeconds ));

				attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
				attacker.PlaySound( 0x11C );
			}

			if ( Poison != null && PoisonCharges > 0 && defender.Poison != Poison)
			{
			    bool chargeConsume = false;
                double chance = 
                    (attacker.Skills[SkillName.Tactics].Value + attacker.Skills[OldSkill].Value) / 200.0 * SpecialMovesController._PoisonChanceSpears
                    + (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus);
				if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
				{
				    chargeConsume = true;
                    --PoisonCharges;
					defender.ApplyPoison( attacker, Poison );
				}
                if (!chargeConsume && 0.25 > Utility.RandomDouble())
                    --PoisonCharges;
			}
		}
		public override void OnHit(Mobile attacker, Mobile defender, int damage)
		{
			if (!Validate(attacker) || !CheckMana(attacker, true))
				return;

			ClearCurrentAbility(attacker);


			attacker.SendMessage("You poisoned your target.");
			defender.SendMessage("You've been poisoned.");

			int level;

			if (Core.AOS)
			{
				if (attacker.InRange(defender, 2))
				{
					int total = (attacker.Skills.Poisoning.Fixed) / 2;

					if (total >= 1000)
						level = 3;
					else if (total > 850)
						level = 2;
					else if (total > 650)
						level = 1;
					else
						level = 0;
				}
				else
				{
					level = 0;
				}
			}
			else
			{
				double total = attacker.Skills[SkillName.Poisoning].Value;

				double dist = attacker.GetDistanceToSqrt(defender);

				if (dist >= 3.0)
					total -= (dist - 3.0) * 10.0;

				if (total >= 200.0 && 1 > Utility.Random(10))
					level = 3;
				else if (total > (Core.AOS ? 170.1 : 170.0))
					level = 2;
				else if (total > (Core.AOS ? 130.1 : 130.0))
					level = 1;
				else
					level = 0;
			}

			defender.ApplyPoison(attacker, Poison.GetPoison(level));

			defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
			defender.PlaySound(0x474);
		}
Example #5
0
		public override void ExecuteTrap( Mobile from )
		{
			base.ExecuteTrap( from );

			Effects.SendLocationEffect( new Point3D( this.Door.X, this.Door.Y, this.Door.Z ), this.Door.Map, 0x11A6, 16, 3 );
			Effects.PlaySound( this.Door.Location, this.Door.Map, 0x231 );

			from.ApplyPoison( this.Owner, Poison.Lethal );

			try
			{
				foreach( Mobile m in this.Door.GetMobilesInRange( 2 ) )
				{
					if( from.Alive )
						from.ApplyPoison( this.Owner, Poison.Deadly );
				}
			}
			catch { }
		}
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			base.OnHit( attacker, defender );

			if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
			{
				--PoisonCharges;

				if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Example #7
0
	public override void OnMovement( Mobile m, Point3D oldLocation )
	{
	            if ( m.InRange( Location, 1 ) )

	     {
				if ( m.Alive )
		      {
                       m.PlaySound( 0x813 );
		    		   m.ApplyPoison( m, Poison.Deadly );
	             }
         }
}    
Example #8
0
        public override void OnHit( Mobile attacker, Mobile defender )
        {
            base.OnHit( attacker, defender );

            if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
            {
                --PoisonCharges;

                if ( Utility.RandomDouble() < PoisonChance && !defender.Poisoned )
                {
                    defender.ApplyPoison( attacker, Poison );
                    defender.SayTo( defender,  true, "{0} has just poisoned you!", attacker.Name );
                }
            }
        }
Example #9
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( Poison != null && PoisonCharges > 0 && ( !defender.Player || attacker.Followers < 5 ) )
			{
                double chance =
                    (attacker.Skills[SkillName.Tactics].Value + attacker.Skills[OldSkill].Value) / 200.0 * SpecialMovesController._PoisonChanceKnives
                    + (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus)
                    - (attacker.Followers * SpecialMovesController._PoisonChancePenaltyPerFollower);
				if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
				{
					defender.ApplyPoison( attacker, Poison );
					--PoisonCharges;
				}
			}
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
				{
					//from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
					from.SendMessage( "You decide against eating it while incognitoed " );
				}
				else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
				{
					//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
					from.SendMessage( "You can not be polymorphed at this time" );
				}
				else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
				{
					//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
					from.SendMessage( "You decide against eating it while polymorphed" );
				}
				else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask || from.FindItemOnLayer( Layer.Helm ) is OrcishKinRPMask )
				{
					//from.SendLocalizedMessage( 501605 ); // You are already disguised.
					from.SendMessage( "You decide against eating it while as your disguised" );
				}
				else
				{
					from.BodyMod = ( from.Female ? 186 : 185 );
					from.HueMod = 0;

					if ( from is PlayerMobile )
						((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );

					//from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe.  Your body paint will last about a week or you can remove it with an oil cloth.
					from.SendMessage( "You now bear the markings of the undead pirates.  This will last about a week" );
					from.PlaySound( Utility.Random( 0x3A, 3 ) );
					if ( from.Body.IsHuman && !from.Mounted )
						from.Animate( 34, 5, 1, true, false, 0 );
					from.ApplyPoison( from, Poison.Lethal );
					Consume();
				}
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
Example #11
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( Poison != null && PoisonCharges > 0 && defender.Poison != Poison )
			{
                bool chargeConsume = false;
                double chance =
                    (attacker.Skills[SkillName.Tactics].Value + attacker.Skills[OldSkill].Value) / 200.0 * SpecialMovesController._PoisonChanceSwords
                    + (attacker.Skills[SkillName.Poisoning].Value / 100.0 * SpecialMovesController._PoisonSkillChanceMaxBonus);
				if ( chance > Utility.RandomDouble() ) // 50% chance to poison @ GM
				{
                    chargeConsume = true;
					defender.ApplyPoison( attacker, Poison );
					--PoisonCharges;
				}
                if (!chargeConsume && 0.25 > Utility.RandomDouble())
                    --PoisonCharges;
			}
		}
Example #12
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( !Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
			{
				defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
				defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );

				attacker.SendMessage( "You deliver a paralyzing blow!" ); // Is this not localized?
				attacker.PlaySound( 0x11C );
			}

			if ( !Core.AOS && Poison != null && PoisonCharges > 0 )
			{
				--PoisonCharges;

				if ( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Example #13
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

            if ((attacker.Skills[SkillName.Anatomy].Value / 1000.0) >= Utility.RandomDouble()) // 10% chance to paralyze at 100 anatomy.
			{
				defender.SendMessage( "You receive a paralyzing blow!" );
				defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );

				attacker.SendMessage( "You deliver a paralyzing blow!" ); 
				attacker.PlaySound( 0x11C );
			}

			if( Core.AOS && Poison != null && PoisonCharges > 0 )
			{
				--PoisonCharges;

				if( Utility.RandomDouble() >= 0.5 ) // 50% chance to poison
					defender.ApplyPoison( attacker, Poison );
			}
		}
Example #14
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
					from.SendMessage( "You decide against eating it while in incognito." );
				else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
					from.SendMessage( "You can not be polymorphed at this time." );
				//else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( WraithFormSpell ) ) )
				//	from.SendMessage( "You decide against eating it while polymorphed." );
				else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
					from.SendMessage( "You decide against eating it while in your disguise." );
				else
				{
					if ( from is PlayerMobile )
					{
						PlayerMobile pm = from as PlayerMobile;
						if ( pm.SavagePaintExpiration > TimeSpan.Zero )
							from.SendMessage( "You already have the markings of another tribe." );
						else
						{
							from.BodyMod = ( from.Female ? 186 : 185 );
							from.HueMod = 0;

							pm.SavagePaintExpiration = TimeSpan.FromDays( 7.0 );

							//from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe.  Your body paint will last about a week or you can remove it with an oil cloth.
							from.SendMessage( "You now bear the markings of the undead pirates.  This will last about a week." );
							from.PlaySound( Utility.Random( 0x3A, 3 ) );
							if ( from.Body.IsHuman && !from.Mounted )
								from.Animate( 34, 5, 1, true, false, 0 );
							from.ApplyPoison( from, Poison.Greater );
							Consume();
						}
					}
				}
			}
			else
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		}
Example #15
0
		public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
		{
			if ( this.Charges >= 1 && Utility.RandomDouble() <= .2 && defender.Poisoned == false)
			{
				int poisontype = 0;
				poisontype += (int)( (attacker.Skills.Poisoning.Value / 50) - (defender.Skills.Poisoning.Value / 100) );
				if ( poisontype < 0 ) poisontype = 0;
				if ( poisontype > 4 ) poisontype = 4;
				switch(poisontype)
				{
					case 0: default: Poison = Poison.Lesser; break;
					case 1 :Poison = Poison.Regular; break;
					case 2: Poison = Poison.Greater; break;
					case 3: Poison = Poison.Deadly; break;
					case 4: Poison = Poison.Lethal; break;
				}
				defender.ApplyPoison(attacker, Poison);
				attacker.SendMessage("Venom Strikes! {0}", Convert.ToString(Poison) );
				this.Charges -= 1;
				attacker.Karma -= 25;
			}
			base.OnHit(attacker, defender, damageBonus);
		}
Example #16
0
        public static void ApplyPoisonToPlayers(string arglist, Mobile triggermob, object refobject, out string status_str)
        {
            status_str = null;
            Item refitem = null;
            Mobile refmob = null;

            if (refobject is Item)
            {
                refitem = (Item)refobject;
            }
            else if (refobject is Mobile)
            {
                refmob = (Mobile)refobject;
            }

            // look for the other args
            string[] str = ParseString(arglist, 4, ",");
            bool playeronly = false;
            int range = 0;
            if (str.Length < 2)
            {
                status_str = "missing poisontype in POISON";
            }
            if (str.Length > 2)
            {
                // get the range arg
                try
                {
                    range = int.Parse(str[2]);
                }
                catch { status_str = "bad range arg in POISON"; }
            }
            if (str.Length > 3)
            {
                if (str[3].ToLower() == "playeronly") playeronly = true;
            }
            try
            {
                if ((range > 0) || (triggermob != null && !triggermob.Deleted))
                {
                    // apply the poison to all players within range if range is > 0
                    if (range > 0)
                    {

                        IPooledEnumerable rangelist = null;
                        if (refitem != null && !refitem.Deleted)
                        {
                            rangelist = refitem.GetMobilesInRange(range);

                        }
                        else if (refmob != null && !refmob.Deleted)
                        {

                            rangelist = refmob.GetMobilesInRange(range);

                        }

                        if (rangelist != null)
                        {
                            foreach (Mobile p in rangelist)
                            {

                                if (p is PlayerMobile || !playeronly)
                                    p.ApplyPoison(p, Poison.Parse(str[1]));
                            }
                            rangelist.Free();
                        }
                    }
                    else
                    {
                        // just apply it to the mob who triggered
                        triggermob.ApplyPoison(triggermob, Poison.Parse(str[1]));

                    }
                }
            }
            catch { }
        }
 public void PoisonAttack( Mobile m )
 {
     DoHarmful( m );
     this.MovingParticles( m, 0x36D4, 1, 0, false, false, 0x3F, 0, 0x1F73, 1, 0, (EffectLayer)255, 0x100 );
     m.ApplyPoison( this, Poison.Regular );
     m.SendLocalizedMessage( 1070821, this.Name ); // %s spits a poisonous substance at you!
 }
		public override void DoAttackEffect( Mobile m )
		{
			m.ApplyPoison( m, Poison.Lethal );
		}
		public void DoDamage( Mobile to )
		{
			switch ( Utility.Random( 4 ) )
			{
				case 0:
				{
					Effects.SendLocationEffect( to, to.Map, 0x113A, 20, 10 );
					to.PlaySound( 0x231 );
					to.LocalOverheadMessage( MessageType.Regular, 0x44, 1010523 ); // A toxic vapor envelops thee.

					to.ApplyPoison( to, Poison.Regular );

					break;
				}
				case 1:
				{
					Effects.SendLocationEffect( to, to.Map, 0x3709, 30 );
					to.PlaySound( 0x54 );
					to.LocalOverheadMessage( MessageType.Regular, 0xEE, 1010524 ); // Searing heat scorches thy skin.

					AOS.Damage( to, to, Utility.RandomMinMax( 10, 40 ), 0, 100, 0, 0, 0 );

					break;
				}
				case 2:
				{
					to.PlaySound( 0x223 );
					to.LocalOverheadMessage( MessageType.Regular, 0x62, 1010525 ); // Pain lances through thee from a sharp metal blade.

					AOS.Damage( to, to, Utility.RandomMinMax( 10, 40 ), 100, 0, 0, 0, 0 );

					break;
				}
				default:
				{
					to.BoltEffect( 0 );
					to.LocalOverheadMessage( MessageType.Regular, 0xDA, 1010526 ); // Lightning arcs through thy body.

					AOS.Damage( to, to, Utility.RandomMinMax( 10, 40 ), 0, 0, 0, 0, 100 );

					break;
				}
			}
		}
Example #20
0
		public override bool OnFailDisarm(Mobile from)
		{
			bool bExploded = false;
			
			double rtskill = from.Skills[SkillName.RemoveTrap].Value;

			double chance = (TrapPower-rtskill)/800;
			
			//make sure there's some chance to trip
			if( chance <= 0 ) chance = .005; //minimum of 1/200 trip
			if( chance >= 1 ) chance = .995;
			chance *= m_TrapSensitivity;

			//debug message only available to non-Player level
			if( from.AccessLevel > AccessLevel.Player)
			{
				from.SendMessage("Chance to trip trap: " + chance);
			}

			if( Utility.RandomDouble() < chance )
			{ //trap is tripped, effect disarmer
				int damage = TrapPower/2 + (Utility.Random(4,12)*TrapPower/25) - (int)rtskill/5;
				int traptype = 0;
				traptype = Utility.Random(0, 3);

				switch ( traptype )
				{
					case 0: //explosion
					{
						from.SendLocalizedMessage( 502999 ); // You set off a trap!

						if ( from.InRange( GetWorldLocation(), 2 ) )
						{
							AOS.Damage( from, damage, 0, 100, 0, 0, 0 );
							from.SendLocalizedMessage( 503000 ); // Your skin blisters from the heat!
						}

						Point3D loc = GetWorldLocation();

						Effects.PlaySound( loc, Map, 0x307 );
						Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z - 11 ), Map, 0x36BD, 15 );

						break;
					}
					case 1: //dart
					{
						from.SendLocalizedMessage( 502999 ); // You set off a trap!

						if ( from.InRange( GetWorldLocation(), 2 ) )
						{
							AOS.Damage( from, damage/2, 100, 0, 0, 0, 0 );
							from.SendLocalizedMessage( 502380 ); // A dart embeds...
						}

						Point3D loc = GetWorldLocation();

						Effects.PlaySound( loc, Map, 0x223 );
						//What effect?!?
						//Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z - 11 ), Map, 0x36BD, 15 );
						break;
					}
					case 2: //poison
					{
						from.SendLocalizedMessage( 502999 ); // You set off a trap!

						if ( from.InRange( GetWorldLocation(), 2 ) )
						{
							Poison p = Poison.Lesser;
							if( damage >= 30 )
								p = Poison.Regular;
							if( damage >= 60 )
								p = Poison.Greater;
							if( damage >= 90 )
								p = Poison.Deadly;
							if( damage >= 100 )
								p = Poison.Lethal;

							from.ApplyPoison( from, p );
							from.SendLocalizedMessage( 503004 ); // You are enveloped...
						}

						Point3D loc = GetWorldLocation();

						Effects.PlaySound( loc, Map, 0x231 );
						Effects.SendLocationEffect( new Point3D( loc.X + 1, loc.Y + 1, loc.Z - 11 ), Map, 0x11A6, 20 ); 
						break;
					}
				}
				from.RevealingAction();
				bExploded = true;
			}

			return bExploded;
		}
		public virtual void Pour_OnTarget( Mobile from, object targ )
		{
			if ( IsEmpty || !Pourable || !ValidateUse( from, false ) )
				return;

			if ( targ is BaseBeverage )
			{
				BaseBeverage bev = (BaseBeverage)targ;

				if ( !bev.ValidateUse( from, true ) )
					return;

				if ( bev.IsFull && bev.Content == this.Content )
				{
					from.SendLocalizedMessage( 500848 ); // Couldn't pour it there.  It was already full.
				}
				else if ( !bev.IsEmpty )
				{
					from.SendLocalizedMessage( 500846 ); // Can't pour it there.
				}
				else
				{
					bev.Content = this.Content;
					bev.Poison = this.Poison;
					bev.Poisoner = this.Poisoner;

					if ( this.Quantity > bev.MaxQuantity )
					{
						bev.Quantity = bev.MaxQuantity;
						this.Quantity -= bev.MaxQuantity;
					}
					else
					{
						bev.Quantity += this.Quantity;
						this.Quantity = 0;
					}

					from.PlaySound( 0x4E );
				}
			}
			else if ( from == targ )
			{
				if ( from.Thirst < 20 )
					from.Thirst += 1;

				if ( ContainsAlchohol )
				{
					int bac = 0;

					switch ( this.Content )
					{
						case BeverageType.Ale: bac = 1; break;
						case BeverageType.Wine: bac = 2; break;
						case BeverageType.Cider: bac = 3; break;
						case BeverageType.Liquor: bac = 4; break;
					}

					from.BAC += bac;

					if ( from.BAC > 60 )
						from.BAC = 60;

					CheckHeaveTimer( from );
				}

				from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );

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

				--Quantity;
			}
			else if ( targ is PlantItem )
			{
				((PlantItem)targ).Pour( from, this );
			}
			else if ( targ is AddonComponent &&
				( ((AddonComponent)targ).Addon is WaterVatEast || ((AddonComponent)targ).Addon is WaterVatSouth ) &&
				this.Content == BeverageType.Water )
			{
				PlayerMobile player = from as PlayerMobile;

				if ( player != null )
				{
					SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

					if ( qs != null )
					{
						QuestObjective obj = qs.FindObjective( typeof( GatherWaterObjective ) );

						if ( obj != null && !obj.Completed )
						{
							BaseAddon vat = ((AddonComponent)targ).Addon;

							if ( vat.X > 5784 && vat.X < 5814 && vat.Y > 1903 && vat.Y < 1934 &&
								( (qs.RedSolen && vat.Map == Map.Trammel) || (!qs.RedSolen && vat.Map == Map.Felucca) ) )
							{
								if ( obj.CurProgress + Quantity > obj.MaxProgress )
								{
									int delta = obj.MaxProgress - obj.CurProgress;

									Quantity -= delta;
									obj.CurProgress = obj.MaxProgress;
								}
								else
								{
									obj.CurProgress += Quantity;
									Quantity = 0;
								}
							}
						}
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 500846 ); // Can't pour it there.
			}
		}
Example #22
0
        public virtual void OnGaveMeleeAttack( Mobile defender )
        {
            Poison p = HitPoison;

            if ( m_Paragon )
                p = PoisonImpl.IncreaseLevel( p );

            if ( p != null && HitPoisonChance >= Utility.RandomDouble() )
                defender.ApplyPoison( this, p );

            if ( AutoDispel && defender is BaseCreature && ((BaseCreature)defender).Summoned && !((BaseCreature)defender).IsAnimatedDead )
                Dispel( defender );
        }
Example #23
0
        /*
        public override bool Eat( Mobile from )
        {
            if( CheckEatRequirement( from ) )
                if( FillHunger( from, m_FillFactor, HitsBonus, ManaBonus ) )
                {
                    Use( from );

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

                    return true;
                }
            return false;
        }
        */
        // modified by alari for new food system
        public override bool Eat( Mobile from )
        {
            if( CheckEatRequirement( from ) )
            {
                // Fill the Mobile with FillFactor
                if ( FillHunger( from, FillFactor, HitsBonus, ManaBonus ) )  // 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 );

                    Use( from );

                    return true;
                }
            }

            return false;
        }
Example #24
0
        public virtual void Pour_OnTarget( Mobile from, object targ )
        {
            if ( IsEmpty || !Pourable || !ValidateUse( from, false ) )
                return;

            if ( targ is BaseBeverage )
            {
                BaseBeverage bev = (BaseBeverage)targ;

                if ( !bev.ValidateUse( from, true ) )
                    return;

                if ( bev.IsFull && bev.Content == this.Content )
                {
                    from.SendLocalizedMessage( 500848 ); // Couldn't pour it there.  It was already full.
                }
                else if ( !bev.IsEmpty )
                {
                    from.SendLocalizedMessage( 500846 ); // Can't pour it there.
                }
                else
                {
                    bev.Content = this.Content;
                    bev.Poison = this.Poison;
                    bev.Poisoner = this.Poisoner;

                    if ( this.Quantity > bev.MaxQuantity )
                    {
                        bev.Quantity = bev.MaxQuantity;
                        this.Quantity -= bev.MaxQuantity;
                    }
                    else
                    {
                        bev.Quantity += this.Quantity;
                        this.Quantity = 0;
                    }

                    from.PlaySound( 0x4E );
                }
            }
            else if ( from == targ )
            {
                if ( from.Thirst < 20 )
                    from.Thirst += 1;

                if ( ContainsAlchohol )
                {
                    int heaves = 0;

                    switch ( this.Content )
                    {
                        case BeverageType.Ale: heaves = 3; break;
                        case BeverageType.Wine: heaves = 5; break;
                        case BeverageType.Cider: heaves = 5; break;
                        case BeverageType.Liquor: heaves = 10; break;
                        default:				heaves = 5; break;
                    }

                    from.BAC += heaves;

                    if ( from.BAC > 60 )
                        from.BAC = 60;

                    CheckHeaveTimer( from );
                }

                from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );

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

                --Quantity;
            }
            else if ( targ is SackFlour )
            {
                SackFlour flour = (SackFlour)targ;
                --Quantity;
                flour.Quantity--;
                if ( flour.Deleted )
                    from.SendAsciiMessage( "No flour left." );
                from.SendAsciiMessage( "You make some dough and put it in your backpack" );
                from.AddToBackpack( new Dough() );
            }
            else
            {
                from.SendLocalizedMessage( 500846 ); // Can't pour it there.
            }
        }
        public virtual void OnGaveMeleeAttack( Mobile defender )
        {
            Poison p = HitPoison;

            if ( m_Paragon )
                p = PoisonImpl.IncreaseLevel( p );

            if ( p != null && HitPoisonChance >= Utility.RandomDouble() ) {
                defender.ApplyPoison( this, p );
                if ( this.Controlled )
                    this.CheckSkill(SkillName.Poisoning, 0, this.Skills[SkillName.Poisoning].Cap);
            }

            if( AutoDispel && defender is BaseCreature && ((BaseCreature)defender).IsDispellable && AutoDispelChance > Utility.RandomDouble() )
                Dispel( defender );
        }
Example #26
0
        public void SpringTrap(Mobile from)
        {
            if (from == null || !from.Alive)
                return;

            int cliloc;
            int damage = Utility.RandomMinMax(75, 150);

            switch (Utility.Random(4))
            {
                default:
                case 0:
                    Effects.SendLocationEffect( from, from.Map, 0x3709, 30 );
					from.PlaySound( 0x54 );
                    cliloc = 1010524; // Searing heat scorches thy skin.
                    AOS.Damage(from, damage, 0, 100, 0, 0, 0);
                    break;
                case 1:
                    from.PlaySound(0x223);
                    cliloc = 1010525; // Pain lances through thee from a sharp metal blade.
                    AOS.Damage(from, damage, 100, 0, 0, 0, 0);
                    break;
                case 2:
                    from.BoltEffect(0);
                    cliloc = 1010526; // Lightning arcs through thy body.
                    AOS.Damage(from, damage, 0, 0, 0, 0, 100);
                    break;
                case 3:
                    Effects.SendLocationEffect( from, from.Map, 0x113A, 20, 10 );
					from.PlaySound( 0x231 );
                    from.ApplyPoison(from, Poison.Deadly);
                    cliloc = 1010523; // A toxic vapor envelops thee.
                    AOS.Damage(from, damage, 0, 0, 0, 100, 0);
                    break;
            }

            from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0xEE, cliloc);
        }
Example #27
0
		public override void OnDoubleClick(Mobile from)
		{
			if (this.ItemID == 0x978) //in jerky form, eat it
			{
				if (!Movable)
					return;

				if (from.InRange(this.GetWorldLocation(), 1))
				{
					int fillfactor = Utility.RandomMinMax(-5, 10);

					// Fill the Mobile with FillFactor
					if (Food.FillHunger(from, fillfactor))
					{
						if (fillfactor < 0)
						{
							from.SendMessage("That jerky didn't taste too good!");
							from.Stam -= Utility.Random(15, 10);
						}

						// 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 (this.Poison != null)
							from.ApplyPoison(this.Poisoner, this.Poison);

						Consume();
					}
				}
			}
			else
			{
				if (Movable) //if it's not movable, then we're already cooking it
				{
					from.SendMessage("Target the fire to make jerky.");
					from.Target = new CookTarget(this);
				}
			}
		}
		public void DoPoison( Mobile from )
		{
			from.ApplyPoison( from, Poison );
		}
Example #29
0
        public override void OnTrigger( Mobile from )
        {
            if ( m_Poison == null || !from.IsPlayer || !from.Alive || from.AccessLevel > AccessLevel.Player )
            {
                return;
            }

            Effects.SendLocationEffect( Location, Map, GetBaseID( this.Type ) - 2, 16, 3, GetEffectHue(), 0 );
            Effects.PlaySound( Location, Map, 0x231 );

            from.ApplyPoison( from, m_Poison );

            from.LocalOverheadMessage( MessageType.Regular, 0x22, 500855 ); // You are enveloped by a noxious gas cloud!
        }
Example #30
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                SilverSerpent serpent = targeted as SilverSerpent;

                if ( serpent == null )
                {
                    // You may only use this on a silver serpent.
                    from.SendLocalizedMessage( 1112221 );
                }
                else if ( !from.InRange( serpent, 1 ) )
                {
                    // That is too far away.
                    from.SendLocalizedMessage( 500446 );
                }
                else if ( serpent.CharmMaster == null )
                {
                    // You seem to anger the beast!
                    serpent.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502805, from.Client );
                }
                else if ( serpent.Venom == SilverSerpent.VenomLeft.None )
                {
                    // This serpent has already been drained of all its venom.
                    from.SendLocalizedMessage( 1112223 );
                }
                else
                {
                    if ( Utility.RandomBool() )
                    {
                        from.AddToBackpack( new SilverSerpentVenom() );

                        if ( serpent.Venom == SilverSerpent.VenomLeft.All )
                            from.SendLocalizedMessage( 1112220 ); // You manage to extract some resources from the creature.
                        else
                            from.SendLocalizedMessage( 1112219 ); // You skillfully extract additional resources from the creature.

                        if ( serpent.Venom == SilverSerpent.VenomLeft.Half || Utility.RandomBool() )
                            serpent.Venom = SilverSerpent.VenomLeft.None;
                        else
                            serpent.Venom = SilverSerpent.VenomLeft.Half;

                        m_Vial.Consume();
                    }
                    else
                    {
                        // You handle the creature but fail to harvest any resources from it.
                        from.SendLocalizedMessage( 1112218 );
                    }

                    if ( Utility.RandomBool() )
                        from.ApplyPoison( serpent, serpent.Poison );
                }
            }