public override void HideEffects(Mobile from)
		{
            if (from == null || from.Deleted)
                return;

			if (playing)
                from.SendMessage("You must wait for the animation to finish.");
            else if (from.Hidden)
            {
                playing = true;
                tohide = false;
                tempHue = from.Hue;
                tempBody = from.BodyValue;
                from.Hue = 0;
                from.BodyValue = 15;
                from.Hidden = false;
                from.Animate(12, 10, 0, true, false, 0);
                from.PlaySound(273);
                Timer.DelayCall(TimeSpan.FromMilliseconds(1500.0), new TimerStateCallback(AnimStop_Callback), from);
            }
            else
            {
                playing = true;
                tohide = true;
                from.Animate(17, 4, 1, true, false, 0);
                Timer.DelayCall(TimeSpan.FromMilliseconds(750.0), new TimerStateCallback(CastStop_Callback), from);
            }

        }
Пример #2
0
		public override void PlayCraftEffect( Mobile from )
		{
			// no animation 
			if ( from.Body.Type == BodyType.Human ) // Vulcan: Added mounted animation
            {
                if (!from.Mounted)
                    from.Animate(9, 5, 1, true, false, 0);
                else
                    from.Animate(26, 5, 1, true, false, 0);
            }
			from.PlaySound( 0x23D );
		}
Пример #3
0
        public override bool Eat(Mobile from)
        {

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("Ceci doit être dans votre sac");
                return false;
            }

            // Fill the Mobile with FillFactor
            if (from is PlayerMobile)
            {
                CanEat = false;
                Timer.DelayCall(TimeSpan.FromSeconds(3), ChangeCanEat);
                // 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 (Poison != null)
                    from.ApplyPoison(Poisoner, Poison);

                if (from.Hunger < 20)
                    from.Hunger += Utility.Random(FillFactor);

                DoEffect(from);

                return true;
            }
            return false;
        }
Пример #4
0
		public override void PlayCraftEffect( Mobile from ) 
		{ 
			// no effects
			if ( from.Body.Type == BodyType.Human && !from.Mounted ) 
				from.Animate( 9, 5, 1, true, false, 0 ); 
			new InternalTimer( from ).Start(); 
		} 
Пример #5
0
		public void Throw( Mobile from )
		{
			BaseKnife knife = from.Weapon as BaseKnife;

			if ( knife == null )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife...
				return;
			}

			from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
			from.MovingEffect( this, knife.ItemID, 7, 1, false, false );
			from.PlaySound( 0x238 );

			double rand = Utility.RandomDouble();

			int message;
			if ( rand < 0.05 )
				message = 500752; // BULLSEYE! 50 Points!
			else if ( rand < 0.20 )
				message = 500753; // Just missed the center! 20 points.
			else if ( rand < 0.45 )
				message = 500754; // 10 point shot.
			else if ( rand < 0.70 )
				message = 500755; // 5 pointer.
			else if ( rand < 0.85 )
				message = 500756; // 1 point.  Bad throw.
			else
				message = 500757; // Missed.

			PublicOverheadMessage( MessageType.Regular, 0x3B2, message );
		}
Пример #6
0
        /// <summary>
        /// Execution de la gifle
        /// </summary>
        public static void Gifle_Callback(Mobile mJoueur, object objCible)
        {
            if (objCible is Mobile)
            {
                Mobile mCible = objCible as Mobile;

                // si le joueur s'est ciblé lui même
                if (mJoueur == mCible)
                    mJoueur.Emote("*{0} se gifle*", mJoueur.Name);
                // si il reussi a donner la gifle
                else if (Utility.Random(10) > 3)    // Scriptiz : pas besoin de stocker le booléen
                {
                    mJoueur.Emote("*{0} gifle {1}*", mJoueur.Name, mCible.Name);
                    mCible.Emote("*{0} se prend une gifle de {1}*", mCible.Name, mJoueur.Name);
                }
                else // quel looseur il s'est manqué
                {
                    mJoueur.Emote("*{0} gifle {1}, mais ratte*", mJoueur.Name, mCible.Name );
                    mCible.Emote("*{0} esquive une gifle de {1}*", mCible.Name, mJoueur.Name);
                }

                // animation
                mCible.Animate(20, 1, 1, true, false, 2);
                mJoueur.Animate(33, 1, 1, true, false, 2);

                // Scriptiz : son
                mCible.PlaySound(0x135);
            }
        }
Пример #7
0
        public override bool Eat(Mobile from)
        {
            if (CheckHunger(from))
            {
                from.PlaySound(Utility.Random(0x3A, 3));

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

                if (from is PlayerMobile || !from.IsHallucinated)
                {
                    PlayerMobile junkie = from as PlayerMobile;
                    junkie.Hallucinating = true;
                    junkie.IncAddiction(new HallucinogenPotion());
                    Timer.DelayCall(TimeSpan.FromMinutes(5), HallucinogenPotion.StopHallucinate, junkie);
                }
                else if (Poison != null)
                    from.ApplyPoison(Poisoner, Poison);

                Consume();

                return true;
            }

            return false;
        }
Пример #8
0
		public override void OnDoubleClick(Mobile from) 
		{ 
			if ( from == null || !from.Alive ) return;

			// lumbervalue = 100; will give 100% sucsess in picking
			mageValue = from.Skills[SkillName.Magery].Value + 20;

			if ( DateTime.Now > lastpicked.AddSeconds(1) ) // 3 seconds between picking changed to 1 sec
			{
				lastpicked = DateTime.Now;
				if ( from.InRange( this.GetWorldLocation(), 1 ) ) 
				{ 
					if ( mageValue > Utility.Random( 100 ) )
					{
						from.Direction = from.GetDirectionTo( this );
						from.Animate( 32, 5, 1, true, false, 0 ); // Bow

						from.SendMessage("You pull the plant up by the root."); 
						this.Delete(); 

						from.AddToBackpack( new MandrakeUprooted() );
					}
					else from.SendMessage("The plant is hard to pull up."); 
				} 
				else 
				{ 
					from.SendMessage( "You are too far away to harvest anything." ); 
				} 
			}
		} 
Пример #9
0
		public override void OnDoubleClick(Mobile from) 
		{ 
			if ( from == null || !from.Alive ) return;

			// lumbervalue = 100; will give 100% sucsess in picking
			lumberValue = from.Skills[SkillName.Lumberjacking].Value / 5;

			if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
			{
				lastpicked = DateTime.Now;
				if ( from.InRange( this.GetWorldLocation(), 2 ) ) 
				{ 
					if ( lumberValue > Utility.Random( 100 ) )
					{
						from.Direction = from.GetDirectionTo( this );
						from.Animate( 32, 5, 1, true, false, 0 ); // Bow

						from.SendMessage(AgriTxt.PullRoot); 
						this.Delete(); 

						from.AddToBackpack( new NightshadeUprooted() );
					}
					else from.SendMessage(AgriTxt.HardPull); 
				} 
				else 
				{ 
					from.SendMessage(AgriTxt.HardPull); 
				} 
			}
		} 
		public override void PlayCraftEffect( Mobile from )
		{
			// no animation
			if ( from.Body.Type == BodyType.Human && !from.Mounted )
				from.Animate( 33, 5, 1, true, false, 0 );

			from.PlaySound( 0x55 );
		}
Пример #11
0
		public void AttackAnimation(Mobile from, Mobile to)
		{
			if (from.Body.IsHuman)
			{
				from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
			}

			from.PlaySound(0x23A);
			from.MovingEffect(to, 0x27AC, 1, 0, false, false);
		}
Пример #12
0
		public void AttackAnimation(Mobile from, Mobile to)
		{
			if (from.Body.IsHuman && !from.Mounted)
			{
				from.Animate(33, 2, 1, true, true, 0);
			}

			from.PlaySound(0x223);
			from.MovingEffect(to, 0x2804, 5, 0, false, false);
		}
Пример #13
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				from.RevealingAction();
                bool releaseLock = true;

				int number = -1;

				if ( targeted is Mobile )
				{
					Mobile targ = (Mobile)targeted;

					if ( targ.Player ) // We can't beg from players
					{
						number = 500398; // Perhaps just asking would work better.
					}
					else if ( !targ.Body.IsHuman ) // Make sure the NPC is human
					{
						number = 500399; // There is little chance of getting money from that!
					}
					else if ( !from.InRange( targ, 2 ) )
					{
						if ( !targ.Female )
							number = 500401; // You are too far away to beg from him.
						else
							number = 500402; // You are too far away to beg from her.
					}
					else if ( from.Mounted ) // If we're on a mount, who would give us money?
					{
						number = 500404; // They seem unwilling to give you any money.
					}
					else
					{
                        releaseLock = false;
						// Face eachother
						from.Direction = from.GetDirectionTo( targ );
						targ.Direction = targ.GetDirectionTo( from );

						from.Animate( 32, 5, 1, true, false, 0 ); // Bow

						new InternalTimer( from, targ ).Start();

						m_SetSkillTime = false;
					}
				}
				else // Not a Mobile
				{
					number = 500399; // There is little chance of getting money from that!
				}

				if ( number != -1 )
					from.SendLocalizedMessage( number );

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }
Пример #14
0
		public void BalanceSequence( Mobile m )
		{
			m.Frozen = true;
			Timer.DelayCall<Mobile>( TimeSpan.FromSeconds( 1.25 ), new TimerStateCallback<Mobile>( EndFall_Callback ), m );

			m.SendLocalizedMessage( 1095161 ); //You skillfully manage to maintain your balance.
			if ( !m.Mounted )
				m.Animate( 17, 1, 1, false, true, 0 );

			m.PlaySound( m.Female ? 0x319 : 0x429 );
		}
Пример #15
0
        private void CastStop_Callback(Mobile from)
        {
            tempHue = from.Hue;
            tempBody = from.BodyValue;
            from.Hue = 0;
            from.BodyValue = 15;
            from.Animate(12, 8, 1, false, false, 0);
            from.PlaySound(274);
            Timer.DelayCall<Mobile>(TimeSpan.FromMilliseconds(1500.0), new TimerStateCallback<Mobile>(AnimStop_Callback), from);

        }
Пример #16
0
        private void AnimStop_Callback(Mobile from)
        {
			from.Hue = tempHue;
			from.BodyValue = tempBody;
			if (tohide)
				from.Hidden = true;
			else
				from.Animate(17, 4, 1, false, false, 0);

			playing = false;
        }
Пример #17
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Mobile )
				{
					Mobile m = (Mobile)targeted;
			
					if ( m != from && from.HarmfulCheck( m ) )
					{
						Direction to = from.GetDirectionTo( m );

						from.Direction = to;

						from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );

						if ( Utility.RandomDouble() <= (Math.Sqrt( from.Dex / 100.0 ) * 1.0) )
						{
							from.MovingEffect( m, 0x10E5, 7, 1, false, false, 0x481, 0 );
							AOS.Damage( m, from, Utility.Random( 5, from.Str / 10 ), 100, 0, 0, 0, 0 );
							m.Paralyze( TimeSpan.FromSeconds( 10 ) );
							Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( ReleasecastLock ), from );
							
						}
						else
						{
							int x = 0, y = 0;

							switch ( to & Direction.Mask )
							{
								case Direction.North: --y; break;
								case Direction.South: ++y; break;
								case Direction.West: --x; break;
								case Direction.East: ++x; break;
								case Direction.Up: --x; --y; break;
								case Direction.Down: ++x; ++y; break;
								case Direction.Left: --x; ++y; break;
								case Direction.Right: ++x; --y; break;
							}

							x += Utility.Random( -1, 3 );
							y += Utility.Random( -1, 3 );

							x += m.X;
							y += m.Y;

							from.MovingEffect( m_MBoomerang, 0x10E5, 7, 1, false, false, 0x481, 0 );

							from.SendMessage( "You miss." );
							Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( ReleasecastLock ), from );
						}
				
					}
				}
			}
