Esempio n. 1
0
        public virtual void CreateBones_Callback(object state)
        {
            Mobile from = (Mobile)state;
            Map map = from.Map;

            if (map == null)
                return;

            int count = Utility.RandomMinMax(1, 3);

            for (int i = 0; i < count; ++i)
            {
                int x = from.X + Utility.RandomMinMax(-1, 1);
                int y = from.Y + Utility.RandomMinMax(-1, 1);
                int z = from.Z;

                if (!map.CanFit(x, y, z, 16, false, true))
                {
                    z = map.GetAverageZ(x, y);

                    if (z == from.Z || !map.CanFit(x, y, z, 16, false, true))
                        continue;
                }

                UnholyBone bone = new UnholyBone();

                bone.Hue = 0;
                bone.Name = "unholy bones";
                bone.ItemID = Utility.Random(0xECA, 9);

                bone.MoveToWorld(new Point3D(x, y, z), map);
            }
        }
Esempio n. 2
0
		public virtual void CreateBones_Callback(Mobile from)
		{
			Map map = from.Map;

			if (map == null)
			{
				return;
			}

			int count = Utility.RandomMinMax(1, 3);

			for (int i = 0; i < count; ++i)
			{
				int x = from.X + Utility.RandomMinMax(-1, 1);
				int y = from.Y + Utility.RandomMinMax(-1, 1);
				int z = from.Z;

				if (!map.CanFit(x, y, z, 16, false, true))
				{
					z = map.GetAverageZ(x, y);

					if (z == from.Z || !map.CanFit(x, y, z, 16, false, true))
					{
						continue;
					}
				}

				var bone = new UnholyBone
				{
					Hue = 0,
					Name = "unholy bones",
					ItemID = Utility.Random(0xECA, 9)
				};

				bone.MoveToWorld(new Point3D(x, y, z), map);
			}
		}