Exemplo n.º 1
0
		public override void OnHit( Mobile attacker, Mobile defender, double damagebonus )
		{
			base.OnHit( attacker, defender, damagebonus );

			this.Delete();
			attacker.SendMessage( "The pool cue breaks as it smashes over their head!" );
			defender.SendMessage( "Your head breaks their pool cue!" );

			StoolLeg sl = new StoolLeg();
			sl.MoveToWorld( defender.Location, defender.Map );

			attacker.AddToBackpack( new StoolLeg() );
		}
Exemplo n.º 2
0
        public override void OnHit(Mobile attacker, Mobile defender, double damagebonus)
        {
            base.OnHit(attacker, defender, damagebonus);

            this.Delete();
            attacker.SendMessage("The pool cue breaks as it smashes over their head!");
            defender.SendMessage("Your head breaks their pool cue!");

            StoolLeg sl = new StoolLeg();

            sl.MoveToWorld(defender.Location, defender.Map);

            attacker.AddToBackpack(new StoolLeg());
        }
        private static void FinishThrow(object state)
        {
            object[] states = (object[])state;

            Mobile from        = (Mobile)states[0];
            Mobile to          = (Mobile)states[1];
            int    m_DamageMin = (int)states[2];
            int    m_DamageMax = (int)states[3];
            bool   m_Break     = (bool)states[4];
            Item   obj         = (Item)states[5];

            Map map = from.Map;

            to.Damage(Utility.RandomMinMax(m_DamageMin, m_DamageMax), from);

            if (m_Break)
            {
                if (map == null)
                {
                    return;
                }

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

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

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

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

                    StoolLeg leg = new StoolLeg();
                    leg.MoveToWorld(new Point3D(x, y, z), map);
                }
            }

            if (obj != null)
            {
                obj.MoveToWorld(to.Location, map);
            }
        }
Exemplo n.º 4
0
        private static void FinishThrow(ThrowInfo info)
        {
            Mobile from = info.From;
            Mobile to   = info.To;
            int    min  = info.DamageMin;
            int    max  = info.DamageMax;
            bool   b    = info.Break;
            Item   item = info.Item;

            to.Damage(Utility.RandomMinMax(min, max), from);

            if (b)
            {
                int count = Utility.RandomMinMax(1, 4);

                for (int i = 0; i < count; ++i)
                {
                    Point3D p = new Point3D(to.Location);

                    p.X += Utility.RandomMinMax(-1, 1);
                    p.Y += Utility.RandomMinMax(-1, 1);

                    if (!from.Map.CanFit(p.X, p.Y, p.Z, 16, false, true))
                    {
                        p.Z = from.Map.GetAverageZ(p.X, p.X);

                        if (p.Z == to.Z || !from.Map.CanFit(p.X, p.Y, p.Z, 16, false, true))
                        {
                            continue;
                        }
                    }

                    StoolLeg leg = new StoolLeg();
                    leg.MoveToWorld(p, from.Map);
                }
            }

            if (item != null)
            {
                item.MoveToWorld(to.Location, to.Map);
            }
        }
Exemplo n.º 5
0
		private static void FinishThrow( ThrowInfo info )
		{
			Mobile from = info.From;
			Mobile to = info.To;
			int min = info.DamageMin;
			int max = info.DamageMax;
			bool b = info.Break;
			Item item = info.Item;

			to.Damage( Utility.RandomMinMax( min, max ), from );

			if ( b )
			{
				int count = Utility.RandomMinMax( 1, 4 );

				for ( int i = 0; i < count; ++i )
				{
					Point3D p = new Point3D( to.Location );

					p.X += Utility.RandomMinMax(-1, 1);
					p.Y += Utility.RandomMinMax(-1, 1);

					if ( !from.Map.CanFit( p.X, p.Y, p.Z, 16, false, true ) )
					{
						p.Z = from.Map.GetAverageZ( p.X, p.X );

						if ( p.Z == to.Z || !from.Map.CanFit( p.X, p.Y, p.Z, 16, false, true ) )
							continue;
					}

					StoolLeg leg = new StoolLeg();
					leg.MoveToWorld( p, from.Map );
				}
			}

			if ( item != null )
				item.MoveToWorld( to.Location, to.Map );
		}
		private static void FinishThrow( object state )
		{
			object[] states = (object[])state;

			Mobile from = (Mobile)states[0];
			Mobile to = (Mobile)states[1];
			int m_DamageMin = (int)states[2];
			int m_DamageMax = (int)states[3];
			bool m_Break = (bool)states[4];
			Item obj = (Item)states[5];

			Map map = from.Map;

			to.Damage( Utility.RandomMinMax( m_DamageMin, m_DamageMax ), from );

			if ( m_Break )
			{
				if (map == null)
                    			return;

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

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

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

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

                    			StoolLeg leg = new StoolLeg();
                    			leg.MoveToWorld(new Point3D(x, y, z), map);
                		}
			}

			if ( obj != null )
				obj.MoveToWorld( to.Location, map );
		}