Пример #18
0
		public override void OnDoubleClick( Mobile from ) 
		{ 
			if ( from.Mounted && !CropHelper.CanWorkMounted )
			{
				from.SendMessage( "Vous ne pouvez planter sur ce type de terrain" ); 
				return; 
			}

			Point3D m_pnt = from.Location;
			Map m_map = from.Map;

			if ( !IsChildOf( from.Backpack ) ) 
			{ 
				from.SendLocalizedMessage( 1042010 ); //You must have the object in your backpack to use it. 
				return; 
			} 

			else if ( !CropHelper.CheckCanGrow( this, m_map, m_pnt.X, m_pnt.Y ) )
			{
				from.SendMessage( "Cette graine ne germera pas ici" ); 
				return; 
			}
			
			//check for BaseCrop on this tile
			ArrayList cropshere = CropHelper.CheckCrop( m_pnt, m_map, 0 );
			if ( cropshere.Count > 0 )
			{
				from.SendMessage( "Il y a deja une graine de plante ici." ); 
				return;
			}

			//check for over planting prohibt if 4 maybe 3 neighboring crops
			ArrayList cropsnear = CropHelper.CheckCrop( m_pnt, m_map, 1 );
			if ( ( cropsnear.Count > 3 ) || (( cropsnear.Count == 3 ) && Utility.RandomBool() ) )
			{
				from.SendMessage( "Il y a trop de pouce ici." ); 
				return;
			}

			if ( this.BumpZ ) ++m_pnt.Z;

			if ( !from.Mounted )
				from.Animate( 32, 5, 1, true, false, 0 ); // Bow

			from.SendMessage("Vous plantez la graine."); 
			this.Consume(); 
			Item item = new OrgeSeedling( from ); 
			item.Location = m_pnt; 
			item.Map = m_map; 
		
		} 
		public override void OnDoubleClick( Mobile from ) 
		{ 
			if ( from.Mounted && !CropHelper.CanWorkMounted )
			{
				from.SendMessage( "You cannot plant a seed while mounted." ); 
				return; 
			}

			Point3D m_pnt = from.Location;
			Map m_map = from.Map;

			if ( !IsChildOf( from.Backpack ) ) 
			{ 
				from.SendLocalizedMessage( 1042010 ); //You must have the object in your backpack to use it. 
				return; 
			} 

			else if ( !CropHelper.CheckCanGrow( this, m_map, m_pnt.X, m_pnt.Y ) )
			{
				from.SendMessage( "This seed will not grow here." ); 
				return; 
			}
			
			//check for BaseCrop on this tile
			ArrayList cropshere = CropHelper.CheckCrop( m_pnt, m_map, 0 );
			if ( cropshere.Count > 0 )
			{
				from.SendMessage( "There is already a crop growing here." ); 
				return;
			}

			//check for over planting prohibt if 6 maybe 5 neighboring crops
			ArrayList cropsnear = CropHelper.CheckCrop( m_pnt, m_map, 1 );
			if ( ( cropsnear.Count > 5 ) || (( cropsnear.Count == 5 ) && Utility.RandomBool() ) )
			{
				from.SendMessage( "There are too many crops nearby." ); 
				return;
			}

			if ( this.BumpZ ) ++m_pnt.Z;

			if ( !from.Mounted )
				from.Animate( 32, 5, 1, true, false, 0 ); // Bow

			from.SendMessage("You plant the seed."); 
			this.Consume(); 
			Item item = new BlackRaspberrySapling(); 
			item.Location = m_pnt; 
			item.Map = m_map; 
			
		} 
Пример #20
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage(AgriTxt.CannotWorkMounted);
                return;
            }

            Point3D m_pnt = from.Location;
            Map m_map = from.Map;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042010); //You must have the object in your backpack to use it. 
                return;
            }

            else if (!CropHelper.CheckCanGrow(this, m_map, m_pnt.X, m_pnt.Y))
            {
                from.SendMessage(AgriTxt.CannotGrowHere);
                return;
            }

            //check for BaseCrop on this tile
            ArrayList cropshere = CropHelper.CheckCrop(m_pnt, m_map, 0);
            if (cropshere.Count > 0)
            {
                from.SendMessage(AgriTxt.AlreadyCrop);
                return;
            }

            //check for over planting prohibt if 4 maybe 3 neighboring crops
            ArrayList cropsnear = CropHelper.CheckCrop(m_pnt, m_map, 2);//1
            if ((cropsnear.Count > 1) || ((cropsnear.Count == 1) && Utility.RandomBool()))//3
            {
                from.SendMessage(AgriTxt.TooMuchCrops);
                return;
            }

            if (this.BumpZ) ++m_pnt.Z;

            if (!from.Mounted)
                from.Animate(32, 5, 1, true, false, 0); // Bow

            from.SendMessage(AgriTxt.CropPlanted);
            this.Consume();
            Item item = new BananaSapling();// from ); 
            item.Location = m_pnt;
            item.Map = m_map;

        }
        public void OnTarget(Mobile from, object obj)
        {

            IPoint3D p3D = obj as IPoint3D;

            if (p3D == null)
                return;

            Point3D m_pnt = from.Location;
            Map m_map = from.Map;
            int x = p3D.X, y = p3D.Y;
            Point3D p = new Point3D(x, y, m_map.GetAverageZ(x, y));

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042010);
                return;
            }
            else if (!from.InRange(p3D, 4))
            {
                from.SendMessage("The trap is too cumbersome to deploy that far away.");
                return;
            }

            ArrayList trapshere = TrapHelper.CheckTrap(p, m_map, 0);
            if (trapshere.Count > 0)
            {
                from.SendMessage("This location is too close to another trap. ");
                return;
            }

            ArrayList trapsnear = TrapHelper.CheckTrap(p, m_map, 1);
            if ((trapsnear.Count > 0))
            {
                from.SendMessage("You can't place any more");
                return;
            }

            if (this.BumpZ)
                ++m_pnt.Z;

            if (!from.Mounted)
                from.Animate(32, 5, 1, true, false, 0);

            from.SendMessage("You deploy the Lobster trap.");

            this.Consume();

            Item item = new Buoy(from);
            item.MoveToWorld(p, m_map);
        }
Пример #22
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(this.Location, 1))
            {
                if (!from.Mounted)
                {
                    BaseIngredient ingredient = Activator.CreateInstance(Ingredient) as BaseIngredient;
                    if (ingredient != null)
                    {
                        int skillReq = ingredient.SkillRequired;
                        int herbalLore = from.Skills[(SkillName)36].Fixed;
                        if (herbalLore < skillReq || (ingredient is PusantiaRoot && ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.Pusantia) < 1))
                        {
                            from.SendMessage("You have no chance of harvesting this crop.");
                            return;
                        }

                        Server.Spells.SpellHelper.Turn(from, this);
                        from.Animate(32, 5, 1, true, false, 0);
                        from.PlaySound(79);

                        double successChance = ((double)(herbalLore - skillReq + 500)) / 1000;
                        if (successChance > Utility.RandomDouble())
                        {
                            from.SendMessage("You skillfully remove the relevant ingredient from the plant.");
                            ingredient.Amount += ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.HerbalGathering);
                            from.AddToBackpack(ingredient);
                            ((PlayerMobile)from).Crafting = true;
                            Misc.LevelSystem.AwardMinimumXP((PlayerMobile)from, 1);
                            ((PlayerMobile)from).Crafting = false;
                            IsPlanted(from);

                            Seed.PickPlantSeed(from, "QatPlant");

                            Delete();
                        }

                        else
                        {
                            from.SendMessage("You try to remove the ingredient from the plant, but end up only ruining it.");
                            IsPlanted(from);
                            Delete();
                        }
                    }
                }
                else
                    from.SendMessage("You can't do that while mounted.");
            }
            else
                from.SendMessage("You are too far away.");
        }
Пример #23
0
        public override void OnDoubleClick(Mobile from)//XUO SCROLLS
        {
            if (!Sphere.CanUse(from, this))
                return;

            if (from.Hits < 5)
            {
                from.LastKiller = from;
                from.Kill();
            }
            else
            {
                from.Hits -= 4;
                from.PlaySound(from.GetHurtSound());

                if (!from.Mounted)
                    from.Animate(20, 5, 1, true, false, 0);
                else
                    from.Animate(29, 5, 1, true, false, 0);

                base.OnDoubleClick(from);
            }
        }
Пример #24
0
 public override void OnMovement(Mobile from, Point3D oldLocation)
 {
     if (from.InRange(this, 3) && from is PlayerMobile) //chooses the area around the bannana
     {
         from.PlaySound(from.Female ? 791 : 1063); //sound
         from.Say("*slipped on " + Name + "*"); //message
         if (!from.Mounted)  //if not on a horse do the following...
         {
             from.Freeze(TimeSpan.FromSeconds(4.0)); //stops player from running
             from.Animate(22, 5, 1, true, false, 0); //show the player falling
             from.Freeze(TimeSpan.FromSeconds(4.0)); //stops the player just a bit longer.
         }
     }
 }
Пример #25
0
 public override void OnDoubleClick(Mobile from) //testing to make sure it works.
 {
     if (from.InRange(this, 3) && from is PlayerMobile)
     {
         from.PlaySound(from.Female ? 791 : 1063);
         from.Say("*slipped on " + Name + "*");
         if (!from.Mounted)
         {
             from.Freeze(TimeSpan.FromSeconds(4.0));
             from.Animate(22, 5, 1, true, false, 0);
             from.Freeze(TimeSpan.FromSeconds(4.0));
         }
     }
 }
Пример #26
0
        private static void GrabLoot(Mobile from, Container cont)
        {
            if (!from.Alive || cont == null)
                return;

            if (cont is Corpse && from == ((Corpse)cont).Owner)
            {
                Corpse corpse = (Corpse)cont;

                if (corpse.Killer == null || corpse.Killer is BaseCreature)
                    corpse.Open(from, true);
                else
                    corpse.Open(from, false);
            }
            else
            {
                bool fullPack = false;
                List<Item> items = new List<Item>(cont.Items);
                LootOptions options = LootGrab.GetOptions(from);

                for (int i = 0; !fullPack && i < items.Count; i++)
                {
                    Item item = items[i];

                    if (options.IsLootable(item))
                    {
                        Container dropCont = options.GetPlacementContainer(LootGrab.ParseType(item));

                        if (dropCont == null || dropCont.Deleted || !dropCont.IsChildOf(from.Backpack))
                            dropCont = from.Backpack;

                        if (!item.DropToItem(from, dropCont, new Point3D(-1, -1, 0)))
                            fullPack = true;

                        if (options.IsToken(item))
                            from.Emote("*loots a few shiny tokens*");
                    }
                }

                if (fullPack)
                    from.SendMessage("You looted as much as you could. The rest remain {0}.", (cont is Corpse ? "on the corpse" : "in the container"));
                else
                    from.SendMessage("You loot all you can from the {0}.", (cont is Corpse ? "corpse" : "container"));

                from.Animate(32, 5, 1, true, false, 0);
                from.PlaySound(79);
                from.RevealingAction();
            }
            UseDelaySystem.AddContext(from, DelayContextType.LootCommand, TimeSpan.FromSeconds(3.0)); //edit timer here, dont forget reference in usedelaysystem.cs!
        }
