コード例 #1
0
ファイル: JailCommand.cs プロジェクト: Orion321/unknown-shard
        private static void JailPlayerInQueue()
        {
            try
            {
                PlayerMobile player = s_JailProcessingQueue.Dequeue() as PlayerMobile;

                if (null != player)
                {
                    Boots boots = new JailBoots(player.Name);
                    boots.MoveToWorld(player.Location, player.Map);
                    player.MoveToWorld(JailConfig.JailLocation, JailConfig.JailMap);
                    Item robe = new Robe(); robe.Hue = JailConfig.RobeHue; robe.Name = JailConfig.RobeTitle; player.AddItem(robe);
                    player.SendMessage("You have been JAILED!");

                    if (0 < JailConfig.FineAmount)
                    {
                        if (!Banker.Withdraw(player, JailConfig.FineAmount))
                        {
                            JailHammer hammer = player.FindItemOnLayer(Layer.OneHanded) as JailHammer;

                            if (null != hammer)
                            {
                                hammer.UsesRemaining *= 2;
                                player.SendMessage("You could not afford the fine so your sentence has been doubled!");
                            }
                        }
                        else
                        {
                            player.SendMessage("You have been fined {0} gold!", JailConfig.FineAmount);
                        }
                    }
                }
            }
            catch { }
        }
コード例 #2
0
		private static void JailPlayerInQueue()
		{
			try
			{
				PlayerMobile player = s_JailProcessingQueue.Dequeue() as PlayerMobile;

				if ( null != player )
				{
					Boots boots = new JailBoots( player.Name );
					boots.MoveToWorld( player.Location, player.Map );
					player.MoveToWorld( JailConfig.JailLocation, JailConfig.JailMap );
					Item robe = new Robe(); robe.Hue = JailConfig.RobeHue; robe.Name = JailConfig.RobeTitle; player.AddItem( robe );
					player.SendMessage( "You have been JAILED!" );

					if ( 0 < JailConfig.FineAmount )
					{
						if ( !Banker.Withdraw( player, JailConfig.FineAmount ) )
						{
							JailHammer hammer = player.FindItemOnLayer( Layer.OneHanded ) as JailHammer;

							if ( null != hammer )
							{
								hammer.UsesRemaining *= 2;
								player.SendMessage( "You could not afford the fine so your sentence has been doubled!" );
							}
						}
						else
							player.SendMessage( "You have been fined {0} gold!", JailConfig.FineAmount );
					}
				}
			}
			catch { }
		}