Пример #27
0
			protected override void OnTarget( Mobile from, object targeted )
			{
			
				if ( targeted is crushingtarget )
				{
					from.Animate( 12, 5, 1, true, false, 0 );
					from.PlaySound( 0x42 );	
					Item item = (Item)targeted;
					item.ItemID = 0x13A7;
					item.Hue = 2315;
					//item.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
					Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x3728, 9, 32, 0x13AF );
					
				}
			}
Пример #28
0
        public void Target( Mobile m )
        {
            Type t = m.GetType();
            bool dispellable = false;

            if ( m is BaseCreature )
                dispellable = ((BaseCreature)m).Summoned && !((BaseCreature)m).IsAnimatedDead;

            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( !dispellable )
            {
                Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                int diff;
                if ( m is Daemon )
                    diff = 95;
                else if ( m is EnergyVortex )
                    diff = 80;
                else if ( m is FireElemental || m is WaterElemental || m is AirElemental || m is EarthElemental )
                    diff = 75;
                else if ( m is BladeSpirit )
                    diff = 50;
                else
                    diff = 0;

                if ( Caster.Skills[SkillName.Magery].Value >= Utility.Random( 41 )-20+diff )
                {
                    Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 );
                    Effects.PlaySound( m, m.Map, 0x201 );

                    m.Delete();
                }
                else
                {
                    m.Animate( 14201, 10, 20, true, false, 0 );
                    Caster.SendAsciiMessage( "{0} resisted the attempt to dispell it!", m.Name );
                }
            }

            FinishSequence();
        }
Пример #29
0
		public override bool Eat(Mobile 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);

				if (Utility.RandomDouble() < 0.05)
					GiveToothAche(from, 0);
				else
					from.SendLocalizedMessage(1077387);
				Consume();
				return true;
		}
Пример #30
0
	    public override void OnDoubleClick( Mobile from )
		{
			// Fill the Mobile with FillFactor
			if( Food.FillHunger( from, 4 ) )
			{
				// 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( Owner != null )
					from.PublicOverheadMessage( MessageType.Emote, 0x22, true, string.Format( "*You see {0} eat some {1}*", from.Name, Name ) );

				Consume();
			}
		}
Пример #31
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage("You cannot harvest a crop while mounted.");
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3))               // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int tailorValue = (int)from.Skills[SkillName.Tailoring].Value / 20;
                if (tailorValue == 0)
                {
                    from.SendMessage("You have no idea how to harvest this crop.");
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 1))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage("There is nothing here to harvest.");

                        if (PlayerCanDestroy && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            UpRootGump g = new UpRootGump(from, this);
                            from.SendGump(g);
                        }
                    }
                    else                     //check skill and sower
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 29:32, 5, 1, true, false, 0);

                        if (from == m_sower)
                        {
                            tailorValue *= 2;
                            m_lastvisit  = DateTime.Now;
                        }

                        if (tailorValue > m_yield)
                        {
                            tailorValue = m_yield + 1;
                        }

                        int pick = Utility.Random(tailorValue);
                        if (pick == 0)
                        {
                            from.SendMessage("You do not manage to harvest any crops.");
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage("You pick {0} pile{1} of cotton!", pick, (pick == 1 ? "" : "s"));

                        double chance = Utility.RandomDouble(); // chance to get a seed is 20%
                        if (0.20 > chance)
                        {
                            from.AddToBackpack(new CottonSeed(1));
                            from.SendMessage("You found a seed!");
                        }

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));
                        ((Item)this).ItemID = pickedGraphic;

                        Cotton crop = new Cotton(pick);
                        from.AddToBackpack(crop);

                        chance = Utility.RandomDouble(); // chance to pull out plant is 10%
                        if ((0.10 > chance) && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            from.SendMessage("You accidently pull the cotton plant out of the ground!");
                            regrowTimer.Stop();
                            this.Delete();
                            return;
                        }

                        if (SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            this.UpRoot(from);
                            return;
                        }

                        if (!regrowTimer.Running)
                        {
                            //regrowTimer = new CropTimer( this );
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }
Пример #32
0
        public ESound(Mobile pm, int SoundMade)
        {
            switch (SoundMade)
            {
            case 1:
                pm.PlaySound(pm.Female ? 778 : 1049);
                pm.Say("*ah!*");
                break;

            case 2:
                pm.PlaySound(pm.Female ? 779 : 1050);
                pm.Say("*ah ha!*");
                break;

            case 3:
                pm.PlaySound(pm.Female ? 780 : 1051);
                pm.Say("*applauds*");
                break;

            case 4:
                pm.PlaySound(pm.Female ? 781 : 1052);
                pm.Say("*blows nose*");
                if (!pm.Mounted)
                {
                    pm.Animate(34, 5, 1, true, false, 0);
                }
                break;

            case 5:
                pm.Say("*bows*");
                if (!pm.Mounted)
                {
                    pm.Animate(32, 5, 1, true, false, 0);
                }
                break;

            case 6:
                pm.PlaySound(pm.Female ? 786 : 1057);
                pm.Say("*bs cough*");
                break;

            case 7:
                pm.PlaySound(pm.Female ? 782 : 1053);
                pm.Say("*burp!*");
                if (!pm.Mounted)
                {
                    pm.Animate(33, 5, 1, true, false, 0);
                }
                break;

            case 8:
                pm.PlaySound(pm.Female ? 0x310 : 1055);
                pm.Say("*clears throat*");
                if (!pm.Mounted)
                {
                    pm.Animate(33, 5, 1, true, false, 0);
                }
                break;

            case 9:
                pm.PlaySound(pm.Female ? 785 : 1056);
                pm.Say("*cough!*");
                if (!pm.Mounted)
                {
                    pm.Animate(33, 5, 1, true, false, 0);
                }
                break;

            case 10:
                pm.PlaySound(pm.Female ? 787 : 1058);
                pm.Say("*cries*");
                break;

            case 11:
                pm.PlaySound(pm.Female ? 791 : 1063);
                pm.Say("*faints*");
                if (!pm.Mounted)
                {
                    pm.Animate(22, 5, 1, true, false, 0);
                }
                break;

            case 12:
                pm.PlaySound(pm.Female ? 792 : 1064);
                pm.Say("*farts*");
                break;

            case 13:
                pm.PlaySound(pm.Female ? 793 : 1065);
                pm.Say("*gasp!*");
                break;

            case 14:
                pm.PlaySound(pm.Female ? 794 : 1066);
                pm.Say("*giggles*");
                break;

            case 15:
                pm.PlaySound(pm.Female ? 0x31B : 0x42B);
                pm.Say("*groans*");
                break;

            case 16:
                pm.PlaySound(pm.Female ? 0x338 : 0x44A);
                pm.Say("*growls*");
                break;

            case 17:
                pm.PlaySound(pm.Female ? 797 : 1069);
                pm.Say("*hey!*");
                break;

            case 18:
                pm.PlaySound(pm.Female ? 798 : 1070);
                pm.Say("*hiccup!*");
                break;

            case 19:
                pm.PlaySound(pm.Female ? 799 : 1071);
                pm.Say("*huh?*");
                break;

            case 20:
                pm.PlaySound(pm.Female ? 800 : 1072);
                pm.Say("*kisses*");
                break;

            case 21:
                pm.PlaySound(pm.Female ? 801 : 1073);
                pm.Say("*laughs*");
                break;

            case 22:
                pm.PlaySound(pm.Female ? 802 : 1074);
                pm.Say("*no!*");
                break;

            case 23:
                pm.PlaySound(pm.Female ? 803 : 1075);
                pm.Say("*oh!*");
                break;

            case 24:
                pm.PlaySound(pm.Female ? 811 : 1085);
                pm.Say("*oooh*");
                break;

            case 25:
                pm.PlaySound(pm.Female ? 812 : 1086);
                pm.Say("*oops*");
                break;

            case 26:
                pm.PlaySound(pm.Female ? 813 : 1087);
                pm.Say("*pukes*");
                if (!pm.Mounted)
                {
                    pm.Animate(32, 5, 1, true, false, 0);
                }
                Puke puke = new Puke();
                puke.Map      = pm.Map;
                puke.Location = pm.Location;
                break;

            case 27:
                pm.PlaySound(315);
                pm.Say("*punches*");
                if (!pm.Mounted)
                {
                    pm.Animate(31, 5, 1, true, false, 0);
                }
                break;

            case 28:
                pm.PlaySound(pm.Female ? 0x32E : 0x440);
                pm.Say("*ahhhh!*");
                break;

            case 29:
                pm.PlaySound(pm.Female ? 815 : 1089);
                pm.Say("*shhh!*");
                break;

            case 30:
                pm.PlaySound(pm.Female ? 816 : 1090);
                pm.Say("*sigh*");
                break;

            case 31:
                pm.PlaySound(948);
                pm.Say("*slaps*");
                if (!pm.Mounted)
                {
                    pm.Animate(11, 5, 1, true, false, 0);
                }
                break;

            case 32:
                pm.PlaySound(pm.Female ? 817 : 1091);
                pm.Say("*ahh-choo!*");
                if (!pm.Mounted)
                {
                    pm.Animate(32, 5, 1, true, false, 0);
                }
                break;

            case 33:
                pm.PlaySound(pm.Female ? 818 : 1092);
                pm.Say("*sniff*");
                if (!pm.Mounted)
                {
                    pm.Animate(34, 5, 1, true, false, 0);
                }
                break;

            case 34:
                pm.PlaySound(pm.Female ? 819 : 1093);
                pm.Say("*snore*");
                break;

            case 35:
                pm.PlaySound(pm.Female ? 820 : 1094);
                pm.Say("*spits*");
                if (!pm.Mounted)
                {
                    pm.Animate(6, 5, 1, true, false, 0);
                }
                break;

            case 36:
                pm.PlaySound(792);
                pm.Say("*sticks out tongue*");
                break;

            case 37:
                pm.PlaySound(874);
                pm.Say("*taps foot*");
                if (!pm.Mounted)
                {
                    pm.Animate(38, 5, 1, true, false, 0);
                }
                break;

            case 38:
                pm.PlaySound(pm.Female ? 821 : 1095);
                pm.Say("*whistles*");
                if (!pm.Mounted)
                {
                    pm.Animate(5, 5, 1, true, false, 0);
                }
                break;

            case 39:
                pm.PlaySound(pm.Female ? 783 : 1054);
                pm.Say("*woohoo!*");
                break;

            case 40:
                pm.PlaySound(pm.Female ? 822 : 1096);
                pm.Say("*yawns*");
                if (!pm.Mounted)
                {
                    pm.Animate(17, 5, 1, true, false, 0);
                }
                break;

            case 41:
                pm.PlaySound(pm.Female ? 823 : 1097);
                pm.Say("*yea!*");
                break;

            case 42:
                pm.PlaySound(pm.Female ? 0x31C : 0x42C);
                pm.Say("*yells*");
                break;
            }
        }
Пример #33
0
            protected override void OnTarget(Mobile from, object obj)
            {
                if (m_Bola.Deleted)
                {
                    return;
                }

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!m_Bola.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1040019);                           // The bola must be in your pack to use it.
                    }
                    else if (!Core.SA && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
                    {
                        from.SendLocalizedMessage(1040015);                           // Your hands must be free to use this
                    }
                    else if (from.Mounted)
                    {
                        from.SendLocalizedMessage(1040016);                           // You cannot use this while riding a mount
                    }
                    else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
                    {
                        from.SendLocalizedMessage(1070902);                           // You can't use this while in an animal form!
                    }
                    else if (!to.Mounted && !to.Flying)
                    {
                        from.SendLocalizedMessage(1049628);                           // You have no reason to throw a bola at that.
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (to.Flying)
                    {
                        to.Flying = false;
                        from.SendMessage("You have been knocked out of the air by a bola, and are dazed!");
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        EtherealMount.StopMounting(from);

                        Item one = from.FindItemOnLayer(Layer.OneHanded);
                        Item two = from.FindItemOnLayer(Layer.TwoHanded);

                        if (one != null)
                        {
                            from.AddToBackpack(one);
                        }

                        if (two != null)
                        {
                            from.AddToBackpack(two);
                        }

                        from.DoHarmful(to);

                        if (Core.SA)
                        {
                            BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(3.0));
                        }

                        m_Bola.Consume();

                        from.Direction = from.GetDirectionTo(to);
                        from.Animate(11, 5, 1, true, false, 0);
                        from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                        Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to });
                    }
                    else
                    {
                        from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1049629);                       // You cannot throw a bola at that.
                }
            }
Пример #34
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();                 //Reveals Beggers

                int number = -1;

                if (targeted is Mobile)                   //Determine the Creature
                {
                    Mobile targ = (Mobile)targeted;       //Rename to Targ

                    bool orcs = IsOrc(targ);              //Sets True/False for Orc

                    if (targ.Player)                      // We can't beg from players
                    {
                        number = 500398;                  // Perhaps just asking would work better.
                    }
                    else if (!targ.Body.IsHuman && !orcs) // Make sure the NPC is human | or Orc
                    {
                        number = 500399;                  // There is little chance of getting money from that!
                    }
                    else if (!from.InRange(targ, 2))      //Gender Differences
                    {
                        if (!targ.Female)
                        {
                            number = 500401;                             // You are too far away to beg from him.
                        }
                        else
                        {
                            number = 500402;                             // You are too far away to beg from her.
                        }
                    }
                    else if (from.Mounted)                     // If we're on a mount, who would give us money? Possible used on server?
                    {
                        number = 500404;                       // They seem unwilling to give you any money.
                    }

                    else
                    {
                        if (targ is BaseVendor)                         //Vendors Themselves are on a 60-90 minute cool down to help prevent macroing
                        {
                            DateTime   now      = DateTime.UtcNow;
                            BaseVendor targvend = targ as BaseVendor;                   //Is Target Vendor?
                            //	Console.WriteLine(targvend.GeneralNextBegging);
                            if (targvend.NextBegging > now)                             //Vendor be used
                            {
                                from.SendLocalizedMessage(500404);                      // They seem unwilling to give you any money.
                                return;
                            }
                            else
                            {
                                //		Console.WriteLine(targvend.GeneralNextBegging);
                                targvend.NextBegging = now + TimeSpan.FromMinutes(Utility.RandomMinMax(60, 90));                                 //Set Vendor Timer 60-90 minutes (Change for Balance)
                            }
                        }
                        else
                        {
                            DateTime     now       = DateTime.UtcNow;
                            BaseCreature targcreat = targ as BaseCreature;
                            //	Console.WriteLine(targcreat.GeneralNextBegging);
                            if (targcreat.GeneralNextBegging > now)                             //Vendor be used
                            {
                                from.SendLocalizedMessage(500404);                              // They seem unwilling to give you any money.
                                return;
                            }
                            else
                            {
                                //		Console.WriteLine(targcreat.GeneralNextBegging);
                                targcreat.GeneralNextBegging = now + TimeSpan.FromMinutes(Utility.RandomMinMax(5, 10));                                 //Set Vendor Timer 60-90 minutes (Change for Balance)
                            }
                        }
                        // Face eachother
                        from.Direction = from.GetDirectionTo(targ);
                        targ.Direction = targ.GetDirectionTo(from);

                        from.Animate(32, 5, 1, true, false, 0);                         // Bow
                        switch (Utility.Random(2))
                        {
                        case 0: from.PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "Please could you spare some change"); break;

                        case 1: from.PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "Anything you give will help. Please"); break;

                        case 2: from.PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "Do you really need that item?"); break;
                        }
                        new InternalTimer(from, targ).Start();                         //Commence Timer

                        m_SetSkillTime = false;
                    }
                }
                else                 // Not a Mobile
                {
                    number = 500399; // There is little chance of getting money from that!
                }

                if (number != -1)
                {
                    from.SendLocalizedMessage(number);
                }
            }
Пример #35
0
        public void OnTarget(Mobile from, object obj)
        {
            if (Deleted || InUse)
            {
                return;
            }

            if (!(obj is IPoint3D p3D))
            {
                return;
            }

            Map map = from.Map;

            if (map == null || map == Map.Internal)
            {
                return;
            }

            int x = p3D.X, y = p3D.Y, z = map.GetAverageZ(x, y); // OSI just takes the targeted Z

            if (!from.InRange(p3D, 6))
            {
                from.SendLocalizedMessage(500976); // You need to be closer to the water to fish!
            }
            else if (!from.InLOS(obj))
            {
                from.SendLocalizedMessage(500979); // You cannot see that location.
            }
            else if (RequireDeepWater
        ? FullValidation(map, x, y)
        : ValidateDeepWater(map, x, y) || ValidateUndeepWater(map, obj, ref z))
            {
                Point3D p = new Point3D(x, y, z);

                if (GetType() == typeof(SpecialFishingNet))
                {
                    for (int i = 1; i < Amount; ++i) // these were stackable before, doh
                    {
                        from.AddToBackpack(new SpecialFishingNet());
                    }
                }

                InUse   = true;
                Movable = false;
                MoveToWorld(p, map);

                SpellHelper.Turn(from, p);
                from.Animate(12, 5, 1, true, false, 0);

                Effects.SendLocationEffect(p, map, 0x352D, 16, 4);
                Effects.PlaySound(p, map, 0x364);

                int index = 0;

                Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 14,
                                () => DoEffect(from, p, index++));

                from.SendLocalizedMessage(RequireDeepWater
          ? 1010487
          : 1074492); // You plunge the net into the sea... / You plunge the net into the water...
            }
            else
            {
                from.SendLocalizedMessage(RequireDeepWater
          ? 1010485
          : 1074491); // You can only use this net in deep water! / You can only use this net in water!
            }
        }
Пример #36
0
        public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message)
        {
            if (Core.ML && AnimalForm.UnderTransformation(dismounted))
            {
                AnimalForm.RemoveContext(dismounted, true);
                if (dismounted.Player)
                {
                    dismounted.SendLocalizedMessage(1114066, dismounter.Name); // ~1_NAME~ knocked you out of animal form!
                }
            }
            else
            {
                if (!dismounted.Mounted)
                {
                    return;
                }

                if (dismounted is Neira || dismounted is ChaosDragoon || dismounted is ChaosDragoonElite)
                {
                    if (dismounter.Player)
                    {
                        dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount.
                    }
                    return;
                }

                IMount mount = dismounted.Mount;

                if (mount != null)
                {
                    if (dismounter is PlayerMobile)
                    {
                        dismounter.SendLocalizedMessage(1060082); // The force of your attack has dislodged them from their mount!
                        ((PlayerMobile)dismounter).SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(Core.TOL && dismounter.Weapon is BaseRanged ? 8 : 10), false);
                    }

                    mount.Rider = null;

                    new BaseMount.DespawnTimer(mount, TimeSpan.FromMinutes(1.0)).Start();
                    if (mount is Mobile newMob)
                    {
                        // if (dismounter.Aggressor) newMob.Aggressed = dismounter;
                        newMob?.Attack(dismounter);
                    }

                    if (message)
                    {
                        if (dismounted.Flying)
                        {
                            if (dismounted.Player)
                            {
                                dismounted.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1113590, dismounter.Name); // You have been grounded by ~1_NAME~!
                            }
                            if (!BaseMount.OnFlightPath(dismounted))
                            {
                                dismounted.Flying = false;
                                dismounted.Freeze(TimeSpan.FromSeconds(1));
                                dismounted.Animate(AnimationType.Land, 0);
                                BuffInfo.RemoveBuff(dismounted, BuffIcon.Fly);
                            }
                        }
                        else
                        {
                            // defender.SendLocalizedMessage(1060083); // You fall off of your mount and take damage!
                            if (dismounted.Player)
                            {
                                dismounted.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1049623, dismounter.Name); // You have been knocked off of your mount by ~1_NAME~!
                            }
                        }
                    }

                    if (Core.ML)
                    {
                        if (dismounter is BaseCreature)
                        {
                            BaseCreature bc = dismounter as BaseCreature;

                            if (bc.ControlMaster is PlayerMobile)
                            {
                                PlayerMobile pm = bc.ControlMaster as PlayerMobile;
                                pm.SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(10.0), false);
                            }
                        }
                    }

                    if (delay != TimeSpan.MinValue)
                    {
                        BaseMount.SetMountPrevention(dismounted, mount, blockmounttype, delay);
                    }
                }
            }
        }
Пример #37
0
        public override void OnDoubleClick(Mobile from)
        {
            double minSkill = 85.0;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
                return;
            }

            double necromancySkill = from.Skills[SkillName.Necromancy].Value;

            if (necromancySkill < 85.0)
            {
                from.SendMessage("You do not have the knowledge required to attempt this.");
                return;
            }
            else if ((from.Followers + 1) > from.FollowersMax)
            {
                from.SendLocalizedMessage(1049607);                   // You have too many followers to control that creature.
                return;
            }

            double scalar;

            if (necromancySkill >= 100.0)
            {
                scalar = 1.0;
            }
            else if (necromancySkill >= 90.0)
            {
                scalar = 0.8;
            }
            else if (necromancySkill >= 80.0)
            {
                scalar = 0.6;
            }
            else
            {
                scalar = 0.5;
            }

            double maxSkill = minSkill + 60.0;

            if (from.Mounted)
            {
                from.SendMessage("You cannot summon while mounted.");
                return;
            }

            from.Animate(17, 7, 1, true, false, 0);

            if (!from.CheckSkill(SkillName.Necromancy, minSkill, maxSkill))
            {
                from.PlaySound(0x24A);
                from.SendMessage("Your summoning has failed.");
                Delete();
                return;
            }
            else
            {
                NecroFleshGolem m = new NecroFleshGolem(true, scalar);

                if (m.SetControlMaster(from))
                {
                    Delete();

                    m.MoveToWorld(from.Location, from.Map);
                    from.PlaySound(0x24A);
                    from.SendMessage("You have summoned a flesh golem.");
                }
            }
        }
Пример #38
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (this.m_Dagger.Deleted)
                {
                    return;
                }
                else if (!from.Items.Contains(this.m_Dagger))
                {
                    from.SendMessage("You must be holding that weapon to use it.");
                }
                else if (targeted is Mobile)
                {
                    Mobile m = (Mobile)targeted;

                    if (m != from && from.HarmfulCheck(m))
                    {
                        Direction to = from.GetDirectionTo(m);

                        from.Direction = to;

                        from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);

                        if (Utility.RandomDouble() >= (Math.Sqrt(m.Dex / 100.0) * 0.8))
                        {
                            from.MovingEffect(m, 0x1BFE, 7, 1, false, false, 0x481, 0);

                            AOS.Damage(m, from, Utility.Random(5, from.Str / 10), 100, 0, 0, 0, 0);

                            this.m_Dagger.MoveToWorld(m.Location, m.Map);
                        }
                        else
                        {
                            int x = 0, y = 0;

                            switch (to & Direction.Mask)
                            {
                            case Direction.North:
                                --y;
                                break;

                            case Direction.South:
                                ++y;
                                break;

                            case Direction.West:
                                --x;
                                break;

                            case Direction.East:
                                ++x;
                                break;

                            case Direction.Up:
                                --x;
                                --y;
                                break;

                            case Direction.Down:
                                ++x;
                                ++y;
                                break;

                            case Direction.Left:
                                --x;
                                ++y;
                                break;

                            case Direction.Right:
                                ++x;
                                --y;
                                break;
                            }

                            x += Utility.Random(-1, 3);
                            y += Utility.Random(-1, 3);

                            x += m.X;
                            y += m.Y;

                            this.m_Dagger.MoveToWorld(new Point3D(x, y, m.Z), m.Map);

                            from.MovingEffect(this.m_Dagger, 0x1BFE, 7, 1, false, false, 0x481, 0);

                            from.SendMessage("You miss.");
                        }
                    }
                }
            }
Пример #39
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (m_System is Mining && targeted is StaticTarget)
            {
                int itemID = ((StaticTarget)targeted).ItemID;

                // grave
                if (itemID == 0xED3 || itemID == 0xEDF || itemID == 0xEE0 || itemID == 0xEE1 || itemID == 0xEE2 || itemID == 0xEE8)
                {
                    PlayerMobile player = from as PlayerMobile;

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

                        if (qs is WitchApprenticeQuest)
                        {
                            FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                            if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.Bones)
                            {
                                player.SendLocalizedMessage(1055037);                                   // You finish your grim work, finding some of the specific bones listed in the Hag's recipe.
                                obj.Complete();

                                return;
                            }
                        }
                    }
                }
            }

            if (m_System is Lumberjacking && targeted is IChopable)
            {
                if (m_Tool.Parent != from)
                {
                    from.SendAsciiMessage("The axe must be equipped for any serious wood chopping.");
                    //from.SendLocalizedMessage( 500487 ); // The axe must be equipped for any serious wood chopping.
                    return;
                }
                else
                {
                    ((IChopable)targeted).OnChop(from);
                }
            }
            else if (m_System is Lumberjacking && targeted is ICarvable)
            {
                from.Animate(32, 5, 1, true, false, 0);
                ((ICarvable)targeted).Carve(from, m_Tool);
            }
            else if (m_System is Lumberjacking && targeted is Log)
            {
                BaseTool tools = new FletcherTools();
                from.SendMenu(new BowFletchingMenu(from, BowFletchingMenu.Main(from), "Main", tools));
                if (tools != null)
                {
                    tools.Delete();
                }
            }
            else if (m_System is Lumberjacking && FurnitureAttribute.Check(targeted as Item))
            {
                DestroyFurniture(from, (Item)targeted);
            }
            else if (m_System is Mining && targeted is TreasureMap)
            {
                ((TreasureMap)targeted).OnBeginDig(from);
            }
            else
            {
                m_System.StartHarvesting(from, m_Tool, targeted);
            }
        }
Пример #40
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Mounted && !TreeHelper.CanPickMounted)
            {
                from.SendMessage("You cannot pick fruit while mounted.");
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3))               // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 20;
                if (from.Mounted)
                {
                    ++lumberValue;
                }

                if (lumberValue < 0)
                {
                    from.SendMessage("You have no idea how to pick this fruit.");
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 2))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage("There is nothing here to harvest.");
                    }
                    else                     //check skill
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 26:17, 7, 1, true, false, 0);

                        if (lumberValue < m_yield)
                        {
                            lumberValue = m_yield + 1;
                        }

                        int pick = Utility.Random(lumberValue);
                        if (pick == 0)
                        {
                            from.SendMessage("You do not manage to gather any fruit.");
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage("You pick {0} pear{1}!", pick, (pick == 1 ? "" : "s"));

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));

                        Pear crop = new Pear(pick);
                        from.AddToBackpack(crop);

                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500446);                       // That is too far away.
                }
            }
        }
Пример #41
0
        protected override bool OnMove(Direction d)
        {
            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            Effects.PlaySound(Location, Map, Utility.RandomList(0x12E, 0x12D));

            if (m_IsCharging)
            {
                IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, 1);

                Queue m_Queue = new Queue();

                foreach (Mobile mobile in nearbyMobiles)
                {
                    if (!mobile.CanBeDamaged() || !mobile.Alive || mobile.AccessLevel > AccessLevel.Player || m_Trampled.Contains(mobile))
                    {
                        continue;
                    }

                    bool validTarget = false;

                    PlayerMobile pm_Target = mobile as PlayerMobile;
                    BaseCreature bc_Target = mobile as BaseCreature;

                    if (pm_Target != null)
                    {
                        validTarget = true;
                    }

                    if (bc_Target != null)
                    {
                        if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile)
                        {
                            validTarget = true;
                        }
                    }

                    if (Combatant != null && Combatant == mobile)
                    {
                        validTarget = false;
                    }

                    if (validTarget)
                    {
                        if (!m_Trampled.Contains(mobile))
                        {
                            m_Trampled.Add(mobile);
                        }

                        m_Queue.Enqueue(mobile);
                    }
                }

                nearbyMobiles.Free();

                while (m_Queue.Count > 0)
                {
                    Mobile mobile = (Mobile)m_Queue.Dequeue();

                    Effects.PlaySound(Location, Map, Utility.RandomList(0x3BB, 0x3BA, 0x3B9));
                    Effects.PlaySound(mobile.Location, mobile.Map, mobile.GetHurtSound());

                    double damage = DamageMin;

                    if (Combatant is BaseCreature)
                    {
                        damage *= 1.5;
                    }

                    new Blood().MoveToWorld(Combatant.Location, Combatant.Map);

                    int bloodCount = 1 + (int)(Math.Ceiling(3 * spawnPercent));

                    for (int a = 0; a < bloodCount; a++)
                    {
                        new Blood().MoveToWorld(new Point3D(Combatant.Location.X + Utility.RandomList(-2, 2), Combatant.Location.Y + Utility.RandomList(-2, 2), Combatant.Location.Z), Map);
                    }

                    new Blood().MoveToWorld(Combatant.Location, Combatant.Map);
                    SpecialAbilities.BleedSpecialAbility(1.0, this, Combatant, damage, 10.0, -1, true, "", "The reaver's lance impales you, causing you to bleed!", "-1");
                    AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0);

                    if (mobile is PlayerMobile)
                    {
                        mobile.Animate(21, 6, 1, true, false, 0);
                    }

                    else if (mobile is BaseCreature)
                    {
                        BaseCreature bc_Creature = mobile as BaseCreature;

                        if (bc_Creature.IsHighSeasBodyType)
                        {
                            bc_Creature.Animate(2, 14, 1, true, false, 0);
                        }

                        else if (bc_Creature.Body != null)
                        {
                            if (bc_Creature.Body.IsHuman)
                            {
                                bc_Creature.Animate(21, 6, 1, true, false, 0);
                            }

                            else
                            {
                                bc_Creature.Animate(2, 4, 1, true, false, 0);
                            }
                        }
                    }

                    SpecialAbilities.HinderSpecialAbility(1.0, this, mobile, 1.0, 2, false, -1, false, "", "You have been trampled and can't move!", "-1");
                }
            }

            CheckChargeResolved();

            return(base.OnMove(d));
        }
Пример #42
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                int number = -1;

                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    if (targ.Player)                       // We can't beg from players
                    {
                        number = 500398;                   // Perhaps just asking would work better.
                    }
                    else if (!targ.Body.IsHuman)           // Make sure the NPC is human
                    {
                        number = 500399;                   // There is little chance of getting money from that!
                    }
                    else if (!from.InRange(targ, 2))
                    {
                        if (!(targ is IBegged))
                        {
                            number = 500403;                             // That's too far away.  You couldn't beg from it anyway.
                        }
                        else if (targ.Female)
                        {
                            number = 500402;                             // You are too far away to beg from her.
                        }
                        else
                        {
                            number = 500401;                             // You are too far away to beg from him.
                        }
                    }
                    else if (from.Mounted)                       // If we're on a mount, who would give us money?
                    {
                        number = 500404;                         // They seem unwilling to give you any money.
                    }
                    else if (targ is IBegged)
                    {
                        // Face eachother
                        from.Direction = from.GetDirectionTo(targ);
                        targ.Direction = targ.GetDirectionTo(from);

                        from.Animate(32, 5, 1, true, false, 0);                           // Bow

                        new InternalTimer(from, (IBegged)targ).Start();

                        m_SetSkillTime = false;
                    }
                    else
                    {
                        number = 500404;                         // They seem unwilling to give you any money.
                    }
                }
                else                 // Not a Mobile
                {
                    number = 500399; // There is little chance of getting money from that!
                }
                if (number != -1)
                {
                    from.SendLocalizedMessage(number);
                }
            }
Пример #43
0
            protected override void OnTick()
            {
                if (m_Player == null || !(m_Player.Map == Map.Malas))
                {
                    Stop();
                }
                else
                {
                    Count++;
                    if (Count == 1) /* TODO consolidate */
                    {
                        m_Player.Paralyze(TimeSpan.FromSeconds(2));
                        Effects.SendTargetEffect(m_Player, 0x11B7, 20, 10);
                        PlayerSendASCII(m_Player, 0);  // You are pinned down ...

                        PlaySounds(m_Player.Location, (!m_Player.Female) ? fs : ms);
                        PlayEffect(ZAdjustedIEFromMobile(m_Player, 50), m_Player, 0x11B7, 20, false);
                    }
                    else if (Count == 2)
                    {
                        DoDamage(m_Player, 80, 90, false);
                        Effects.SendTargetEffect(m_Player, 0x36BD, 20, 10);
                        PlaySounds(m_Player.Location, exp);
                        PlayerSendASCII(m_Player, 1); // A speeding rock  ...

                        if (AniSafe(m_Player))
                        {
                            m_Player.Animate(21, 10, 1, true, true, 0);
                        }
                    }
                    else if (Count == 3)
                    {
                        Stop();

                        Effects.SendTargetEffect(m_Player, 0x36B0, 20, 10);
                        PlayerSendASCII(m_Player, 1); // A speeding rock  ...
                        PlaySounds(m_Player.Location, (!m_Player.Female) ? fs2 : ms2);

                        int j = Utility.Random(6, 10);
                        for (int i = 0; i < j; i++)
                        {
                            IEntity m_IEntity = new Entity(Serial.Zero, RandomPointIn(m_Player.Location, 10), m_Player.Map);

                            List <Mobile>     mobiles = new List <Mobile>();
                            IPooledEnumerable eable   = m_IEntity.Map.GetMobilesInRange(m_IEntity.Location, 2);

                            foreach (Mobile m in eable)
                            {
                                mobiles.Add(m);
                            }
                            eable.Free();
                            for (int k = 0; k < mobiles.Count; k++)
                            {
                                if (IsValidDamagable(mobiles[k]) && mobiles[k] != m_Player)
                                {
                                    PlayEffect(m_Player, mobiles[k], Rock(), 8, true);
                                    DoDamage(mobiles[k], 25, 30, false);

                                    if (mobiles[k].Player)
                                    {
                                        POHMessage(mobiles[k], 2); // OUCH!
                                    }
                                }
                            }
                            PlayEffect(m_Player, m_IEntity, Rock(), 8, false);
                        }
                    }
                }
            }
Пример #44
0
        public void GroundSlap()
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            ArrayList targets = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(8))
            {
                if (m == this || !CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                {
                    targets.Add(m);
                }
                else if (m.Player)
                {
                    targets.Add(m);
                }
            }

            PlaySound(0x140);


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

                int distance = (int)m.GetDistanceToSqrt(this);

                if (distance == 0)
                {
                    distance = 1;
                }

                double damage = 75 / distance;
                damage = targets.Count * damage;

                damage = 10 * targets.Count;

                if (damage < 40.0)
                {
                    damage = 40.0;
                }
                else if (damage > 75.0)
                {
                    damage = 75.0;
                }

                DoHarmful(m);

                AOS.Damage(m, this, (int)damage, 100, 0, 0, 0, 0);

                m.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist);
                BaseMount.Dismount(m);

                if (m.Alive && m.Body.IsHuman && !m.Mounted)
                {
                    m.Animate(20, 7, 1, true, false, 0);                       // take hit
                }
            }
        }
Пример #45
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }
            if (from != m_sower)
            {
                from.SendMessage("You do not own this plant !!!"); return;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage("You cannot harvest a crop while mounted."); return;
            }
            if (DateTime.UtcNow > lastpicked.AddSeconds(3))
            {
                lastpicked = DateTime.UtcNow;
                int cookValue = (int)from.Skills[SkillName.Cooking].Value / 20;
                if (cookValue == 0)
                {
                    from.SendMessage("You have no idea how to harvest this crop."); return;
                }
                if (from.InRange(this.GetWorldLocation(), 1))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage("There is nothing here to harvest.");
                    }
                    else
                    {
                        from.Direction = from.GetDirectionTo(this);
                        from.Animate(from.Mounted ? 29:32, 5, 1, true, false, 0);
                        m_lastvisit = DateTime.UtcNow;
                        if (cookValue > m_yield)
                        {
                            cookValue = m_yield + 1;
                        }
                        int pick = Utility.RandomMinMax(cookValue - 4, cookValue);
                        if (pick < 0)
                        {
                            pick = 0;
                        }
                        if (pick == 0)
                        {
                            from.SendMessage("You do not manage to harvest any crops."); return;
                        }
                        m_yield -= pick;
                        from.SendMessage("You harvest {0} crop{1}!", pick, (pick == 1 ? "" : "s"));
                        if (m_yield < 1)
                        {
                            ((Item)this).ItemID = pickedGraphic;
                        }
                        SweetHops crop = new SweetHops(pick);
                        from.AddToBackpack(crop);
                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }
Пример #46
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Mounted && !TreeHelper.CanPickMounted)
            {
                from.SendMessage(AgriTxt.CannotWorkMounted);
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3)) // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 5;
                if (from.Mounted)
                {
                    ++lumberValue;
                }

                if (lumberValue < 3)
                {
                    from.SendMessage(AgriTxt.DunnoHowTo);
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 2))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage(AgriTxt.NoCrop);
                    }
                    else //check skill
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 26 : 17, 7, 1, true, false, 0);

                        if (lumberValue > m_yield)
                        {
                            lumberValue = m_yield + 1;
                        }

                        int pick = Utility.Random(lumberValue);
                        if (pick == 0)
                        {
                            from.SendMessage(AgriTxt.ZeroPicked);
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage(AgriTxt.YouPick + " {0} banane{1}!", pick, (pick == 1 ? "" : "s"));

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));

                        Banana crop = new Banana(pick); // naga fruit
                        from.AddToBackpack(crop);

                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500446); // That is too far away.
                }
            }
        }
Пример #47
0
        public static bool OnHarvest(Mobile m, Item tool)
        {
            if (!(m is PlayerMobile) || m.Map != Map.TerMur)
            {
                return(false);
            }

            PlayerMobile pm = m as PlayerMobile;

            if (pm.ToggleMiningStone && VolcanoMineBounds.Contains(m.Location))
            {
                object locked = tool;

                if (!m.BeginAction(locked))
                {
                    return(false);
                }

                m.Animate(AnimationType.Attack, 3);

                Timer.DelayCall(Mining.System.OreAndStone.EffectSoundDelay, () =>
                {
                    m.PlaySound(Utility.RandomList(Mining.System.OreAndStone.EffectSounds));
                });

                Timer.DelayCall(Mining.System.OreAndStone.EffectDelay, () =>
                {
                    TheGreatVolcanoQuest quest = QuestHelper.GetQuest(pm, typeof(TheGreatVolcanoQuest)) as TheGreatVolcanoQuest;

                    if (quest != null && !quest.Completed && 0.05 > Utility.RandomDouble())
                    {
                        if (m.CheckSkill(SkillName.Mining, 90, 100))
                        {
                            double chance = Utility.RandomDouble();

                            if (0.08 > chance)
                            {
                                BaseCreature spawn = new VolcanoElemental();
                                Point3D p          = m.Location;

                                for (int i = 0; i < 10; i++)
                                {
                                    int x = Utility.RandomMinMax(p.X - 1, p.X + 1);
                                    int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1);
                                    int z = Map.TerMur.GetAverageZ(x, y);

                                    if (Map.TerMur.CanSpawnMobile(x, y, z))
                                    {
                                        p = new Point3D(x, y, z);
                                        break;
                                    }
                                }

                                spawn.MoveToWorld(p, Map.TerMur);
                                spawn.Combatant = m;

                                m.SendLocalizedMessage(1156508);      // Uh oh...that doesn't look like a lava rock!
                            }
                            else if (0.55 > chance)
                            {
                                m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1156507, m.NetState);     // *You uncover a lava rock and carefully store it for later!*
                                quest.Update(m);
                            }
                            else
                            {
                                m.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1156509);     // You loosen some dirt but fail to find anything.
                            }
                        }
                        else
                        {
                            m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509);     // You loosen some dirt but fail to find anything.
                        }
                    }
                    else
                    {
                        m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509);     // You loosen some dirt but fail to find anything.
                    }
                    if (tool is IUsesRemaining)
                    {
                        ((IUsesRemaining)tool).UsesRemaining--;

                        if (((IUsesRemaining)tool).UsesRemaining <= 0)
                        {
                            m.SendLocalizedMessage(1044038);     // You have worn out your tool!
                            tool.Delete();
                        }
                    }

                    m.EndAction(locked);
                });

                return(true);
            }

            return(false);
        }
Пример #48
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage(AgriTxt.CannotWorkMounted);
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3)) // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 5;
                if (lumberValue == 0)
                {
                    from.SendMessage(AgriTxt.DunnoHowTo);
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 2))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage(AgriTxt.NoCrop);

                        if (PlayerCanDestroy && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            UpRootGump g = new UpRootGump(from, this);
                            from.SendGump(g);
                        }
                    }
                    else //check skill and sower
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 29 : 32, 5, 1, true, false, 0);

                        if (from == m_sower)
                        {
                            lumberValue *= 2;
                            m_lastvisit  = DateTime.Now;
                        }

                        if (lumberValue > m_yield)
                        {
                            lumberValue = m_yield + 1;
                        }

                        int pick = Utility.Random(lumberValue);
                        if (pick == 0)
                        {
                            from.SendMessage(AgriTxt.ZeroPicked);
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage(AgriTxt.YouPick + " {0} crop{1}!", pick, (pick == 1 ? "" : "s"));

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); // use for debuging
                        ((Item)this).ItemID = pickedGraphic;

                        // ********************************
                        // *** Wheat does not yet exist ***
                        // ********************************
                        // Wheat crop = new Wheat( pick );
                        BreadLoaf crop = new BreadLoaf(pick);
                        from.AddToBackpack(crop);

                        if (SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            this.UpRoot(from);
                            return;
                        }

                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage(AgriTxt.TooFar);
                }
            }
        }
Пример #49
0
            protected override void OnTick()
            {
                if (m_attachment == null)
                {
                    return;
                }

                Item weapon = m_attachment.AttachedTo as Item;
                Item target = m_attachment.AttackTarget;

                if (weapon == null || weapon.Deleted || target == null || target.Deleted)
                {
                    Stop();
                    return;
                }

                // the weapon must be equipped
                Mobile attacker = weapon.Parent as Mobile;

                if (attacker == null || attacker.Deleted)
                {
                    Stop();
                    return;
                }

                // the attacker cannot be fighting

                if (attacker.Combatant != null)
                {
                    attacker.SendMessage("Cannot siege while fighting.");
                    Stop();
                    return;
                }

                // get the location of the attacker

                Point3D attackerloc = attacker.Location;
                Map     attackermap = attacker.Map;

                Point3D targetloc = target.Location;
                Map     targetmap = target.Map;

                if (targetmap == null || targetmap == Map.Internal || attackermap == null || attackermap == Map.Internal || targetmap != attackermap)
                {
                    // if the attacker or target has an invalid map, then stop
                    Stop();
                    return;
                }

                // compare it against previous locations.  If they have moved then break off the attack
                if (attackerloc != m_attachment.CurrentLoc || attackermap != m_attachment.CurrentMap)
                {
                    Stop();
                    return;
                }



                // attack the target
                // Animate( int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay )
                int action = 26;                 // 1-H bash animation, 29=2-H

                // get the layer
                switch (weapon.Layer)
                {
                case Layer.OneHanded:
                    action = 26;
                    break;

                case Layer.TwoHanded:
                    action = 29;
                    break;
                }

                // attack animation
                attacker.Animate(action, 7, 1, true, false, 0);

                int    basedamage = 1;
                double basedelay  = BaseWeaponDelay;

                if (weapon is BaseWeapon)
                {
                    BaseWeapon b = (BaseWeapon)weapon;
                    // calculate the siege damage based on the weapon min/max damage and the overall damage scale factor
                    basedamage = (int)(Utility.RandomMinMax(b.MinDamage, b.MaxDamage) * DamageScaleFactor);
                    // reduce the actual delay by the weapon speed
                    basedelay -= b.Speed / 10;
                }

                if (basedelay < 1)
                {
                    basedelay = 1;
                }
                if (basedamage < 1)
                {
                    basedamage = 1;
                }

                // apply siege damage, all physical
                XmlSiege.Attack(attacker, target, basedamage, 0);

                // prepare for the next attack
                m_attachment.DoTimer(TimeSpan.FromSeconds(basedelay), false);
            }
Пример #50
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Region is FeluccaDungeon)
            {
                from.SendMessage("Moonstones do not work in dungeons");
            }
            else if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (
                IsSpecial(m_Destination) ||
                IsSpecial(from.Location) ||
                !SpellHelper.CheckTravel(from.Map, from.Location, TravelCheckType.GateFrom, from) ||
                !SpellHelper.CheckTravel(from.Map, m_Destination, TravelCheckType.GateTo, from))
            {
                from.SendMessage("Something interferes with the moonstone.");
            }
            else if (m_Marked == false)
            {
                from.SendMessage("That stone has not yet been marked.");
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1005399);                   // You can not bury a stone while you sit on a mount.
            }
            else if (!from.Body.IsHuman)
            {
                from.SendLocalizedMessage(1005400);                   // You can not bury a stone in this form.
            }
            else if (from.Criminal)
            {
                from.SendLocalizedMessage(1005403);                   // The magic of the stone cannot be evoked by the lawless.
            }
            else if (from.Map.CanFit(m_Destination, 16) == false)
            {
                from.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else
            {
                Movable = false;
                Point3D StoneLoc;
                StoneLoc = from.Location;
                int StoneDir = 0;
                StoneDir = (int)from.Direction;
                if (StoneDir >= 128)
                {
                    StoneDir = StoneDir - 128;
                }
                switch (StoneDir)
                {
                case 0:
                    StoneLoc.Y--;
                    break;

                case 1:
                    StoneLoc.Y--;
                    StoneLoc.X++;
                    break;

                case 2:
                    StoneLoc.X++;
                    break;

                case 3:
                    StoneLoc.Y++;
                    StoneLoc.X++;
                    break;

                case 4:
                    StoneLoc.Y++;
                    break;

                case 5:
                    StoneLoc.Y++;
                    StoneLoc.X--;
                    break;

                case 6:                          //West
                    StoneLoc.X--;
                    break;

                case 7:                         //Mask, UP?
                    StoneLoc.X--;
                    StoneLoc.Y--;
                    break;

                default:                          //Anything else, leave it alone.
                    break;
                }
                MoveToWorld(StoneLoc, from.Map);

                from.Animate(32, 5, 1, true, false, 0);

                new SettleTimer(this, StoneLoc, from.Map, from, m_Destination).Start();
            }
        }
Пример #51
0
            protected override void OnTick()
            {
                m_Count++;

                if (!m_Mobile.Alive)
                {
                    this.Stop();
                    if (m_bRepair)
                    {
                        m_Wall.CurrentRepairWorker = null;
                    }
                    else
                    {
                        m_Wall.CurrentDamageWorker = null;
                    }
                }
                else
                {
                    if (m_Mobile.Hidden)
                    {
                        m_Mobile.Hidden = false;
                    }

                    bool bHasMoved = false;
                    if (m_Mobile.Location != m_MobLoc)
                    {
                        bHasMoved = true;
                    }

                    if (bHasMoved || m_Mobile.Map == Map.Internal)
                    {
                        if (m_bRepair)
                        {
                            m_Mobile.SendMessage("You move and stop repairing the wall.");
                        }
                        else
                        {
                            m_Mobile.SendMessage("You move and stop damaging the wall.");
                        }
                        this.Stop();
                        if (m_bRepair)
                        {
                            m_Wall.CurrentRepairWorker = null;
                        }
                        else
                        {
                            m_Wall.CurrentDamageWorker = null;
                        }
                    }
                    else
                    {
                        if (m_Count > SECONDS_UNTIL_DONE || (Server.Misc.TestCenter.Enabled && m_Count > 10))                         //1 minute to repair the wall
                        {
                            this.Stop();
                            if (m_bRepair)
                            {
                                m_Wall.CurrentRepairWorker = null;
                            }
                            else
                            {
                                m_Wall.CurrentDamageWorker = null;
                            }
                            m_Wall.EndRepair(m_Mobile, m_bRepair, m_bFull);
                        }
                        else if (m_Count % 5 == 0)
                        {
                            if (m_bRepair)
                            {
                                m_Mobile.Emote("*repairs the wall*");
                            }
                            else
                            {
                                m_Mobile.Emote("*damages the wall*");
                                m_Wall.NotifyOfDamager(m_Mobile);
                            }
                            m_Mobile.Animate(11, 5, 1, true, false, 0);
                        }
                    }
                }
            }
Пример #52
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_belt.Deleted)
                {
                    return;
                }
                else if (targeted is Mobile)
                {
                    if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
                    {
                        from.SendLocalizedMessage(1063299);                           // You must have a free hand to throw shuriken.
                        return;
                    }

                    Mobile m = (Mobile)targeted;

                    double dist = from.GetDistanceToSqrt(m.Location);

                    if (m.Map != from.Map || dist > 11)
                    {
                        from.SendLocalizedMessage(500446);                           // That is too far away.
                        return;
                    }
                    else if (from.InRange(m, 2))
                    {
                        from.SendLocalizedMessage(1063303);                           // Your target is too close!
                        return;
                    }

                    if (m != from && from.HarmfulCheck(m))
                    {
                        Direction to = from.GetDirectionTo(m);

                        from.Direction = to;

                        from.RevealingAction();

                        from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);

                        if (Fukiya.CheckHitChance(from, m))
                        {
                            from.MovingEffect(m, 0x27AC, 7, 1, false, false, 0x23A, 0);

                            AOS.Damage(m, from, Utility.Random(3, 5), 100, 0, 0, 0, 0);

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

                                Poison poison   = m_belt.Poison;
                                int    maxLevel = from.Skills[SkillName.Poisoning].Fixed / 200;
                                if (poison.Level > maxLevel)
                                {
                                    poison = Poison.GetPoison(maxLevel);
                                }

                                m.ApplyPoison(from, poison);
                            }
                        }
                        else
                        {
                            from.MovingEffect(new Shuriken(), 0x27AC, 7, 1, false, false, 0x23A, 0);

                            from.SendMessage("You miss.");
                        }

                        // Throwing a shuriken restarts you weapon's swing delay
                        from.NextCombatTime = DateTime.UtcNow + from.Weapon.GetDelay(from);

                        m_belt.UsesRemaining--;
                    }
                }
            }
Пример #53
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.ItemID == 0xA21)               // EMPTY
            {
                bool soaked;
                CheckWater(from, 3, out soaked);

                if (!IsChildOf(from.Backpack))
                {
                    from.SendMessage("This must be in your backpack to fill.");
                    return;
                }
                else if (soaked)
                {
                    from.PlaySound(0x240);
                    this.ItemID = 0x98F;
                    this.Name   = "waterskin";
                }
                else
                {
                    from.SendMessage("You can only fill this at a water trough, tub, or barrel!");
                }
            }
            else
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.SendMessage("This must be in your backpack to drink.");
                    return;
                }
                else
                {
                    // increase characters thirst value based on type of drink
                    if (from.Thirst < 20)
                    {
                        from.Thirst += 5;
                        // Send message to character about their current thirst value
                        int iThirst = from.Thirst;
                        if (iThirst < 5)
                        {
                            from.SendMessage("You drink the water but are still extremely thirsty");
                        }
                        else if (iThirst < 10)
                        {
                            from.SendMessage("You drink the water and feel less thirsty");
                        }
                        else if (iThirst < 15)
                        {
                            from.SendMessage("You drink the water and feel much less thirsty");
                        }
                        else
                        {
                            from.SendMessage("You drink the water and are no longer thirsty");
                        }

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

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

                        this.ItemID = 0xA21;
                        this.Name   = "empty waterskin";

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

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

                            from.Stam = from.Stam + 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 quenched to drink any more!");
                        from.Thirst = 20;
                    }
                }
            }
        }
Пример #54
0
        public ESound(Mobile pm, int SoundMade)
        {
            switch (SoundMade)
            {
            case 1:
                pm.PlaySound(pm.Female ? 778 : 1049);
                pm.Say("*ah!*");
                break;

            case 2:
                pm.PlaySound(pm.Female ? 779 : 1050);
                pm.Say("*ah ha!*");
                break;

            case 3:
                pm.PlaySound(pm.Female ? 780 : 1051);
                pm.Say("*applauds*");
                break;

            case 4:
                pm.PlaySound(pm.Female ? 781 : 1052);
                pm.Say("*blows nose*");
                if (!pm.Mounted)
                {
                    pm.Animate(34, 5, 1, true, false, 0);
                }
                break;

            case 5:
                pm.Say("*bows*");
                if (!pm.Mounted)
                {
                    pm.Animate(32, 5, 1, true, false, 0);
                }
                break;

            case 6:
                pm.PlaySound(pm.Female ? 786 : 1057);
                pm.Say("*bs cough*");
                break;

            case 7:
                pm.PlaySound(pm.Female ? 782 : 1053);
                pm.Say("*burp!*");
                if (!pm.Mounted)
                {
                    pm.Animate(33, 5, 1, true, false, 0);
                }
                break;

            case 8:
                pm.PlaySound(pm.Female ? 748 : 1055);
                pm.Say("*clears throat*");
                if (!pm.Mounted)
                {
                    pm.Animate(33, 5, 1, true, false, 0);
                }
                break;

            case 9:
                pm.PlaySound(pm.Female ? 785 : 1056);
                pm.Say("*cough!*");
                if (!pm.Mounted)
                {
                    pm.Animate(33, 5, 1, true, false, 0);
                }
                break;

            case 10:
                pm.PlaySound(pm.Female ? 787 : 1058);
                pm.Say("*cries*");
                break;

            case 11:
                pm.PlaySound(pm.Female ? 791 : 1063);
                pm.Say("*faints*");
                if (!pm.Mounted)
                {
                    pm.Animate(22, 5, 1, true, false, 0);
                }
                break;

            case 12:
                pm.PlaySound(pm.Female ? 792 : 1064);
                pm.Say("*farts*");
                break;

            case 13:
                pm.PlaySound(pm.Female ? 793 : 1065);
                pm.Say("*gasp!*");
                break;

            case 14:
                pm.PlaySound(pm.Female ? 794 : 1066);
                pm.Say("*giggles*");
                break;

            case 15:
                pm.PlaySound(pm.Female ? 795 : 1067);
                pm.Say("*groans*");
                break;

            case 16:
                pm.PlaySound(pm.Female ? 796 : 1068);
                pm.Say("*growls*");
                break;

            case 17:
                pm.PlaySound(pm.Female ? 797 : 1069);
                pm.Say("*hey!*");
                break;

            case 18:
                pm.PlaySound(pm.Female ? 798 : 1070);
                pm.Say("*hiccup!*");
                break;

            case 19:
                pm.PlaySound(pm.Female ? 799 : 1071);
                pm.Say("*huh?*");
                break;

            case 20:
                pm.PlaySound(pm.Female ? 800 : 1072);
                pm.Say("*kisses*");
                break;

            case 21:
                pm.PlaySound(pm.Female ? 801 : 1073);
                pm.Say("*laughs*");
                break;

            case 22:
                pm.PlaySound(pm.Female ? 802 : 1074);
                pm.Say("*no!*");
                break;

            case 23:
                pm.PlaySound(pm.Female ? 803 : 1075);
                pm.Say("*oh!*");
                break;

            case 24:
                pm.PlaySound(pm.Female ? 811 : 1085);
                pm.Say("*oooh*");
                break;

            case 25:
                pm.PlaySound(pm.Female ? 812 : 1086);
                pm.Say("*oops*");
                break;

            case 26:
                pm.PlaySound(pm.Female ? 813 : 1087);
                pm.Say("*pukes*");
                if (!pm.Mounted)
                {
                    pm.Animate(32, 5, 1, true, false, 0);
                }
                Point3D p = new Point3D(pm.Location);
                switch (pm.Direction)
                {
                case Direction.North:
                    p.Y--; break;

                case Direction.South:
                    p.Y++; break;

                case Direction.East:
                    p.X++; break;

                case Direction.West:
                    p.X--; break;

                case Direction.Right:
                    p.X++; p.Y--; break;

                case Direction.Down:
                    p.X++; p.Y++; break;

                case Direction.Left:
                    p.X--; p.Y++; break;

                case Direction.Up:
                    p.X--; p.Y--; break;

                default:
                    break;
                }
                p.Z = pm.Map.GetAverageZ(p.X, p.Y);

                bool canFit = Server.Spells.SpellHelper.AdjustField(ref p, pm.Map, 12, false);

                if (canFit)
                {
                    Puke puke = new Puke();
                    puke.Map      = pm.Map;
                    puke.Location = p;
                }

                /*else
                 *      pm.SendMessage( "your puke won't fit!" ); /* Debug testing */
                break;

            case 27:
                pm.PlaySound(315);
                pm.Say("*punches*");
                if (!pm.Mounted)
                {
                    pm.Animate(31, 5, 1, true, false, 0);
                }
                break;

            case 28:
                pm.PlaySound(pm.Female ? 814 : 1088);
                pm.Say("*ahhhh!*");
                break;

            case 29:
                pm.PlaySound(pm.Female ? 815 : 1089);
                pm.Say("*shhh!*");
                break;

            case 30:
                pm.PlaySound(pm.Female ? 816 : 1090);
                pm.Say("*sigh*");
                break;

            case 31:
                pm.PlaySound(948);
                pm.Say("*slaps*");
                if (!pm.Mounted)
                {
                    pm.Animate(11, 5, 1, true, false, 0);
                }
                break;

            case 32:
                pm.PlaySound(pm.Female ? 817 : 1091);
                pm.Say("*ahh-choo!*");
                if (!pm.Mounted)
                {
                    pm.Animate(32, 5, 1, true, false, 0);
                }
                break;

            case 33:
                pm.PlaySound(pm.Female ? 818 : 1092);
                pm.Say("*sniff*");
                if (!pm.Mounted)
                {
                    pm.Animate(34, 5, 1, true, false, 0);
                }
                break;

            case 34:
                pm.PlaySound(pm.Female ? 819 : 1093);
                pm.Say("*snore*");
                break;

            case 35:
                pm.PlaySound(pm.Female ? 820 : 1094);
                pm.Say("*spits*");
                if (!pm.Mounted)
                {
                    pm.Animate(6, 5, 1, true, false, 0);
                }
                break;

            case 36:
                pm.PlaySound(792);
                pm.Say("*sticks out tongue*");
                break;

            case 37:
                pm.PlaySound(874);
                pm.Say("*taps foot*");
                if (!pm.Mounted)
                {
                    pm.Animate(38, 5, 1, true, false, 0);
                }
                break;

            case 38:
                pm.PlaySound(pm.Female ? 821 : 1095);
                pm.Say("*whistles*");
                if (!pm.Mounted)
                {
                    pm.Animate(5, 5, 1, true, false, 0);
                }
                break;

            case 39:
                pm.PlaySound(pm.Female ? 783 : 1054);
                pm.Say("*woohoo!*");
                break;

            case 40:
                pm.PlaySound(pm.Female ? 822 : 1096);
                pm.Say("*yawns*");
                if (!pm.Mounted)
                {
                    pm.Animate(17, 5, 1, true, false, 0);
                }
                break;

            case 41:
                pm.PlaySound(pm.Female ? 823 : 1097);
                pm.Say("*yea!*");
                break;

            case 42:
                pm.PlaySound(pm.Female ? 823 : 1098);
                pm.Say("*yells*");
                break;
            }
        }
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item i = (Item)targeted;

                    bool isGrave = false;

                    foreach (int check in m_Grave)
                    {
                        if (check == i.ItemID)
                        {
                            isGrave = true;
                        }
                    }

                    if (isGrave == true)
                    {
                        bool isNearPumpkins = false;

                        foreach (Item item in i.GetItemsInRange(2))
                        {
                            if (item is PumpkinheadGraveAddon)
                            {
                                isNearPumpkins = true;
                            }
                        }

                        if (isNearPumpkins == true)
                        {
                            if (m_From != null)
                            {
                                m_From.SendMessage("You start to dig.");
                            }

                            DigTimer dt = new DigTimer(m_From, m_Item, TimeSpan.FromSeconds(5.0));
                            dt.Start();
                            m_From.PlaySound(Utility.RandomList(0x125, 0x126));
                            m_From.Animate(11, 5, 1, true, false, 0);
                            m_Item.IsDigging = true;
                        }
                        else
                        {
                            if (m_From != null)
                            {
                                m_From.SendMessage("That is not Pumpkinhead's grave.");
                            }
                        }
                    }
                    else
                    {
                        if (m_From != null)
                        {
                            m_From.SendMessage("That is not a grave.");
                        }
                    }
                }
                else if (targeted is StaticTarget)
                {
                    StaticTarget i = (StaticTarget)targeted;

                    bool isGrave = false;

                    foreach (int check in m_Grave)
                    {
                        if (check == i.ItemID)
                        {
                            isGrave = true;
                        }
                    }

                    if (isGrave == true)
                    {
                        bool isNearPumpkins = false;
                        foreach (Item item in m_From.GetItemsInRange(2))
                        {
                            if (item is PumpkinheadGraveAddon)
                            {
                                isNearPumpkins = true;
                            }
                        }

                        if (isNearPumpkins == true)
                        {
                            if (m_From != null)
                            {
                                m_From.SendMessage("You start to dig.");
                            }

                            DigTimer dt = new DigTimer(m_From, m_Item, TimeSpan.FromSeconds(10.0));
                            dt.Start();
                            m_From.PlaySound(Utility.RandomList(0x125, 0x126));
                            m_From.Animate(11, 5, 1, true, false, 0);
                            m_Item.IsDigging = true;
                        }
                        else
                        {
                            if (m_From != null)
                            {
                                m_From.SendMessage("That is not Pumpkinhead's grave.");
                            }
                        }
                    }
                    else
                    {
                        if (m_From != null)
                        {
                            m_From.SendMessage("That is not a grave.");
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("That is not a grave.");
                }
            }
Пример #56
0
        public void OnHit(Mobile from, Item tool)
        {
            // Vérifions que le joueur ne soit pas trop loin ^^
            if (from.GetDistanceToSqrt(this.Location) > 2)
            {
                from.SendMessage("Vous êtes trop loin");
                return;
            }

            // Pour ne pas taper dessus trop vite
            if (lastHit + TimeSpan.FromSeconds(1) > DateTime.Now)
            {
                return;
            }

            lastHit = DateTime.Now;

            // On retire un point
            Hits--;

            // Petite animation
            from.Direction = from.GetDirectionTo(this);
            from.Animate(Utility.RandomList(Mining.System.Definitions[0].EffectActions), 5, 1, true, false, 0);
            from.PlaySound(Utility.RandomList(Mining.System.Definitions[0].EffectSounds));

            // S'il n'y a plus de points on delete le rocher
            if (Hits == 0)
            {
                // Delete après l'animation de minage
                Timer.DelayCall(TimeSpan.FromMilliseconds(900), new TimerCallback(Delete));

                // On réduit de 1 le nombre d'utilisation de l'outil ayant servis
                if (tool is IUsesRemaining)
                {
                    ((IUsesRemaining)tool).UsesRemaining--;
                }

                // Et la récompense tordue :p
                int max      = Utility.Random(5);
                int countGem = 0;
                int countOre = 0;
                for (int i = 0; i < max; i++)
                {
                    if (Utility.RandomBool())
                    {
                        countGem++;
                        from.AddToBackpack(Loot.Construct(Loot.GemTypes, Utility.Random(Loot.GemTypes.Length)));
                    }
                    else
                    {
                        if (Utility.RandomBool())
                        {
                            countOre++;
                            int chance = Utility.Random(100);

                            if (chance > 0)
                            {
                                from.AddToBackpack(new IronOre());
                            }
                            else
                            {
                                from.AddToBackpack(new SilverOre());    // environ 1 chance sur 200
                            }
                        }
                    }
                }

                if (countGem > 0)
                {
                    from.SendMessage(String.Format("Vous avez trouver {0} gemmes", countGem));

                    if (countOre > 0)
                    {
                        from.SendMessage("ainsi qu'un peu de minerai...");
                    }
                }
                else
                {
                    if (countOre > 0)
                    {
                        from.SendMessage("Vous trouvez un peu de minerai...");
                    }
                }
            }
        }
Пример #57
0
        private void DrinkWater(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to drink.");
                return;
            }
            else
            {
                //If thirsty
                if (from.Thirst < 20)
                {
                    //Add to thirst and normalize to 20
                    from.Thirst += 5;
                    if (from.Thirst > 20)
                    {
                        from.Thirst = 20;
                    }

                    // Send message to character about their current thirst value
                    int iThirst = from.Thirst;
                    if (iThirst < 5)
                    {
                        from.SendMessage("You drink the water but are still extremely thirsty");
                    }
                    else if (iThirst < 10)
                    {
                        from.SendMessage("You drink the water and feel less thirsty");
                    }
                    else if (iThirst < 15)
                    {
                        from.SendMessage("You drink the water and feel much less thirsty");
                    }
                    else
                    {
                        from.SendMessage("You drink the water and are no longer thirsty");
                    }

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

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


                    this.Quantity -= 1;
                    InvalidateProperties();

                    if (this.Quantity == 0)
                    {
                        this.ItemID = 0xA21;
                        this.Name   = "waterskin";
                        from.SendMessage("Thou hast emptied thine waterskin.");
                    }

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

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

                        from.Stam = from.Stam + 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("Thou art simply too quenched to drink any more!");
                    //from.Thirst = 20;
                }
            }
        }
Пример #58
0
        public override void OnDoubleClick(Mobile from)
        {
            bool soaked;

            CheckWater(from, 3, out soaked);

            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to fill.");
                return;
            }
            else if (soaked)
            {
                from.SendMessage("You fill the waterskin with fresh water.");
                from.PlaySound(0x240);
                this.Consume();
                Item flask = new Waterskin();
                flask.ItemID = 0x98F;
                flask.Name   = "waterskin";
                from.AddToBackpack(flask);
            }
            else if (from.Thirst < 20)
            {
                from.Thirst += 5;
                // Send message to character about their current thirst value
                int iThirst = from.Thirst;
                if (iThirst < 5)
                {
                    from.SendMessage("You drink the dirty water but are still extremely thirsty");
                }
                else if (iThirst < 10)
                {
                    from.SendMessage("You drink the dirty water and feel less thirsty");
                }
                else if (iThirst < 15)
                {
                    from.SendMessage("You drink the dirty water and feel much less thirsty");
                }
                else
                {
                    from.SendMessage("You drink the dirty water and are no longer thirsty");
                }

                this.Consume();

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

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

                Item flask = new Waterskin();
                flask.ItemID = 0xA21;
                flask.Name   = "empty waterskin";
                from.AddToBackpack(flask);

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

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

                    from.Stam = from.Stam + 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 (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!");
                }
            }
            else
            {
                from.SendMessage("You are simply too quenched to drink any more!");
                from.Thirst = 20;
            }
        }
Пример #59
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage("You cannot harvest a crop while mounted.");
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3))               // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int cookValue = (int)from.Skills[SkillName.Cooking].Value / 20;
                if (cookValue == 0)
                {
                    from.SendMessage("You have no idea how to harvest this crop.");
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 1))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage("There is nothing here to harvest.");

                        if (PlayerCanDestroy && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            UpRootGump g = new UpRootGump(from, this);
                            from.SendGump(g);
                        }
                    }
                    else                     //check skill and sower
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 29:32, 5, 1, true, false, 0);

                        if (from == m_sower)
                        {
                            cookValue  *= 2;
                            m_lastvisit = DateTime.Now;
                        }

                        if (cookValue > m_yield)
                        {
                            cookValue = m_yield + 1;
                        }

                        int pick = Utility.Random(cookValue);
                        if (pick == 0)
                        {
                            from.SendMessage("You do not manage to harvest any crops.");
                            return;
                        }
                        // *** Limit to one yield until we have FieldCorn item ***
                        if (pick > 1)
                        {
                            pick = 1;
                        }

                        m_yield -= pick;
                        from.SendMessage("You harvest {0} crop{1}!", pick, (pick == 1 ? "" : "s"));

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));
                        ((Item)this).ItemID = pickedGraphic;

                        FieldCorn crop = new FieldCorn(pick);
                        from.AddToBackpack(crop);

                        if (SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            this.UpRoot(from);
                            return;
                        }

                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }
Пример #60
0
 protected override void OnTick()
 {
     m_From.PlaySound(0x2A);
     m_From.Animate(AnimationType.Attack, 3);
 }